/* Admin panel mockup — mirrors the planned Filament v5 panel (docs/02 §8) */
:root {
  --brand-950: #012623; --brand-900: #02342f; --brand-800: #024a40; --brand-600: #00704f;
  --accent: #00c485; --cyan: #2fe8d3; --mint: #dffbf6;
  --bg: #f3f5f5; --line: #e1e6e5; --ink: #18211f; --muted: #66716e;
  --danger: #c62828; --warn: #b26a00;
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.5; }
a { color: var(--brand-600); }
button, input, select, textarea { font: inherit; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.2; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse 60% 60% at 90% 100%, rgba(0, 196, 150, .5), transparent 70%), linear-gradient(160deg, #011d1a, #023d35); }
.login-box { background: #fff; width: 100%; max-width: 440px; padding: 34px; box-shadow: 0 20px 50px rgba(0, 0, 0, .3); }
.login-box img { height: 20px; margin-bottom: 22px; }
.login-box h1 { font-size: 1.3rem; }
.login-box p { color: var(--muted); margin: 0 0 18px; }
.role-btn { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); padding: 12px 14px; margin-bottom: 10px; cursor: pointer; text-align: left; }
.role-btn:hover { border-color: var(--brand-600); background: var(--mint); }
.role-btn small { display: block; color: var(--muted); }
.otp { display: none; margin-top: 8px; }
.otp.on { display: block; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: var(--brand-950); color: #fff; padding: 22px 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { padding: 0 22px 20px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.sidebar .brand img { height: 17px; }
.sidebar .brand small { display: block; color: var(--cyan); font-size: .7rem; letter-spacing: .15em; text-transform: uppercase; margin-top: 8px; }
.sidebar nav { padding: 14px 10px; }
.sidebar .group { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .45); padding: 14px 12px 6px; }
.sidebar a { display: flex; align-items: center; justify-content: space-between; color: rgba(255, 255, 255, .85); text-decoration: none; padding: 9px 12px; border-radius: 4px; font-size: .88rem; }
.sidebar a:hover { background: rgba(255, 255, 255, .07); }
.sidebar a.on { background: rgba(47, 232, 211, .14); color: #fff; font-weight: 600; }
.sidebar .count { background: var(--cyan); color: var(--brand-950); font-size: .7rem; font-weight: 700; border-radius: 10px; padding: 0 7px; }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #fff; border-bottom: 1px solid var(--line); padding: 12px 26px; position: sticky; top: 0; z-index: 10; }
.topbar .who { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.menu-btn { display: none; background: none; border: 1px solid var(--line); padding: 6px 10px; cursor: pointer; }
.content { padding: 26px; max-width: 1200px; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.page-head h1 { font-size: 1.45rem; margin: 0; }
.crumb { color: var(--muted); font-size: .82rem; margin-bottom: 4px; }
.crumb a { text-decoration: none; }

/* ---------- ui ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; padding: 8px 14px; border-radius: 4px; cursor: pointer; font-weight: 600; font-size: .85rem; text-decoration: none; background: #fff; color: var(--ink); border-color: var(--line); }
.btn:hover { border-color: #b9c4c2; }
.btn-primary { background: var(--brand-800); color: #fff; border-color: var(--brand-800); }
.btn-primary:hover { background: var(--brand-900); }
.btn-accent { background: var(--cyan); color: var(--brand-950); border-color: var(--cyan); }
.btn-danger { color: var(--danger); }
.btn-sm { padding: 4px 9px; font-size: .78rem; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 20px; margin-bottom: 18px; }
.card h2 { font-size: 1.05rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 18px; }
.stat b { display: block; font-size: 1.8rem; color: var(--brand-800); }
.stat span { color: var(--muted); font-size: .85rem; }
table.tbl { width: 100%; border-collapse: collapse; background: #fff; }
.tbl th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #fafbfb; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:hover td { background: #fbfdfc; }
.tbl .actions { white-space: nowrap; text-align: right; }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.thumb { width: 54px; height: 36px; object-fit: cover; border-radius: 3px; }
.badge { display: inline-block; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.b-green { background: #dcf7ec; color: #0b6b45; }
.b-grey { background: #eceeee; color: #555; }
.b-amber { background: #fff1d6; color: var(--warn); }
.b-blue { background: #e1f0ff; color: #1556a6; }
.b-red { background: #fde4e4; color: var(--danger); }
.muted { color: var(--muted); }
.empty { padding: 26px; text-align: center; color: var(--muted); }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-weight: 600; font-size: .82rem; margin-bottom: 5px; }
.field .help { color: var(--muted); font-size: .76rem; margin-top: 4px; }
.field input[type=text], .field input[type=email], .field input[type=date], .field input[type=password], .field input[type=url], .field select, .field textarea, .inp { width: 100%; padding: 8px 10px; border: 1px solid #cfd8d6; border-radius: 4px; background: #fff; }
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .inp:focus, .rich:focus { outline: 2px solid rgba(0, 112, 79, .35); border-color: var(--brand-600); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button { background: none; border: 0; padding: 10px 16px; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--brand-800); border-bottom-color: var(--brand-800); }
.tab-pane { display: none; }
.tab-pane.on { display: block; }
.translate-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: #f2fbf8; border: 1px dashed #9fd2c4; padding: 10px 12px; margin-bottom: 14px; font-size: .82rem; }
.rich-wrap { border: 1px solid #cfd8d6; border-radius: 4px; background: #fff; }
.rich-bar { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--line); padding: 5px; background: #fafbfb; }
.rich-bar button { background: none; border: 1px solid transparent; border-radius: 3px; padding: 3px 8px; cursor: pointer; font-size: .8rem; min-width: 30px; }
.rich-bar button:hover { border-color: var(--line); background: #fff; }
.rich { min-height: 220px; max-height: 520px; overflow-y: auto; padding: 12px 14px; line-height: 1.6; }
.rich h3 { font-size: 1.05rem; margin: 14px 0 6px; }
.rich h4 { font-size: .95rem; margin: 12px 0 6px; }
.repeater-row { display: grid; grid-template-columns: 1fr 2fr auto; gap: 8px; margin-bottom: 8px; }

/* ---------- client matters ---------- */
.matter-head { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.agenda { border: 1px solid var(--line); border-radius: 6px; margin-bottom: 14px; overflow: hidden; background: #fff; }
.agenda-head { display: flex; align-items: center; gap: 10px; background: #f4f8f7; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.agenda-head input { flex: 1; font-weight: 600; border: 1px solid transparent; background: transparent; padding: 5px 8px; border-radius: 4px; }
.agenda-head input:hover, .agenda-head input:focus { border-color: #cfd8d6; background: #fff; }
.prow { display: grid; grid-template-columns: 150px 1fr 1fr 36px; gap: 8px; padding: 8px 12px; border-bottom: 1px solid #eef2f1; align-items: start; }
.prow.head { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #fafbfb; padding-top: 6px; padding-bottom: 6px; }
.prow textarea { min-height: 38px; resize: vertical; }
.prow .del { background: none; border: 0; color: var(--danger); cursor: pointer; font-size: 1.1rem; padding: 6px; }
.agenda-foot { padding: 8px 12px; }
.add-agenda { display: flex; gap: 8px; flex-wrap: wrap; }
.add-agenda input { flex: 1; min-width: 200px; }
.saved-hint { color: var(--muted); font-size: .78rem; }

.notice { background: #fff8d6; border: 1px solid #f0e2a0; color: #5a4a00; padding: 10px 14px; border-radius: 4px; font-size: .82rem; margin-bottom: 16px; }
.msg-body { white-space: pre-wrap; background: #fafbfb; border: 1px solid var(--line); padding: 14px; border-radius: 4px; }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 160%); background: var(--brand-950); color: #fff; padding: 11px 18px; border-radius: 4px; z-index: 100; transition: transform .25s; max-width: calc(100vw - 32px); font-size: .86rem; }
.toast.show { transform: translate(-50%, 0); }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 250px; z-index: 30; transform: translateX(-100%); transition: transform .25s; }
  .shell.menu-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .4); }
  .menu-btn { display: inline-block; }
  .content { padding: 16px; }
  .topbar { padding: 10px 16px; }
  .form-grid, .matter-head { grid-template-columns: 1fr; }
  .prow { grid-template-columns: 1fr; gap: 6px; }
  .prow.head { display: none; }
  .prow .del { justify-self: end; }
  .repeater-row { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
}
