/* K-AMS - Kunjio Attendance
   Global Styles */

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #f59e0b;
    --info: #0891b2;
    --light: #f8fafc;
    --dark: #1e293b;
    --border: #e2e8f0;
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    padding: 0;
    color: #333;
}

.ecams-app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.ecams-navbar {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.ecams-navbar .navbar-brand {
    color: #fff !important;
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ecams-navbar .navbar-logo {
    height: 32px;
    width: auto;
    border-radius: 6px;
}

.ecams-navbar .nav-link {
    color: rgba(255,255,255,0.85) !important;
    transition: color 0.2s;
    font-size: 0.9rem;
    white-space: nowrap;
}

.ecams-navbar .nav-link:hover {
    color: #fff !important;
}

.ecams-navbar .navbar-toggler {
    border-color: rgba(255,255,255,0.3);
}

.ecams-navbar .navbar-toggler-icon {
    filter: invert(1);
}

.ecams-navbar .dropdown-menu {
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.ecams-content {
    flex: 1;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.ecams-footer {
    padding: 15px;
    color: #888;
    font-size: 0.8rem;
}

/* ===== Auth pages — modern split-panel design ===== */
.auth-page {
    margin: 0;
}

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    background: #f0f4f8;
    padding: 0;
}

/* --- Left: Branding panel --- */
.auth-brand-panel {
    flex: 1 1 50%;
    background: linear-gradient(160deg, #1e3a5f 0%, #1e40af 55%, #2563eb 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px 40px;
    position: relative;
    overflow: hidden;
}

.auth-brand-panel::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 280px;
    height: 280px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
}

.auth-brand-panel::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: -40px;
    width: 220px;
    height: 220px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.auth-brand-content {
    position: relative;
    z-index: 2;
    max-width: 380px;
    text-align: center;
}

.auth-brand-logo {
    width: 76px;
    height: 76px;
    object-fit: contain;
    margin-bottom: 22px;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.25));
}

.auth-brand-name {
    font-size: 2rem;
    font-weight: 800;
    margin: 0 0 10px;
    letter-spacing: -0.5px;
}

.auth-brand-tagline {
    font-size: 1rem;
    opacity: 0.85;
    margin: 0 0 36px;
    font-weight: 400;
}

.auth-brand-features {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 36px;
    text-align: left;
}

.auth-brand-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    opacity: 0.95;
    background: rgba(255,255,255,0.08);
    padding: 11px 18px;
    border-radius: 10px;
    backdrop-filter: blur(4px);
    transition: background 0.25s ease;
}

.auth-brand-feature:hover {
    background: rgba(255,255,255,0.14);
}

.auth-brand-feature i {
    font-size: 1.15rem;
    color: #93c5fd;
    flex-shrink: 0;
}

