/* Golf Simulator Automation - dashboard light theme */
:root {
    --navy:#003068; --navy-deep:#001F4A; --navy-ink:#0F1B33;
    --green:#5BC500; --green-dark:#3A9F00; --green-deep:#2E7E00; --green-wash:#E8F7D8;
    --sky:#0070C8;
    --bg:#F4F7FB; --surface:#FFFFFF; --surface-2:#EEF2F8; --surface-3:#E6ECF6;
    --border:#D8DFEB; --muted:#5C6B85; --muted-2:#7A8AA8;
    --danger:#DC2626; --danger-dark:#B91C1C; --warn:#F59E0B;
    --radius:12px; --radius-sm:8px;
    --font-body:'Inter','Segoe UI',system-ui,-apple-system,sans-serif;
    --font-display:'Inter','Segoe UI',system-ui,-apple-system,sans-serif;
    --shadow-sm:0 1px 2px rgba(15,27,51,.05),0 1px 1px rgba(15,27,51,.04);
    --shadow-md:0 4px 14px rgba(0,48,104,.08);
    --shadow-lg:0 12px 32px rgba(0,48,104,.14);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font-body); background: var(--bg); color: var(--navy-ink); min-height: 100vh; -webkit-font-smoothing: antialiased; }
h1,h2,h3,h4 { font-family: var(--font-display); color: var(--navy); font-weight: 700; letter-spacing: -.01em; }

