/* =========================================================
   GLOBAL RESET & BASE TYPOGRAPHY
   ========================================================= */
   html, body {
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: #000;
    background: #fff;
}

h1, h2, h3, h4 {
    margin: 0 0 12px 0;
    font-weight: bold;
}

p {
    margin: 0 0 12px 0;
}

/* =========================================================
   UTILITY CLASSES
   ========================================================= */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-left { text-align: left; }

.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; justify-content: center; align-items: center; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }

.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

.hidden { display: none !important; }

header .user-initials {
    flex: 0 0 auto !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    background-color: #0d6efd !important;
    color: white !important;
    font-size: 0.85rem !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-transform: uppercase !important;
}

.login-wrapper {
    min-height: calc(100vh - 120px); /* adjust if your header is taller/shorter */
    padding-top: 10px;               /* optional small breathing room */
}

/* =========================================================
   RESPONSIVE TABLES (GLOBAL)
   ========================================================= */
/* Desktop: unchanged */
.responsive-table {
    width: 100%;
    border-collapse: collapse;
}

/* Mobile: stack rows */
@media (max-width: 768px) {
    .responsive-table,
    .responsive-table thead,
    .responsive-table tbody,
    .responsive-table th,
    .responsive-table td,
    .responsive-table tr {
        display: block;
        width: 100%;
    }

    .responsive-table tr {
        margin-bottom: 12px;
        border-bottom: 1px solid #ddd;
        padding-bottom: 8px;
    }

    .responsive-table td {
        text-align: left !important;
        padding: 6px 0;
    }

    .responsive-table colgroup {
        display: none;
    }
}

/* =========================================================
   SECTION / CARD SYSTEM (GLOBAL)
   ========================================================= */
.section-card {
    border: 1px solid #ccc;
    border-radius: 6px;
    margin-bottom: 20px;
    background: #fafafa;
    overflow: hidden;
}

.section-header {
    padding: 12px 14px;
    font-weight: bold;
    background: #f2f2f2;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-body {
    padding: 12px 14px;
}

/* Chevron indicator (optional) */
.section-header::after {
    content: "▾";
    font-size: 14px;
    margin-left: 8px;
}

.section-header.collapsed::after {
    content: "▸";
}

/* =========================================================
   MOBILE SPACING & LAYOUT
   ========================================================= */
@media (max-width: 768px) {
    .mobile-stack {
        display: block !important;
        width: 100% !important;
    }

    .mobile-pad {
        padding: 12px !important;
    }

    .mobile-hide {
        display: none !important;
    }
}

/* =========================================================
   BUTTONS (GLOBAL)
   ========================================================= */
.btn {
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: bold;
}

.btn-primary {
    background: #007bff;
    color: #fff;
}

.btn-secondary {
    background: #e0e0e0;
    color: #000;
}

.btn-danger {
    background: #c62828;
    color: #fff;
}

/* =========================================================
   FORMS (GLOBAL)
   ========================================================= */
input[type="text"],
input[type="number"],
select,
textarea {
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
}

label {
    font-weight: bold;
    margin-bottom: 4px;
    display: block;
}

/* =========================================================
   RESPONSIVE GRID HELPERS
   ========================================================= */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -8px;
}

.col {
    padding: 0 8px;
    flex: 1;
}

@media (max-width: 768px) {
    .col {
        flex: 0 0 100%;
    }
}

/* =========================================================
UNIFIED EMS DASHBOARD SYSTEM
========================================================= */

.ems-dashboard-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding: 10px 0;
}


.ems-dashboard-card {
    display: block;
    background: #fafafa;
    border-radius: 10px;
    padding: 20px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease, transform 0.15s ease;
    margin-bottom: 16px;

    flex: 0 1 280px;
    max-width: 320px;
}

.ems-dashboard-card:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
}

/* FIXED: restore original internal layout */
.ems-dashboard-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ems-dashboard-icon {
    font-size: 2.2rem;
    color: #444 !important;
    opacity: 0.85;
}

.ems-dashboard-title {
    font-size: 1.2rem;
    font-weight: bold;
}

.ems-dashboard-desc {
    font-size: 0.9rem;
    opacity: 0.85;
}

@media (max-width: 768px) {
    .ems-dashboard-grid {
        display: block;
    }

    .ems-dashboard-card {
        padding: 24px;
    }
}

@media (min-width: 769px) {
    .ems-dashboard-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    .ems-dashboard-row {
        flex-direction: column;
        text-align: center;
    }

    .ems-dashboard-icon {
        font-size: 2.6rem;
        margin-bottom: 10px;
        opacity: 1;
    }
}

/* Even smaller screens */
@media (max-width: 480px) {

    .dashboard-card {
        padding: 24px !important;
    }

    .dashboard-icon {
        font-size: 1.6rem !important;
    }

    .dashboard-card .fw-bold {
        font-size: 1.15rem;
    }
}

.chevron-icon {
    transition: transform 0.2s ease;
}

.chevron-icon.rotate {
    transform: rotate(90deg);
}

