:root {
    --brand: #104205;
    --brand-dark: #0c3303;
    --bg: #f4f7f6;
    --border: #dee2e6;
}
* { box-sizing: border-box; }
body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg);
    margin: 0;
    color: #1f2937;
}
a { color: inherit; }

/* ---------- Login ---------- */
.login-wrap { max-width: 420px; margin: 80px auto; width: 100%; padding: 0 10px; }
.login-panel { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 30px; box-shadow: 0 10px 25px rgba(0,0,0,0.08); }
.form-group { margin-bottom: 20px; text-align: left; }
.form-group label { display: block; font-size: .88em; font-weight: 600; margin-bottom: 8px; color: #444; }
.form-control, input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], select, textarea {
    width: 100%; padding: 10px 12px; height: 42px; border: 1px solid #ccc; border-radius: 6px; font-family: inherit; font-size: .95em; background: #fff; color: #333; margin-bottom: 15px;
}
textarea { height: auto; padding: 10px 12px; }
.btn-submit, .btn, .btn-success, button[type=submit] {
    background: var(--brand); color: #fff; border: none; border-radius: 6px; font-weight: 600; font-size: 1em; cursor: pointer; padding: 10px 20px; height: 46px;
}
.btn-submit:hover, .btn-success:hover, button[type=submit]:hover { background: var(--brand-dark); }
.alert-msg { background: #ffebee; color: #c62828; padding: 12px; border-radius: 6px; margin-bottom: 20px; font-weight: 600; font-size: .9em; text-align: center; border: 1px solid #ffcdd2; }
.success-msg { background: #e8f5e9; color: #2e7d32; padding: 12px; border-radius: 6px; margin-bottom: 20px; font-weight: 600; font-size: .9em; text-align: center; border: 1px solid #c8e6c9; }

/* ---------- Admin / Dashboard shell ---------- */
.admin-container, .dashboard-container { max-width: 1400px; margin: 0 auto; padding: 20px; }
.admin-header {
    background: var(--brand); color: #fff; padding: 18px 24px; border-radius: 10px; margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
}
.tab-nav-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.tab-btn { background: #fff; border: 1px solid var(--border); padding: 10px 16px; border-radius: 8px; cursor: pointer; font-weight: 600; font-family: inherit; font-size: .9em; color: #475569; }
.tab-btn.active-tab { background: var(--brand); color: #fff; border-color: var(--brand); }
.tab-window-content { display: none; }
.tab-window-content.active-window { display: block; }

.panel { background: #fff; border: 1px solid #eef2f5; border-radius: 12px; padding: 22px; margin-bottom: 24px; box-shadow: 0 2px 8px rgba(0,0,0,.03); }
.panel h3 { margin-top: 0; color: var(--brand); }
.form-grid { display: flex; gap: 15px; flex-wrap: wrap; }
.form-grid > div { flex: 1; min-width: 180px; }

table { width: 100%; border-collapse: collapse; margin: 15px 0 5px; background: #fff; border: 1px solid #eef2f5; border-radius: 8px; overflow: hidden; font-size: .92em; }
th { background: #f1f5f9; color: #475569; font-weight: 600; text-align: left; padding: 10px 14px; text-transform: uppercase; font-size: .78em; letter-spacing: .4px; }
td { padding: 10px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
tr:hover td { background: #f8fafc; }
.table-responsive-container { overflow-x: auto; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 4px; font-size: .78em; font-weight: 700; background: #f1f3f5; color: #37474f; }
.badge-active { background: #e8f5e9; color: #2e7d32; }
.badge-paused { background: #fff3e0; color: #e65100; }

.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.btn-primary { background: #334155; }
.btn-warning { background: #ffe0b2; color: #e65100; border: 1px solid #ffb74d; }
.btn-danger { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }

.system-alert-banner-item { position: fixed; top: 25px; right: 25px; z-index: 99999; max-width: 420px; padding: 16px 24px; border-radius: 8px; box-shadow: 0 10px 25px rgba(0,0,0,.15); font-weight: 500; }

.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 99999; justify-content: center; align-items: center; }
.modal-overlay.active-modal { display: flex; }
.modal-content { background: #fff; width: 100%; max-width: 550px; padding: 30px; border-radius: 12px; box-shadow: 0 15px 35px rgba(0,0,0,.2); position: relative; max-height: 90vh; overflow-y: auto; }
.modal-content h3 { margin-top: 0; color: var(--brand); border-bottom: 1px solid #eef2f5; padding-bottom: 12px; }
.modal-close-x-btn { position: absolute; top: 15px; right: 20px; background: none; border: none; font-size: 1.6em; color: #94a3b8; cursor: pointer; }

code, pre { font-family: 'Courier New', monospace; background: #f8fafc; border: 1px solid #e2e2f0; padding: 4px 8px; border-radius: 4px; font-size: .88em; }

/* ---------- Dashboard bookings ---------- */
.status-summary-card { flex: 1; min-width: 110px; background: #fff; border: 1px solid #cbd5e1; border-radius: 6px; padding: 8px 10px; text-align: center; }
.summary-count { font-size: 1.4em; font-weight: 700; color: var(--brand); line-height: 1.1; }
.summary-label { font-size: .72em; color: #64748b; font-weight: 600; text-transform: uppercase; margin-top: 2px; }
#icabbi-matrix-status-telemetry-summary-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

.collapsible-log-trigger { background: #fff; border: 1px solid #eef2f5; border-radius: 8px; padding: 14px 18px; display: flex; justify-content: space-between; cursor: pointer; margin-bottom: 6px; align-items: center; }
.log-title-text { font-weight: 600; margin-right: 10px; }
.log-body-accordion-wrapper { display: none; margin-bottom: 18px; }
.log-body-accordion-wrapper.open { display: block; }

/* ---------- Dashboard fullscreen mode ---------- */
/* Mirrors the legacy dashboard.php ".fullscreen-active-matrix" behavior:
   the wrapper fills the viewport, chrome (header, page padding) is hidden,
   the telemetry bar compresses, and only the live bookings table scrolls. */
.fullscreen-active-matrix {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100% !important;
    padding: 12px 20px !important;
    margin: 0 !important;
    background: #ffffff !important;
    z-index: 999999 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}
.fullscreen-active-matrix .admin-header { display: none !important; }
.fullscreen-active-matrix #icabbi-matrix-status-telemetry-summary-bar {
    flex-shrink: 0 !important;
    margin-bottom: 10px !important;
    padding: 6px !important;
    background: #f1f5f9 !important;
    border-radius: 6px !important;
}
.fullscreen-active-matrix .status-summary-card { padding: 4px 8px !important; }
.fullscreen-active-matrix .summary-count { font-size: 1.1em !important; }
.fullscreen-active-matrix #icabbi-data-container {
    flex: 1 !important;
    overflow-y: auto !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}
.fullscreen-active-matrix #icabbi-data-container table thead th {
    position: sticky !important;
    top: 0 !important;
    z-index: 2 !important;
}
