* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; background: #f4f6f8; color: #17202a; }
a { color: #8b0000; font-weight: 700; text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar { background: #23272f; color: #fff; display: flex; align-items: center; gap: 18px; padding: 10px 18px; position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 245px; }
.brand img { height: 38px; background: #fff; padding: 3px; }
.brand span { font-weight: 800; letter-spacing: .4px; }
.nav { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.nav a, .nav button { color: #fff; background: transparent; border: 0; padding: 8px 10px; border-radius: 5px; cursor: pointer; font-weight: 700; }
.nav a:hover, .nav button:hover { background: #8b0000; text-decoration: none; }
.user-badge { font-size: 12px; color: #d7dee7; white-space: nowrap; }
.page { max-width: 1320px; margin: 0 auto; padding: 22px; }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: #f7f7f7; }
.auth-panel { width: min(420px, 100%); background: #fff; border: 1px solid #d6dce4; border-radius: 6px; padding: 26px; box-shadow: 0 10px 30px rgba(23,32,42,.08); }
.auth-panel img { width: 260px; display: block; margin: 0 auto 18px; }
h1 { font-size: 24px; margin: 0 0 16px; }
h2 { font-size: 18px; margin: 22px 0 10px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.grid { display: grid; gap: 14px; }
.metrics { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 18px; }
.metric { background: #fff; border: 1px solid #d8dee6; border-left: 5px solid #8b0000; border-radius: 6px; padding: 14px; }
.metric b { display: block; font-size: 28px; }
.panel { background: #fff; border: 1px solid #d8dee6; border-radius: 6px; padding: 16px; margin-bottom: 18px; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid #d8dee6; border-radius: 6px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px; border-bottom: 1px solid #e5e9ef; text-align: left; vertical-align: top; }
th { background: #eef2f6; font-size: 13px; }
tr:last-child td { border-bottom: 0; }
label { display: block; font-weight: 700; margin: 10px 0 5px; }
input, select, textarea { width: 100%; border: 1px solid #b8c2cf; border-radius: 5px; padding: 9px; font: inherit; background: #fff; }
textarea { min-height: 100px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px 14px; }
.compact-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 220px)); }
.recovery-form { padding-bottom: 0; }
.form-section { padding: 18px; }
.section-heading { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.section-heading h2 { margin: 0 0 4px; }
.section-heading p { margin: 0; }
.step { flex: 0 0 auto; width: 30px; height: 30px; display: inline-grid; place-items: center; border-radius: 50%; background: #34495e; color: #fff; font-weight: 800; }
.lookup-row { display: grid; grid-template-columns: minmax(220px, 360px) auto; gap: 12px; align-items: end; margin-bottom: 10px; }
.lookup-actions { padding-bottom: 20px; }
.lookup-message { padding: 10px 12px; border-radius: 5px; margin: 10px 0 14px; font-weight: 700; }
.form-help { color: #677485; font-size: 12px; margin-top: 4px; }
.checkbox-row { display: flex; align-items: center; gap: 9px; margin-top: 16px; }
.checkbox-row input { width: auto; }
.sticky-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 4px 0 18px; }
.schedule-list { display: grid; gap: 14px; }
.schedule-item { border: 1px solid #d8dee6; border-radius: 6px; padding: 14px; background: #fff; }
.schedule-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.inline-options { display: flex; flex-wrap: wrap; gap: 18px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
button, .button { background: #b00020; color: #fff; border: 0; border-radius: 5px; padding: 9px 13px; font-weight: 800; cursor: pointer; display: inline-block; }
button.secondary, .button.secondary { background: #34495e; }
button.subtle, .button.subtle { background: #e9eef4; color: #17202a; }
button.danger { background: #7a1f1f; }
.status { padding: 10px 12px; border-radius: 5px; background: #eaf7ee; border: 1px solid #b7dfc4; margin-bottom: 14px; }
.errors { padding: 10px 12px; border-radius: 5px; background: #fff0f0; border: 1px solid #f0b7b7; margin-bottom: 14px; }
.tag { display: inline-block; padding: 3px 7px; border-radius: 999px; font-size: 12px; font-weight: 800; background: #e9eef4; }
.green { background: #d7f3dc !important; }
.orange { background: #ffe8bf !important; }
.red { background: #ffd1d1 !important; }
.grey { background: #eceff3 !important; }
.mobile-actions button, .mobile-actions .button { width: 100%; padding: 16px; margin: 7px 0; }
.muted { color: #677485; font-size: 13px; }
@media (max-width: 760px) {
    .topbar { align-items: flex-start; flex-direction: column; }
    .brand { min-width: 0; }
    .page { padding: 14px; }
    .nav { width: 100%; }
    .lookup-row { grid-template-columns: 1fr; }
    .lookup-actions { padding-bottom: 0; }
    .sticky-actions { justify-content: stretch; }
    .sticky-actions .button, .sticky-actions button { flex: 1; text-align: center; }
}
