html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

button {
    background-color: #336699;
    border-radius: 4px;
    border: 2px solid #336699;
    display: inline-block;
    cursor: pointer;
    color: #fff;
    font-weight: bold;
    font-family: Arial;
    font-size: 12px;
    padding: 4px 12px;
    text-decoration: none;
    text-shadow: 0px 0px 5px #283966;
}

    button:disabled {
        background-color: #cccccc; /* light gray */
        border: 2px solid #999999; /* darker gray border */
        color: #666666; /* gray text */
        cursor: not-allowed;
        text-shadow: none;
        filter: none; /* remove gradient/filter effects */
    }

    button:hover, button:active {
        background-color: #2a5580 !important;
        border-color: #2a5580 !important;
        color: #fff !important;
    }

        button:focus, button:active:focus, .form-control:focus, .form-check-input:focus {
            box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
        }

html, body {
    height: 100%;
    margin: 0;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ── Table header ───────────────────────────────────────────── */
.TableHeader {
    background-color: #336699;
    color: white;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    border-radius: 10px 10px 0px 0px;
    white-space: nowrap;
    padding: 0.5rem 1rem;
}

/* ── Row header ─────────────────────────────────────────────── */
.RowHeader {
    background-color: #dde4ec;
    text-align: right;
    font-size: 0.9rem;
    font-weight: bold;
    white-space: nowrap;
    padding-right: 0.5rem;
    flex-shrink: 0;
}

/* ── App shell ─────────────────────────────────────────────── */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
    width: 200px;
    flex-shrink: 0;
    background-color: #336699;
    color: #fff;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 1rem 1rem 0.75rem;
    border-bottom: 1px solid #2a5580;
}

.sidebar-brand {
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
}

    .sidebar-brand:hover {
        color: #dee2e6;
    }

.sidebar-logo {
    max-width: 100%;
    max-height: 60px;
    display: block;
    margin: 0 auto;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: #fff;
    position: absolute;
    right: 0.75rem;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 0.25rem;
}

/* ── Sidebar menu (Level-1 items) ───────────────────────────── */
.sidebar-menu {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
}

.sidebar-menu-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.4rem 1rem;
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: bold;
    transition: background 0.15s;
}

    .sidebar-menu-link:hover {
        background-color: #2a5580;
        color: #fff;
    }

.sidebar-menu-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
}

    .sidebar-menu-link.active {
        background-color: #dde4ec;
        color: #000;
    }

/* ── Sidebar section placeholders (Recent Visits, Quick Menu) ─ */
.sidebar-section {
    padding: 0.6rem 1rem 0.25rem;
    margin-top: 0.75rem;
    border-top: 1px solid #2a5580;
}

.sidebar-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #adc8e8;
    letter-spacing: 0.05em;
}

/* ── Navigation page ────────────────────────────────────────── */
.nav-page-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #336699;
    margin-bottom: 1.25rem;
}

.nav-section {
    margin-bottom: 2rem;
}

.nav-section-header {
    font-size: 0.95rem;
    font-weight: 700;
    color: #336699;
    padding-bottom: 0.3rem;
    margin-bottom: 0.75rem;
    border-bottom: 2px solid #336699;
}

    .nav-section-header--blank {
        border-bottom-color: #dde4ec;
    }

/* ── Nav cards (Level-3 items) ──────────────────────────────── */
.nav-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.nav-card {
    width: 160px;
    min-height: 80px;
    border: 2px solid #336699;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.2);
}

.nav-card-title {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background-color: #fff;
    color: #336699;
    font-weight: 700;
    font-size: 0.9rem;
    transition: background 0.15s;
    border-radius: 3px;
    flex: 1;
}

.nav-card--link .nav-card-title:hover,
.nav-card-title.has-submenu:hover {
    background-color: #dde4ec;
}

.nav-card-title.has-submenu {
    position: relative;
    cursor: pointer;
    flex: none;
}

.nav-card-desc {
    font-size: 0.75rem;
    font-weight: normal;
    color: #666;
    margin-top: 0.2rem;
}

/* ── Nav card sub-menu (Level-4 items) ──────────────────────── */
.nav-card-submenu {
    display: none;
    list-style: none;
    margin: 0;
    padding: 0;
    background-color: #f5f8fc;
    border: 1px solid #336699;
    position: absolute;
    top: 100%;
    left: -2px;
    width: calc(100% + 4px);
    z-index: 100;
    box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.2);
}

    .nav-card-submenu.show {
        display: block;
    }

.nav-card-submenu-link {
    display: block;
    padding: 0.3rem 0.75rem;
    font-size: 0.85rem;
    color: #336699;
    text-decoration: none;
}

    .nav-card-submenu-link:hover {
        background-color: #dde4ec;
    }

    .nav-card-submenu-link--plain {
        cursor: default;
        color: #555;
    }

/* ── Content wrapper ────────────────────────────────────────── */
.content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #dee2e6;
    min-height: 2.75rem;
    display: flex;
    align-items: center;
}

.main-content {
    flex: 1;
    padding: 1.5rem;
}

/* ── Mobile: sidebar off-canvas ─────────────────────────────── */
.sidebar-open-btn {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

@media (max-width: 767.98px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        height: 100%;
    }

        .sidebar.show {
            transform: translateX(0);
        }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
    }

        .sidebar-overlay.show {
            display: block;
        }
}

@media (min-width: 768px) {
    .sidebar-open-btn {
        display: none;
    }
}
