/* ========================================
   Flow Retail Monitor - Main Stylesheet
   ======================================== */

:root {
    --color-up: #22c55e;
    --color-down: #ef4444;
    --color-partial: #f59e0b;
    --color-maintenance: #6b7280;
    --color-unknown: #9ca3af;
    --color-primary: #0f3557;
    --color-primary-hover: #0a2841;
    --color-primary-light: #1a4a73;
    --color-accent: #3b82f6;
    --color-bg: #f1f5f9;
    --color-bg-card: #ffffff;
    --color-white: #ffffff;
    --color-text: #1e293b;
    --color-text-muted: #64748b;
    --color-border: #e2e8f0;
    --color-shadow: rgba(15, 23, 42, 0.06);
    --color-shadow-lg: rgba(15, 23, 42, 0.1);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --transition: 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-family);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Admin Body */
.admin-body {
    background: var(--color-bg);
}

a { color: var(--color-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--color-text);
    letter-spacing: -0.02em;
}

h2 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

/* Admin Navbar */
.admin-navbar {
    background: var(--color-primary);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.2);
}

.admin-navbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    height: 56px;
    gap: 1.5rem;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
}

.navbar-brand .logo {
    height: 30px;
    width: auto;
    background: rgba(255,255,255,0.9);
    padding: 2px 5px;
    border-radius: 4px;
}

.navbar-brand h1 {
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    margin-bottom: 0;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.navbar-right {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.navbar-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

.navbar-menu li a {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    border-radius: var(--border-radius);
    color: rgba(255,255,255,0.75);
    font-size: 0.825rem;
    font-weight: 500;
    transition: all var(--transition);
    white-space: nowrap;
}

.navbar-menu li a:hover {
    background: rgba(255,255,255,0.1);
    color: #ffffff;
    text-decoration: none;
}

.navbar-menu li a.active {
    background: rgba(255,255,255,0.18);
    color: #ffffff;
}

.navbar-menu li a .caret {
    font-size: 0.65em;
    margin-left: 1px;
    opacity: 0.7;
}

.nav-separator {
    width: 1px;
    height: 20px;
    background: rgba(255,255,255,0.2);
    margin: 0 0.35rem;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255,255,255,0.6);
    padding: 0.3rem 0.5rem;
}

/* Navbar Dropdowns */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    cursor: pointer;
    user-select: none;
}

.nav-dropdown-menu {
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.15s ease, visibility 0s 0.5s;
    position: absolute;
    top: 100%;
    padding-top: 4px;
    left: 0;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    min-width: 210px;
    padding: 0.4rem;
    z-index: 100;
    list-style: none;
}

.nav-dropdown:hover .nav-dropdown-menu {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.15s ease, visibility 0s 0s;
}

.nav-dropdown-menu li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    font-size: 0.825rem;
    color: var(--color-text);
    border-radius: 6px;
    white-space: nowrap;
}

.nav-dropdown-menu li a:hover {
    background: var(--color-bg);
    color: var(--color-text);
}

.nav-dropdown-menu li a.active {
    background: var(--color-primary);
    color: var(--color-white);
}

.nav-dropdown-menu li a kbd {
    font-family: var(--font-family);
    font-size: 0.65rem;
    color: var(--color-text-muted);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
    margin-left: 1rem;
}

.nav-dropdown-menu li a.active kbd {
    color: rgba(255, 255, 255, 0.65);
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Admin Main Content */
.admin-main {
    flex: 1;
    padding: 1.5rem 0;
}

/* Container */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    border-left: 3px solid;
}