/* Login */
.login-page { display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at top, rgba(91,197,0,.06), transparent 60%), linear-gradient(180deg,#FFFFFF 0%,var(--bg) 100%); }
.login-container { background: var(--surface); padding: 44px 40px; border-radius: 16px; width: 420px; border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.login-logo { text-align: center; margin-bottom: 30px; }
.login-logo-img { width: 84px; height: 84px; object-fit: contain; margin-bottom: 12px; filter: drop-shadow(0 8px 22px rgba(0,48,104,.18)); }
.login-logo h1 { color: var(--navy); font-size: 22px; line-height: 1.2; }
.login-logo p { color: var(--muted); margin-top: 6px; font-size: 13px; font-family: var(--font-body); }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; color: var(--navy-ink); margin-bottom: 6px; font-size: 13px; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 11px 14px; background: var(--surface); border: 1px solid var(--border); color: var(--navy-ink); border-radius: var(--radius-sm); font-size: 14px; font-family: var(--font-body); transition: border-color .15s ease, box-shadow .15s ease; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(91,197,0,.15); }
/* Checkboxes/radios must stay inline with their label text (not stretch full width like text inputs). */
.form-group input[type="checkbox"], .form-group input[type="radio"] { width: auto; display: inline-block; margin: 0 8px 0 0; padding: 0; vertical-align: middle; accent-color: var(--green); box-shadow: none; }
.form-group label:has(> input[type="checkbox"]), .form-group label:has(> input[type="radio"]) { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.form-group small { font-weight: 400; }
/* Notification bell */
.notif-wrap { position: relative; }
.notif-bell { position: relative; background: none; border: none; font-size: 16px; cursor: pointer; line-height: 1; padding: 5px; border-radius: 8px; transition: background .15s ease; }
.notif-bell:hover { background: var(--surface-2); }
.notif-badge { position: absolute; top: -1px; right: -1px; background: var(--danger); color: #fff; font-size: 9px; font-weight: 700; min-width: 14px; height: 14px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; padding: 0 3px; box-shadow: 0 0 0 2px var(--surface); }
/* Hover tooltip shown only when there are unread notifications */
.notif-bell.has-unread::after { content: attr(data-tip); position: absolute; top: 130%; right: 0; background: var(--navy-ink); color: #fff; font-size: 11.5px; font-weight: 500; white-space: nowrap; padding: 6px 10px; border-radius: 8px; box-shadow: 0 6px 18px rgba(15,27,51,.28); opacity: 0; pointer-events: none; transform: translateY(-4px); transition: opacity .15s ease, transform .15s ease; z-index: 9500; }
.notif-bell.has-unread::before { content: ""; position: absolute; top: 118%; right: 8px; border: 5px solid transparent; border-bottom-color: var(--navy-ink); opacity: 0; transition: opacity .15s ease; z-index: 9500; }
.notif-bell.has-unread:hover::after { opacity: 1; transform: translateY(0); }
.notif-bell.has-unread:hover::before { opacity: 1; }
.notif-panel { position: absolute; right: 0; top: 38px; width: 320px; max-height: 420px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: 0 12px 32px rgba(15,27,51,.18); z-index: 9000; }
.notif-head { padding: 12px 14px; font-weight: 600; border-bottom: 1px solid var(--border); }
.notif-empty { padding: 18px; color: var(--text2); text-align: center; font-size: 13px; }
.notif-item { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.notif-item.unread { background: rgba(91,197,0,.08); }
.notif-title { font-weight: 600; font-size: 13px; color: var(--navy-ink); }
.notif-msg { font-size: 13px; color: var(--text2); margin-top: 2px; }

/* Top-right user menu (name + dropdown) */
.user-menu { position: relative; }
.user-menu-btn { display: flex; align-items: center; gap: 9px; background: transparent; border: 1px solid var(--border); border-radius: 999px; padding: 5px 10px 5px 6px; cursor: pointer; font-family: var(--font-body); transition: background .15s ease, border-color .15s ease; }
.user-menu-btn:hover { background: var(--surface-2); border-color: var(--muted-2); }
.user-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 12.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; text-transform: uppercase; flex: 0 0 auto; }
.user-name { font-size: 13.5px; font-weight: 600; color: var(--navy-ink); max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-caret { font-size: 11px; color: var(--muted); transition: transform .18s ease; }
.user-menu.open .user-caret { transform: rotate(180deg); }
.user-menu-panel { position: absolute; right: 0; top: 46px; width: 230px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: 0 12px 32px rgba(15,27,51,.18); z-index: 9000; overflow: hidden; padding: 6px; }
.user-menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.user-menu-name { font-size: 14px; font-weight: 600; color: var(--navy-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-menu-mail { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.user-menu-plan { display: inline-block; margin-top: 8px; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: var(--green-wash); color: var(--green-deep); }
.user-menu-plan.inactive { background: #FEF3C7; color: #92400E; }
.user-menu-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: transparent; border: none; cursor: pointer; padding: 9px 12px; border-radius: var(--radius-sm); font-family: var(--font-body); font-size: 13.5px; font-weight: 500; color: var(--navy-ink); text-decoration: none; transition: background .12s ease; }
.user-menu-item:hover { background: var(--surface-2); }
.user-menu-item.danger { color: var(--danger); }
.user-menu-item.danger:hover { background: rgba(220,38,38,.08); }
@media (max-width: 640px) { .user-name { display: none; } }
.notif-time { font-size: 11px; color: var(--text2); margin-top: 4px; }
.btn { padding: 10px 20px; border: none; border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; font-weight: 600; font-family: var(--font-body); transition: background .15s ease, transform .1s ease, box-shadow .15s ease; }
.btn-primary { background: var(--green); color: #fff; box-shadow: 0 4px 12px rgba(91,197,0,.25); }
.btn-primary:hover { background: var(--green-dark); box-shadow: 0 6px 16px rgba(91,197,0,.35); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-dark); }
.btn-warn { background: var(--warn); color: #1F2A44; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--navy-ink); }
.btn-outline:hover { background: var(--surface-2); border-color: var(--muted-2); }
.btn-small { padding: 6px 12px; font-size: 12px; }
.btn-full { width: 100%; }
.error-msg { color: var(--danger); margin-top: 10px; text-align: center; min-height: 20px; font-size: 13px; }
.register-link { text-align: center; margin-top: 18px; color: var(--muted); font-size: 14px; }
.register-link a { color: var(--green-dark); text-decoration: none; font-weight: 600; }
.register-link a:hover { color: var(--navy); }

/* ===== Split-screen auth (login) ===== */
.auth-page { min-height: 100vh; background: var(--surface); }
.auth-split { display: flex; min-height: 100vh; }

/* Brand panel */
.auth-brand {
    flex: 0 0 46%;
    position: relative;
    display: flex; flex-direction: column; justify-content: space-between;
    padding: 56px 52px;
    color: #fff;
    background:
        radial-gradient(1100px 480px at 18% 0%, rgba(91,197,0,.18), transparent 55%),
        radial-gradient(900px 600px at 100% 100%, rgba(0,112,200,.22), transparent 55%),
        linear-gradient(155deg, var(--navy) 0%, var(--navy-deep) 100%);
    overflow: hidden;
}
.auth-brand::after {
    content: ""; position: absolute; left: 52px; right: 52px; bottom: 92px; height: 1px;
    background: linear-gradient(90deg, rgba(255,255,255,.18), transparent);
}
.auth-brand-inner { margin: auto 0; max-width: 440px; }
.auth-brand-logo { box-sizing: border-box; width: 220px; height: 220px; object-fit: contain; margin-bottom: 26px; background: #fff; border-radius: 24px; padding: 22px; box-shadow: 0 14px 34px rgba(0,0,0,.30); }
.auth-brand-title { color: #fff; font-size: 30px; line-height: 1.15; letter-spacing: -.02em; margin-bottom: 16px; }
.auth-brand-tag { color: rgba(255,255,255,.78); font-size: 16px; line-height: 1.6; font-family: var(--font-body); margin-bottom: 30px; max-width: 400px; }
.auth-feature-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.auth-feature-list li { position: relative; padding-left: 36px; font-size: 14.5px; color: rgba(255,255,255,.9); font-family: var(--font-body); line-height: 1.4; }
.auth-feature-list li::before {
    content: "✓"; position: absolute; left: 0; top: -1px;
    width: 24px; height: 24px; border-radius: 50%;
    background: rgba(91,197,0,.18); color: var(--green);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; box-shadow: inset 0 0 0 1px rgba(91,197,0,.45);
}
.auth-brand-footer { position: relative; color: rgba(255,255,255,.5); font-size: 12.5px; font-family: var(--font-body); }

/* Form panel */
.auth-form-panel { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 28px; background: var(--surface); }
.auth-form-wrap { width: 100%; max-width: 380px; }
.auth-form-logo { display: none; width: 220px; height: 220px; object-fit: contain; margin: 0 auto 16px; }
.auth-form-head { margin-bottom: 28px; }
.auth-form-head h2 { color: var(--navy); font-size: 26px; letter-spacing: -.01em; }
.auth-form-head p { color: var(--muted); font-size: 14px; margin-top: 6px; font-family: var(--font-body); }

/* Password field with show/hide toggle */
.auth-pass-wrap { position: relative; }
.auth-pass-wrap input { padding-right: 64px; }
.auth-pass-toggle {
    position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
    background: transparent; border: none; cursor: pointer;
    color: var(--green-dark); font-weight: 600; font-size: 12.5px; font-family: var(--font-body);
    padding: 6px 8px; border-radius: 6px; transition: background .15s ease, color .15s ease;
}
.auth-pass-toggle:hover { background: var(--green-wash); color: var(--navy); }

.auth-form-wrap .btn-full { margin-top: 6px; padding: 12px 20px; font-size: 15px; }
.auth-form-wrap .btn-primary:disabled { opacity: .7; cursor: default; box-shadow: none; }

/* Responsive: drop the brand panel, center the form, show the small logo */
@media (max-width: 860px) {
    .auth-brand { display: none; }
    .auth-form-panel { background: radial-gradient(ellipse at top, rgba(91,197,0,.06), transparent 60%), linear-gradient(180deg,#FFFFFF 0%,var(--bg) 100%); }
    .auth-form-head { text-align: center; }
    .auth-form-logo { display: block; }
}

/* Layout - navy sidebar + light main */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 250px; background: var(--navy); padding: 18px 0; display: flex; flex-direction: column; box-shadow: 4px 0 18px rgba(0,48,104,.08); }
.sidebar-brand { padding: 8px 16px 16px; border-bottom: 1px solid rgba(255,255,255,.1); display: flex; flex-direction: column; align-items: stretch; }
.sidebar-logo { width: 100%; max-height: 100px; object-fit: contain; background: #fff; border-radius: 10px; padding: 10px; box-sizing: border-box; }
.sidebar-nav { flex: 1; padding: 14px 8px; }
.sidebar-nav a { display: flex; align-items: center; padding: 10px 14px; color: rgba(255,255,255,.72); text-decoration: none; font-size: 14px; transition: all .15s ease; gap: 10px; border-radius: 8px; margin-bottom: 2px; font-weight: 500; }
.sidebar-nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
.sidebar-nav a.active { color: #fff; background: var(--navy-deep); box-shadow: inset 3px 0 0 var(--green); }
.sidebar-nav a.gated { opacity: .42; cursor: not-allowed; }
.sidebar-nav a.gated::after { content: "\1F512"; margin-left: auto; font-size: 11px; opacity: .8; }
.plan-badge { margin: 10px 16px 0; padding: 6px 10px; background: rgba(91,197,0,.18); color: #c9f5a0; border: 1px solid rgba(91,197,0,.35); border-radius: 999px; font-size: 11px; font-weight: 600; text-align: center; text-transform: uppercase; letter-spacing: .06em; }
.plan-badge:empty { display: none; }
.upgrade-card { max-width: 640px; }
.upgrade-card h2 { color: var(--navy); margin-bottom: 10px; font-family: var(--font-display); }
.upgrade-card p { color: var(--muted); margin-bottom: 8px; }
.upgrade-card a { color: var(--green-dark); font-weight: 600; }
.sidebar-footer { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.1); }
.sidebar-footer .user-info { font-size: 12.5px; color: rgba(255,255,255,.65); margin-bottom: 10px; }
.sidebar-footer .btn-outline { color: #fff; border-color: rgba(255,255,255,.22); }
.sidebar-footer .btn-outline:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.4); }
.main { flex: 1; overflow-y: auto; }
.topbar { padding: 18px 28px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; box-shadow: var(--shadow-sm); gap: 12px; }
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar h1 { font-size: 22px; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hamburger { display: none; background: transparent; border: none; font-size: 22px; line-height: 1; color: var(--navy); cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.hamburger:hover { background: var(--surface-2); }
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(15,27,51,.45); z-index: 1100; }
/* On mobile the action buttons are relocated out of the topbar into a strip below it (set by JS). */
#topbarActions.actions-mobile { width: 100%; padding: 0 16px; }
#topbarActions.actions-mobile:not(:empty) { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px 2px; background: var(--bg); }
#topbarActions.actions-mobile .btn { flex: 1 1 auto; min-width: 140px; }
.content { padding: 28px; max-width: 1400px; }

/* Cards */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); transition: transform .15s ease, box-shadow .15s ease; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card .label { color: var(--muted); font-size: 12px; margin-bottom: 6px; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }
.stat-card .value { font-size: 30px; font-weight: 700; color: var(--navy); font-family: var(--font-display); }
.stat-card .value.green { color: var(--green-dark); }
.stat-card .value.red { color: var(--danger); }
.stat-card .value.yellow { color: var(--warn); }
.stat-card .value.blue { color: var(--sky); }

.bay-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
/* overflow: visible so the Reset dropdown can escape the card on small screens.
   The bay-header below restates its border-radius so its colored background still
   visually clips at the top corners without relying on the parent to clip it. */
.bay-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: transform .15s ease, box-shadow .15s ease; position: relative; }
.bay-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.bay-header { padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0; }
.bay-header h3 { font-size: 17px; color: var(--navy); }
.bay-header-right { display: flex; align-items: center; gap: 10px; }
.bay-del { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 1px solid var(--border,#D8DFEB); background: var(--surface,#fff); color: var(--muted,#5C6B85); border-radius: 8px; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.bay-del:hover { background: #DC2626; color: #fff; border-color: #DC2626; }
.bay-status { padding: 4px 12px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.bay-status.active, .bay-status.idle { background: var(--green-wash); color: var(--green-deep); }
.bay-status.offline { background: #FEE2E2; color: var(--danger); }
.bay-status.resetting, .bay-status.booting { background: #FEF3C7; color: #B45309; }
.bay-status.restarting { background: #FEE2E2; color: var(--danger); }
.bay-body { padding: 16px 18px; }
.bay-info { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.bay-info .info-item { font-size: 13px; color: var(--navy-ink); }
.bay-info .info-label { color: var(--muted); font-size: 12px; display: block; margin-bottom: 1px; }
.bay-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.bay-controls .btn { flex: 1; min-width: 80px; text-align: center; }

/* Slider */
.slider-group { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.slider-group label { font-size: 13px; color: var(--muted); min-width: 70px; }
.slider-group input[type="range"] { flex: 1; accent-color: var(--green); }
.slider-group .slider-val { font-size: 13px; min-width: 35px; text-align: right; color: var(--navy-ink); font-weight: 600; }

/* Table */
.table-container { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 13px 16px; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
td { padding: 12px 16px; font-size: 14px; border-bottom: 1px solid var(--border); color: var(--navy-ink); }
tr:last-child td { border-bottom: none; }
tr:hover { background: var(--surface-2); }

/* Plan badge (used in license/bay rows) */
.plan-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: var(--green-wash); color: var(--green-deep); }
.plan-badge.commercial { background: #DBEAFE; color: #1E40AF; }
.plan-badge.professional { background: #E0E7FF; color: #4338CA; }
.plan-badge.enterprise { background: #FCE7F3; color: #9D174D; }

/* Toast */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; }
.toast { background: var(--surface); color: var(--navy-ink); padding: 14px 20px; border-radius: var(--radius-sm); margin-top: 8px; border-left: 4px solid var(--green); font-size: 14px; animation: slideIn .3s; box-shadow: var(--shadow-md); }
.toast.error { border-left-color: var(--danger); }
@keyframes slideIn { from { transform: translateX(100px); opacity:0; } to { transform: translateX(0); opacity:1; } }

/* Modal */
.modal-overlay { display: none; position: fixed; top:0; left:0; right:0; bottom:0; background: rgba(15,27,51,.5); z-index: 9998; align-items: center; justify-content: center; backdrop-filter: blur(2px); }
.modal-overlay.show { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; min-width: 420px; max-width: 560px; width: 92vw; max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-lg); position: relative; }
.modal h2 { margin-bottom: 18px; font-size: 22px; padding-right: 36px; }
.modal-actions { display: flex; gap: 10px; margin-top: 22px; justify-content: flex-end; position: sticky; bottom: -28px; background: var(--surface); padding: 12px 0 4px; }
.modal-close { position: absolute; top: 12px; right: 14px; width: 32px; height: 32px; border: none; background: transparent; color: var(--text2, #6B7280); font-size: 24px; line-height: 1; cursor: pointer; border-radius: 6px; transition: background .12s ease, color .12s ease; z-index: 2; }
.modal-close:hover { background: rgba(0,0,0,.06); color: var(--text, #111); }

/* Venue page — stack the cover + gallery columns below the small breakpoint */
@media (max-width: 900px) {
    .venue-photos-grid { grid-template-columns: 1fr !important; }
}

/* Tickets / generic tab strip used across the dashboard (currently Tickets page) */
.tk-tab {
    background: transparent; border: 0; padding: 12px 18px; cursor: pointer;
    font-family: inherit; font-size: 14px; font-weight: 600;
    color: var(--muted, #6B7280); position: relative;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tk-tab:hover { color: var(--text, #111); }
.tk-tab.active { color: var(--green-deep, #0F5132); border-bottom-color: var(--green-deep, #0F5132); }

/* Venue page — bay tab pills */
.ven-bay-tab {
    display: inline-flex; align-items: center;
    padding: 9px 16px; border-radius: 999px;
    background: var(--surface, white); border: 1.5px solid var(--border);
    color: var(--text, #111); font-family: inherit; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.ven-bay-tab:hover { background: var(--surface-2, #F1F5F9); border-color: #CBD5E1; }
.ven-bay-tab.active { background: var(--green, #0F5132); color: white; border-color: var(--green, #0F5132); }
.ven-bay-tab.active:hover { background: var(--green-deep, #0a3d27); }

/* Section */
.section { margin-bottom: 28px; }
.section-title { font-size: 18px; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; color: var(--navy); font-family: var(--font-display); }

/* Plan-gating - locked features */
.locked { position: relative; opacity: .55; pointer-events: none; }
.locked::after { content: '\1F512  Upgrade required'; position: absolute; top: 8px; right: 8px; background: var(--navy); color: #fff; padding: 4px 10px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: .04em; pointer-events: auto; }

/* Responsive */
@media (max-width: 768px) {
    /* Off-canvas sidebar toggled by the hamburger */
    .hamburger { display: inline-flex; align-items: center; justify-content: center; }
    .sidebar { position: fixed; top: 0; left: 0; height: 100vh; width: 250px; z-index: 1200; transform: translateX(-100%); transition: transform .25s ease; }
    .sidebar.open { transform: translateX(0); box-shadow: 0 0 50px rgba(0,0,0,.5); }
    .sidebar-backdrop.show { display: block; }
    .topbar { padding: 14px 16px; }
    .topbar h1 { font-size: 18px; }
    .topbar-right { gap: 6px; }
    .content { padding: 18px; }
    .bay-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    /* Modal must never be wider than the viewport */
    .modal { min-width: 0; width: calc(100vw - 32px); max-width: 540px; padding: 22px; }
}
@media (max-width: 420px) {
    .stats-grid { grid-template-columns: 1fr; }
}

/* ===================== Guide system (tour + per-tab help) ===================== */
/* Topbar Help button */
.guide-help-btn { display: inline-flex; align-items: center; gap: 7px; background: transparent; border: 1px solid var(--border); color: var(--muted); border-radius: 999px; padding: 6px 12px 6px 8px; cursor: pointer; font-family: var(--font-body); font-size: 13px; font-weight: 600; transition: background .15s ease, color .15s ease, border-color .15s ease; }
.guide-help-btn:hover { background: var(--green-wash); color: var(--green-deep); border-color: var(--green); }
.guide-help-q { display: inline-flex; align-items: center; justify-content: center; width: 19px; height: 19px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 12px; font-weight: 700; line-height: 1; }
.guide-help-btn:hover .guide-help-q { background: var(--green-dark); }
@media (max-width: 640px) { .guide-help-label { display: none; } .guide-help-btn { padding: 6px; } }

/* Spotlight tour */
.guide-catch { position: fixed; inset: 0; z-index: 10000; background: transparent; }
.guide-catch.dim { background: rgba(15,27,51,.55); }
.guide-spot { position: fixed; z-index: 10001; border-radius: 10px; box-shadow: 0 0 0 9999px rgba(15,27,51,.55), 0 0 0 2px var(--green); pointer-events: none; transition: left .25s ease, top .25s ease, width .25s ease, height .25s ease; }
.guide-tip { position: fixed; z-index: 10002; width: 320px; max-width: calc(100vw - 28px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 16px 18px; font-family: var(--font-body); animation: guideTipIn .2s ease; }
.guide-tip.center { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); width: 380px; }
@keyframes guideTipIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.guide-tip.center { animation: none; }
.guide-tip-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.guide-step { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--green-deep); text-transform: uppercase; }
.guide-x { background: transparent; border: none; color: var(--muted-2); font-size: 22px; line-height: 1; cursor: pointer; padding: 0 2px; border-radius: 6px; }
.guide-x:hover { color: var(--navy-ink); }
.guide-tip-title { font-size: 16px; font-weight: 700; color: var(--navy-ink); margin-bottom: 5px; }
.guide-tip-body { font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.guide-tip-body b { color: var(--navy-ink); font-weight: 600; }
.guide-tip-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.guide-foot-right { display: flex; gap: 8px; }
.guide-btn { background: var(--green); color: #fff; border: 1px solid var(--green-dark); border-radius: var(--radius-sm); padding: 8px 16px; font-size: 13px; font-weight: 600; font-family: var(--font-body); cursor: pointer; transition: background .15s ease; }
.guide-btn:hover { background: var(--green-dark); }
.guide-btn.ghost { background: transparent; color: var(--navy-ink); border-color: var(--border); }
.guide-btn.ghost:hover { background: var(--surface-2); }
.guide-link { background: transparent; border: none; color: var(--muted-2); font-size: 13px; cursor: pointer; font-family: var(--font-body); padding: 0; }
.guide-link:hover { color: var(--navy-ink); text-decoration: underline; }

/* Per-tab help drawer */
.guide-drawer-back { position: fixed; inset: 0; z-index: 10010; background: rgba(15,27,51,.4); opacity: 0; transition: opacity .24s ease; }
.guide-drawer-back.open { opacity: 1; }
.guide-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 10011; width: 380px; max-width: 92vw; background: var(--surface); border-left: 1px solid var(--border); box-shadow: -12px 0 32px rgba(0,48,104,.14); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .24s ease; }
.guide-drawer.open { transform: none; }
.guide-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 20px 22px 16px; border-bottom: 1px solid var(--border); }
.guide-drawer-kicker { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--green-deep); margin-bottom: 3px; }
.guide-drawer-head h3 { font-size: 19px; color: var(--navy-ink); font-weight: 700; }
.guide-drawer-body { padding: 18px 22px; overflow-y: auto; flex: 1; }
.guide-intro { font-size: 13.5px; line-height: 1.55; color: var(--muted); margin-bottom: 18px; }
.guide-sec-h { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-2); margin: 0 0 10px; }
.guide-steps { list-style: none; margin: 0 0 22px; padding: 0; }
.guide-steps li { display: flex; gap: 11px; align-items: flex-start; font-size: 13.5px; line-height: 1.5; color: var(--navy-ink); margin-bottom: 12px; }
.guide-steps li b { font-weight: 600; }
.guide-num { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; background: var(--green-wash); color: var(--green-deep); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; }
.guide-tips { margin: 0; padding-left: 18px; }
.guide-tips li { font-size: 12.5px; line-height: 1.5; color: var(--muted); margin-bottom: 7px; }
.guide-drawer-foot { padding: 14px 22px; border-top: 1px solid var(--border); }
.guide-drawer-foot .guide-btn { width: 100%; }
@media (prefers-reduced-motion: reduce) { .guide-spot, .guide-tip, .guide-drawer, .guide-drawer-back { transition: none; animation: none; } }

/* ===================== Bay card v2: connection, component pills, loading, reset menu ===================== */
.bay-conn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; border: 1px solid transparent; }
.bay-conn::before { content: ''; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.bay-conn.online { background: var(--green-wash); color: var(--green-deep); border-color: rgba(91,197,0,.35); }
.bay-conn.online::before { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.18); }
.bay-conn.offline { background: rgba(220,38,38,.08); color: var(--danger-dark); border-color: rgba(220,38,38,.25); }
.bay-conn.offline::before { background: var(--danger); }
.bay-conn.busy { background: rgba(245,158,11,.10); color: #B45309; border-color: rgba(245,158,11,.30); }
.bay-conn.busy::before { background: var(--warn); animation: bayPulse 1.4s ease-in-out infinite; }

.comp-row { display: flex; flex-wrap: wrap; gap: 6px; }
.bay-status-footer { border-top: 1px solid var(--border); margin: 14px -18px -16px; padding: 12px 18px 14px; background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); display: flex; flex-direction: column; gap: 8px; }
.comp-pill { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px 4px 9px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; font-size: 12.5px; color: var(--navy-ink); font-weight: 600; }
.comp-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.comp-dot.ok   { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.16); }
.comp-dot.warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(245,158,11,.16); animation: bayPulse 1.4s ease-in-out infinite; }
.comp-dot.bad  { background: var(--danger); box-shadow: 0 0 0 3px rgba(220,38,38,.16); }
.comp-dot.idle { background: #CBD5E1; }
@keyframes bayPulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }

.boot-line { display: flex; align-items: center; gap: 8px; padding: 6px 18px 0; font-size: 12.5px; color: #B45309; font-weight: 600; }
.boot-line .spinner { width: 12px; height: 12px; border: 2px solid var(--warn); border-top-color: transparent; border-radius: 50%; animation: baySpin .9s linear infinite; }
@keyframes baySpin { to { transform: rotate(360deg); } }

.round-line { padding: 8px 18px 0; font-size: 12.5px; color: var(--muted); }
.round-line b { color: var(--navy-ink); font-weight: 600; }
.round-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-right: 6px; }
.round-tag.in   { background: var(--green-wash); color: var(--green-deep); }
.round-tag.menu { background: var(--surface-3); color: var(--muted); }
.idle-info      { color: var(--muted-2); font-weight: 500; }
.idle-info.on   { color: #B45309; font-weight: 600; }

/* ===================== Tickets page (v1.9) ===================== */
/* Company-mode header (above the sidebar nav). Only visible for role=company users. */
.company-header { padding: 14px 16px 12px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 8px; }
.company-header-name { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: rgba(255,255,255,.7); margin-bottom: 6px; }
.franchise-picker { width: 100%; padding: 8px 10px; background: rgba(0,0,0,.25); color: #fff; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; font-size: 13px; font-family: var(--font-body); cursor: pointer; }
.franchise-picker:focus { outline: 2px solid var(--green); outline-offset: 1px; }
/* Subtle "Franchise: X" badge tag for entity rows when the row's user is under a company. */
.org-crumb { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--surface-3, #E6ECF6); color: var(--muted, #5C6B85); font-size: 11px; font-weight: 600; margin-left: 6px; }
.org-crumb b { color: var(--navy-ink, #0F1B33); font-weight: 700; }

/* Sidebar badge for unread escalated tickets — also used on the Bays/Tickets nav links. */
.sidebar-nav a { position: relative; }
.nav-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; margin-left: 8px; box-shadow: 0 0 0 3px rgba(220,38,38,.18); animation: navPulse 2s ease-in-out infinite; vertical-align: middle; }
@keyframes navPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }

.ticket-headline { background: rgba(220,38,38,.06); border: 1px solid rgba(220,38,38,.18); color: var(--danger-dark); padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; margin: -4px 0 16px; }
.ticket-headline b { color: var(--danger); font-size: 18px; }

.ticket-row-bump td { background: rgba(245,158,11,.06); }
.ticket-row-bump td:first-child { box-shadow: inset 3px 0 0 var(--warn); }

.ticket-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.ticket-badge.open    { background: var(--surface-3); color: var(--muted); }
.ticket-badge.running { background: rgba(245,158,11,.10); color: #B45309; }
.ticket-badge.ok      { background: var(--green-wash); color: var(--green-deep); }
.ticket-badge.bad     { background: rgba(220,38,38,.08); color: var(--danger-dark); }
.ticket-unread { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); margin-left: 6px; vertical-align: middle; box-shadow: 0 0 0 3px rgba(220,38,38,.16); }

.ticket-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.ticket-meta b { color: var(--navy-ink); font-weight: 600; }

.ticket-sec-h { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-2); margin: 6px 0 8px; }

.ticket-shots { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ticket-shot { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.ticket-shot-label { padding: 6px 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); background: var(--surface); border-bottom: 1px solid var(--border); letter-spacing: .04em; }
.ticket-shot-img { width: 100%; display: block; min-height: 140px; background: #0F1B33; }

.ticket-log { padding-left: 22px; margin: 0; }
.ticket-log li { font-size: 13px; color: var(--navy-ink); margin-bottom: 6px; }
.ticket-log-time { color: var(--muted-2); font-size: 11.5px; }

@media (max-width: 540px) {
    .ticket-shots { grid-template-columns: 1fr; }
}

/* Comments on ticket detail (v1.9 phase 3) */
.ticket-comments { display: flex; flex-direction: column; gap: 8px; max-height: 240px; overflow-y: auto; }
.ticket-comment-empty { color: var(--muted-2); font-style: italic; font-size: 13px; padding: 4px 0; }
.ticket-comment { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; }
.ticket-comment-head { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.ticket-comment-head b { color: var(--navy-ink); font-weight: 600; }
.ticket-comment-time { color: var(--muted-2); font-size: 11.5px; margin-left: 8px; }
.ticket-comment-body { font-size: 13px; color: var(--navy-ink); white-space: pre-wrap; line-height: 1.45; }
.ticket-comment-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.ticket-comment-form textarea { flex: 1; padding: 9px 12px; background: var(--surface); border: 1px solid var(--border); color: var(--navy-ink); border-radius: var(--radius-sm); font-size: 13px; font-family: var(--font-body); resize: vertical; min-height: 50px; }

/* Split-button Reset → small popover with three options */
.reset-wrap { position: relative; display: inline-block; }
.reset-menu { position: absolute; top: 100%; left: 0; min-width: 230px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg, 0 12px 32px rgba(15,23,42,.18)); padding: 4px; margin-top: 6px; z-index: 1000; }
.reset-menu-h { font-size: 11px; color: var(--muted-2); padding: 6px 12px 4px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.reset-menu button { display: block; width: 100%; text-align: left; background: transparent; border: none; padding: 9px 12px; font-size: 13px; font-family: var(--font-body); color: var(--navy-ink); cursor: pointer; border-radius: 5px; font-weight: 500; }
.reset-menu button:hover { background: var(--surface-2); }
.reset-menu .muted { color: var(--muted-2); font-weight: 400; font-size: 12px; }
