:root {
  --ink: #172b32;
  --muted: #65767b;
  --teal: #103d4a;
  --teal2: #1d5965;
  --orange: #dc6a3b;
  --line: #dce5e6;
  --soft: #f4f8f8;
  --danger: #a42d2d;
}
* { box-sizing: border-box; }
body { margin: 0; background: #f5f8f8; color: var(--ink); font: 14px/1.5 system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif; }
button,input,select,textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.admin-page { min-height: 100vh; }
.login-panel { width: min(440px,calc(100% - 28px)); margin: 8vh auto; background: white; border: 1px solid var(--line); border-radius: 12px; padding: 34px; box-shadow: 0 12px 40px rgba(16,61,74,.08); }
.admin-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--teal); }
.admin-brand-logo { display: block; width: 170px; max-width: 42vw; height: auto; flex: none; }
.admin-brand-context { color: #718287; font-size: 10px; letter-spacing: 1.1px; }
.login-panel h1 { font-size: 23px; margin: 27px 0 2px; color: var(--teal); }
.login-panel > p { color: var(--muted); margin: 0 0 20px; }
.login-panel form,.content-card form { display: grid; gap: 15px; }
.login-panel label,.content-card label { display: grid; gap: 6px; color: #42585d; font-weight: 650; font-size: 13px; }
.login-panel input,.content-card input,.filter-grid input,.filter-grid select { border: 1px solid #cbd7d9; border-radius: 6px; background: #fff; padding: 10px; color: var(--ink); min-height: 40px; }
.login-panel input:focus,.content-card input:focus,.filter-grid input:focus,.filter-grid select:focus { outline: 2px solid #d5e7e8; border-color: var(--teal2); }
.primary-button,.secondary-button { padding: 9px 14px; border: 1px solid transparent; border-radius: 6px; font-weight: 700; font-size: 12px; }
.primary-button { background: var(--teal); color: white; }
.primary-button:hover { background: #0b303a; }
.secondary-button { border-color: #c3d0d2; background: white; color: var(--teal); }
.secondary-button:hover { background: #f2f7f7; }
.back-link { display: inline-block; margin-top: 18px; color: var(--teal2); text-decoration: none; font-size: 12px; }
.error { color: var(--danger); min-height: 18px; }
.topbar { height: 70px; background: white; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; padding: 0 max(calc((100vw - 1300px)/2),24px); }
.account-tools { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 12px; }
.dashboard-wrap { max-width: 1300px; margin: 27px auto; padding: 0 22px; }
.page-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 19px; }
.page-title h1 { color: var(--teal); font-size: 27px; margin: 0; }
.eyebrow { letter-spacing: 1.4px; color: var(--orange); font-weight: 800; font-size: 10px; margin: 0 0 4px; }
.stat-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 21px; }
.stat-card { background: white; border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.stat-card span { display: block; color: var(--muted); font-size: 11px; }
.stat-card strong { display: block; color: var(--teal); font-size: 23px; margin-top: 3px; }
.tabs { display: flex; gap: 5px; border-bottom: 1px solid #cdd9da; margin-bottom: 16px; }
.tab { border: 0; background: transparent; padding: 11px 15px; color: var(--muted); font-weight: 700; border-bottom: 2px solid transparent; }
.tab.active { color: var(--teal); border-color: var(--orange); }
.filter-panel,.content-card,.table-wrap { background: white; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 15px; }
.filter-panel { padding: 15px; }
.filter-grid { display: grid; grid-template-columns: 2fr repeat(3,1fr) repeat(3,150px); gap: 10px; }
.filter-grid label { display: grid; gap: 5px; font-size: 11px; color: var(--muted); font-weight: 650; }
.filter-grid input,.filter-grid select { min-width: 0; font-size: 12px; min-height: 36px; padding: 7px; }
.filter-actions { display: flex; align-items: center; gap: 13px; margin-top: 12px; color: var(--muted); font-size: 12px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 990px; }
th { text-align: left; color: #66797e; font-size: 10px; text-transform: uppercase; letter-spacing: .5px; background: #f8fafa; }
th,td { border-bottom: 1px solid #edf1f1; padding: 11px 12px; vertical-align: top; }
td { font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }
.reference { color: var(--teal); font-weight: 800; }
.subline { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.status-pill { display: inline-block; background: #eaf1f2; color: #33555d; border-radius: 20px; padding: 4px 8px; font-size: 10px; white-space: nowrap; }
.status-new { background: #fff0e8; color: #8f461d; }
.status-completed { background: #e8f4ec; color: #24703c; }
.row-actions { display: flex; gap: 5px; flex-wrap: wrap; }
.row-actions button { border: 1px solid #ccd7d8; border-radius: 5px; background: #fff; color: var(--teal); padding: 5px 7px; font-size: 10px; font-weight: 700; }
.row-actions button.danger { color: var(--danger); }
.empty-state { text-align: center; padding: 35px; color: var(--muted); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 15px; margin: 12px 0 25px; color: var(--muted); font-size: 12px; }
.content-card { padding: 20px; }
.content-card h2 { color: var(--teal); font-size: 17px; margin: 0 0 6px; }
.content-card p { color: var(--muted); font-size: 12px; margin: 0 0 15px; }
.button-row { display: flex; gap: 9px; flex-wrap: wrap; }
.warning-box { background: #fff7eb; border: 1px solid #ead7bb; border-radius: 7px; padding: 11px 13px; color: #684e2e; font-size: 12px; margin: 12px 0; }
.status-message { color: var(--teal2); font-size: 12px; }
.inline-check { display: flex !important; grid-template-columns: 20px 1fr; align-items: center; }
.inline-check input { width: 16px; min-height: 16px; }
.subtle { font-size: 11px !important; }
.drive-callback-uri code { display: block; overflow-wrap: anywhere; }
.modal { position: fixed; inset: 0; z-index: 10; display: flex; justify-content: flex-end; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(13,31,36,.48); }
.modal-card { position: relative; background: white; width: min(760px,100%); height: 100%; overflow: auto; box-shadow: -10px 0 35px rgba(0,0,0,.12); }
.modal-card > header { position: sticky; top: 0; background: white; z-index: 2; border-bottom: 1px solid var(--line); padding: 18px 22px; display: flex; justify-content: space-between; align-items: center; }
.modal-card h2 { font-size: 20px; color: var(--teal); margin: 0; }
.icon-button { border: 0; background: none; color: var(--muted); font-size: 28px; }
.detail-content { padding: 20px 22px; }
.detail-section { border: 1px solid var(--line); border-radius: 7px; margin-bottom: 13px; overflow: hidden; }
.detail-section h3 { margin: 0; background: #f4f8f8; padding: 10px 12px; font-size: 13px; color: var(--teal); }
.detail-kv { display: grid; grid-template-columns: 180px 1fr; border-top: 1px solid #edf1f1; padding: 8px 11px; font-size: 12px; gap: 10px; }
.detail-kv strong { color: #60757a; text-transform: capitalize; }
.detail-kv span { white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-section .button-row,.detail-section textarea,.detail-section select,.detail-section .status-form { margin: 10px; }
.detail-section textarea { width: calc(100% - 20px); min-height: 80px; border: 1px solid var(--line); border-radius: 5px; padding: 8px; }
.status-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.status-form select { border: 1px solid var(--line); border-radius: 5px; padding: 7px; }
.note-form { display: flex; gap: 8px; padding: 10px; }
.note-form textarea { flex: 1; min-height: 60px; }
.detail-link { display: block; padding: 9px 11px; border-top: 1px solid #edf1f1; font-size: 12px; }
.toast { position: fixed; bottom: 18px; right: 18px; background: var(--teal); color: white; padding: 11px 16px; border-radius: 7px; box-shadow: 0 8px 25px #1233; z-index: 20; opacity: 0; pointer-events: none; transition: opacity .2s; }
.toast.show { opacity: 1; }
code { background: #f1f5f5; padding: 2px 4px; border-radius: 3px; }
@media(max-width:1000px) {
  .filter-grid { grid-template-columns: repeat(3,1fr); }
  .stat-grid { grid-template-columns: repeat(4,1fr); }
}
@media(max-width:650px) {
  .topbar { padding: 0 14px; }
  .admin-brand-context { display: none; }
  .dashboard-wrap { padding: 0 12px; margin-top: 18px; }
  .page-title h1 { font-size: 22px; }
  .stat-grid { grid-template-columns: repeat(2,1fr); gap: 8px; }
  .stat-card { padding: 11px; }
  .filter-grid { grid-template-columns: repeat(2,1fr); }
  .filter-grid label:first-child { grid-column: 1/-1; }
  .tabs { overflow: auto; }
  .tab { white-space: nowrap; padding: 10px; }
  .detail-kv { grid-template-columns: 120px 1fr; }
  .login-panel { padding: 26px 21px; }
  .account-tools { gap: 7px; }
  .account-tools #admin-name { display: none; }
}
