body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.dashboard-body {
    background: linear-gradient(180deg, #f0f4f8 0%, #e8eef5 100%);
    min-height: 100vh;
}

.navbar-brand span {
    letter-spacing: 0.08em;
}

.bg-deep-blue {
    background: #022b55;
}

.text-deep-blue {
    color: #022b55;
}

.card-dashboard {
    border-radius: 0.8rem;
}

.badge-plan {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Port selector bar */
.port-selector-bar {
    background: #eef2f7;
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 0;
}

.port-select {
    border-radius: 0.5rem;
    border: 1px solid #ced4da;
    font-weight: 500;
}

/* Service cards */
.service-card {
    border-radius: 0.75rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background: #fff;
    cursor: pointer;
}

.service-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1.5rem rgba(2, 43, 85, 0.12) !important;
}

.service-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #022b55 0%, #044078 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.service-card .card-title {
    font-size: 0.95rem;
}

/* Logo sizing */
.navbar-logo {
    height: 2.5rem;
    width: auto;
    object-fit: contain;
}

.landing-logo {
    max-height: 4rem;
    width: auto;
}

.card-logo {
    height: 2.2rem;
    width: auto;
    object-fit: contain;
}

.footer-logo {
    height: 2.5rem;
    width: auto;
    opacity: 0.85;
}

/* Dashboard right slider panel */
.cursor-pointer {
    cursor: pointer;
}

.slider-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.slider-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.slider-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 480px;
    height: 100%;
    background: #fff;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 1050;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    pointer-events: none;
}

.slider-panel.open {
    transform: translateX(0);
    pointer-events: auto;
}

.slider-panel .slider-header {
    flex-shrink: 0;
    background: #f8f9fa;
}

.slider-panel .slider-body {
    flex: 1;
}

/* Minimal landing / login (index.php) */
.landing-simple-body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

.landing-simple-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
}

.landing-simple-card {
    width: 100%;
    max-width: 380px;
    border-radius: 0.75rem;
}

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

/* Admin: left sidebar layout */
.admin-body {
    overflow-x: hidden;
}

.admin-shell {
    align-items: stretch;
}

.admin-sidebar {
    width: 260px;
    min-height: 100vh;
    z-index: 1050;
}

.admin-sidebar-logo,
.admin-sidebar-brand .navbar-logo {
    height: 1.5rem !important;
    max-height: 28px;
    max-width: 100px;
    width: auto !important;
    object-fit: contain;
    flex-shrink: 0;
}

.admin-sidebar-link {
    color: rgba(255, 255, 255, 0.88);
    border-radius: 0.4rem;
    padding: 0.45rem 0.75rem;
    font-size: 0.95rem;
}

.admin-sidebar-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.admin-sidebar-link.active {
    color: #022b55;
    background: #fff;
    font-weight: 600;
}

.admin-sidebar-footer .dropdown-menu {
    z-index: 1060;
}

.admin-main-wrap > main {
    flex: 1 1 auto;
    min-width: 0;
}

.admin-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1040;
}

.admin-backdrop.show {
    display: block;
}

@media (max-width: 991.98px) {
    .admin-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100%;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    }

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

    body.admin-sidebar-open {
        overflow: hidden;
    }
}

@media (min-width: 992px) {
    .admin-sidebar {
        position: sticky;
        top: 0;
        align-self: flex-start;
        height: 100vh;
        max-height: 100vh;
    }

    .admin-backdrop {
        display: none !important;
    }
}

/* Admin directory: company modal — <form> wraps header/body/footer, so flex chain for
   .modal-dialog-scrollable must apply to the form; otherwise .modal-body never scrolls. */
#companyModal.modal .modal-dialog-scrollable {
    max-height: calc(100% - 1rem);
}

#companyModal.modal .modal-dialog-scrollable .modal-content {
    max-height: min(90vh, calc(100vh - 2rem));
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#companyModal.modal .modal-dialog-scrollable form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

#companyModal.modal .modal-dialog-scrollable .modal-header,
#companyModal.modal .modal-dialog-scrollable .modal-footer {
    flex-shrink: 0;
}

#companyModal.modal .modal-dialog-scrollable .modal-body {
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

/* Admin dashboard: matrix of sidebar links — mobile-first grid (2 cols on narrow phones) */
.admin-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

@media (min-width: 576px) {
    .admin-dashboard-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.85rem;
    }
}

@media (min-width: 992px) {
    .admin-dashboard-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1rem;
    }
}

@media (min-width: 1400px) {
    .admin-dashboard-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

.admin-dashboard-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 5.75rem;
    padding: 0.75rem 0.45rem;
    border-radius: 0.75rem;
    background: #fff;
    border: 1px solid rgba(2, 43, 85, 0.1);
    box-shadow: 0 0.125rem 0.45rem rgba(2, 43, 85, 0.06);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    text-decoration: none;
    color: #212529;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

a.admin-dashboard-tile:hover,
a.admin-dashboard-tile:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 0.4rem 1rem rgba(2, 43, 85, 0.12);
    color: #212529;
    border-color: rgba(2, 43, 85, 0.22);
}

a.admin-dashboard-tile:focus-visible {
    outline: 2px solid #044078;
    outline-offset: 2px;
}

.admin-dashboard-tile--current {
    border-color: rgba(2, 43, 85, 0.35);
    background: linear-gradient(180deg, #f0f5fa 0%, #fff 55%);
    cursor: default;
}

.admin-dashboard-tile__icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.65rem;
    background: linear-gradient(135deg, #022b55 0%, #044078 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.admin-dashboard-tile__label {
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.25;
    margin-top: 0.45rem;
    word-break: break-word;
    hyphens: auto;
}

.admin-dashboard-tile__meta {
    font-size: 0.68rem;
    color: #6c757d;
    margin-top: 0.2rem;
    line-height: 1.2;
}

/* Admin: shipping updates Add/Edit modal — scroll long form; header/footer stay put */
#updateModal.modal .modal-dialog-scrollable .modal-content {
    max-height: min(92vh, calc(100vh - 1rem));
}

#updateModal.modal .modal-dialog-scrollable form.update-modal-form {
    min-height: 0;
    overflow: hidden;
}

#updateModal.modal .modal-dialog-scrollable .update-modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: min(70vh, 580px);
}