/* Header */
.ems-header {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.ems-header .logo {
    height: 48px;
}

.ems-title {
    font-size: 1.25rem;
    font-weight: 600;
}

/* Hamburger */
.hamburger-btn {
    padding: 0;
    border: none;
    background: none;
}

.hamburger-icon {
    font-size: 2rem;
    line-height: 1;
}

/* =========================================================
   MOBILE DASHBOARD CARD FIX
   ========================================================= */
   @media (max-width: 768px) {

    /* Remove container padding and flex centering */
    .ems-dashboard-grid {
        padding-left: 0;
        padding-right: 0;
        display: block;              /* keep stacked layout */
    }

    /* Make cards nearly full width */
    .ems-dashboard-card {
        width: calc(100% - 20px);    /* full width minus 10px margin on each side */
        max-width: none;             /* override desktop max-width */
        margin: 10px auto;           /* centers visually */
        flex: none !important;       /* disable flex-basis: 280px */
        box-sizing: border-box;
    }
}

/* =========================================================
   RESPONSIVE HAMBURGER DROPDOWN (FIXED)
   ========================================================= */

/* Desktop: unchanged */
.ems-dropdown {
    min-width: 180px;
}

/* Mobile: correct behavior */
@media (max-width: 576px) {
    .ems-dropdown {
        width: 75vw;               /* let Bootstrap size naturally */
        max-width: 75vw;           /* wide enough to feel intentional */
        right: 0 !important;       /* stay aligned under hamburger */
        left: auto !important;     /* prevents hugging the left */
        transform: none !important;
        border-radius: 0.5rem;     /* clean mobile look */
        margin-top: 30px !important; /* ensures menu does NOT cover hamburger */
    }

    .ems-dropdown .dropdown-item {
        padding: 16px 20px;        /* larger tap targets */
        font-size: 1.15rem;        /* readable on mobile */
    }

    header .user-initials {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    .logout-icon i,
    .login-icon i {
        font-size: 1.1rem !important;
    }
}

.ems-icon-link .ems-dashboard-icon {
    font-size: 1.4rem;
}

@media (min-width: 769px) {
    .ems-icon-link .ems-dashboard-icon {
        font-size: 1.4rem;
    }
}

.bucket-card {
    border: 1px solid #dee2e6;
    border-radius: .5rem;
    overflow: hidden;
}

.bucket-header {
    background: #0d6efd;
    color: #fff;
    padding: .75rem 1rem;
}

.bucket-body {
    background: #fff;
}

/* Base row */
.suite-row {
    padding: 4px 0 4px 20px;
    border-left: 10px solid transparent;
}

/* CLOSED SUITE (oc = 0) — gray bar, dimmed text */
.suite-closed {
    color: #6c757d;
    opacity: 0.65;
    border-left-color: #6c757d !important; /* match header gray */
}

/* OPEN SUITE (oc = 1) — bar color depends on pl */
.suite-prepped {
    border-left-color: #28a745 !important; /* green */
    opacity: 1;
}

.suite-locked {
    border-left-color: #dc3545 !important; /* red */
    opacity: 1;
}

/* Header colors (unchanged) */
.suite-card-open .card-header {
    background-color: #244a7a;
    color: #fff;
}

.suite-card-closed .card-header {
    background-color: #6c757d;
    color: #fff;
    opacity: 0.85;
}

/* Toggle — clean, visible, not overpowering */
.suite-toggle-wrapper .form-check-input {
    transform: scale(1.25);
    cursor: pointer;
}

.suite-toggle-wrapper {
    margin-left: 10px;
}

.staff-columns {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    padding-left: 2rem;   /* shift both columns right */
}
.staff-column {
    flex: 1;
}
.staff-column ul {
    margin: 0;
    padding: 0;
    list-style: none;
}
.staff-column li {
    padding: 2px 0;      /* light spacing */
    border: none;        /* remove all lines */
    font-size: 0.9rem;
}

.icon-bar a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem; /* consistent click target */
    color: #6c757d;   /* matches text-secondary */
}

.icon-bar a i {
    font-size: 1.25rem; /* consistent icon size */
}

.icon-bar {
    gap: 0.5rem; /* even spacing between icons */
}

.ems-toggle {
    width: 120px;          /* guaranteed space for "Inactive" */
    height: 24px;
    border-radius: 14px;
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center; /* centers the label */
    padding: 0 6px;
    transition: background-color 0.25s ease;
    user-select: none;
}

.ems-toggle.on {
    background-color: #28a745; /* green */
}

.ems-toggle.off {
    background-color: #dc3545; /* red */
}

.ems-toggle-handle {
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    transition: left 0.25s ease;
}

/* handle travel tuned for 120px pill */
.ems-toggle.on .ems-toggle-handle {
    left: 96px;
}

.ems-toggle.off .ems-toggle-handle {
    left: 4px;
}

.ems-toggle-label {
    color: white;
    font-weight: 600;
    font-size: 0.70rem;
    z-index: 2;              /* ensures label stays above handle */
    pointer-events: none;    /* prevents click interference */
    white-space: nowrap;     /* prevents wrapping */
}