/* ADA Active Clients — Modern 2026 Theme */

:root {
  --primary:      #6366f1;
  --primary-dark: #4f46e5;
  --primary-dim:  rgba(99,102,241,.12);
  --accent:       #22d3ee;
  --bg:           #f1f3f9;
  --surface:      #ffffff;
  --surface-2:    #f8f9fc;
  --header-bg:    #0f172a;
  --text:         #0f172a;
  --text-muted:   #64748b;
  --text-faint:   #94a3b8;
  --border:       #e2e8f0;
  --border-focus: #6366f1;
  --urgent:       #f43f5e;
  --warning:      #f59e0b;
  --success:      #10b981;
  --shadow-xs:    0 1px 2px rgba(15,23,42,.06);
  --shadow-sm:    0 2px 8px rgba(15,23,42,.08);
  --shadow:       0 4px 20px rgba(15,23,42,.10);
  --radius-sm:    6px;
  --radius:       10px;
  --radius-lg:    16px;
  --font:         "Inter", "Segoe UI", system-ui, sans-serif;
  --transition:   .15s cubic-bezier(.4,0,.2,1);
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* VIEW MANAGEMENT */
.view { display: none; }
.view.active { display: block; }
#login-view.active { display: flex; }

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 16px; border-radius: var(--radius-sm); border: none;
  font-size: 13px; font-weight: 600; font-family: var(--font);
  cursor: pointer; transition: all var(--transition);
  text-decoration: none; white-space: nowrap; letter-spacing: .01em;
}
.btn:disabled { opacity: .45; cursor: default; pointer-events: none; }
.btn:active { transform: scale(.97); }

.btn-primary {
  background: var(--primary); color: #fff;
  box-shadow: 0 1px 3px rgba(99,102,241,.35);
}
.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 2px 8px rgba(99,102,241,.45);
}

.btn-accent {
  background: var(--accent); color: var(--header-bg);
  box-shadow: 0 1px 3px rgba(34,211,238,.3);
}
.btn-accent:hover {
  background: #06c4df;
  box-shadow: 0 2px 8px rgba(34,211,238,.4);
}

