/* The Muse Home - ported from the Next.js build (globals.css) */
:root {
  --bg: #f2f6fc;
  --panel: #ffffff;
  --ink: #172947;
  --muted: #647891;
  --line: #e1e9f5;
  --accent: #096cf0;
  --accent-dark: #085bcc;
  --gold: #47779f;
  --danger: #b54747;
  --success: #2d7a45;
  --shadow: 0 14px 40px rgba(17, 50, 90, 0.10);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Arial, Tahoma, sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
svg { width: 18px; height: 18px; flex: 0 0 auto; }
a.ghost-button, a.text-button, .sidebar nav a { text-decoration: none; }
form { margin: 0; }

/* Login */
.login-screen { min-height: 100vh; display: grid; place-items: center; background-size: cover; background-position: 50%; position: relative; padding: 28px; }
.login-screen::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8, 26, 54, .86), rgba(17, 46, 89, .40)); }
.login-panel { position: relative; width: min(920px, 100%); min-height: 520px; display: grid; grid-template-columns: 1.1fr 420px; gap: 32px; align-items: flex-end; color: white; }
.login-panel h1 { font-size: clamp(42px, 6vw, 72px); margin: 8px 0 16px; letter-spacing: 0; }
.login-panel p { max-width: 580px; line-height: 1.7; color: rgba(255, 255, 255, .86); }
.login-form { display: grid; gap: 14px; background: rgba(255, 255, 255, .95); color: var(--ink); padding: 28px; border-radius: 8px; box-shadow: var(--shadow); }
.eyebrow { margin: 0; color: var(--gold); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }

/* Shell */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
.sidebar { background: #112e59; color: white; padding: 22px 16px; display: flex; flex-direction: column; gap: 22px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 18px; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.brand-mark { width: 42px; height: 42px; border-radius: 8px; background: var(--gold); display: grid; place-items: center; color: #ffffff; font-weight: 800; }
.brand strong, .brand span { display: block; }
.brand span { color: rgba(255, 255, 255, .66); font-size: 12px; margin-top: 2px; }
.sidebar nav { display: grid; gap: 6px; }
.ghost-button, .primary-button, .sidebar nav a, .text-button { border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.sidebar nav a { min-height: 44px; padding: 0 12px; border-radius: 8px; color: rgba(255, 255, 255, .74); background: transparent; justify-content: flex-start; }
.sidebar nav a.active, .sidebar nav a:hover { background: rgba(255, 255, 255, .12); color: white; }


.workspace { min-width: 0; padding: 24px; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.topbar h2 { margin: 4px 0 0; font-size: 28px; }
.topbar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* Buttons & notices */
.ghost-button { min-height: 40px; padding: 0 12px; border-radius: 8px; background: var(--panel); color: var(--ink); border: 1px solid var(--line); }
.logout-button { color: var(--danger); border-color: var(--danger); white-space: nowrap; }
.logout-button:hover { background: #fbeeee; }
.primary-button { min-height: 44px; padding: 0 16px; border-radius: 8px; background: var(--accent); color: white; font-weight: 700; }
.primary-button:hover { background: var(--accent-dark); }
.ghost-button:disabled, .primary-button:disabled { opacity: .6; cursor: not-allowed; }
.text-button { padding: 0; background: transparent; color: var(--accent); font-weight: 700; }
.notice { padding: 12px 14px; border-radius: 8px; margin-bottom: 14px; }
.notice.success { color: var(--success); background: #e8f4ed; }
.notice.danger, .form-error { color: var(--danger); background: #fbeeee; }
.form-error { border-radius: 8px; padding: 10px; margin: 0; }

/* Content */
.view-stack { display: grid; gap: 16px; }
.hero-band { min-height: 170px; display: flex; align-items: flex-end; padding: 24px; border-radius: 8px; background: linear-gradient(135deg, #112e59, #3478be); color: white; }
.hero-band h3 { margin: 8px 0; font-size: 34px; }
.hero-band p:last-child { margin: 0; color: rgba(255, 255, 255, .78); }
.stats-grid { display: grid; grid-template-columns: repeat(6, minmax(140px, 1fr)); gap: 12px; }
.stats-grid.compact { grid-template-columns: repeat(3, minmax(180px, 1fr)); }
.stat { min-height: 112px; padding: 16px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; justify-content: space-between; }
.stat span, .stat small { color: var(--muted); }
.stat strong { font-size: 24px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 18px; min-width: 0; }
.split-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 430px); gap: 16px; align-items: flex-start; }
.form-panel { display: grid; gap: 14px; }
.wide-form { max-width: 980px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-heading h3 { margin: 0; font-size: 18px; }
.section-heading span { color: var(--muted); font-size: 13px; }
.search-box { min-width: 270px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; min-height: 40px; }
.search-box input { border: 0; outline: 0; width: 100%; }

/* Tables & forms */
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.right { text-align: right; }
.field { display: grid; gap: 6px; }
.field span { color: var(--muted); font-size: 13px; font-weight: 700; }
.field input, .field select, .field textarea, .line-item input { width: 100%; border: 1px solid var(--line); border-radius: 8px; min-height: 42px; padding: 9px 10px; background: white; color: var(--ink); }
.field textarea { resize: vertical; }
.field-hint { color: var(--muted); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check-field { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.line-items { display: grid; gap: 8px; }
.line-item { display: grid; grid-template-columns: 1fr 72px 100px 100px; gap: 8px; }
.empty-state { padding: 24px; text-align: center; color: var(--muted); }

/* Badges & complaints */
.badge { display: inline-flex; align-items: center; min-height: 26px; padding: 0 9px; border-radius: 999px; background: #edf2fa; color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge-urgent { background: #fff1db; color: #996316; }
.badge-active, .badge-normal, .badge-resolved { background: #e7f3ec; color: var(--success); }
.badge-new { background: #e9f0ff; color: #345995; }
.badge-in_progress { background: #fff3d6; color: #8f6812; }
.complaint-list { display: grid; gap: 10px; }
.complaint-row { display: grid; grid-template-columns: 1fr auto; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.complaint-row p { margin: 6px 0; line-height: 1.6; }
.complaint-row p, .complaint-row small { color: var(--muted); }
.complaint-actions { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* Receipt modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(8, 26, 54, .58); z-index: 20; display: grid; place-items: center; padding: 24px; }
.receipt-modal { width: min(820px, 100%); max-height: 92vh; overflow: auto; background: white; border-radius: 8px; padding: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 12px; }
.print-receipt { border: 1px solid var(--line); padding: 32px; }
.print-receipt header, .print-receipt footer, .receipt-meta, .signature-row { display: flex; justify-content: space-between; gap: 18px; }
.print-receipt h2 { margin: 0; font-size: 28px; }
.print-receipt p { margin: 4px 0 0; color: var(--muted); }
.receipt-no { text-align: right; }
.receipt-no span, .receipt-total span { display: block; color: var(--muted); }
.receipt-meta { margin: 28px 0 18px; color: var(--muted); }
.print-receipt footer { align-items: flex-end; margin-top: 20px; }
.receipt-total { text-align: right; }
.receipt-total strong { font-size: 24px; }
.signature-row { margin-top: 72px; }
.signature-row span { min-width: 220px; text-align: center; border-top: 1px solid var(--ink); padding-top: 8px; }

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 92px 1fr; }
  .brand div:last-child, .sidebar nav span { display: none; }
  .sidebar nav a { justify-content: center; }
  .stats-grid { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
  .split-layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .login-panel { align-items: center; }
  .app-shell, .login-panel { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 10; padding: 10px; }
  .brand { display: none; }
  .sidebar nav { display: flex; overflow-x: auto; }
  .workspace { padding: 16px; }
  .section-heading, .topbar { align-items: stretch; flex-direction: column; }
  .search-box, .topbar-actions { width: 100%; }
  .form-grid, .line-item, .stats-grid, .stats-grid.compact { grid-template-columns: 1fr; }
  .complaint-row, .print-receipt header, .print-receipt footer, .receipt-meta, .signature-row { flex-direction: column; display: flex; }
  .receipt-no, .receipt-total { text-align: left; }
}

@media print {
  body * { visibility: hidden; }
  .print-receipt, .print-receipt * { visibility: visible; }
  .modal-backdrop, .receipt-modal { position: static; inset: auto; background: white; padding: 0; max-height: none; width: 100%; }
  .modal-actions { display: none; }
  .print-receipt { border: 0; }
}


/* Shared blue palette, matching the Dashboard. */
.panel, .stat { background:linear-gradient(145deg,#fff,#fbfdff); border-color:#e1e9f5; border-radius:12px; box-shadow:0 3px 8px #11325a0b; }
.primary-button { background:linear-gradient(100deg,#0879ff,#0964df); box-shadow:0 3px 8px #096cf01a; }
.primary-button:hover { background:linear-gradient(100deg,#096bea,#0857c4); }
.ghost-button { color:#49627d; border-color:#dce6f3; }
.ghost-button:hover { background:#f1f6fe; border-color:#a8c9f6; }
.logout-button { color:#bd4256; border-color:#f0cdd4; }
.logout-button:hover { color:#a82f42; background:#fff0f3; border-color:#eab8c3; }
.field input, .field select, .field textarea, .line-item input { border-color:#dce6f3; }
.field input:focus, .field select:focus, .field textarea:focus, .line-item input:focus { outline:2px solid #8abaff; outline-offset:1px; border-color:#4090f5; }
.field input[readonly], .field input:disabled { background:#f3f7fd; }
input[type=checkbox], input[type=radio] { accent-color:#096cf0; }
.search-box { background:#fff; border-color:#dce6f3; }
th { background:#f5f8fd; color:#58779c; }
tbody tr:hover { background:#f7faff; }
.notice:not(.success):not(.danger) { color:#385c89; background:#eaf3ff; border:1px solid #d4e5fc; }
.notice.success { border:1px solid #cee9d8; }
.notice.danger, .form-error { border:1px solid #f2d4db; }
.login-form { border:1px solid #e1e9f5; border-radius:14px; background:rgba(255,255,255,.98); box-shadow:0 18px 50px #081a3640; }
.login-panel .eyebrow { color:#b8d9ff; }
.receipt-modal { border:1px solid #e1e9f5; border-radius:12px; box-shadow:0 18px 60px #081a3633; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline:3px solid #72aaff; outline-offset:3px; }
@media print {
  body { background:white; }
  .print-receipt { color:#000; background:#fff; border:0; box-shadow:none; }
  .print-receipt p, .print-receipt .receipt-meta, .print-receipt .receipt-no span, .print-receipt .receipt-total span { color:#333; }
  .print-receipt th { color:#000; background:#fff; }
  .print-receipt td, .print-receipt th { border-color:#ccc; }
  .print-receipt tr:hover { background:transparent; }
}
