@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* ── RESET & BASE ─────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { overflow-x: hidden; }
body { font-family: 'Poppins', sans-serif; color: #333; font-size: 14px; background: #f0f4ff; overflow-x: hidden; }
a { text-decoration: none; color: inherit; }
textarea { font-family: 'Poppins', sans-serif; width: 100%; padding: 10px; background: #f4f6fb; border: 1px solid #dce3f3; border-radius: 8px; font-size: 14px; resize: vertical; }

/* ── COLORS ───────────────────────────────────────────────── */
:root {
    --primary:   #3a6cde;
    --primary-d: #2d58c4;
    --success:   #28a745;
    --danger:    #dc3545;
    --warning:   #ffc107;
    --info:      #17a2b8;
    --bg:        #f0f4ff;
    --card-bg:   #ffffff;
    --border:    #dce3f3;
    --text-mute: #888;
    --nav-h:     62px;
}

/* ── NAVIGATION ───────────────────────────────────────────── */
.public-nav, .dashboard-nav {
    position: sticky; top: 0; z-index: 100;
    height: var(--nav-h);
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.nav-brand {
    font-size: 17px; font-weight: 700; color: var(--primary);
    display: flex; align-items: center; gap: 8px;
}
.nav-brand i { font-size: 22px; }
.nav-logo { height: 28px; width: auto; display: block; }
.nav-user, .nav-links { display: flex; align-items: center; gap: 14px; }
.nav-link { font-size: 13px; color: var(--primary); font-weight: 500; padding: 6px 12px; border-radius: 6px; transition: background .2s; }
.nav-link:hover { background: #eef2ff; }
.btn-logout { background: #f0f4ff; color: var(--primary); padding: 7px 16px; border-radius: 8px; font-size: 13px; font-weight: 500; border: 1px solid var(--border); cursor: pointer; transition: .2s; }
.btn-logout:hover { background: var(--primary); color: #fff; }

/* ── AUTH PAGE ────────────────────────────────────────────── */
.auth-wrapper {
    min-height: calc(100vh - var(--nav-h));
    display: flex;
}
.auth-banner {
    width: 42%;
    background: linear-gradient(145deg, #1e4db7 0%, #3a6cde 60%, #5b8dee 100%);
    display: flex; align-items: flex-start; justify-content: center;
    padding: 28px 40px 30px;
    position: sticky; top: var(--nav-h); height: calc(100vh - var(--nav-h));
    overflow-y: auto;
}
/* Only relevant on mobile (see the 900px block below) — on desktop
   both panels already show side by side, so no Login button is needed. */
.banner-login-btn {
    display: none;
    position: absolute; top: 20px; right: 20px; z-index: 5;
    align-items: center; gap: 6px;
    background: rgba(255,255,255,.15); border: 1.5px solid rgba(255,255,255,.5);
    color: #fff; font-size: 13px; font-weight: 600;
    padding: 8px 16px; border-radius: 20px; cursor: pointer;
    backdrop-filter: blur(4px);
}
.banner-login-btn:hover { background: rgba(255,255,255,.25); }
.banner-content { color: #fff; width: 100%; max-width: 100%; box-sizing: border-box; }
.banner-icon { width: 64px; height: auto; margin-bottom: 20px; display: block; opacity: .95; }
.banner-logo-main { width: 100%; max-width: 806px; height: auto; display: block; margin: 0 auto 10px; opacity: .97; }
.banner-content p { font-size: 15px; opacity: .85; margin-bottom: 18px; line-height: 1.6; }
.banner-features { display: flex; flex-direction: column; gap: 10px; }
.banner-features div { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; }
.banner-features i { color: #a8f0c6; }

.banner-bottom-row { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: flex-start; width: 100%; }
.banner-hours {
    background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
    border-radius: 12px; padding: 10px 16px; min-width: 180px;
}
.banner-hours-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 12.5px; font-weight: 700; color: #fff;
    margin-bottom: 6px; text-transform: uppercase; letter-spacing: .4px;
}
.banner-hours-title i { color: #a8f0c6; }
.banner-hours-row {
    display: flex; justify-content: space-between; gap: 16px;
    font-size: 12px; color: rgba(255,255,255,.85);
    padding: 2px 0;
}
.banner-hours-row span:first-child { font-weight: 600; }

.auth-forms {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 50px 30px; background: var(--bg);
}
/* Only relevant on mobile (see the 900px block below) */
.back-to-banner-link {
    display: none;
    align-self: flex-start;
    align-items: center; gap: 6px;
    font-size: 13px; font-weight: 600; color: var(--primary);
    margin-bottom: 16px;
}
.form-box { width: 100%; max-width: 440px; display: none; }
.form-box.active { display: block; }
.form-header { text-align: center; margin-bottom: 26px; }
.form-header i { font-size: 2.2rem; color: var(--primary); }
.form-header h2 { font-size: 1.6rem; font-weight: 700; margin: 8px 0 4px; }
.form-header p { color: var(--text-mute); font-size: 13px; }

.input-group { position: relative; margin-bottom: 16px; }
.input-group i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #aab4cc; font-size: 15px; }
.input-group input,
.input-group select {
    width: 100%; padding: 12px 14px 12px 40px;
    background: #fff; border: 1.5px solid var(--border);
    border-radius: 10px; font-size: 14px; font-family: 'Poppins', sans-serif;
    outline: none; transition: border-color .2s;
}
.input-group input:focus,
.input-group select:focus { border-color: var(--primary); }

.btn-primary {
    width: 100%; padding: 13px;
    background: var(--primary); color: #fff;
    border: none; border-radius: 10px;
    font-size: 15px; font-weight: 600; cursor: pointer;
    transition: background .2s; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary:hover { background: var(--primary-d); }

.form-switch { font-size: 13px; text-align: center; margin-top: 14px; color: #666; }
.form-switch a { color: var(--primary); font-weight: 500; }

.forgot-link { display: block; text-align: right; font-size: 12.5px; color: var(--primary); font-weight: 500; margin: -10px 0 16px; }
.forgot-link:hover { text-decoration: underline; }

/* ── OTP VERIFICATION ─────────────────────────────────────── */
.otp-boxes { display: flex; gap: 10px; justify-content: center; margin-bottom: 22px; }
.otp-box {
    width: 46px; height: 54px; text-align: center;
    font-size: 1.4rem; font-weight: 600; color: #333;
    background: #fff; border: 1.5px solid var(--border);
    border-radius: 10px; outline: none; transition: border-color .2s;
}
.otp-box:focus { border-color: var(--primary); }
.otp-resend-row { text-align: center; font-size: 13px; color: var(--text-mute); margin-top: 14px; }
.link-btn {
    background: none; border: none; padding: 0; margin-left: 4px;
    color: var(--primary); font-weight: 600; font-size: 13px;
    cursor: pointer; font-family: inherit;
}
.link-btn:disabled { color: #aab4cc; cursor: not-allowed; }

/* ── ALERTS ───────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; display: flex; align-items: center; gap: 10px; font-size: 14px; width: 100%; max-width: 440px; }
.alert-success { background: #d4edda; color: #155724; }
.alert-error   { background: #f8d7da; color: #721c24; }
/* ── DEV MODE OTP ALERT ─────────────────────────────────────
   Only ever rendered while APP_ENV !== 'production'. Shares the
   .alert base class so it auto-fades after 5s, same as every
   other alert on this page. */
.alert-dev {
    background: #fff3cd; color: #6b5300; border: 1.5px solid #f0b429;
    align-items: flex-start;
}
.alert-dev .dev-code { font-family: 'Courier New', monospace; font-size: 1.1rem; letter-spacing: 2px; }
.alert-dev .dev-otp-caption { font-size: 12px; color: #8a6d00; margin-top: 4px; line-height: 1.5; }
.alert-dev code { background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 4px; }
.alert i { flex-shrink: 0; }

/* ── BADGES ───────────────────────────────────────────────── */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.badge-success  { background: #d4edda; color: #155724; }
.badge-danger   { background: #f8d7da; color: #721c24; }
.badge-warning  { background: #fff3cd; color: #856404; }
.badge-info     { background: #d1ecf1; color: #0c5460; }
.badge-primary  { background: #cfe2ff; color: #084298; }
.badge-secondary{ background: #e2e3e5; color: #41464b; }

/* ── DASHBOARD LAYOUT ─────────────────────────────────────── */
.dashboard-body { background: var(--bg); }
.dashboard-wrapper { display: flex; min-height: calc(100vh - var(--nav-h)); }

.sidebar {
    width: 240px; min-height: 100%;
    background: #fff; border-right: 1px solid var(--border);
    padding: 24px 16px; position: sticky; top: var(--nav-h);
    height: calc(100vh - var(--nav-h)); overflow-y: auto;
}
.sidebar-profile { text-align: center; margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.avatar { width: 62px; height: 62px; background: var(--bg); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; font-size: 26px; color: var(--primary); border: 2px solid var(--border); }
.admin-avatar { background: #fff3cd; color: #856404; }
.sidebar-profile h3 { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar-link { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; font-size: 13.5px; color: #555; font-weight: 500; transition: .2s; }
.sidebar-link:hover, .sidebar-link.active { background: #eef2ff; color: var(--primary); }
.sidebar-link i { width: 16px; text-align: center; }

.dashboard-main { flex: 1; padding: 28px; max-width: calc(100% - 240px); }

/* ── CARDS ────────────────────────────────────────────────── */
.card { background: #fff; border-radius: 14px; border: 1px solid var(--border); margin-bottom: 24px; overflow: hidden; }
.card-header { padding: 18px 22px; border-bottom: 1px solid var(--border); }
.card-header h2 { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 22px; }

/* ── STATS GRID ───────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 20px; display: flex; align-items: center; gap: 16px; }
.stat-icon { font-size: 2rem; }
.stat-num { font-size: 1.8rem; font-weight: 700; }
.stat-label { font-size: 12px; color: var(--text-mute); font-weight: 500; }

/* ── FORMS (DASHBOARD) ────────────────────────────────────── */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.form-col { display: flex; flex-direction: column; gap: 6px; }
.form-col label { font-size: 13px; font-weight: 600; color: #555; }
.form-col input,
.form-col select,
.form-col textarea { padding: 10px 14px; background: #f4f6fb; border: 1.5px solid var(--border); border-radius: 8px; font-size: 14px; font-family: 'Poppins', sans-serif; outline: none; transition: border-color .2s; }
.form-col input:focus,
.form-col select:focus { border-color: var(--primary); background: #fff; }

.fee-notice { background: #eef2ff; border: 1px solid #c7d4f8; border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; color: var(--primary); font-size: 13px; }

/* ── TABLES ───────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th { background: var(--bg); padding: 12px 14px; text-align: left; font-weight: 600; color: #555; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 12px 14px; border-bottom: 1px solid #f0f2f8; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafbff; }
.text-muted { color: var(--text-mute); font-size: 12px; }

.btn-pay, .btn-view {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; transition: .2s;
}
.btn-pay { background: var(--primary); color: #fff; }
.btn-pay:hover { background: var(--primary-d); }
.btn-view { background: #eef2ff; color: var(--primary); border: 1px solid var(--border); }
.btn-view:hover { background: var(--primary); color: #fff; }
.btn-sm { font-size: 12px; padding: 5px 10px; }

.empty-state { text-align: center; padding: 40px; color: var(--text-mute); }
.empty-state i { font-size: 3rem; margin-bottom: 12px; display: block; opacity: .3; }

/* ── PAYMENT PAGE ─────────────────────────────────────────── */
.payment-wrapper { min-height: calc(100vh - var(--nav-h)); background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.payment-card { background: #fff; border-radius: 16px; padding: 40px; width: 100%; max-width: 560px; box-shadow: 0 4px 24px rgba(0,0,0,.08); border: 1px solid var(--border); }
.payment-header { text-align: center; margin-bottom: 30px; }
.payment-header i { font-size: 2.5rem; color: var(--primary); }
.payment-header h2 { font-size: 1.5rem; font-weight: 700; margin: 10px 0 4px; }
.payment-header p { color: var(--text-mute); font-size: 13px; }
.payment-summary { background: var(--bg); border-radius: 12px; padding: 20px; margin-bottom: 28px; }
.payment-summary h3 { font-size: 14px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.summary-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.summary-row:last-child { border-bottom: none; }
.total-row { margin-top: 8px; font-size: 15px; }
.amount { color: var(--primary); font-size: 1.3rem; }
.payment-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0 24px; }
.payment-method-option input[type="radio"] { display: none; }
.method-card { border: 2px solid var(--border); border-radius: 12px; padding: 14px 10px; text-align: center; cursor: pointer; transition: .2s; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; }
.method-card:hover { border-color: var(--primary); background: #eef2ff; }
.payment-method-option input:checked + .method-card { border-color: var(--primary); background: #eef2ff; color: var(--primary); }
.security-notice { background: #d4edda; color: #155724; border-radius: 10px; padding: 12px 16px; font-size: 13px; margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }
.btn-pay-now { font-size: 16px; padding: 14px; border-radius: 12px; }

/* ── MODAL ────────────────────────────────────────────────── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 1000; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal { background: #fff; border-radius: 16px; padding: 0; width: 100%; max-width: 640px; max-height: 90vh; overflow-y: auto; margin: 20px; box-shadow: 0 10px 40px rgba(0,0,0,.2); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: #888; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: background .2s; }
.modal-close:hover { background: var(--bg); }
.modal-body { padding: 24px; }
.modal-ref { background: var(--bg); border-radius: 8px; padding: 10px 14px; margin-bottom: 20px; font-size: 13.5px; font-weight: 600; color: var(--primary); }

/* ── RESULTS BODY ─────────────────────────────────────────── */
.results-body { background: var(--bg); min-height: 100vh; }
.results-hero { background: linear-gradient(135deg, #1e4db7 0%, #3a6cde 100%); padding: 60px 20px; text-align: center; }
.hero-content { max-width: 700px; margin: 0 auto; }
.hero-content h1 { color: #fff; font-size: 2rem; font-weight: 700; margin-bottom: 12px; }
.hero-content p { color: rgba(255,255,255,.85); font-size: 15px; margin-bottom: 30px; }
.search-form { max-width: 580px; margin: 0 auto; }
.search-bar { display: flex; gap: 0; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.search-bar input { flex: 1; padding: 16px 20px; border: none; font-size: 15px; outline: none; font-family: 'Poppins', sans-serif; }
.search-bar button { padding: 0 28px; background: #1e4db7; color: #fff; border: none; font-size: 15px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 8px; white-space: nowrap; transition: background .2s; }
.search-bar button:hover { background: #1840a4; }

.results-container { max-width: 1000px; margin: 0 auto; padding: 40px 20px; }
.section-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 20px; display: flex; align-items: center; gap: 8px; color: #333; }

.result-card { background: #fff; border-radius: 14px; border: 1px solid var(--border); margin-bottom: 20px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.result-safe    { border-top: 4px solid var(--success); }
.result-unsafe  { border-top: 4px solid var(--danger); }
.result-treatment { border-top: 4px solid var(--warning); }

.result-header { display: flex; justify-content: space-between; align-items: flex-start; padding: 20px 24px; border-bottom: 1px solid var(--border); gap: 16px; }
.result-title h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.result-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12.5px; color: var(--text-mute); }
.result-meta span { display: flex; align-items: center; gap: 5px; }
.result-status { padding: 10px 18px; border-radius: 20px; font-weight: 700; font-size: 13px; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.result-safe-badge    { background: #d4edda; color: #155724; }
.result-unsafe-badge  { background: #f8d7da; color: #721c24; }
.result-treatment-badge { background: #fff3cd; color: #856404; }

.parameters-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0; padding: 0 24px; }
.param-item { padding: 16px 10px; text-align: center; border-right: 1px solid var(--border); }
.param-item:last-child { border-right: none; }
.param-label { font-size: 11px; color: var(--text-mute); font-weight: 600; text-transform: uppercase; margin-bottom: 6px; }
.param-value { font-size: 15px; font-weight: 700; color: #333; margin-bottom: 4px; }
.param-note  { font-size: 10px; color: var(--text-mute); }

.result-remarks { padding: 14px 24px; background: #fffbf0; border-top: 1px solid var(--border); font-size: 13.5px; display: flex; gap: 8px; }
.result-footer { padding: 14px 24px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 16px; font-size: 12.5px; color: var(--text-mute); }

/* Recent cards grid */
.recent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.recent-card { background: #fff; border-radius: 12px; padding: 20px; border: 1px solid var(--border); }
.recent-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.recent-card h4 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.recent-card p { font-size: 12.5px; color: var(--text-mute); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.recent-card .btn-view { margin-top: 12px; width: 100%; justify-content: center; }

.no-results { text-align: center; padding: 60px 20px; color: var(--text-mute); }
.no-results i { font-size: 3rem; display: block; margin-bottom: 16px; opacity: .3; }
.no-results h3 { font-size: 1.1rem; margin-bottom: 8px; color: #555; }

/* Detail result page */
.result-detail-card { background: #fff; border-radius: 16px; padding: 32px; box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.detail-status-banner { border: 2px solid; border-radius: 12px; padding: 20px 24px; margin-bottom: 28px; display: flex; align-items: center; gap: 20px; }
.detail-section { margin-bottom: 28px; }
.detail-section h3 { font-size: 15px; font-weight: 700; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid var(--border); display: flex; align-items: center; gap: 8px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.detail-grid div { background: var(--bg); border-radius: 8px; padding: 12px 16px; }
.detail-grid label { display: block; font-size: 11px; color: var(--text-mute); text-transform: uppercase; font-weight: 600; margin-bottom: 4px; }
.detail-grid span { font-size: 14px; font-weight: 500; }
.params-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.params-table th { background: var(--bg); padding: 12px 14px; text-align: left; font-weight: 600; color: #555; border-bottom: 1px solid var(--border); }
.params-table td { padding: 12px 14px; border-bottom: 1px solid #f0f2f8; }
.remarks-box { background: var(--bg); border-radius: 10px; padding: 16px; font-size: 14px; line-height: 1.6; }
.detail-footer { text-align: center; padding-top: 20px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; font-size: 13px; color: #666; }

/* ── FOOTER ───────────────────────────────────────────────── */
.site-footer { background: #1e4db7; color: rgba(255,255,255,.8); text-align: center; padding: 24px; font-size: 13px; margin-top: 40px; }
.site-footer p { margin-bottom: 6px; }

/* ── SAMPLE TRACKING TIMELINE ─────────────────────────────── */
.req-card {
    background: #fff; border: 1px solid var(--border); border-radius: 14px;
    margin-bottom: 18px; overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
    transition: box-shadow .2s;
}
.req-card:hover { box-shadow: 0 4px 18px rgba(0,0,0,.09); }

/* Temporary highlight when scrolled to via Monthly Results dropdown */
.req-card.req-card-glow {
    animation: reqCardGlow 1.8s ease-out;
}
@keyframes reqCardGlow {
    0%   { box-shadow: 0 0 0 0 rgba(58,108,222,.55), 0 2px 8px rgba(0,0,0,.04); border-color: var(--primary); }
    60%  { box-shadow: 0 0 0 10px rgba(58,108,222,0), 0 2px 8px rgba(0,0,0,.04); border-color: var(--primary); }
    100% { box-shadow: 0 2px 8px rgba(0,0,0,.04); border-color: var(--border); }
}

/* Monthly Results dropdown */
.monthly-dropdown { position: relative; display: inline-block; }
.monthly-dropdown-trigger {
    display: inline-flex; align-items: center; gap: 8px;
    background: #eef2ff; border: 1.5px solid #bfd2ff; border-radius: 9px;
    padding: 0 14px; height: 40px; box-sizing: border-box;
    font-size: 12.5px; font-weight: 600; color: var(--primary-d);
    cursor: pointer; transition: border-color .2s, background .2s;
}
.monthly-dropdown-trigger:hover { border-color: var(--primary); background: #dfe7ff; }
.monthly-dropdown-trigger .monthly-count {
    background: var(--primary); color: #fff; font-size: 10.5px; font-weight: 700;
    border-radius: 20px; padding: 1px 7px; line-height: 1.5;
}
.monthly-chevron { font-size: 10px; color: var(--primary); transition: transform .2s; }
.monthly-dropdown.open .monthly-chevron { transform: rotate(180deg); }

.monthly-dropdown-menu {
    display: none;
    position: fixed; z-index: 9999;
    background: #fff; border: 1px solid var(--border); border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0,0,0,.14);
    min-width: 260px; max-height: 260px; overflow-y: auto; padding: 6px;
}
.monthly-dropdown.open .monthly-dropdown-menu { display: block; }

.monthly-dropdown-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px; border-radius: 8px; text-decoration: none;
    font-size: 12.5px; color: var(--text); transition: background .15s;
}
a.monthly-dropdown-item:hover { background: #eef2ff; }
.monthly-item-disabled { color: var(--text-mute); cursor: default; }
.monthly-item-num {
    flex-shrink: 0; font-weight: 700; color: var(--primary-d);
    background: #eef2ff; border-radius: 6px; padding: 2px 7px; font-size: 11px;
}
.monthly-item-disabled .monthly-item-num { color: #9ca3af; background: #f1f2f4; }
.monthly-item-ref { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.monthly-item-date { flex-shrink: 0; font-size: 11px; color: var(--text-mute); }


.req-card-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    padding: 16px 20px 12px; border-bottom: 1px solid var(--border);
    flex-wrap: wrap; gap: 10px;
}
.req-card-meta { display: flex; flex-direction: column; gap: 4px; }
.req-ref { font-size: 14.5px; font-weight: 700; color: var(--primary); }
.req-date, .req-addr { font-size: 12.5px; color: var(--text-mute); display: flex; align-items: center; gap: 5px; }
.req-card-badges { display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-start; }

/* Horizontal step tracker */
.tracking-timeline {
    display: flex; align-items: flex-start;
    padding: 20px 20px 16px;
    gap: 0; overflow-x: auto;
    position: relative;
}

.track-step {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    position: relative; min-width: 90px;
}

/* Connector line between steps */
.track-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 15px; left: 50%;
    width: 100%; height: 3px;
    background: #e0e4f0;
    z-index: 0;
}
.track-step.step-done:not(:last-child)::after,
.track-step.step-active:not(:last-child)::after {
    background: linear-gradient(90deg, var(--primary), #a0b4f0);
}

.track-dot {
    width: 32px; height: 32px; border-radius: 50%; border: 3px solid #d0d5e8;
    background: #f4f6fb; display: flex; align-items: center; justify-content: center;
    font-size: 12px; color: #c0c8e0; z-index: 1; position: relative;
    transition: all .25s;
}
.track-step.step-done .track-dot {
    background: var(--primary); border-color: var(--primary); color: #fff;
}
.track-step.step-active .track-dot {
    background: #fff; border-color: var(--primary); color: var(--primary);
    box-shadow: 0 0 0 4px rgba(116,148,236,.2);
    animation: pulse-dot 1.6s ease-in-out infinite;
}
@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 4px rgba(116,148,236,.2); }
    50%       { box-shadow: 0 0 0 8px rgba(116,148,236,.08); }
}
.dot-inner {
    width: 8px; height: 8px; border-radius: 50%; background: #d0d5e8;
}

.track-label {
    margin-top: 8px; display: flex; flex-direction: column; align-items: center;
    text-align: center; gap: 2px;
}
.track-icon { font-size: 1.1rem; line-height: 1; }
.track-name {
    font-size: 11px; font-weight: 600; color: #aab; line-height: 1.3;
    max-width: 80px;
}
.track-step.step-done .track-name,
.track-step.step-active .track-name { color: var(--primary); }
.track-time {
    font-size: 10px; color: #bbb; margin-top: 2px;
}
.track-step.step-active .track-time { color: #888; }

/* Action row */
.req-card-action {
    padding: 12px 20px; border-top: 1px solid #f0f2f8;
    display: flex; align-items: center; background: #fafbff;
}
.btn-see-result {
    display: inline-flex; align-items: center; gap: 7px;
    background: #28a745; color: #fff; padding: 0 20px; height: 40px;
    box-sizing: border-box;
    border-radius: 9px; font-size: 13.5px; font-weight: 600;
    text-decoration: none; border: none; cursor: pointer;
    transition: background .2s;
}
.btn-see-result:hover { background: #218838; }

.subscribed-badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12.5px; font-weight: 600; color: #10b981;
    background: #d1fae5; padding: 0 16px; height: 40px;
    box-sizing: border-box; border-radius: 9px;
}
.awaiting-msg {
    font-size: 12.5px; color: #888; display: flex; align-items: center; gap: 6px;
}
.awaiting-msg i { color: #f0ad4e; }

/* ── HAMBURGER BUTTON (hidden on desktop) ─────────────────── */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 22px;
    color: var(--primary);
    padding: 4px 8px;
    border-radius: 8px;
    line-height: 1;
    flex-shrink: 0;
}
.hamburger-btn:hover { background: #eef2ff; }

/* ── MOBILE OVERLAY ──────────────────────────────────────── */
.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 998;
}

/* ── TABLET 900px ────────────────────────────────────────── */
@media (max-width: 900px) {
    /* Auth: banner is the default mobile view (full screen, with a
       Login button top-right). Tapping it adds .mobile-login-active
       to .auth-wrapper, which swaps to showing the form instead. On
       desktop (above 900px) both panels always show side by side as
       normal — this toggle only exists below this breakpoint. */
    .auth-wrapper { min-height: 0; }
    .auth-banner {
        display: flex; width: 100%;
        position: fixed; top: var(--nav-h); left: 0; right: 0; bottom: 0;
        overflow: hidden;
        padding: 16px 24px 14px;
        align-items: center; /* center vertically now that height is fixed, instead of pinning to top */
    }
    .banner-login-btn { display: inline-flex; }
    .banner-content { display: flex; flex-direction: column; justify-content: center; gap: 6px; }
    .banner-logo-main { max-height: 26vh; width: auto; max-width: 90%; margin: 0 auto; object-fit: contain; }
    .banner-content p { font-size: 12.5px; margin-bottom: 8px; line-height: 1.4; }
    .banner-bottom-row { gap: 10px; }
    .banner-features { gap: 5px; }
    .banner-features div { font-size: 12px; }
    .banner-hours { padding: 6px 12px; min-width: 0; flex: 1; }
    .banner-hours-title { font-size: 10.5px; margin-bottom: 3px; }
    .banner-hours-row { font-size: 10.5px; padding: 1px 0; }
    .auth-forms { display: none; width: 100%; padding: 30px 20px; }
    .back-to-banner-link { display: inline-flex; }
    .auth-wrapper.mobile-login-active .auth-banner { display: none; }
    .auth-wrapper.mobile-login-active .auth-forms {
        display: flex;
        justify-content: flex-start;
        padding-top: 20px;
    }
    .auth-wrapper:not(.mobile-login-active) { overflow: hidden; max-height: 100vh; }

    /* Nav */
    .dashboard-main { max-width: 100%; padding: 20px 16px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .parameters-grid { grid-template-columns: repeat(4, 1fr); }

    /* Show hamburger */
    .hamburger-btn { display: flex; align-items: center; justify-content: center; }

    /* Sidebar: hidden off-screen, slides in when .open is added */
    .sidebar {
        display: block !important;
        position: fixed;
        top: 0;
        left: -260px;
        width: 240px;
        height: 100vh;
        z-index: 999;
        transition: left 0.28s ease;
        box-shadow: 4px 0 24px rgba(0,0,0,0.18);
        overflow-y: auto;
    }
    .sidebar.open { left: 0; }
}

/* ── MOBILE 600px ─────────────────────────────────────────── */
@media (max-width: 600px) {
    /* Nav */
    .dashboard-nav, .public-nav { padding: 0 10px; }
    .nav-brand { font-size: 13px; }
    .nav-brand i { font-size: 16px; }
    .nav-logo { height: 20px; }
    .nav-user, .nav-links { gap: 6px; }
    .nav-user span { display: none; }
    .nav-link { font-size: 11px; padding: 5px 7px; }
    .btn-logout { font-size: 11px; padding: 5px 10px; }

    /* Dashboard */
    .dashboard-main { padding: 12px 10px; }
    .card-header { padding: 12px 14px; }
    .card-header h2 { font-size: 14px; }
    .card-body { padding: 12px 10px; }

    /* Stats */
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
    .stat-card { padding: 12px 10px; gap: 10px; }
    .stat-icon { font-size: 1.4rem; }
    .stat-num { font-size: 1.3rem; }
    .stat-label { font-size: 11px; }

    /* Forms */
    .form-row { grid-template-columns: 1fr; gap: 10px; }
    .form-col input, .form-col select, .form-col textarea { font-size: 13px; }

    /* Tables */
    .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .data-table { min-width: 600px; font-size: 12px; }
    .data-table th, .data-table td { padding: 8px 8px; white-space: nowrap; }

    /* Results page */
    .results-hero { padding: 30px 14px; }
    .hero-content h1 { font-size: 1.3rem; }
    .hero-content p { font-size: 12.5px; margin-bottom: 18px; }
    .search-bar input { padding: 11px 12px; font-size: 13px; }
    .search-bar button { padding: 0 14px; font-size: 13px; }
    .search-bar button span { display: none; }
    .results-container { padding: 18px 10px; }
    .parameters-grid { grid-template-columns: repeat(2, 1fr); }
    .param-item { padding: 10px 6px; }
    .result-header { flex-direction: column; gap: 8px; padding: 12px 14px; }
    .result-title h3 { font-size: 14px; }
    .result-meta { gap: 6px; font-size: 11px; }
    .result-footer { padding: 10px 14px; gap: 8px; font-size: 11px; }
    .recent-grid { grid-template-columns: 1fr; }

    /* Result detail page */
    .detail-grid { grid-template-columns: 1fr; }
    .detail-status-banner { flex-direction: column; text-align: center; padding: 16px; gap: 10px; }
    .params-table { font-size: 12px; }
    .params-table th, .params-table td { padding: 7px 8px; }

    /* Payment */
    .payment-card { padding: 20px 14px; }
    .payment-methods { grid-template-columns: 1fr; }

    /* Modal */
    .modal { margin: 8px; border-radius: 12px; max-height: 96vh; }
    .modal-header { padding: 12px 14px; }
    .modal-header h3 { font-size: 13.5px; }
    .modal-body { padding: 14px; }

}

/* ── SMALL PHONES 400px ──────────────────────────────────── */
@media (max-width: 400px) {
    .nav-brand { font-size: 12px; }
    .stats-grid { gap: 8px; }
    .stat-card { padding: 10px 8px; }
    .stat-num { font-size: 1.1rem; }
    .hero-content h1 { font-size: 1.1rem; }
}

/* ── CANCEL SUBSCRIPTION — CONFIRMATION PIN PAD ─────────────── */
.cancel-pin-panel {
    display: none;
    position: fixed; z-index: 9999;
    background: #fff; border: 1px solid var(--border); border-radius: 16px;
    box-shadow: 0 12px 32px rgba(0,0,0,.18);
    padding: 14px 16px 16px; width: 210px;
    box-sizing: border-box;
    white-space: normal; /* the trigger sits in a white-space:nowrap table cell — override it here */
}
.cancel-pin-panel.open { display: block; }

.cancel-pin-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 8px;
}
.cancel-pin-title {
    font-size: 11.5px; font-weight: 700; color: var(--text);
    display: flex; align-items: center; gap: 5px;
}
.cancel-pin-title i { color: #dc3545; font-size: 11px; }
.cancel-pin-close {
    background: none; border: none; cursor: pointer;
    color: var(--text-mute); font-size: 15px; line-height: 1;
    padding: 2px 4px; border-radius: 6px;
}
.cancel-pin-close:hover { background: var(--bg); color: var(--text); }

.cancel-pin-code {
    text-align: center; font-size: 11px; color: var(--text-mute);
    margin-bottom: 10px;
}
.cancel-pin-code strong {
    color: var(--primary); font-size: 15px; letter-spacing: 3px;
    font-family: 'Courier New', monospace;
}

.cancel-pin-dots {
    display: flex; justify-content: center; gap: 9px; margin-bottom: 12px;
}
.cancel-pin-dots.shake { animation: cancelPinShake .4s; }
@keyframes cancelPinShake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-6px); }
    40%      { transform: translateX(6px); }
    60%      { transform: translateX(-4px); }
    80%      { transform: translateX(4px); }
}
.pin-dot {
    width: 11px; height: 11px; border-radius: 50%;
    border: 1.5px solid #c7cedb; background: #fff;
    transition: background .15s, border-color .15s, transform .15s;
}
.pin-dot.filled { background: var(--primary); border-color: var(--primary); transform: scale(1.1); }
.cancel-pin-dots.success .pin-dot.filled { background: #10b981; border-color: #10b981; }

.cancel-pin-keys {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
}
.cancel-pin-keys button {
    height: 34px; border-radius: 9px; border: 1px solid var(--border);
    background: var(--bg); color: var(--text); font-size: 13.5px; font-weight: 700;
    cursor: pointer; transition: background .12s, transform .08s;
}
.cancel-pin-keys button:hover { background: #e8edfb; }
.cancel-pin-keys button:active { transform: scale(.92); }
.cancel-pin-keys button.key-empty { visibility: hidden; cursor: default; }
.cancel-pin-keys button.key-back { color: #dc3545; font-size: 12px; }

/* ── PRINT ───────────────────────────────────────────────── */
@media print {
    .public-nav, .dashboard-nav, .btn-primary, .btn-view, nav { display: none !important; }
    body { background: #fff; }
}
