
:root {
  --navy: #24130f;
  --navy-2: #3a2119;
  --ink: #30221c;
  --muted: #796a62;
  --line: #e3d5c9;
  --surface: #fffdfa;
  --canvas: #f5efe9;
  --blue: #8b4a2f;
  --blue-dark: #673320;
  --green: #2f6b4f;
  --green-bg: #eaf4ee;
  --amber: #8a5a19;
  --amber-bg: #fff4da;
  --red: #a33a2a;
  --red-bg: #fff0ec;
  --info-bg: #f2e6dc;
  --radius: 16px;
  --shadow: 0 12px 32px rgba(74, 42, 29, .09);
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { margin: 0; min-height: 100%; color: var(--ink); background: var(--canvas); font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, .button { transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(177, 105, 61, .32); outline-offset: 2px; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 24px 16px; color: #f1e5dc; background: linear-gradient(180deg, #2b1712 0%, var(--navy) 100%); display: flex; flex-direction: column; z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; padding: 0 8px 26px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 18px; letter-spacing: .2px; }
.brand small { margin-top: 1px; color: #bda99d; font-size: 12px; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #fffaf5; font-weight: 900; background: linear-gradient(145deg, #bc7447, #743823); box-shadow: 0 8px 22px rgba(139, 74, 47, .38); }
.brand-mark-large { width: 52px; height: 52px; border-radius: 15px; font-size: 24px; }
.nav-list { display: grid; gap: 5px; }
.nav-item { display: flex; align-items: center; gap: 11px; min-height: 44px; padding: 10px 12px; color: #cdbbb0; border-radius: 11px; text-decoration: none; font-weight: 650; }
.nav-item:hover { color: #fffaf5; background: rgba(255,244,234,.07); }
.nav-item.active { color: #fffaf5; background: #4a2a20; box-shadow: inset 3px 0 #d59661; }
.nav-icon { width: 20px; text-align: center; font-size: 17px; }
.safe-mode { margin-top: auto; display: flex; gap: 10px; align-items: flex-start; border: 1px solid rgba(103, 176, 128, .25); background: rgba(47, 107, 79, .18); padding: 12px; border-radius: 12px; }
.safe-mode strong, .safe-mode small { display: block; }
.safe-mode strong { color: #baf3d5; font-size: 12px; }
.safe-mode small { color: #9db8a7; font-size: 11px; }
.safe-dot { width: 9px; height: 9px; flex: 0 0 9px; margin-top: 5px; border-radius: 50%; background: #3ddc8d; box-shadow: 0 0 0 4px rgba(61,220,141,.12); }
.main-shell { min-width: 0; }
.sidebar-overlay { display: none; }
.topbar { height: 74px; position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 18px; padding: 0 30px; border-bottom: 1px solid var(--line); background: rgba(255,253,250,.94); backdrop-filter: blur(12px); }
.topbar-title { font-weight: 750; }
.menu-button { display: none; width: 38px; height: 38px; place-items: center; border: 0; border-radius: 9px; background: transparent; cursor: pointer; }
.menu-button:hover { background: #f2e7df; }
.menu-lines, .menu-lines::before, .menu-lines::after { display: block; width: 20px; height: 2px; border-radius: 2px; background: var(--ink); }
.menu-lines { position: relative; }
.menu-lines::before, .menu-lines::after { position: absolute; left: 0; content: ""; }
.menu-lines::before { top: -6px; }
.menu-lines::after { top: 6px; }
.user-menu { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #f0e2d7; color: #713923; font-weight: 800; }
.user-copy strong, .user-copy small { display: block; line-height: 1.25; }
.user-copy strong { font-size: 13px; }
.user-copy small { color: var(--muted); font-size: 11px; }
.link-button { border: 0; padding: 6px 8px; color: var(--muted); background: transparent; cursor: pointer; font-weight: 650; }
.content { width: min(1440px, 100%); margin: 0 auto; padding: 32px clamp(20px, 4vw, 52px) 60px; }
.page-heading { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 24px; }
.page-heading h1 { margin: 0; font-size: clamp(26px, 3vw, 36px); letter-spacing: -.6px; }
.page-heading p { margin: 7px 0 0; color: var(--muted); max-width: 760px; }
.heading-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { min-width: 0; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-compact { padding: 17px; }
.card h2, .card h3 { margin: 0 0 6px; }
.card h2 { font-size: 19px; }
.card h3 { font-size: 16px; }
.card p { margin: 0; color: var(--muted); }
.card-link { display: block; text-decoration: none; position: relative; overflow: hidden; }
.card-link::after { content: '→'; position: absolute; top: 18px; right: 20px; color: #8ca0ba; font-size: 20px; }
.card-link:hover { transform: translateY(-2px); border-color: #cba98f; box-shadow: 0 18px 36px rgba(74,42,29,.13); }
.card-kicker { display: inline-flex; margin-bottom: 16px; padding: 5px 9px; border-radius: 999px; color: #fffaf5; background: var(--navy); font-size: 11px; font-weight: 850; letter-spacing: .4px; text-transform: uppercase; }
.metric { padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.metric-label { color: var(--muted); font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .45px; }
.metric-value { margin-top: 6px; font-size: 30px; line-height: 1; font-weight: 850; letter-spacing: -.5px; }
.metric-meta { margin-top: 8px; color: var(--muted); font-size: 12px; }
.section { margin-top: 22px; }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 0 0 12px; }
.section-title h2 { margin: 0; font-size: 19px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 15px; border-bottom: 1px solid #efe5dd; text-align: left; vertical-align: top; white-space: nowrap; }
th { color: #705d53; background: #faf5f0; font-size: 11px; letter-spacing: .45px; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fdf8f4; }
td.wrap { white-space: normal; min-width: 220px; }
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.badge-neutral { color: #685a53; background: #eee8e3; }
.badge-success { color: var(--green); background: var(--green-bg); }
.badge-warning { color: var(--amber); background: var(--amber-bg); }
.badge-danger { color: var(--red); background: var(--red-bg); }
.badge-info { color: #744127; background: var(--info-bg); }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 42px; padding: 9px 15px; border: 1px solid transparent; border-radius: 10px; text-decoration: none; font-weight: 750; cursor: pointer; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--blue); box-shadow: 0 8px 18px rgba(139,74,47,.24); }
.button-primary:hover { background: var(--blue-dark); }
.button-secondary { color: var(--ink); background: #fffdfa; border-color: var(--line); }
.button-danger { color: var(--red); background: var(--red-bg); border-color: #ffd2ce; }
.button-small { min-height: 32px; padding: 5px 10px; font-size: 12px; }
.button-wide { width: 100%; }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.alert { margin: 0 0 18px; padding: 14px 16px; border: 1px solid transparent; border-radius: 12px; font-weight: 650; }
.alert-success { color: var(--green); background: var(--green-bg); border-color: #bfead2; }
.alert-warning { color: var(--amber); background: var(--amber-bg); border-color: #f1dda3; }
.alert-danger { color: var(--red); background: var(--red-bg); border-color: #ffd0cc; }
.alert-info { color: #744127; background: var(--info-bg); border-color: #dfc6b3; }
.stack-form { display: grid; gap: 15px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
label { display: grid; gap: 6px; color: #55443b; font-size: 12px; font-weight: 750; }
input, select, textarea { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #d8c8bc; border-radius: 9px; color: var(--ink); background: #fffdfa; }
textarea { min-height: 92px; resize: vertical; }
input:disabled { color: #89776d; background: #f0ebe7; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.muted { color: var(--muted); }
.inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.split { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.drop-zone { position: relative; padding: 34px 20px; text-align: center; border: 2px dashed #d8c4b4; border-radius: 13px; background: #fdf9f5; transition: .15s ease; }
.drop-zone:hover, .drop-zone.dragging { border-color: var(--blue); background: #f7eee7; }
.drop-zone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-zone strong { display: block; margin-bottom: 5px; }
.empty-state { padding: 42px 24px; text-align: center; border: 1px dashed #d7c7bc; border-radius: 14px; background: #fdf9f5; }
.empty-state h3 { margin: 12px 0 5px; }
.empty-state p { margin: 0 auto 16px; max-width: 560px; color: var(--muted); }
.empty-icon { width: 42px; height: 42px; margin: auto; display: grid; place-items: center; border-radius: 50%; color: var(--green); background: var(--green-bg); font-weight: 900; }
.progress { height: 8px; overflow: hidden; border-radius: 999px; background: #eee4dc; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #7b3f2a, #c88350); }
.tabs { display: flex; gap: 5px; overflow: auto; margin-bottom: 18px; padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: #fffdfa; }
.tab { padding: 8px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 700; white-space: nowrap; }
.tab.active { color: #6f3824; background: #f1e3d8; }
.code { padding: 2px 6px; border-radius: 5px; background: #f0e8e2; font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; }
.login-body { color: #fff; background: radial-gradient(circle at 25% 20%, #72422f 0, transparent 38%), #1b0e0b; }
.login-shell { min-height: 100vh; width: min(1100px, 100%); margin: auto; padding: 40px; display: grid; grid-template-columns: 1.2fr .8fr; gap: 72px; align-items: center; }
.login-brand h1 { max-width: 610px; margin: 24px 0 12px; font-size: clamp(44px, 6vw, 70px); line-height: 1.02; letter-spacing: -2px; }
.login-brand p { max-width: 570px; color: #d7c2b5; font-size: 18px; }
.eyebrow { display: inline-block; margin-top: 22px; color: #e0a878; font-size: 11px; font-weight: 900; letter-spacing: 1.4px; }
.login-safe { display: inline-flex; gap: 9px; align-items: center; margin-top: 24px; color: #baf3d5; font-size: 13px; font-weight: 700; }
.login-card { padding: 34px; color: var(--ink); background: #fffdfa; border: 1px solid rgba(255,255,255,.25); border-radius: 20px; box-shadow: 0 30px 70px rgba(0,0,0,.34); }
.login-card h2 { margin: 8px 0 4px; font-size: 29px; }
.login-card > p { margin: 0 0 22px; color: var(--muted); }
.login-card .eyebrow { margin: 0; color: #82472d; }
.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 10px; }
.toast { max-width: 380px; padding: 13px 16px; color: #fffaf5; background: var(--navy-2); border-radius: 10px; box-shadow: 0 14px 35px rgba(0,0,0,.2); }
.toast-danger { background: #9f221a; }
.content-clients {
  --client-board-bg: #120805;
  --client-card-bg: #2a100a;
  --client-line: #71351f;
  --client-text: #fff7f1;
  --client-muted: #c1a094;
  width: 100%;
  max-width: none;
  min-height: calc(100vh - 74px);
  margin: 0;
  color: var(--client-text);
  background:
    radial-gradient(circle at 8% -8%, rgba(139, 63, 34, .18), transparent 30%),
    radial-gradient(circle at 96% 12%, rgba(94, 39, 21, .16), transparent 26%),
    var(--client-board-bg);
}
.content-clients .page-heading h1 { color: var(--client-text); }
.content-clients .page-heading p { color: var(--client-muted); }
.client-overview-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.client-overview-card {
  min-height: 84px;
  padding: 14px 16px;
  border: 1px solid var(--client-line);
  border-radius: 11px;
  background: rgba(45, 18, 11, .86);
  box-shadow: inset 0 1px rgba(255,255,255,.02);
}
.client-overview-card span, .client-overview-card strong, .client-overview-card small { display: block; }
.client-overview-card span { color: #f5e9e2; font-size: 13px; font-weight: 750; }
.client-overview-card strong { margin-top: 7px; color: #fff; font-size: 23px; line-height: 1; }
.client-overview-card small { margin-top: 5px; color: var(--client-muted); font-size: 10px; }
.client-overview-card .client-safe-value { font-size: 22px; }
.client-create-panel {
  margin-top: 10px;
  border: 1px solid var(--client-line);
  border-radius: 10px;
  background: rgba(43, 17, 10, .76);
}
.client-create-panel summary { padding: 10px 14px; color: #f8ebe4; cursor: pointer; font-size: 12px; font-weight: 760; }
.client-create-panel > div { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 0 14px 14px 30px; }
.client-create-panel p { margin: 0; color: var(--client-muted); font-size: 12px; }
.client-create-link { flex: 0 0 auto; padding: 7px 10px; border: 1px solid #925337; border-radius: 8px; color: #fff7f1; background: #58301f; text-decoration: none; font-size: 12px; font-weight: 760; }
.client-create-link:hover { background: #6c3924; }
.client-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 10px; margin-top: 10px; }
.client-work-card {
  min-width: 0;
  min-height: 320px;
  padding: 13px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--client-line);
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(47, 18, 11, .98), rgba(39, 13, 8, .98));
  box-shadow: 0 12px 26px rgba(0, 0, 0, .16);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.client-work-card:hover { transform: translateY(-2px); border-color: #9a4f2c; box-shadow: 0 17px 31px rgba(0, 0, 0, .25); }
.client-card-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.client-card-heading h2 { min-width: 0; margin: 0; color: #fff; font-size: 16px; line-height: 1.05; letter-spacing: -.2px; }
.client-card-heading h2 a { text-decoration: none; }
.client-card-heading h2 a:hover { text-decoration: underline; text-decoration-color: #b86136; text-underline-offset: 3px; }
.client-kind { flex: 0 0 auto; padding: 3px 6px; border-radius: 999px; color: #e7eefc; background: #0d1a2c; font-size: 9px; font-weight: 780; }
.client-card-meta { min-height: 30px; margin: 8px 0 11px; color: var(--client-muted); font-size: 9px; line-height: 1.35; overflow-wrap: anywhere; }
.client-card-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin: -4px 0 12px; color: #e9d8cf; font-size: 9px; line-height: 1.35; }
.client-card-facts span { min-width: 0; overflow-wrap: anywhere; }
.client-card-facts strong { color: #fff; }
.client-operational-status { grid-template-columns: 1fr; gap: 4px; margin: -2px 0 12px; }
.client-operational-status [data-status] { display: block; }
.client-card-source { margin: 9px 0 0; color: var(--client-muted); font-size: 9px; line-height: 1.45; overflow-wrap: anywhere; }
.client-primary-actions { display: grid; justify-items: start; gap: 7px; }
.client-action-form { margin: 0; }
.client-action {
  width: max-content;
  min-height: 29px;
  padding: 6px 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 7px;
  color: #fff;
  text-decoration: none;
  font-size: 11px;
  line-height: 1;
  font-weight: 820;
  cursor: pointer;
  box-shadow: inset 0 1px rgba(255,255,255,.12), 0 5px 10px rgba(0,0,0,.13);
}
.client-action:hover { transform: translateY(-1px); filter: brightness(1.08); }
.client-action-open { background: #08765a; }
.client-action-check { background: #6b22c9; }
.client-action-documents { background: #0873a4; }
.client-technical { margin-top: auto; padding-top: 10px; }
.client-technical summary { width: max-content; color: #f1e5df; cursor: pointer; font-size: 11px; }
.client-technical summary::marker { color: #f4d8c7; }
.client-technical-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.client-technical-links a { padding: 6px 9px; border-radius: 7px; color: #f7f9ff; background: #101d2d; text-decoration: none; font-size: 10px; line-height: 1.15; font-weight: 790; }
.client-technical-links a:hover { background: #1a304b; transform: translateY(-1px); }
.client-empty { margin-top: 10px; padding: 45px 24px; text-align: center; border: 1px dashed var(--client-line); border-radius: 11px; background: rgba(43,17,10,.7); }
.client-empty h2 { margin: 0 0 6px; }
.client-empty p { margin: 0; color: var(--client-muted); }
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .client-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; transform: translateX(-102%); width: 250px; transition: transform .2s ease; box-shadow: 20px 0 50px rgba(0,0,0,.2); }
  .sidebar.open { transform: translateX(0); }
  .sidebar.open + .sidebar-overlay { display: block; position: fixed; inset: 0; z-index: 19; border: 0; background: rgba(5, 18, 34, .42); }
  .menu-button { display: grid; }
  .topbar { padding: 0 18px; }
  .topbar-title { display: none; }
  .content { padding: 24px 16px 50px; }
  .login-shell { grid-template-columns: 1fr; gap: 34px; padding: 24px; }
  .login-brand h1 { font-size: 44px; }
}
@media (max-width: 620px) {
  .grid-2, .grid-3, .grid-4, .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .client-overview-grid { grid-template-columns: 1fr; }
  .client-create-panel > div { display: grid; padding-left: 14px; }
  .client-create-link { width: 100%; text-align: center; }
  .page-heading { display: grid; }
  .heading-actions, .heading-actions .button { width: 100%; }
  .user-copy { display: none; }
  .card { padding: 18px; }
  th, td { padding: 11px 12px; }
  .login-shell { align-items: start; }
  .login-brand { padding-top: 30px; }
}
@media print {
  .sidebar, .topbar, .heading-actions, .button, .link-button { display: none !important; }
  .app-shell { display: block; }
  .content { width: 100%; padding: 0; }
  .card, .table-wrap { box-shadow: none; break-inside: avoid; }
}
