/* Watson & Son Scaffold Management — standalone styles (no Tailwind) */

:root {
  --background: #eef1f5;
  --surface: #ffffff;
  --foreground: #111827;
  --muted: #6b7280;
  --muted-soft: #9ca3af;
  --border: #d1d5db;
  --border-light: #e5e7eb;
  --primary: #1877f2;
  --primary-hover: #166fe5;
  --primary-soft: #e8f1fe;
  --accent-red: #e41e3f;
  --accent-red-soft: #fde8ec;
  --success: #15803d;
  --success-soft: #e8f6ee;
  --warning: #b45309;
  --warning-soft: #fff7ed;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(17, 24, 39, 0.05);
  --shadow-md: 0 6px 20px rgba(17, 24, 39, 0.07);
  --font: var(--font-geist-sans), "Segoe UI", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
  margin: 0;
}

img {
  max-width: 100%;
  display: block;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select,
textarea {
  display: block;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--foreground);
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.4;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

textarea {
  min-height: 112px;
  resize: vertical;
}

/* ——— App shell ——— */
#ws-shell {
  position: relative;
  min-height: 100vh;
  background: var(--background);
}

#ws-sidebar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  bottom: 0 !important;
  width: 260px !important;
  max-width: 260px !important;
  min-width: 260px !important;
  z-index: 40;
  overflow: auto;
  background: #fff;
  border-right: 1px solid var(--border-light);
}

#ws-main {
  margin-left: 260px !important;
  min-height: 100vh;
  min-width: 0;
  padding: 1.75rem 2rem 3rem;
  background: var(--background);
}

#ws-main-inner {
  max-width: 72rem;
  margin: 0 auto;
}

/* ——— Surfaces ——— */
.ui-card,
.ui-card-lg,
.ui-panel {
  background: #fff;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
}

.ui-card {
  border-radius: 14px;
}

.ui-card-lg {
  border-radius: 16px;
  box-shadow: var(--shadow-md);
}

.ui-panel {
  border-radius: 18px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.ui-panel-body {
  padding: 1.5rem 1.75rem;
}

.ui-panel-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.625rem;
  padding: 1rem 1.75rem;
  border-top: 1px solid #eef0f3;
  background: #fafbfc;
}

.ui-section-label {
  margin: 0 0 0.35rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-soft);
}

.ui-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--foreground);
}

.ui-subtitle,
.ui-page-desc,
.ui-muted {
  color: var(--muted);
}

.ui-subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  line-height: 1.45;
}

.ui-page-title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--foreground);
}

.ui-page-desc {
  margin: 0.4rem 0 0;
  font-size: 0.875rem;
  line-height: 1.4;
}

.ui-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0.75rem;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.ui-seg {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  background: #e8ebf0;
  border-radius: 12px;
}

.ui-seg a,
.ui-seg button {
  flex: 1;
  border: none;
  border-radius: 10px;
  padding: 0.55rem 1rem;
  font-size: 0.8125rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
}

.ui-seg a.is-active,
.ui-seg button.is-active {
  background: #fff;
  color: var(--foreground);
  box-shadow: var(--shadow);
}

.ui-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ui-row:hover {
  border-color: #bfdbfe;
  box-shadow: var(--shadow-md);
}

.ui-stack {
  display: grid;
  gap: 0.75rem;
}

.ui-grid-2 {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.ui-error {
  margin: 0;
  border-radius: 12px;
  background: var(--accent-red-soft);
  padding: 0.65rem 0.85rem;
  font-size: 0.875rem;
  color: var(--accent-red);
  font-weight: 600;
}

.ui-hint {
  margin: 0;
  border-radius: 10px;
  background: #f5f9ff;
  padding: 0.65rem 0.85rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

.ui-doc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.ui-doc-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-radius: 10px;
  background: var(--background);
  padding: 0.65rem 0.85rem;
  font-size: 0.875rem;
}

.ui-upload-row {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-end;
}

/* Fallback layout helpers still used in a few places */
.flex { display: flex; }
.grid { display: grid; }
.hidden { display: none; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1 1 0%; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.min-h-screen { min-height: 100vh; }
.w-full { width: 100%; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mb-7 { margin-bottom: 1.75rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.text-center { text-align: center; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-extrabold { font-weight: 800; }
.tracking-tight { letter-spacing: -0.025em; }
.rounded-xl { border-radius: 12px; }
.rounded-2xl { border-radius: 16px; }
.rounded-full { border-radius: 999px; }
.bg-white { background: #fff; }
.text-foreground { color: var(--foreground); }
.text-muted { color: var(--muted); }
.text-muted-soft { color: var(--muted-soft); }
.text-primary { color: var(--primary); }
.text-accent-red { color: var(--accent-red); }
.bg-primary { background: var(--primary); }
.bg-primary-soft { background: var(--primary-soft); }
.bg-accent-red-soft { background: var(--accent-red-soft); }
.bg-background { background: var(--background); }
.border { border: 1px solid var(--border-light); }
.border-border-light { border-color: var(--border-light); }
.shadow-sm { box-shadow: var(--shadow); }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-5 > * + * { margin-top: 1.25rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

@media (min-width: 640px) {
  .sm\:p-6 { padding: 1.5rem; }
  .sm\:p-10 { padding: 2.5rem; }
  .sm\:flex-row { flex-direction: row; }
  .sm\:items-end { align-items: flex-end; }
  .sm\:items-start { align-items: flex-start; }
  .sm\:justify-between { justify-content: space-between; }
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:col-span-2 { grid-column: span 2 / span 2; }
  .sm\:text-right { text-align: right; }
  .sm\:flex-1 { flex: 1 1 0%; }
  .sm\:w-48 { width: 12rem; }
  .sm\:flex-row { flex-direction: row; }
  .sm\:items-end { align-items: flex-end; }
}

@media (max-width: 900px) {
  #ws-sidebar {
    width: 220px !important;
    min-width: 220px !important;
    max-width: 220px !important;
  }
  #ws-main {
    margin-left: 220px !important;
    padding: 1.25rem 1.25rem 2rem;
  }
}