.auth-brand-company {
    font-size: 0.82rem;
    opacity: 0.6;
    margin: 0;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* --- Right: Form panel --- */
.auth-form-panel {
    flex: 1 1 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background: #f0f4f8;
}

.auth-card-modern {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 40px rgba(30,58,95,0.10);
    overflow: hidden;
}

.auth-mobile-logo {
    display: none;
    text-align: center;
    padding: 28px 0 0;
}

.auth-mobile-logo img {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.auth-card-header {
    text-align: center;
    padding: 30px 30px 0;
}

.auth-card-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 6px;
}

.auth-card-header p {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0;
}

.auth-card-body {
    padding: 24px 30px 10px;
}

/* Tab switcher */
.auth-tabs {
    display: flex;
    gap: 6px;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 5px;
    margin-bottom: 24px;
}

.auth-tab {
    flex: 1;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 10px 8px;
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.auth-tab i {
    font-size: 1rem;
}

.auth-tab.active {
    background: #fff;
    color: #2563eb;
    box-shadow: 0 2px 8px rgba(37,99,235,0.15);
}

.auth-tab:hover:not(.active) {
    color: #1e40af;
}

/* Form fields */
.auth-field {
    margin-bottom: 18px;
}

.auth-field .form-label {
    font-weight: 600;
    font-size: 0.82rem;
    color: #475569;
    margin-bottom: 7px;
}

.auth-field .form-label i {
    color: #2563eb;
    margin-right: 4px;
}

.auth-input-group .form-control {
    border-radius: 10px 0 0 10px;
}

.auth-input-group .auth-toggle-pw {
    border-radius: 0 10px 10px 0;
    border-color: #cbd5e1;
    color: #64748b;
}

.auth-input-group .auth-toggle-pw:hover {
    color: #2563eb;
    background: #f8fafc;
}

.auth-field .form-control {
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    padding: 11px 14px;
    font-size: 0.92rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-field .form-control:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.auth-submit-btn {
    border-radius: 10px !important;
    font-weight: 700 !important;
    padding: 12px !important;
    font-size: 0.95rem !important;
    letter-spacing: 0.3px;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.auth-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(37,99,235,0.28);
}

.auth-forgot-link {
    color: #64748b !important;
    font-weight: 500;
    transition: color 0.2s ease;
}

.auth-forgot-link:hover {
    color: #2563eb !important;
}

/* Card footer */
.auth-card-footer {
    padding: 16px 30px 26px;
    text-align: center;
    border-top: 1px solid #f1f5f9;
}

.auth-footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-bottom: 14px;
}

.auth-footer-links a {
    font-size: 0.82rem;
    color: #64748b;
    font-weight: 500;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.auth-footer-links a:hover {
    color: #2563eb;
}

.auth-copyright {
    font-size: 0.76rem;
    color: #94a3b8;
    margin: 0;
}

/* --- Responsive: hide branding panel on small screens --- */
@media (max-width: 991px) {
    .auth-brand-panel {
        display: none;
    }
    .auth-form-panel {
        flex: 1 1 100%;
        padding: 30px 18px;
    }
    .auth-mobile-logo {
        display: block;
    }
    .auth-card-header {
        padding-top: 8px;
    }
}

@media (max-width: 480px) {
    .auth-card-modern {
        box-shadow: none;
        border-radius: 0;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    .auth-form-panel {
        padding: 16px;
    }
    .auth-card-header,
    .auth-card-body,
    .auth-card-footer {
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* Legacy compatibility (keep for any other auth views that still use old classes) */
.auth-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow: hidden;
    width: 100%;
    max-width: 440px;
}

.auth-header {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    color: #fff;
    padding: 30px 20px;
    text-align: center;
}

.auth-header h1 {
    font-size: 1.8rem;
    margin: 0;
    font-weight: 700;
}

.auth-header p {
    margin: 5px 0 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

.auth-body {
    padding: 30px;
}

.auth-footer {
    text-align: center;
    padding: 15px;
    border-top: 1px solid #eee;
    background: #f8fafc;
    font-size: 0.85rem;
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

/* Form styles */
.form-control {
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 10px 14px;
    font-size: 0.95rem;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 6px;
    color: #444;
}

.btn {
    border-radius: 8px;
    font-weight: 600;
    padding: 10px 24px;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* Cards */
.ecams-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.ecams-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Stats cards */
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 18px 14px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: transform 0.2s;
    border: 1px solid #e2e8f0;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.stat-card .stat-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.stat-card .stat-value {
    font-size: 2.4rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
    word-break: break-word;
}

.stat-card .stat-label {
    font-size: 1rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 8px;
}

.stat-card.bg-primary { background: #dbeafe; border-color: #bfdbfe; }
.stat-card.bg-success { background: #dcfce7; border-color: #bbf7d0; }
.stat-card.bg-warning { background: #fef3c7; border-color: #fde68a; }
.stat-card.bg-danger { background: #fee2e2; border-color: #fecaca; }
.stat-card.bg-info { background: #cffafe; border-color: #a5f3fc; }

/* Issue #13: Compact modern dashboard stat cards (~35% smaller) */
.stat-mini {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    height: 100%;
}
.stat-mini:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
}
.stat-mini .stat-mini-icon {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.25rem;
    line-height: 1;
}
.stat-mini .stat-mini-body {
    flex: 1 1 auto;
    min-width: 0;
}
.stat-mini .stat-mini-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.05;
}
.stat-mini .stat-mini-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Tinted icon backgrounds (modern, soft) */
.stat-mini.tint-green   .stat-mini-icon { background: #dcfce7; color: #16a34a; }
.stat-mini.tint-amber   .stat-mini-icon { background: #fef3c7; color: #d97706; }
.stat-mini.tint-cyan    .stat-mini-icon { background: #cffafe; color: #0891b2; }
.stat-mini.tint-orange  .stat-mini-icon { background: #ffedd5; color: #ea580c; }
.stat-mini.tint-blue    .stat-mini-icon { background: #dbeafe; color: #2563eb; }
.stat-mini.tint-violet  .stat-mini-icon { background: #ede9fe; color: #7c3aed; }
.stat-mini.tint-emerald .stat-mini-icon { background: #d1fae5; color: #059669; }
.stat-mini.tint-rose    .stat-mini-icon { background: #ffe4e6; color: #e11d48; }
.stat-mini.tint-yellow  .stat-mini-icon { background: #fef9c3; color: #ca8a04; }
.stat-mini.tint-slate   .stat-mini-icon { background: #f1f5f9; color: #475569; }
.stat-mini.tind-indigo  .stat-mini-icon { background: #e0e7ff; color: #4f46e5; }
.stat-mini.tint-indigo  .stat-mini-icon { background: #e0e7ff; color: #4f46e5; }
@media (max-width: 768px) {
    .stat-mini .stat-mini-value { font-size: 1.25rem; }
    .stat-mini .stat-mini-icon { width: 38px; height: 38px; font-size: 1.1rem; }
}
@media (max-width: 480px) {
    .stat-mini { padding: 10px 12px; gap: 10px; }
    .stat-mini .stat-mini-value { font-size: 1.15rem; }
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table th {
    background: #f8fafc;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    font-weight: 700;
}

.table td {
    vertical-align: middle;
}

/* Round-4 #3: Sortable table headers + wider tables to prevent header wrapping */
.table th {
    white-space: nowrap;
}
.sortable-th {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background 0.15s ease;
}
.sortable-th:hover {
    background: #e2e8f0 !important;
}
.sortable-th .sort-indicator {
    font-size: 0.7rem;
    margin-left: 2px;
    color: #2563eb;
}
/* Widen data tables inside cards so headers don't wrap */
.table-responsive {
    overflow-x: auto;
}
.table-responsive > .table {
    width: 100%;
    min-width: 760px;
}
/* Allow the last column (usually Actions) and narrow columns to wrap content
   but keep headers on one line */
.table td {
    word-break: break-word;
}

/* Badges */
.badge-status-present { background: #16a34a; color: #fff; }
.badge-status-late { background: #f59e0b; color: #fff; }
.badge-status-half-day { background: #8b5cf6; color: #fff; }
.badge-status-absent { background: #dc2626; color: #fff; }
.badge-status-incomplete { background: #64748b; color: #fff; }
.badge-mode-office { background: #2563eb; color: #fff; }
.badge-mode-wfh { background: #0891b2; color: #fff; }
.badge-mode-field { background: #f59e0b; color: #fff; }

/* Attendance page */
.attendance-wrapper {
    max-width: 900px;
    margin: 0 auto;
}

.location-frame {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    margin: 0;
    position: relative;
    background: #f8fafc;
}

#mapFrame {
    width: 100%;
    max-width: 320px;
    height: auto;
    aspect-ratio: 4/3;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    display: block;
    margin: 0 auto;
}

.location-frame {
    text-align: center;
}

.camera-container {
    text-align: center;
}

#cameraContainer {
    position: relative;
    text-align: center;
}

#cameraStream {
    width: 100%;
    max-width: 320px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    display: block;
    margin: 0 auto;
    aspect-ratio: 4/3;
    object-fit: cover;
    background: #1e293b;
    /* Mirror the live preview so it feels natural (like a selfie mirror) */
    transform: scaleX(-1);
}

/* Face detection overlay — must match the mirrored video */
#cameraContainer > canvas,
.ecams-face-overlay {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(-1);
    max-width: 320px;
    width: 100%;
    border-radius: 12px;
    pointer-events: none;
    z-index: 10;
}

/* Profile face-signature overlay: sized to match the 320px selfie video */
#fsCameraContainer {
    position: relative;
    text-align: center;
}
#fsCameraContainer .ecams-face-overlay,
.ecams-fs-overlay {
    max-width: 320px;
}

#selfieCanvas {
    display: none;
}

.selfie-preview {
    width: 100%;
    max-width: 320px;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid #16a34a;
    margin: 0 auto;
    display: block;
}

.work-mode-selector .btn {
    margin: 5px;
    padding: 12px 20px;
}

.work-mode-selector .btn.active {
    background: var(--primary);
    color: #fff;
}

/* Calendar */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.calendar-day {
    aspect-ratio: 1;
    border-radius: 8px;
    padding: 8px;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.calendar-day.today {
    border: 2px solid var(--primary);
    font-weight: 700;
}

.calendar-day.present { background: #dcfce7; color: #166534; }
.calendar-day.late { background: #fef3c7; color: #92400e; }
.calendar-day.half-day { background: #ede9fe; color: #5b21b6; }
.calendar-day.absent { background: #fee2e2; color: #991b1b; }
.calendar-day.on-leave { background: #dbeafe; color: #1e40af; }
.calendar-day.holiday { background: #fef9c3; color: #854d0e; border: 2px solid #facc15; }
.calendar-day.week-off { background: #f1f5f9; color: #64748b; border: 1px dashed #cbd5e1; }
.calendar-day.no-record { background: #f1f5f9; color: #94a3b8; }

.calendar-day .day-num {
    font-weight: 700;
    margin-bottom: 2px;
}

.calendar-day .day-status {
    font-size: 0.7rem;
}

/* Responsive */
@media (max-width: 768px) {
    .ecams-content {
        padding: 15px;
    }

    .stat-card .stat-value {
        font-size: 1.3rem;
    }

    .stat-card .stat-icon {
        font-size: 1.4rem;
    }

    .ecams-navbar .navbar-brand {
        font-size: 1.1rem;
    }

    .ecams-navbar .nav-link {
        font-size: 0.85rem;
    }

    #mapFrame {
        max-width: 260px;
    }

    #cameraStream {
        max-width: 260px;
    }

    /* Item R39-31: keep the face-detection overlay matched to the shrunken video on mobile */
    #cameraContainer > canvas,
    .ecams-face-overlay {
        max-width: 260px;
    }

    .selfie-preview {
        max-width: 260px;
    }

    .work-mode-selector .btn {
        display: block;
        width: 100%;
        margin: 5px 0;
    }

    .calendar-day {
        font-size: 0.7rem;
        padding: 4px;
    }

    .calendar-day .day-status {
        display: none;
    }

    .table {
        font-size: 0.85rem;
    }

    .table th, .table td {
        padding: 8px 6px;
    }
}

@media (max-width: 480px) {
    .ecams-content {
        padding: 10px;
    }

    .auth-card {
        max-width: 100%;
    }

    .auth-body {
        padding: 20px;
    }

    .stat-card {
        padding: 15px 10px;
    }
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0,0,0,0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Alert animations */
.alert {
    border-radius: 8px;
    border: none;
    padding: 12px 16px;
}

/* Timeline */
.timeline-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.timeline-item:last-child {
    border-bottom: none;
}

.timeline-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
}

.timeline-info {
    flex: 1;
}

.timeline-date {
    font-weight: 700;
    color: #1e293b;
    font-size: 0.95rem;
}

.timeline-meta {
    font-size: 0.8rem;
    color: #64748b;
}

/* Toggle switch */
.form-switch .form-check-input {
    width: 3em;
    height: 1.5em;
    cursor: pointer;
}

/* Selfie frame on attendance */
.selfie-area {
    background: #f8fafc;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
}

/* Punch hero on dashboard */
.punch-hero {
    background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
    border: 1px solid #dbeafe;
}

.punch-btn-main {
    box-shadow: 0 4px 14px rgba(22,163,74,0.3);
    font-size: 1.15rem;
}

.punch-btn-main.btn-danger {
    box-shadow: 0 4px 14px rgba(220,38,38,0.3);
}

.spin-anim {
    animation: spin 0.8s linear;
}

/* ============================================
   Sticky Top Navbar (Round-4 #7)
   The menu bar is always fixed at the top of the
   viewport so it remains visible while scrolling.
   ============================================ */

.ecams-navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
}

/* Ensure sticky navbar dropdowns render above page content */
.ecams-navbar .dropdown-menu {
    z-index: 1031;
}


/* ==================== K-AMS Multi-Select Dropdown (Issue #15) ==================== */
.ecams-multiselect {
    position: relative;
}

.ecams-ms-toggle {
    cursor: pointer;
    min-height: 38px;
    background-color: #fff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.ecams-multiselect.ecams-ms-open .ecams-ms-toggle {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.ecams-ms-toggle .ecams-ms-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.ecams-ms-toggle .ecams-ms-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    flex: 1;
    overflow: hidden;
}

.ecams-ms-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #0d6efd;
    color: #fff;
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 1rem;
    white-space: nowrap;
    line-height: 1.4;
}

.ecams-ms-chip .ecams-ms-chip-x {
    cursor: pointer;
    font-weight: bold;
    opacity: 0.8;
}

.ecams-ms-chip .ecams-ms-chip-x:hover {
    opacity: 1;
}

.ecams-ms-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1060;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    margin-top: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    max-height: 320px;
    overflow: hidden;
    display: none;
    flex-direction: column;
}

.ecams-multiselect.ecams-ms-open .ecams-ms-dropdown {
    display: flex;
}

.ecams-ms-options {
    overflow-y: auto;
    max-height: 220px;
}

.ecams-ms-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.1s;
    margin: 0;
}

.ecams-ms-option:hover {
    background-color: #f8f9fa;
}

.ecams-ms-option input[type="checkbox"] {
    flex-shrink: 0;
    margin: 0;
}

.ecams-ms-option.ecams-ms-hidden {
    display: none;
}

.ecams-ms-actions a {
    font-size: 0.8rem;
    color: #0d6efd;
}

.ecams-ms-actions a:hover {
    text-decoration: underline !important;
}

.ecams-ms-no-results {
    padding: 12px;
    text-align: center;
    color: #6c757d;
    font-size: 0.85rem;
}

/* ==================== Issue #12: Mobile View Improvements ==================== */
/* Ensure all containers respect viewport width on mobile */
@media (max-width: 768px) {
    .ecams-content {
        padding: 12px 10px;
        overflow-x: hidden;
    }

    /* Make all cards full-width with proper margins */
    .ecams-card,
    .card {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* Ensure tables scroll horizontally instead of overflowing */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    .table {
        min-width: 500px;
        font-size: 0.82rem;
    }

    .table th, .table td {
        padding: 6px 4px;
        white-space: nowrap;
    }

    .table th:first-child, .table td:first-child {
        white-space: normal;
    }

    /* Fix filter forms to stack vertically */
    .row.g-2 > [class*="col-"],
    .row.g-3 > [class*="col-"] {
        margin-bottom: 8px;
    }

    /* Buttons should not exceed container width on mobile */
    .btn-group .btn,
    .d-flex .btn {
        white-space: nowrap;
    }

    /* Make modals full-width on mobile */
    .modal-dialog {
        margin: 8px;
        max-width: calc(100% - 16px);
    }

    .modal-body {
        padding: 12px;
    }

    /* Stat cards: 1 or 2 per row on mobile */
    .col-md-3, .col-lg-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .col-md-2 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    /* Headings smaller on mobile */
    h1, .h3 {
        font-size: 1.3rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    /* Ensure form controls don't overflow */
    .form-control, .form-select {
        max-width: 100%;
    }

    /* Flex utilities wrap on mobile */
    .d-flex.gap-2,
    .d-flex.gap-3 {
        flex-wrap: wrap;
        gap: 8px !important;
    }

    /* Quick action buttons wrap and don't overflow */
    .d-flex.flex-wrap {
        gap: 6px;
    }

    /* Calendar improvements */
    .attendance-calendar {
        overflow-x: auto;
    }

    .calendar-grid {
        min-width: 280px;
    }

    /* Badge text smaller on mobile */
    .badge {
        font-size: 0.7rem;
        font-weight: 500;
    }

    /* Alert text smaller */
    .alert {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    /* Nav tabs scrollable on mobile */
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

    .nav-tabs .nav-link {
        white-space: nowrap;
        padding: 8px 12px;
    }

    /* Dropdown menus full width on mobile */
    .dropdown-menu {
        min-width: 200px;
        max-width: 280px;
    }

    /* Progress bars full width */
    .progress {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .ecams-content {
        padding: 8px 6px;
    }

    /* Single column on very small screens */
    .col-md-2, .col-md-3, .col-lg-3, .col-lg-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .stat-card {
        padding: 12px 8px;
    }

    .stat-card .stat-value {
        font-size: 1.1rem;
    }

    /* Buttons full-width on tiny screens for better touch targets */
    .btn-group-sm .btn,
    .btn-sm {
        padding: 4px 10px;
        font-size: 0.78rem;
    }

    /* Tables even smaller */
    .table {
        font-size: 0.78rem;
    }

    .table th, .table td {
        padding: 4px 3px;
    }
}

/* ==================== Issue #18: Design Fixes — Prevent Overflow ==================== */

/* Ensure all buttons and elements stay within their container bounds */
.btn {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Allow button text to wrap in narrow containers */
.btn-sm .bi + span,
.btn .bi + span {
    display: inline;
}

/* Prevent card content from exceeding bounds */
.ecams-card,
.card-body {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

/* Ensure long text in table cells wraps properly */
.table td {
    word-break: break-word;
}

/* Badge should not overflow its container */
.badge {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: middle;
}

/* Ensure form-select dropdowns don't exceed container */
.form-select {
    width: 100%;
}

/* Action button groups should wrap and not overflow */
.btn-group,
.btn-toolbar {
    flex-wrap: wrap;
}

/* Fix for filter form row not exceeding bounds */
form .row {
    max-width: 100%;
}

/* Ensure code blocks and pre don't overflow */
pre, code {
    white-space: pre-wrap;
    word-break: break-word;
}

/* Alert text wrapping */
.alert {
    overflow-wrap: break-word;
}

/* Card title should not overflow */
.ecams-card-title,
.card-title {
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Ensure image/img elements are responsive */
img {
    max-width: 100%;
    height: auto;
}

/* Table action column buttons should not overflow */
.table .btn-group {
    display: inline-flex;
    flex-wrap: nowrap;
}

.table .btn-group .btn {
    white-space: nowrap;
    overflow: visible;
}

/* Prevent horizontal scrollbar from button groups in tables */
.table-responsive .btn {
    font-size: 0.78rem;
}

/* Multi-select dropdown should not exceed container */
.ecams-multiselect {
    max-width: 100%;
}

.ecams-ms-dropdown {
    max-width: 100%;
    min-width: 200px;
}

/* Ensure flex containers don't overflow */
.d-flex {
    max-width: 100%;
}

/* Container-fluid should not cause horizontal scroll */
.container-fluid {
    padding-left: 12px;
    padding-right: 12px;
}

@media (min-width: 769px) {
    .container-fluid {
        padding-left: 24px;
        padding-right: 24px;
    }
}

/* Round-7.1: Beautified dashboard filter bar */
.dash-filter-wrap {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

.dash-filter-header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #fff;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: opacity 0.2s;
}

.dash-filter-header:hover {
    opacity: 0.95;
}

.dash-filter-header .dash-filter-title {
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dash-filter-header .dash-filter-count {
    background: rgba(255,255,255,0.25);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 0.72rem;
    font-weight: 600;
}

.dash-filter-body {
    padding: 16px 18px 12px;
}

.dash-filter-field {
    margin-bottom: 8px;
}

/* UI-R2: Equal-sized filter fields with consistent height */
.dash-filter-grid .dash-filter-field {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.dash-filter-grid .dash-filter-field label {
    min-height: 1.1rem;
}

.dash-filter-grid .dash-filter-field .form-control,
.dash-filter-grid .dash-filter-field .form-select {
    flex: 1;
    min-height: 36px;
}

.dash-filter-field label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.dash-filter-field .form-control,
.dash-filter-field .form-select {
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    font-size: 0.82rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.dash-filter-field .form-control:focus,
.dash-filter-field .form-select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 0.18rem rgba(99,102,241,0.15);
}

.dash-quick-date {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    background: #e0e7ff;
    color: #4338ca;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.dash-quick-date:hover {
    background: #c7d2fe;
    color: #3730a3;
    text-decoration: none;
}

.dash-quick-date.active {
    background: #4f46e5;
    color: #fff;
}

.dash-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.dash-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px 3px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    background: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
    text-decoration: none;
    transition: all 0.2s;
}

.dash-filter-chip:hover {
    background: #e0e7ff;
    text-decoration: none;
    color: #3730a3;
}

.dash-filter-chip .chip-close {
    font-size: 0.85rem;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.dash-filter-chip:hover .chip-close {
    opacity: 1;
}

.dash-filter-chip.status-present  { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.dash-filter-chip.status-late     { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.dash-filter-chip.status-absent   { background: #ffe4e6; color: #be123c; border-color: #fecdd3; }
.dash-filter-chip.status-incomplete { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.dash-filter-chip.status-half_day { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }
.dash-filter-chip.mode-office     { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }
.dash-filter-chip.mode-wfh        { background: #cffafe; color: #0e7490; border-color: #a5f3fc; }
.dash-filter-chip.mode-field      { background: #ffedd5; color: #c2410c; border-color: #fed7aa; }

.dash-filter-btn-apply {
    border-radius: 8px;
    font-weight: 600;
    padding: 6px 20px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border: none;
    transition: opacity 0.2s, transform 0.1s;
}

.dash-filter-btn-apply:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

.dash-filter-btn-reset {
    border-radius: 8px;
    font-weight: 600;
    padding: 6px 16px;
    border: 1px solid #cbd5e1;
    color: #64748b;
    transition: all 0.2s;
}

.dash-filter-btn-reset:hover {
    background: #f1f5f9;
    color: #334155;
}

.dash-filter-collapse-icon {
    transition: transform 0.3s;
}

.dash-filter-collapse-icon.collapsed {
    transform: rotate(-90deg);
}


/* ===================================================================
   ECAMS Reusable Filter Bar + Polished Table (v8)
   Based on the dashboard filter design — applied to all admin list pages
   =================================================================== */

/* --- Filter wrapper (collapsible, gradient header) --- */
.ecams-filter-wrap {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}

.ecams-filter-header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #fff;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: opacity 0.2s;
}

.ecams-filter-header:hover {
    opacity: 0.95;
}

.ecams-filter-header .ecams-filter-title {
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ecams-filter-header .ecams-filter-count {
    background: rgba(255,255,255,0.25);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 0.72rem;
    font-weight: 600;
}

.ecams-filter-body {
    padding: 16px 18px 12px;
}

/* Equal-sized filter fields with consistent height */
.ecams-filter-grid .ecams-filter-field {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ecams-filter-grid .ecams-filter-field label {
    min-height: 1.1rem;
}

.ecams-filter-grid .ecams-filter-field .form-control,
.ecams-filter-grid .ecams-filter-field .form-select {
    flex: 1;
    min-height: 36px;
}

/* Issue (Reports filter alignment): keep the multi-select toggle aligned
   with sibling single-input fields so all filter rows line up neatly. */
.ecams-filter-grid .ecams-filter-field .ecams-multiselect {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.ecams-filter-grid .ecams-filter-field .ecams-ms-toggle {
    flex: 1;
    min-height: 36px;
}

.ecams-filter-field {
    margin-bottom: 8px;
}

.ecams-filter-field label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ecams-filter-field .form-control,
.ecams-filter-field .form-select {
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    font-size: 0.82rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ecams-filter-field .form-control:focus,
.ecams-filter-field .form-select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 0.18rem rgba(99,102,241,0.15);
}

/* Apply / Reset buttons */
.ecams-filter-btn-apply {
    border-radius: 8px;
    font-weight: 600;
    padding: 6px 20px;    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border: none;
    color: #fff;
    transition: opacity 0.2s, transform 0.1s;
}

.ecams-filter-btn-apply:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    color: #fff;
}

.ecams-filter-btn-reset {
    border-radius: 8px;
    font-weight: 600;
    padding: 6px 16px;
    border: 1px solid #cbd5e1;
    color: #64748b;
    background: #fff;
    transition: all 0.2s;
}

.ecams-filter-btn-reset:hover {
    background: #f1f5f9;
    color: #334155;
}

.ecams-filter-collapse-icon {
    transition: transform 0.3s;
}

.ecams-filter-collapse-icon.collapsed {
    transform: rotate(-90deg);
}

/* Bulk action bar (R8) */
.ecams-bulk-bar {
    border-color: #e2e8f0 !important;
}
.ecams-bulk-bar #bulkAction optgroup,
.ecams-bulk-bar #bulkValue optgroup {
    font-style: normal;
    font-weight: 600;
    color: #4f46e5;
}
.ecams-bulk-bar #bulkValue {
    border-color: #c7d2fe;
}

/* Active filter chips */
.ecams-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.ecams-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px 3px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    background: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
    text-decoration: none;
    transition: all 0.2s;
}

.ecams-filter-chip:hover {
    background: #e0e7ff;
    text-decoration: none;
    color: #3730a3;
}

.ecams-filter-chip .chip-close {
    font-size: 0.85rem;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.ecams-filter-chip:hover .chip-close {
    opacity: 1;
}

/* --- Polished data table --- */
.ecams-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 0;
    font-size: 0.85rem;
}

.ecams-table thead th {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #f1f5f9;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 10px 14px;
    border: none;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 5;
}

.ecams-table thead th:first-child {
    border-top-left-radius: 10px;
}

.ecams-table thead th:last-child {
    border-top-right-radius: 10px;
}

.ecams-table thead th.sortable-th:hover {
    background: linear-gradient(135deg, #312e81 0%, #4338ca 100%) !important;
}

.ecams-table thead th.sortable-th .sort-indicator {
    color: #a5b4fc;
}

.ecams-table tbody td {
    padding: 9px 14px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.ecams-table tbody tr {
    transition: background 0.15s ease;
}

.ecams-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.ecams-table tbody tr:hover {
    background: #eef2ff !important;
}

.ecams-table tbody tr:last-child td {
    border-bottom: none;
}

/* Table wrapped in a styled container with rounded corners + shadow */
.ecams-table-wrap {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.ecams-table-wrap .table-responsive {
    border-radius: 12px;
}

/* Smaller variant for compact tables */
.ecams-table-sm thead th {
    padding: 7px 10px;
    font-size: 0.72rem;
}

.ecams-table-sm tbody td {
    padding: 6px 10px;
    font-size: 0.8rem;
}

/* R8 Issue 1: Compact table that fits all columns without horizontal scroll.
   Overrides the global .table-responsive > .table { min-width: 760px } rule
   which forces narrow tables to scroll. Used by the Recent Manual Punches
   table so all 7 columns (Employee, Date, Time, Type, Mode, By, Actions)
   display within the card without a horizontal scrollbar. */
.ecams-table-compact {
    width: 100%;
    min-width: auto !important;
    table-layout: auto;
}
.ecams-table-compact thead th,
.ecams-table-compact tbody td {
    white-space: nowrap;
}
/* Let the Employee column (widest, has two lines) and the By column wrap if needed */
.ecams-table-compact thead th:first-child,
.ecams-table-compact tbody td:first-child {
    white-space: normal;
}
/* Tighter horizontal padding so columns pack together */
.ecams-table-compact thead th {
    padding-left: 10px;
    padding-right: 10px;
}
.ecams-table-compact tbody td {
    padding-left: 10px;
    padding-right: 10px;
}

/* R8 Issue 1: Keep the Record Manual Punch form card pinned while the
   longer recent-punches table scrolls alongside it. */
@media (min-width: 992px) {
    .ecams-card-sticky {
        position: sticky;
        top: 20px;
    }
}

/* Mobile responsiveness for filter grid */
@media (max-width: 576px) {
    .ecams-filter-header {
        padding: 8px 12px;
    }
    .ecams-filter-body {
        padding: 12px;
    }
    .ecams-filter-field label {
        font-size: 0.68rem;
    }
}

/* ============================================================
   R38 PHASE 4 — Notifications & UI/Layout
   ============================================================ */

/* Item R38-18: persistent recent-notification list with unread highlight */
.notif-recent-list .notif-item {
    white-space: normal;
    border-left: 3px solid transparent;
    transition: background-color 0.15s ease;
}
.notif-recent-list .notif-item.notif-unread {
    background-color: rgba(13, 110, 253, 0.07);
    border-left-color: #0d6efd;
}
.notif-recent-list .notif-item.notif-read {
    opacity: 0.75;
}
.notif-recent-list .notif-item:hover {
    background-color: rgba(13, 110, 253, 0.12);
}

/* Item R38-16: floating "bubble" toast for newly-arrived notifications */
.ecams-notif-bubble {
    position: fixed;
    top: 70px;
    right: 18px;
    z-index: 1080;
    min-width: 280px;
    max-width: 360px;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
    border-left: 4px solid #0d6efd;
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.18);
    padding: 12px 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    animation: ecamsNotifSlideIn 0.35s cubic-bezier(0.21, 1.02, 0.73, 1);
}
.ecams-notif-bubble:hover {
    box-shadow: 0 10px 34px rgba(0,0,0,0.24);
}
.ecams-notif-bubble .bubble-icon {
    color: #0d6efd;
    font-size: 1.25rem;
    line-height: 1;
    margin-top: 2px;
}
.ecams-notif-bubble .bubble-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: #212529;
}
.ecams-notif-bubble .bubble-msg {
    font-size: 0.78rem;
    color: #6c757d;
    margin-top: 2px;
}
.ecams-notif-bubble .bubble-close {
    margin-left: auto;
    color: #adb5bd;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.ecams-notif-bubble.ecams-notif-hide {
    animation: ecamsNotifSlideOut 0.3s ease forwards;
}
@keyframes ecamsNotifSlideIn {
    from { transform: translateX(120%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}
@keyframes ecamsNotifSlideOut {
    from { transform: translateX(0);    opacity: 1; }
    to   { transform: translateX(120%); opacity: 0; }
}

/* Item R38-21: brand logo size & positioning.
   Slightly larger, vertically centred, with a subtle text brand fallback. */
.ecams-navbar .navbar-brand {
    padding-top: 0;
    padding-bottom: 0;
}
.ecams-navbar .navbar-logo {
    height: 40px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    border-radius: 6px;
    display: block;
}
@media (max-width: 991.98px) {
    .ecams-navbar .navbar-logo {
        height: 34px;
        max-width: 150px;
    }
}

/* Item R39-12: Policy editor font & design (light touch) */
.policy-editor {
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #212529;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.policy-editor:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.policy-editor h2 { font-size: 1.4rem; font-weight: 700; margin: 0.6em 0 0.4em; }
.policy-editor h3 { font-size: 1.15rem; font-weight: 600; margin: 0.6em 0 0.4em; }
.policy-editor p { margin: 0 0 0.6em; }
.policy-editor ul, .policy-editor ol { padding-left: 1.4em; margin: 0 0 0.6em; }
.policy-toolbar { gap: 4px; }
.policy-toolbar .btn { padding: 4px 8px; }

/* R51: Use plain numeric inputs throughout the SaaS UI; remove browser spinner arrows. */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}