.btn-secondary {
  background: transparent; color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-secondary:hover { background: var(--primary-dim); }

.btn-hdr {
  background: rgba(255,255,255,.07); color: rgba(255,255,255,.8);
  border: 1px solid rgba(255,255,255,.12);
  font-size: 12.5px; padding: 6px 13px;
}
.btn-hdr:hover { background: rgba(255,255,255,.14); color: #fff; }

.btn-full { width: 100%; justify-content: center; padding: 12px; font-size: 14.5px; }

/* LOGIN */
.login-bg {
  min-height: 100vh; width: 100%;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(99,102,241,.25) 0%, transparent 60%),
    linear-gradient(160deg, #090d1a 0%, #0f172a 45%, #131d35 100%);
  padding: 24px; position: relative; overflow: hidden;
}
.login-bg::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(34,211,238,.06) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(99,102,241,.08) 0%, transparent 50%);
  pointer-events: none;
}
.login-card {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-radius: var(--radius-lg);
  padding: 44px 40px 40px;
  width: 100%; max-width: 380px;
  box-shadow: 0 24px 64px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.12);
  position: relative;
}
.login-title {
  font-size: 26px; font-weight: 700; color: #fff;
  text-align: center; margin-bottom: 4px; letter-spacing: -.02em;
}
.login-sub {
  text-align: center; color: rgba(255,255,255,.4); font-size: 12px;
  letter-spacing: .1em; text-transform: uppercase; font-weight: 500;
  margin-bottom: 36px;
}
.login-form .field-label {
  display: block; font-size: 11.5px; font-weight: 600;
  color: rgba(255,255,255,.5); letter-spacing: .07em;
  text-transform: uppercase; margin-bottom: 8px;
}
.login-form input[type="password"] {
  width: 100%; padding: 12px 14px;
  background: rgba(255,255,255,.06);
  border: 1.5px solid rgba(255,255,255,.1);
  border-radius: var(--radius-sm); font-size: 14.5px;
  font-family: var(--font); color: #fff;
  transition: border-color var(--transition), background var(--transition);
  outline: none;
}
.login-form input[type="password"]::placeholder { color: rgba(255,255,255,.25); }
.login-form input:focus {
  border-color: var(--primary);
  background: rgba(255,255,255,.09);
}
.login-form .btn-full {
  margin-top: 18px;
  background: var(--primary);
  box-shadow: 0 4px 16px rgba(99,102,241,.5);
  font-size: 14.5px; letter-spacing: .01em;
}
.login-form .btn-full:hover {
  background: #5457e8;
  box-shadow: 0 6px 24px rgba(99,102,241,.6);
}
.error-msg { color: #fb7185; font-size: 12.5px; min-height: 18px; margin-top: 10px; }

/* APP HEADER */
.app-header {
  background: var(--header-bg);
  height: 56px; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 1px 0 rgba(255,255,255,.06), 0 4px 16px rgba(0,0,0,.3);
  position: sticky; top: 0; z-index: 100;
}
.hdr-left { display: flex; align-items: center; gap: 16px; }
.hdr-title {
  font-size: 15.5px; font-weight: 600; color: rgba(255,255,255,.9);
  letter-spacing: -.01em;
}
.hdr-right { display: flex; align-items: center; gap: 8px; }
.refresh-status { font-size: 11.5px; color: rgba(255,255,255,.35); }

/* LIST VIEW */
.list-main { padding: 20px 24px; max-width: 1500px; margin: 0 auto; }

.table-wrap {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden; overflow-x: auto;
}
.cases-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.cases-table thead { background: var(--header-bg); }
.cases-table th {
  padding: 10px 14px; text-align: left;
  font-size: 10.5px; font-weight: 600; letter-spacing: .09em;
  text-transform: uppercase; color: rgba(255,255,255,.45);
  white-space: nowrap; user-select: none;
}
.cases-table tbody tr {
  border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background var(--transition);
}
.cases-table tbody tr:last-child { border-bottom: none; }
.cases-table tbody tr:hover { background: #f5f6ff; }
.cases-table td { padding: 11px 14px; vertical-align: middle; }
.col-defendant strong { color: var(--text); font-weight: 600; }
.col-owner-name {
  display: block; font-size: 11.5px; color: var(--text-faint);
  font-weight: 400; margin-top: 1px;
}


.empty-state {
  text-align: center; padding: 60px 24px;
  color: var(--text-faint);
}

/* STATUS BADGES */
.status-badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
  letter-spacing: .01em;
}
.status-new        { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.status-responded  { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.status-consult    { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.status-active     { background: #eef2ff; color: var(--primary-dark); border: 1px solid #c7d2fe; }
.status-retained   { background: var(--primary); color: #fff; border: 1px solid transparent; }
.status-declined   { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }
.status-neutral    { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }

.badge-retained {
  background: var(--accent); color: var(--header-bg);
  font-size: 10.5px; padding: 2px 8px; border-radius: 20px;
  font-weight: 700; letter-spacing: .02em;
}

.star-icon { color: var(--accent); font-size: 14px; line-height: 1; vertical-align: middle; }

.th-docket { width: 44px; padding: 0; }
.col-docket { width: 44px; padding: 2px 4px; text-align: center; }
.docket-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 28px; border-radius: var(--radius-sm);
  font-size: 15px; line-height: 1; color: var(--text-muted);
  text-decoration: none; background: var(--surface-2);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.docket-link:hover {
  background: var(--primary); color: #fff; border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(99,102,241,.4);
}

.deadline-input {
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 4px 8px; font-size: 13px; font-family: var(--font);
  color: var(--text); background: var(--surface); cursor: pointer;
  transition: border-color var(--transition);
}
.deadline-input:focus { outline: none; border-color: var(--border-focus); }

.col-notes {
  max-width: 220px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; color: var(--text-muted); font-size: 12.5px;
}

/* DEADLINE COLORS */
.dl-urgent  { color: var(--urgent); font-weight: 700; }
.dl-warning { color: var(--warning); font-weight: 600; }
.dl-past    { color: var(--text-faint); text-decoration: line-through; }

/* MOBILE CARDS */
.cases-cards { display: none; }
.case-card {
  background: var(--surface); border-radius: var(--radius);
  padding: 16px; margin-bottom: 8px;
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border);
  cursor: pointer; transition: all var(--transition);
}
.case-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--primary);
  transform: translateY(-1px);
}
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.card-case { font-size: 11.5px; color: var(--text-faint); font-weight: 500; letter-spacing: .04em; }
.card-name { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 8px; letter-spacing: -.01em; }
.card-meta { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-muted); margin-bottom: 10px; }
.card-foot { display: flex; justify-content: space-between; align-items: center; }
.card-docstatus { font-size: 11.5px; color: var(--text-faint); }

@media (max-width: 780px) {
  .table-wrap  { display: none; }
  .cases-cards { display: block; }
  .list-main   { padding: 12px 16px; }
  .app-header  { height: auto; padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .hdr-title   { font-size: 15px; }
  .refresh-status { display: none; }
}

/* DETAIL VIEW */
.detail-main { max-width: 900px; margin: 0 auto; padding: 20px 24px; }

.d-section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border);
}

.d-section-hdr {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.d-section-hdr .d-section-title { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.d-section-actions { display: flex; align-items: center; gap: 10px; }

.d-section-title {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  margin-bottom: 18px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  letter-spacing: -.005em;
  display: flex; align-items: center; gap: 8px;
}
.d-section-title::before {
  content: "";
  display: inline-block; width: 3px; height: 14px;
  background: var(--primary); border-radius: 2px;
  flex-shrink: 0;
}
.section-note {
  font-size: 11.5px; font-weight: 400; color: var(--text-faint);
  font-family: var(--font);
}

.d-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
.d-field { display: flex; flex-direction: column; gap: 4px; }
.d-lbl {
  font-size: 10.5px; font-weight: 600; color: var(--text-faint);
  letter-spacing: .08em; text-transform: uppercase;
}
.d-val { font-size: 14px; color: var(--text); font-weight: 500; }
.d-val--name { font-size: 17px; font-weight: 700; color: var(--text); letter-spacing: -.02em; }
.d-val a { color: var(--primary); }
.d-val a:hover { text-decoration: underline; }

/* ATTORNEY FORM */
.atty-form { display: flex; flex-direction: column; gap: 16px; }
.form-field .field-label {
  display: block; font-size: 11px; font-weight: 600;
  color: var(--text-muted); letter-spacing: .07em;
  text-transform: uppercase; margin-bottom: 7px;
}
.form-field select,
.form-field textarea,
#atty-status,
#atty-notes {
  width: 100%; padding: 10px 12px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13.5px; font-family: var(--font); color: var(--text);
  background: var(--surface-2); outline: none;
  transition: border-color var(--transition), background var(--transition);
}
.form-field select:focus,
.form-field textarea:focus,
#atty-status:focus,
#atty-notes:focus {
  border-color: var(--border-focus);
  background: var(--surface);
}
#atty-notes { resize: vertical; min-height: 100px; }
.form-actions { display: flex; align-items: center; gap: 12px; }
.save-status { font-size: 13px; color: var(--success); font-weight: 600; }
.save-status.is-error { color: var(--urgent); }

/* DOC GENERATION */
.d-section--docgen { border-left: 3px solid var(--accent); }
.docgen-wrap { display: flex; flex-direction: column; gap: 14px; }
.docgen-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.docgen-status { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.docgen-status .d-lbl { font-size: 10.5px; }

@media (max-width: 600px) {
  .detail-main { padding: 12px 16px; }
  .d-section   { padding: 16px; }
  .d-grid      { grid-template-columns: 1fr; }
  .docgen-btns { flex-direction: column; }
  .docgen-btns .btn { width: 100%; justify-content: center; }
  .form-actions { flex-direction: column; align-items: flex-start; }
}