.alert-info { background: #eff6ff; color: #1e40af; border-color: #3b82f6; }
.alert-danger { background: #fef2f2; color: #991b1b; border-color: #ef4444; }
.alert-success { background: #f0fdf4; color: #166534; border-color: #22c55e; }
.alert-warning { background: #fffbeb; color: #92400e; border-color: #f59e0b; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    font-size: 0.825rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.5;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--color-primary); color: var(--color-white); border-color: var(--color-primary); box-shadow: 0 1px 3px rgba(15, 53, 87, 0.2); }
.btn-primary:hover { background: var(--color-primary-hover); box-shadow: 0 2px 6px rgba(15, 53, 87, 0.25); }
.btn-secondary { background: var(--color-white); color: var(--color-text); border-color: var(--color-border); }
.btn-secondary:hover { background: var(--color-bg); border-color: #cbd5e1; }
.btn-danger { background: var(--color-down); color: var(--color-white); border-color: var(--color-down); }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: var(--color-up); color: var(--color-white); border-color: var(--color-up); }
.btn-success:hover { background: #16a34a; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.75rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Forms */
.form-group { margin-bottom: 1rem; }

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--color-text);
    letter-spacing: 0.01em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    font-family: var(--font-family);
    transition: all var(--transition);
    background: var(--color-white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.form-row { display: flex; gap: 1rem; }
.form-row .form-group { flex: 1; }

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-white);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: 0 1px 4px var(--color-shadow);
}

thead th {
    background: #f8fafc;
    padding: 0.7rem 1rem;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
}

tbody td {
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
    border-bottom: 1px solid #f1f5f9;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }
tbody tr { transition: background var(--transition); }

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.status-badge.up { background: #dcfce7; color: #166534; }
.status-badge.down { background: #fef2f2; color: #991b1b; }
.status-badge.unknown { background: #f1f5f9; color: #475569; }
.status-badge.client { background: #dbeafe; color: #1e40af; }

.btn-retest {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0.1rem 0.3rem;
    font-size: 0.75rem;
    border-radius: 4px;
    vertical-align: middle;
}
.btn-retest:hover { color: var(--color-primary); background: var(--color-bg-hover, #f1f5f9); }
.btn-retest:disabled { opacity: 0.5; cursor: not-allowed; }

/* Dashboard Summary Cards */
.dashboard-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-card {
    background: var(--color-white);
    border-radius: var(--border-radius-lg);
    padding: 1.25rem;
    box-shadow: 0 1px 4px var(--color-shadow);
    text-align: center;
    transition: box-shadow var(--transition);
}

.summary-card:hover {
    box-shadow: 0 3px 12px var(--color-shadow-lg);
}

.summary-card h3 {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.summary-stat { font-size: 2rem; font-weight: 700; }
.summary-up { color: var(--color-up); }
.summary-down { color: var(--color-down); }

/* Dashboard Controls */
.dashboard-controls {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.dashboard-controls select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
}

/* Login Page */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

.login-box {
    background: var(--color-white);
    padding: 2.5rem;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 4px 24px var(--color-shadow-lg);
    width: 100%;
    max-width: 400px;
}

.login-box h2 { margin-bottom: 1.5rem; text-align: center; }

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.modal-content {
    background: var(--color-white);
    border-radius: var(--border-radius-lg);
    padding: 1.75rem;
    max-width: 620px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.modal-content h2 {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border);
    font-size: 1.15rem;
}

/* Card — shared base for panels */
.card {
    background: var(--color-white);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 1px 4px var(--color-shadow);
}

/* Report Sections */
.report-controls {
    background: var(--color-white);
    padding: 1.25rem;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 1px 4px var(--color-shadow);
    margin-bottom: 1.5rem;
}

.report-summary {
    background: var(--color-white);
    padding: 1.25rem;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 1px 4px var(--color-shadow);
    margin-bottom: 1.5rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.summary-grid .stat {
    text-align: center;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: var(--border-radius);
}

.summary-grid .stat .label {
    display: block;
    font-size: 0.7rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.summary-grid .stat .value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

.report-services,
.report-incidents {
    background: var(--color-white);
    padding: 1.25rem;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 1px 4px var(--color-shadow);
    margin-bottom: 1.5rem;
}

/* Log Filters */
.log-filters {
    background: var(--color-white);
    padding: 1.25rem;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 1px 4px var(--color-shadow);
    margin-bottom: 1.5rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 1rem 0;
}

.pagination button {
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--color-border);
    background: var(--color-white);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.875rem;
}

.pagination button:hover { background: var(--color-bg); }
.pagination button:disabled { opacity: 0.5; cursor: not-allowed; }
.pagination .page-info { font-size: 0.875rem; color: var(--color-text-muted); }

/* Tenant / Status Pages */
.tenant-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.tenant-logo { height: 48px; width: auto; }

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.services-grid.layout-2col {
    grid-template-columns: repeat(2, 1fr);
}
.services-grid.layout-stacked {
    grid-template-columns: 1fr;
}

.service-card {
    background: var(--color-white);
    border-radius: var(--border-radius-lg);
    padding: 1.25rem;
    box-shadow: 0 1px 4px var(--color-shadow);
    transition: box-shadow var(--transition);
}

.service-card:hover {
    box-shadow: 0 3px 12px var(--color-shadow-lg);
}

.service-card h3 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.service-card .status-indicator {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.service-card .status-indicator.up { background: #d4edda; color: #155724; }
.service-card .status-indicator.down { background: #f8d7da; color: #842029; }

.service-card canvas { margin-top: 0.75rem; }

.service-card .incidents-table { margin-top: 0.75rem; box-shadow: none; }

/* 30-Day Calendar */
.status-calendar {
    background: var(--color-white);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 1px 4px var(--color-shadow);
    margin-bottom: 1.5rem;
    text-align: center;
}

.status-calendar h2 {
    text-align: center;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: -0.01em;
}

.calendar-grid {
    display: inline-flex;
    gap: 4px;
    margin-top: -1px;
}

.calendar-day {
    width: 28px;
    height: 28px;
    border-radius: 5px;
    cursor: pointer;
    position: relative;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.calendar-day:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

.calendar-day.up { background: var(--color-up); }
.calendar-day.partial { background: var(--color-partial); }
.calendar-day.down { background: var(--color-down); }
.calendar-day.no-data { background: var(--color-unknown); }

.calendar-day .tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 10;
    margin-bottom: 4px;
}

.calendar-day:hover .tooltip { display: block; }

.calendar-legend {
    display: inline-flex;
    gap: 1rem;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.calendar-legend span { display: flex; align-items: center; gap: 0.3rem; }

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
}

/* Maintenance Section */
.maintenance-section { margin-top: 1.5rem; }

.bottom-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.bottom-panel {
    background: var(--color-white);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 1px 4px var(--color-shadow);
}

@media (max-width: 768px) {
    .bottom-panels { grid-template-columns: 1fr; }
}

.maintenance-card {
    background: var(--color-white);
    border-left: 4px solid var(--color-maintenance);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 4px var(--color-shadow);
}

.maintenance-card h4 { margin-bottom: 0.25rem; }
.maintenance-card .time { font-size: 0.85rem; color: var(--color-text-muted); }
.maintenance-card .desc { font-size: 0.85rem; margin-top: 0.25rem; }

/* Admin Footer */
.admin-footer {
    text-align: center;
    padding: 1.25rem;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    border-top: 1px solid var(--color-border);
    margin-top: auto;
    background: var(--color-white);
}

/* Legacy footer (non-admin pages) */
.footer {
    text-align: center;
    padding: 1rem;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    border-top: 1px solid var(--color-border);
    margin-top: auto;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--color-text-muted);
    gap: 0.5rem;
}

/* Criteria row in test form */
.criteria-row {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    margin-bottom: 0.5rem;
}

.criteria-row select,
.criteria-row input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
}

.criteria-row select { width: 180px; }
.criteria-row input { flex: 1; }

/* SLA met/not met */
.sla-met { color: var(--color-up); font-weight: 600; }
.sla-not-met { color: var(--color-down); font-weight: 600; }

/* Role Badges */
.role-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.role-badge.admin { background: #cfe2ff; color: #084298; }
.role-badge.tenant { background: #e2e3e5; color: #41464b; }

/* Tenant Checklist (User form) */
.tenant-checklist {
    max-height: 160px;
    overflow-y: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 0.5rem;
}
.tenant-check-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.3rem;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
}
.tenant-check-item:hover { background: var(--color-bg); }
.tenant-check-item input[type="checkbox"] { width: auto; }

/* TOTP QR Display */
.totp-qr-container {
    display: flex;
    justify-content: center;
    padding: 1rem 0;
}

/* Nav View-As Select */
.nav-view-as { display: flex; align-items: center; }
.nav-select {
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    font-size: 0.8rem;
    background: var(--color-white);
    color: var(--color-text);
    cursor: pointer;
    max-width: 180px;
}

/* Overall Status Banner */
.status-banner {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    letter-spacing: -0.01em;
}
.status-banner.all-up {
    background: linear-gradient(135deg, #d1e7dd, #c3e6cb);
    color: #0f5132;
    border: none;
    box-shadow: 0 1px 4px rgba(40, 167, 69, 0.15);
}
.status-banner.some-down {
    background: linear-gradient(135deg, #f8d7da, #f5c2c7);
    color: #842029;
    border: none;
    box-shadow: 0 1px 4px rgba(220, 53, 69, 0.15);
}

/* Summary Stats Row */
.status-summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.status-summary-stats .summary-card {
    background: var(--color-white);
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: 0 1px 3px var(--color-shadow);
    text-align: center;
}
.status-summary-stats .summary-card h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
}
.status-summary-stats .summary-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
}

/* Enhanced Service Cards */
.service-card.enhanced {
    border-left: none;
    border-radius: 10px;
    position: relative;
    transition: box-shadow 0.2s ease;
}
.service-card.enhanced:hover {
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
}

.service-card .service-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}
.service-card .service-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Status Pill */
.status-pill {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.status-pill.up { background: #d4edda; color: #155724; }
.status-pill.down { background: #f8d7da; color: #842029; }
.status-pill.unknown { background: #e9ecef; color: #495057; }

/* Incident History Section */
.incident-history {
    background: var(--color-white);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 1px 4px var(--color-shadow);
    margin-bottom: 1.5rem;
}
.incident-history h2 { margin-bottom: 0.75rem; }
.incident-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.875rem;
}
.incident-item:last-child { border-bottom: none; }
.incident-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-down);
    flex-shrink: 0;
}
.incident-dot.maintenance { background: var(--color-maintenance); }

/* View-As Banner */
.view-as-banner {
    background: #fff3cd;
    color: #664d03;
    border: 1px solid #ffecb5;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem;
}
.view-as-banner a {
    color: #664d03;
    font-weight: 600;
}

/* Service Group Sections (Dashboard) */
.service-group-section {
    margin-bottom: 1.25rem;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: 0 1px 4px var(--color-shadow);
}

.group-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--color-primary);
    color: var(--color-white);
    padding: 0.65rem 1.25rem;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.01em;
}

.service-group-section table {
    box-shadow: none;
    border-radius: 0;
}

.dashboard-table {
    table-layout: fixed;
    width: 100%;
}
.dashboard-table td:nth-child(2) {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Checkbox Inline (User/Test forms) */
.checkbox-inline {
    display: flex !important;
    align-items: center;
    gap: 0.4rem;
}

.checkbox-inline input[type="checkbox"] {
    width: auto;
}

/* Group header rows in admin tables */
.group-header-row td {
    background: var(--color-bg-card);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    padding: 0.5rem 0.75rem;
    border-bottom: 2px solid var(--color-border);
}
.group-header-row td i.fa-folder-open,
.group-header-row td i.fa-folder {
    margin-right: 0.4rem;
}

/* Reorder arrow buttons */
.reorder-btns {
    display: inline-flex;
    gap: 0.15rem;
    margin-left: 0.5rem;
    vertical-align: middle;
}
.btn-xs {
    padding: 0.1rem 0.35rem;
    font-size: 0.7rem;
    line-height: 1;
    border-radius: 4px;
}
.btn-ghost {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    cursor: pointer;
}
.btn-ghost:hover {
    background: var(--color-bg-card);
    color: var(--color-text);
    border-color: var(--color-text-muted);
}
.actions-cell {
    white-space: nowrap;
}

/* Threshold fieldset (View form) */
.threshold-fieldset {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
}
.threshold-fieldset legend {
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0 0.4rem;
}
.form-help {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    margin: 0 0 0.5rem 0;
}

.form-warning {
    font-size: 0.82rem;
    color: #b45309;
}

/* Section Toggles Table (View form) */
.section-toggles-table {
    width: 100%;
    border-collapse: collapse;
}
.section-toggles-table td {
    padding: 0.35rem 0.5rem;
    border: none;
    vertical-align: middle;
    font-size: 0.875rem;
}
.section-toggles-table td:first-child {
    width: 1.5rem;
    text-align: center;
}
.section-toggles-table td:first-child input[type="checkbox"] {
    width: auto;
    accent-color: var(--color-accent);
}
.section-toggles-table label {
    cursor: pointer;
    font-weight: 500;
    white-space: nowrap;
}
.section-toggles-table .section-desc {
    color: var(--color-text-muted);
    font-size: 0.8rem;
}
.section-toggles-table tr:hover {
    background: var(--color-bg);
}
.section-toggles-table .section-separator td {
    padding: 0.15rem 0;
    border-bottom: 1px solid var(--color-border);
}

/* Quick Stats Bar */
.quick-stats-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.qs-item {
    flex: 1;
    background: var(--color-bg-card);
    border-radius: var(--border-radius);
    padding: 1rem;
    text-align: center;
    box-shadow: 0 1px 3px var(--color-shadow);
}
.qs-item .qs-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text);
}
.qs-item .qs-value small { font-size: 0.9rem; font-weight: 500; color: var(--color-text-muted); }
.qs-item .qs-label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 0.25rem;
}
.qs-up .qs-value { color: var(--color-up); }
.qs-down .qs-value { color: var(--color-down); }

/* Group Summary Cards */
.group-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.gs-card {
    background: var(--color-bg-card);
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: 0 1px 3px var(--color-shadow);
    border-left: 4px solid var(--color-up);
}
.gs-card.gs-down { border-left-color: var(--color-down); }
.gs-name { font-weight: 600; font-size: 0.95rem; margin-bottom: 0.35rem; }
.gs-count { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.gs-count span { font-size: 0.75rem; font-weight: 500; color: var(--color-text-muted); }
.gs-bar {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
}
.gs-bar-fill {
    height: 100%;
    background: var(--color-up);
    border-radius: 2px;
    transition: width 0.3s ease;
}
.gs-down .gs-bar-fill { background: var(--color-down); }

/* SLA Overview & Uptime Summary Tables */
.sv-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 1px 3px var(--color-shadow);
    margin-bottom: 1.5rem;
}
.sv-table thead th {
    background: var(--color-primary);
    color: var(--color-white);
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-align: left;
}
.sv-table tbody td {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--color-border);
}
.sv-table tbody tr:last-child td { border-bottom: none; }
.sv-table tbody tr:hover { background: #f8fafc; }

.sla-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}
.sla-met { background: rgba(34, 197, 94, 0.12); color: var(--color-up); }
.sla-not-met { background: rgba(239, 68, 68, 0.12); color: var(--color-down); }

.ut-good { color: var(--color-up); font-weight: 600; }
.ut-ok { color: var(--color-partial); font-weight: 600; }
.ut-bad { color: var(--color-down); font-weight: 600; }

#group-summary-section .section-heading,
#sla-overview-section .section-heading,
#uptime-summary-section .section-heading {
    margin-bottom: 1rem;
}

/* Status View Page Header */
/* Status Page — Modern Layout */
.status-page-body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Inter', var(--font-family);
}

.status-page-header {
    background: var(--color-primary);
    padding: 1.5rem 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.status-page-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.status-page-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-page-logo {
    height: 60px;
    width: auto;
}

.status-page-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.status-page-description {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0.15rem;
}

.status-page-branding {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    opacity: 0.85;
    transition: opacity 0.2s;
}
.status-page-branding:hover { opacity: 1; }

.branding-logo {
    height: 28px;
    width: auto;
    background: rgba(255, 255, 255, 0.9);
    padding: 3px 6px;
    border-radius: 5px;
}

.branding-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.02em;
}

.status-page-container {
    flex: 1;
    padding-top: 7rem;
    padding-bottom: 4rem;
}

.status-page-footer {
    text-align: center;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    background: var(--color-primary);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}
.status-page-footer a { color: rgba(255, 255, 255, 0.7); }
.status-page-footer a:hover { color: #ffffff; }
.status-page-footer strong { font-weight: 600; color: rgba(255, 255, 255, 0.9); }

/* Section Headings */
.section-heading {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--color-text);
}

/* Responsive: branding */
@media (max-width: 600px) {
    .status-page-header-inner { flex-direction: column; align-items: flex-start; }
    .status-page-branding { align-self: flex-end; }
    .branding-text { display: none; }
}

/* Calendar Month Labels & Separators */
.calendar-months {
    display: inline-flex;
    gap: 4px;
    margin-bottom: 0;
    font-size: 0.7rem;
    color: var(--color-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.calendar-month-label {
    width: 28px;
    flex-shrink: 0;
    overflow: visible;
    white-space: nowrap;
    padding-bottom: 0.25rem;
}

.calendar-month-sep-label {
    width: 2px;
    flex-shrink: 0;
    margin: 0 1px;
    background: var(--color-text-muted);
    align-self: stretch;
    opacity: 0.4;
}

.calendar-month-sep {
    width: 2px;
    background: var(--color-text-muted);
    align-self: stretch;
    margin: 0 1px;
    flex-shrink: 0;
    opacity: 0.4;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-navbar-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }

    .navbar-right { width: 100%; }
    .navbar-menu { flex-wrap: wrap; justify-content: center; }
    .form-row { flex-direction: column; gap: 0; }
    .dashboard-summary { grid-template-columns: repeat(2, 1fr); }
    .services-grid, .services-grid.layout-2col, .services-grid.layout-stacked { grid-template-columns: 1fr; }
    .modal-content { width: 95%; margin: 1rem; }
}

/* Print */
@media print {
    .navbar, .footer, .dashboard-controls, .btn,
    .log-filters, .pagination, .report-controls { display: none; }
    body { background: white; }
    .container { max-width: none; padding: 0; }
    table { box-shadow: none; }
    .summary-card, .report-summary, .service-card { box-shadow: none; border: 1px solid #ccc; }
}
