:root {
  color-scheme: light;
  --ink: #13333a;
  --muted: #65777b;
  --paper: #f5f8f7;
  --card: #ffffff;
  --line: #dce7e4;
  --teal: #087f78;
  --teal-dark: #05645f;
  --aqua: #d9f2ee;
  --coral: #f08a72;
  --navy: #123b49;
  --shadow: 0 18px 55px rgba(16, 58, 65, .12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; }
.login-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(300px, 46%) 1fr; }
.brand-panel { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: clamp(42px, 8vw, 110px); background: linear-gradient(145deg, #063e45, #087f78 68%, #0b9d91); color: white; }
.brand-panel h1 { max-width: 560px; margin: 10px 0 16px; font-size: clamp(42px, 6vw, 78px); line-height: .98; letter-spacing: -.055em; }
.brand-panel > p:last-of-type { max-width: 470px; margin: 0; font-size: 18px; color: rgba(255,255,255,.78); }
.brand-mark { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; background: rgba(255,255,255,.15); font-size: 24px; transform: rotate(-8deg); }
.eyebrow { margin: 24px 0 0; font-size: 12px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.eyebrow.teal { margin: 0 0 9px; color: var(--teal); }
.brand-orbit { position: absolute; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; }
.orbit-one { width: 420px; height: 420px; right: -200px; top: -180px; }
.orbit-two { width: 620px; height: 620px; left: -320px; bottom: -440px; }
.login-panel { display: grid; place-items: center; padding: 32px; }
.login-card { width: min(430px, 100%); display: grid; gap: 20px; padding: 36px; background: var(--card); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow); }
.login-card h2 { margin: 0; font-size: 34px; letter-spacing: -.03em; }
.muted { color: var(--muted); }
label { display: grid; gap: 8px; font-size: 14px; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid #cddbd8; border-radius: 12px; padding: 12px 13px; color: var(--ink); background: white; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(8,127,120,.13); }
textarea { min-height: 116px; resize: vertical; }
.button { border: 0; border-radius: 12px; padding: 12px 17px; font-weight: 800; }
.button.primary { color: white; background: var(--teal); }
.button.primary:hover { background: var(--teal-dark); }
.button.secondary { color: var(--ink); background: var(--aqua); }
.button.ghost { color: var(--ink); background: transparent; border: 1px solid var(--line); }
.button.danger { color: #9d2c1b; background: #fff0ed; }
.form-error { min-height: 20px; margin: -8px 0 0; color: #b93825; font-size: 14px; }
.security-note { margin: -4px 0 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.dashboard { min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px clamp(20px, 4vw, 58px); background: rgba(255,255,255,.92); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.logo-lockup { display: flex; align-items: center; gap: 12px; font-weight: 900; }
.logo-lockup span:first-child { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 12px; background: var(--teal); color: white; }
.user-actions { display: flex; align-items: center; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 6px 8px 6px 6px; border-radius: 99px; background: var(--paper); }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--navy); font-weight: 800; }
.content { width: min(1380px, 100%); margin: 0 auto; padding: 38px clamp(20px, 4vw, 58px) 70px; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 28px; }
.page-head h1 { margin: 5px 0 0; font-size: clamp(31px, 4vw, 48px); letter-spacing: -.045em; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(145px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat { padding: 18px 20px; border: 1px solid var(--line); background: var(--card); border-radius: 18px; }
.stat strong { display: block; margin-top: 8px; font-size: 30px; }
.stat span { color: var(--muted); font-size: 13px; }
.workspace { overflow: hidden; border: 1px solid var(--line); background: var(--card); border-radius: 22px; box-shadow: 0 10px 35px rgba(16,58,65,.07); }
.toolbar { display: grid; grid-template-columns: 1fr 220px auto; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); }
.search-wrap { position: relative; }
.search-wrap input { padding-left: 41px; }
.search-wrap::before { content: '⌕'; position: absolute; left: 14px; top: 7px; font-size: 24px; color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 900px; }
th { padding: 13px 17px; text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: #f8faf9; }
td { padding: 15px 17px; border-top: 1px solid #edf2f0; font-size: 14px; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #f7fbfa; }
.client-cell strong { display: block; }
.client-cell span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 6px 9px; font-size: 11px; font-weight: 800; }
.badge.new { color: #075c58; background: #d9f2ee; }
.badge.progress { color: #775b06; background: #fff4c7; }
.badge.waiting { color: #7a3a2d; background: #ffe3dc; }
.badge.closed { color: #405156; background: #e8eeee; }
.empty { padding: 70px 25px; text-align: center; color: var(--muted); }
.empty strong { display: block; margin-bottom: 7px; color: var(--ink); font-size: 20px; }
.detail-dialog { width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 30px); padding: 0; border: 0; border-radius: 24px; box-shadow: var(--shadow); }
.detail-dialog.compact { width: min(520px, calc(100vw - 24px)); }
.detail-dialog::backdrop { background: rgba(7,38,43,.58); backdrop-filter: blur(4px); }
.dialog-head { display: flex; align-items: start; justify-content: space-between; gap: 18px; padding: 23px 25px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 2px 0 0; }
.dialog-body { display: grid; gap: 18px; padding: 24px 25px; overflow-y: auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .wide { grid-column: 1 / -1; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 25px; border-top: 1px solid var(--line); }
.icon-button { border: 0; background: transparent; color: var(--muted); font-size: 24px; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: 24px; transform: translate(-50%, 20px); padding: 12px 16px; color: white; background: var(--navy); border-radius: 12px; opacity: 0; pointer-events: none; transition: .2s; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 820px) {
  .login-layout { grid-template-columns: 1fr; }
  .brand-panel { min-height: 280px; padding: 38px 25px; justify-content: end; }
  .brand-panel h1 { font-size: 45px; }
  .login-panel { padding: 22px 16px 38px; margin-top: -25px; position: relative; }
  .login-card { padding: 27px 22px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .page-head { align-items: start; flex-direction: column; }
  .toolbar { grid-template-columns: 1fr; }
  .user-chip span:not(.avatar) { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
}
