:root {
    --a2z-charcoal: #2f3030;
    --a2z-black: #080808;
    --a2z-grey: #73777a;
    --a2z-light-grey: #f3f5f1;
    --a2z-green: #7ed321;
    --a2z-lime: #a7f32a;
    --a2z-deep-green: #198754;
    --a2z-white: #ffffff;
    --a2z-border: #dfe5dc;
    --a2z-shadow: 0 14px 36px rgba(47, 48, 48, 0.12);
}

html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

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

body {
    margin-bottom: 60px;
    background: linear-gradient(180deg, #fbfcf8 0%, var(--a2z-light-grey) 100%);
    color: #202426;
}

.login-page {
    background: #087f6f;
    margin: 0;
    min-height: 100vh;
}

.login-shell {
    align-items: stretch;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(360px, 0.8fr);
    margin: clamp(16px, 4vw, 44px);
    min-height: calc(100vh - clamp(32px, 8vw, 88px));
}

.login-brand-panel,
.login-form-panel {
    background: var(--a2z-white);
    overflow: hidden;
    position: relative;
}

.login-brand-panel {
    align-items: center;
    border-right: 2px solid #bfddd8;
    display: flex;
    justify-content: center;
    padding: clamp(28px, 6vw, 76px);
}

.login-brand-content {
    max-width: 600px;
    text-align: center;
    z-index: 1;
}

.login-logo {
    display: block;
    margin: 0 auto 22px;
    max-width: min(310px, 72vw);
    width: 42%;
}

.login-title-block {
    color: #066f65;
    margin-bottom: 18px;
}

.login-title-primary {
    font-size: clamp(2.3rem, 4.2vw, 4.4rem);
    font-weight: 850;
    line-height: 1;
    text-transform: uppercase;
}

.login-title-secondary {
    color: #202426;
    font-size: clamp(1.7rem, 3.2vw, 3.2rem);
    font-weight: 650;
    line-height: 1.15;
    margin-top: 18px;
}

.login-brand-content p {
    color: #2f3030;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.55;
    margin: 0 auto;
    max-width: 620px;
}

.login-form-panel {
    align-items: center;
    display: flex;
    justify-content: center;
    padding: clamp(26px, 4vw, 56px);
}

.login-form-card {
    max-width: 420px;
    position: relative;
    text-align: center;
    width: 100%;
    z-index: 1;
}

.login-form-card h2 {
    color: #172121;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.1rem, 4vw, 3.4rem);
    font-style: italic;
    font-weight: 500;
    margin-bottom: 18px;
    position: relative;
    z-index: 2;
}

.login-lock {
    align-items: center;
    background: #0b877b;
    border-radius: 999px;
    color: var(--a2z-white);
    display: inline-flex;
    font-size: 0;
    height: 46px;
    justify-content: center;
    margin-bottom: 16px;
    position: relative;
    width: 46px;
}

.login-lock::before {
    border: 3px solid var(--a2z-white);
    border-bottom: 0;
    border-radius: 10px 10px 0 0;
    content: "";
    height: 13px;
    position: absolute;
    top: 11px;
    width: 16px;
}

.login-lock::after {
    background: var(--a2z-white);
    border-radius: 2px;
    content: "";
    height: 14px;
    position: absolute;
    top: 22px;
    width: 18px;
}

.login-kicker {
    color: #535f60;
    font-weight: 650;
    margin-bottom: 22px;
}

.login-input {
    border: 2px solid #bfd6d2;
    border-radius: 0;
}

.login-options {
    align-items: center;
    display: flex;
    font-size: 0.78rem;
    gap: 12px;
    justify-content: space-between;
    margin: 12px 0 20px;
    text-align: left;
}

.login-options a {
    color: #0b877b;
    text-decoration: none;
}

.login-button {
    background: linear-gradient(90deg, #069074, #0879a0);
    border: 0;
    border-radius: 0;
    color: var(--a2z-white);
    font-weight: 750;
    padding: 12px 18px;
    text-transform: uppercase;
    width: 100%;
}

.login-button:hover,
.login-button:focus {
    color: var(--a2z-white);
    filter: brightness(0.95);
}

.corner {
    border-style: solid;
    height: 0;
    pointer-events: none;
    position: absolute;
    width: 0;
    z-index: 0;
}

.corner-top {
    border-color: #b9ded8 transparent transparent transparent;
    border-width: 94px 94px 0 0;
    right: 0;
    top: 0;
}

.corner-bottom {
    border-color: transparent transparent transparent #b9ded8;
    border-width: 150px 0 0 150px;
    bottom: 0;
    left: 0;
}

.dashboard-shell {
    min-height: 100vh;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem var(--a2z-white), 0 0 0 0.25rem rgba(126, 211, 33, 0.45);
}

.btn-primary,
.bg-primary {
    background-color: var(--a2z-green) !important;
    border-color: var(--a2z-green) !important;
    color: var(--a2z-black) !important;
}

.btn-success,
.bg-success {
    background-color: var(--a2z-deep-green) !important;
    border-color: var(--a2z-deep-green) !important;
}

.btn-dark,
.bg-dark,
.bg-secondary {
    background-color: var(--a2z-charcoal) !important;
}

.btn-warning,
.bg-warning {
    background-color: var(--a2z-lime) !important;
    border-color: var(--a2z-lime) !important;
    color: var(--a2z-black) !important;
}

.btn-danger,
.bg-danger {
    background-color: #d83a3a !important;
    border-color: #d83a3a !important;
}

.btn-info,
.bg-info {
    background-color: #dff8c5 !important;
    border-color: #dff8c5 !important;
    color: var(--a2z-black) !important;
}

.card {
    border: 1px solid var(--a2z-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(47, 48, 48, 0.08);
}

.table {
    border-color: var(--a2z-border);
}

.table-light {
    --bs-table-bg: #edf4e8;
    color: var(--a2z-charcoal);
}

.badge {
    border-radius: 6px;
}

.sidebar {
    width: 260px;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: linear-gradient(180deg, var(--a2z-charcoal) 0%, #171919 100%);
    color: var(--a2z-white);
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 10px 0 28px rgba(8, 8, 8, 0.18);
    z-index: 10;
    overflow-y: auto;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 4px 22px;
    margin-bottom: 8px;
    color: var(--a2z-white);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-logo {
    width: 54px;
    height: 54px;
    object-fit: contain;
    border-radius: 50%;
    background: var(--a2z-white);
    padding: 4px;
}

.brand-text {
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.sidebar-nav {
    display: grid;
    gap: 18px;
    margin-top: 18px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #e5eadf;
    padding: 10px 11px;
    border-radius: 8px;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a:focus {
    background: rgba(126, 211, 33, 0.14);
    border-left-color: var(--a2z-lime);
    color: var(--a2z-white);
}

.nav-section {
    display: grid;
    gap: 4px;
}

.nav-heading {
    align-items: center;
    background: transparent;
    border: 0;
    color: #bfc7bd;
    display: flex;
    font-size: 0.72rem;
    font-weight: 700;
    justify-content: space-between;
    letter-spacing: 0.08em;
    padding: 0 4px 3px;
    text-align: left;
    text-transform: uppercase;
    width: 100%;
}

.nav-heading-toggle {
    cursor: pointer;
}

.nav-heading-toggle:hover,
.nav-heading-toggle:focus {
    color: var(--a2z-white);
    outline: none;
}

.nav-heading-toggle:focus-visible {
    box-shadow: 0 0 0 0.18rem rgba(167, 243, 42, 0.3);
    border-radius: 6px;
}

.nav-chevron {
    border-color: currentColor;
    border-style: solid;
    border-width: 0 2px 2px 0;
    display: inline-block;
    height: 8px;
    margin-left: 10px;
    transform: rotate(45deg);
    transition: transform 0.16s ease;
    width: 8px;
}

.nav-section.is-collapsed .nav-chevron {
    transform: rotate(-45deg);
}

.nav-section-links {
    display: grid;
    gap: 4px;
    overflow: hidden;
}

.nav-section.is-collapsed .nav-section-links {
    display: none;
}

.nav-mark {
    align-items: center;
    background: rgba(255, 255, 255, 0.11);
    border-radius: 6px;
    color: var(--a2z-lime);
    display: inline-flex;
    flex: 0 0 24px;
    font-size: 0.72rem;
    font-weight: 800;
    height: 24px;
    justify-content: center;
    width: 24px;
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-top: 15px;
}

.user-chip {
    color: #edf4e8;
    font-size: 0.9rem;
    margin-bottom: 10px;
    overflow-wrap: anywhere;
}

.powered-by {
    color: #bfc7bd;
    margin-top: 12px;
    font-size: 0.75rem;
}

.main {
    padding: 24px 28px;
    min-width: 0;
}

.main.with-sidebar {
    margin-left: 260px;
}

.topbar {
    align-items: center;
    background: rgba(255, 255, 255, 0.92);
    padding: 18px 22px;
    border-radius: 8px;
    margin-bottom: 24px;
    box-shadow: var(--a2z-shadow);
    border: 1px solid rgba(126, 211, 33, 0.16);
    min-height: 86px;
}

.topbar-title-group {
    align-items: center;
    display: flex;
    gap: 14px;
    min-width: 0;
}

.topbar-app-title {
    color: var(--a2z-deep-green);
    font-size: 1.2rem;
    font-weight: 850;
    line-height: 1.2;
    margin-bottom: 2px;
    overflow-wrap: anywhere;
}

.notification-menu {
    position: relative;
}

.notification-button {
    align-items: center;
    background: var(--a2z-white);
    border: 1px solid var(--a2z-border);
    border-radius: 8px;
    display: inline-flex;
    height: 42px;
    justify-content: center;
    position: relative;
    width: 42px;
}

.notification-button:hover,
.notification-button:focus {
    box-shadow: 0 0 0 0.18rem rgba(126, 211, 33, 0.25);
    outline: none;
}

.notification-bell {
    border: 2px solid var(--a2z-charcoal);
    border-bottom: 0;
    border-radius: 14px 14px 4px 4px;
    height: 18px;
    position: relative;
    width: 16px;
}

.notification-bell::before {
    background: var(--a2z-charcoal);
    border-radius: 999px;
    bottom: -6px;
    content: "";
    height: 4px;
    left: 4px;
    position: absolute;
    width: 4px;
}

.notification-bell::after {
    background: var(--a2z-charcoal);
    bottom: -2px;
    content: "";
    height: 2px;
    left: -4px;
    position: absolute;
    width: 20px;
}

.notification-count {
    align-items: center;
    background: #d83a3a;
    border: 2px solid var(--a2z-white);
    border-radius: 999px;
    color: var(--a2z-white);
    display: inline-flex;
    font-size: 0.68rem;
    font-weight: 800;
    height: 20px;
    justify-content: center;
    min-width: 20px;
    padding: 0 5px;
    position: absolute;
    right: -7px;
    top: -7px;
}

.notification-panel {
    background: var(--a2z-white);
    border: 1px solid var(--a2z-border);
    border-radius: 8px;
    box-shadow: var(--a2z-shadow);
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: min(360px, 86vw);
    z-index: 20;
}

.notification-panel-header {
    align-items: center;
    border-bottom: 1px solid var(--a2z-border);
    display: flex;
    justify-content: space-between;
    padding: 12px 14px;
}

.notification-refresh {
    background: transparent;
    border: 0;
    color: var(--a2z-deep-green);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0;
}

.notification-list {
    max-height: 360px;
    overflow-y: auto;
    padding: 8px;
}

.notification-item {
    align-items: center;
    border-radius: 8px;
    color: #202426;
    display: grid;
    gap: 2px 10px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 10px;
    text-decoration: none;
}

.notification-item:hover,
.notification-item:focus {
    background: #f3f8ee;
    color: #202426;
}

.notification-title {
    font-weight: 750;
}

.notification-category {
    color: var(--a2z-grey);
    font-size: 0.78rem;
}

.notification-pill {
    background: var(--a2z-green);
    border-radius: 999px;
    color: var(--a2z-black);
    font-size: 0.78rem;
    font-weight: 800;
    min-width: 28px;
    padding: 3px 8px;
    text-align: center;
}

.notification-empty {
    color: var(--a2z-grey);
    padding: 18px 12px;
    text-align: center;
}

.filter-bar {
    align-items: end;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(4, minmax(140px, 1fr)) auto auto auto;
    margin-bottom: 18px;
}

.approval-form {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(180px, 1fr) auto;
    margin-bottom: 8px;
}

.settings-section,
.import-panel,
.guide-content section {
    border: 1px solid var(--a2z-border);
    border-radius: 8px;
    background: var(--a2z-white);
    margin-bottom: 16px;
    padding: 16px;
}

.settings-row {
    display: grid;
    gap: 10px;
    grid-template-columns: 220px minmax(0, 1fr) auto;
    margin-top: 12px;
}

.settings-row label {
    font-weight: 800;
}

.import-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.import-panel {
    display: grid;
    gap: 10px;
}

.guide-layout {
    display: grid;
    gap: 20px;
    grid-template-columns: 240px minmax(0, 1fr);
}

.guide-index {
    align-self: start;
    background: var(--a2z-white);
    border: 1px solid var(--a2z-border);
    border-radius: 8px;
    display: grid;
    gap: 6px;
    padding: 12px;
    position: sticky;
    top: 18px;
}

.guide-index a {
    color: var(--a2z-charcoal);
    font-weight: 700;
    padding: 8px 10px;
    text-decoration: none;
}

.guide-index a:hover,
.guide-index a:focus {
    background: #f3f8ee;
    border-radius: 6px;
}

.sidebar-toggle {
    align-items: center;
    background: var(--a2z-white);
    border: 1px solid var(--a2z-border);
    border-radius: 8px;
    display: none;
    flex-direction: column;
    gap: 4px;
    height: 42px;
    justify-content: center;
    padding: 0;
    width: 42px;
}

.sidebar-toggle span {
    background: var(--a2z-charcoal);
    border-radius: 999px;
    display: block;
    height: 2px;
    width: 18px;
}

.sidebar-overlay {
    background: rgba(8, 8, 8, 0.45);
    border: 0;
    display: none;
    inset: 0;
    padding: 0;
    position: fixed;
    z-index: 9;
}

.topbar h4,
h1,
h2,
h3 {
    color: #1f2424;
    font-weight: 750;
}

.alert-info {
    background: #edf9df;
    border-color: #c8ef9b;
    color: #25321f;
}

/* SLA overdue highlight */
.sla-overdue {
    background-color: #fff0f0 !important;
    border-left: 5px solid #d83a3a;
}

@keyframes pulse {
    0% {
        background-color: #ffe0e0;
    }

    50% {
        background-color: #ffc2c2;
    }

    100% {
        background-color: #ffe0e0;
    }
}

.room-box {
    border-radius: 8px;
    padding: 12px;
    color: var(--a2z-white);
    font-size: 14px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 8px 22px rgba(47, 48, 48, 0.16);
}

.room-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(47, 48, 48, 0.2);
}

.green {
    background: linear-gradient(145deg, var(--a2z-green), var(--a2z-deep-green));
}

.orange {
    background: linear-gradient(145deg, var(--a2z-lime), #d4a400);
    color: var(--a2z-black);
}

.red {
    background: linear-gradient(145deg, #d83a3a, #8f2424);
}

.maintenance-filter-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.maintenance-filter-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(47, 48, 48, 0.18);
}

.ticket-row:hover {
    background-color: #edf9df !important;
}

.page-actions {
    align-items: center;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    margin-bottom: 16px;
}

.management-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.location-management-grid {
    grid-template-columns: repeat(4, minmax(220px, 1fr));
}

.management-panel {
    background: var(--a2z-white);
    border: 1px solid var(--a2z-border);
    border-radius: 8px;
    padding: 16px;
}

.management-panel h3 {
    font-size: 1.1rem;
    margin-bottom: 14px;
}

.compact-form,
.inline-edit-row {
    display: grid;
    gap: 8px;
}

.compact-form {
    border-bottom: 1px solid var(--a2z-border);
    margin-bottom: 14px;
    padding-bottom: 14px;
}

.stack-list {
    display: grid;
    gap: 10px;
}

.inline-edit-row {
    background: #f8faf5;
    border: 1px solid var(--a2z-border);
    border-radius: 8px;
    padding: 10px;
}

.asset-catalog-row {
    grid-template-columns: minmax(0, 1fr) auto;
}

.empty-management-item {
    background: #f8faf5;
    border: 1px dashed var(--a2z-border);
    border-radius: 8px;
    color: var(--a2z-grey);
    padding: 12px;
}

table {
    min-width: 720px;
}

@media (max-width: 900px) {
    body.nav-open {
        overflow: hidden;
    }

    .sidebar {
        max-width: 86vw;
        transform: translateX(-105%);
        transition: transform 0.18s ease;
        width: 280px;
        z-index: 11;
    }

    body.nav-open .sidebar {
        transform: translateX(0);
    }

    body.nav-open .sidebar-overlay {
        display: block;
    }

    .main.with-sidebar {
        margin-left: 0;
    }

    .main {
        padding: 16px;
    }

    .sidebar-toggle {
        display: inline-flex;
    }

    .topbar {
        padding: 12px;
    }

    .topbar h4 {
        font-size: 1.05rem;
    }

    .topbar-app-title {
        font-size: 1rem;
    }

    .page-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .management-grid {
        grid-template-columns: 1fr;
    }

    .location-management-grid {
        grid-template-columns: 1fr;
    }

    .filter-bar,
    .settings-row,
    .guide-layout {
        grid-template-columns: 1fr;
    }

    .guide-index {
        position: static;
    }

    .approval-form {
        grid-template-columns: 1fr;
    }

    table.responsive-table {
        min-width: 0;
    }

    .responsive-table thead {
        display: none;
    }

    .responsive-table,
    .responsive-table tbody,
    .responsive-table tr,
    .responsive-table td {
        display: block;
        width: 100%;
    }

    .responsive-table tr {
        background: var(--a2z-white);
        border: 1px solid var(--a2z-border);
        border-radius: 8px;
        margin-bottom: 12px;
        padding: 8px;
    }

    .responsive-table td {
        border: 0;
        display: grid;
        gap: 10px;
        grid-template-columns: 120px minmax(0, 1fr);
        padding: 8px;
    }

    .responsive-table td::before {
        color: var(--a2z-grey);
        content: attr(data-label);
        font-weight: 800;
    }

    .login-shell {
        grid-template-columns: 1fr;
        margin: 14px;
        min-height: calc(100vh - 28px);
    }

    .login-brand-panel {
        border-bottom: 2px solid #bfddd8;
        border-right: 0;
        min-height: 38vh;
        padding: 26px 20px;
    }

    .login-logo {
        max-width: 180px;
        width: 52%;
    }

    .login-form-panel {
        padding: 30px 20px 36px;
    }

    .login-options {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 1200px) and (min-width: 901px) {
    .management-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    .location-management-grid {
        grid-template-columns: repeat(2, minmax(280px, 1fr));
    }
}
