@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
    --c-dark: #0C102D;
    --c-mid: #263286;
    --c-soft: #99BAED;
    --c-red: #D13800;
    --c-orange: #FF7400;
    --c-yellow: #FFDE00;
    --sidebar-mini: 86px;
    --sidebar-full: 294px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--c-dark);
}

body {
    margin: 0;
    min-height: 100%;
    font-family: 'Poppins', Arial, sans-serif;
    background: var(--c-dark);
    color: var(--c-soft);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background-color: var(--c-dark);
    background-size: cover;
    background-position: center;
}

.login-card {
    width: min(430px, 100%);
    background: linear-gradient(145deg, var(--c-mid), var(--c-dark));
    border: 2px solid var(--c-mid);
    border-radius: 28px;
    padding: 34px;
    display: grid;
    gap: 18px;
}

.login-logo {
    width: min(250px, 100%);
    max-height: 110px;
    object-fit: contain;
    margin: 0 auto;
}

.line {
    height: 2px;
    width: 100%;
    background: linear-gradient(90deg, var(--c-orange), var(--c-yellow), var(--c-orange));
    border-radius: 99px;
}

.login-clock {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    font-weight: 700;
    color: var(--c-yellow);
}

.login-form {
    display: grid;
    gap: 14px;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar-mini) 1fr;
}

body.menu-expanded .app-shell {
    grid-template-columns: var(--sidebar-full) 1fr;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    background: linear-gradient(180deg, var(--c-dark), var(--c-mid));
    border-right: 2px solid var(--c-mid);
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
}

.brand {
    min-height: 76px;
    display: grid;
    place-items: center;
}

.brand-logo {
    display: none;
    width: 220px;
    max-width: 100%;
    max-height: 82px;
    object-fit: contain;
}

.brand-icon {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

body.menu-expanded .brand-logo {
    display: block;
}

body.menu-expanded .brand-icon {
    display: none;
}

.side-info {
    display: grid;
    gap: 8px;
    text-align: center;
}

.side-date,
.side-time,
.side-weather {
    background: var(--c-mid);
    border: 1px solid var(--c-soft);
    border-radius: 16px;
    padding: 9px 8px;
    color: var(--c-soft);
    font-size: 12px;
    font-weight: 700;
    overflow: hidden;
}

body.menu-expanded .side-date,
body.menu-expanded .side-time,
body.menu-expanded .side-weather {
    font-size: 13px;
    padding: 11px 10px;
}

.weather-mark {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 99px;
    color: var(--c-yellow);
    animation: pulseWeather 1.4s infinite alternate;
}

@keyframes pulseWeather {
    from { transform: scale(1); }
    to { transform: scale(1.28); }
}

.menu-toggle,
.btn,
.btn-small,
.danger-btn,
.ghost-btn {
    border: 0;
    cursor: pointer;
    border-radius: 999px;
    color: var(--c-dark);
    background: linear-gradient(135deg, var(--c-yellow), var(--c-orange));
    font-weight: 800;
    letter-spacing: .02em;
    transition: transform .18s ease;
}

.menu-toggle:hover,
.btn:hover,
.btn-small:hover,
.danger-btn:hover,
.ghost-btn:hover {
    transform: translateY(-2px);
}

.menu-toggle {
    min-height: 46px;
    padding: 0 12px;
    color: var(--c-dark);
}

.toggle-full {
    display: none;
}

body.menu-expanded .toggle-mini {
    display: none;
}

body.menu-expanded .toggle-full {
    display: inline;
}

.nav {
    display: grid;
    gap: 8px;
    padding-bottom: 20px;
}

.nav-item {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border-radius: 18px;
    color: var(--c-soft);
    background: var(--c-dark);
    border: 1px solid var(--c-mid);
    position: relative;
}

body.menu-expanded .nav-item {
    justify-content: flex-start;
    padding: 0 14px;
}

.nav-item.active,
.nav-item:hover {
    background: var(--c-mid);
    color: var(--c-yellow);
    border-color: var(--c-orange);
}

.nav-icon {
    font-size: 20px;
    color: currentColor;
    width: 24px;
    text-align: center;
}

.nav-label {
    display: none;
    font-weight: 700;
}

body.menu-expanded .nav-label {
    display: inline;
}

body:not(.menu-expanded) .nav-item:hover::after {
    content: attr(data-label);
    position: fixed;
    left: 84px;
    background: var(--c-mid);
    color: var(--c-yellow);
    border: 1px solid var(--c-orange);
    border-radius: 12px;
    padding: 8px 12px;
    z-index: 30;
    font-size: 13px;
}

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

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.eyebrow {
    color: var(--c-orange);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .12em;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
    color: var(--c-yellow);
    font-size: clamp(25px, 3vw, 40px);
    line-height: 1.05;
}

h2 {
    color: var(--c-yellow);
    font-size: 18px;
    margin-bottom: 16px;
}

h3 {
    color: var(--c-yellow);
}

.user-pill {
    display: grid;
    gap: 2px;
    justify-items: end;
    background: var(--c-mid);
    border: 1px solid var(--c-soft);
    border-radius: 18px;
    padding: 11px 15px;
    min-width: 150px;
}

.user-pill span {
    font-size: 11px;
    color: var(--c-soft);
    font-weight: 600;
}

.user-pill strong {
    color: var(--c-yellow);
}

.flash {
    border-radius: 18px;
    padding: 13px 16px;
    margin-bottom: 20px;
    background: var(--c-mid);
    border: 1px solid var(--c-yellow);
    color: var(--c-yellow);
    font-weight: 700;
}

.flash.error {
    border-color: var(--c-red);
    color: var(--c-orange);
}

.grid {
    display: grid;
    gap: 18px;
}

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.card,
.stat-card,
.item-card,
.viewer {
    background: linear-gradient(145deg, var(--c-mid), var(--c-dark));
    border: 1px solid var(--c-mid);
    border-radius: 28px;
    padding: 20px;
    min-width: 0;
}

.stat-card {
    min-height: 150px;
    display: grid;
    align-content: space-between;
    gap: 14px;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--c-orange), var(--c-mid), var(--c-dark));
    opacity: .28;
}

.stat-label,
.stat-value,
.stat-hint {
    position: relative;
}

.stat-label {
    color: var(--c-soft);
    font-weight: 700;
    font-size: 14px;
}

.stat-value {
    color: var(--c-yellow);
    font-size: clamp(26px, 4vw, 44px);
    font-weight: 900;
    line-height: 1;
    word-break: break-word;
}

.stat-hint {
    color: var(--c-soft);
    font-size: 12px;
    font-weight: 600;
}

.item-card {
    display: grid;
    gap: 12px;
}

.item-card h2 {
    margin-bottom: 0;
    font-size: 20px;
}

.meta-list {
    display: grid;
    gap: 7px;
}

.meta-row {
    display: grid;
    gap: 3px;
}

.meta-row span {
    color: var(--c-orange);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.meta-row strong {
    color: var(--c-soft);
    font-size: 14px;
    word-break: break-word;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
}

.field {
    display: grid;
    gap: 7px;
}

.field-full {
    grid-column: 1 / -1;
}

.field span {
    color: var(--c-soft);
    font-size: 12px;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--c-soft);
    background: var(--c-dark);
    color: var(--c-soft);
    border-radius: 15px;
    padding: 13px 14px;
    outline: none;
}

select option {
    background: var(--c-dark);
    color: var(--c-soft);
}

textarea {
    min-height: 110px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--c-yellow);
}

.btn-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 14px;
}

.btn {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
}

.btn-small {
    min-height: 36px;
    padding: 0 13px;
    font-size: 12px;
}

.danger-btn {
    background: linear-gradient(135deg, var(--c-red), var(--c-orange));
    color: var(--c-yellow);
}

.ghost-btn {
    background: var(--c-mid);
    color: var(--c-yellow);
    border: 1px solid var(--c-orange);
}

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

.list-line {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    background: var(--c-dark);
    border: 1px solid var(--c-mid);
    border-radius: 18px;
    padding: 12px;
}

.list-line strong {
    color: var(--c-yellow);
}

.list-line span {
    color: var(--c-soft);
    font-size: 12px;
}

.inline-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

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

.check-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: var(--c-dark);
    border: 1px solid var(--c-mid);
    border-radius: 16px;
    padding: 12px;
    color: var(--c-soft);
    font-weight: 700;
}

.check-item input {
    width: 22px;
    height: 22px;
    accent-color: var(--c-orange);
}

.viewer {
    display: none;
    height: calc(100vh - 140px);
    padding: 14px;
}

.viewer.active {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 12px;
}

.viewer iframe {
    width: 100%;
    height: 100%;
    border: 2px solid var(--c-mid);
    border-radius: 20px;
    background: var(--c-dark);
}

.viewer-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    place-items: center;
    padding: 24px;
    background: var(--c-dark);
    z-index: 80;
    overflow-y: auto;
}

.modal.active {
    display: grid;
}

.modal-box {
    width: min(900px, 100%);
    background: linear-gradient(145deg, var(--c-mid), var(--c-dark));
    border: 2px solid var(--c-orange);
    border-radius: 28px;
    padding: 22px;
}

.modal-form {
    display: none;
}

.modal-form.active {
    display: block;
}

.empty-state {
    border: 1px solid var(--c-mid);
    border-radius: 24px;
    padding: 22px;
    color: var(--c-soft);
    background: var(--c-dark);
    font-weight: 700;
}

.status-open {
    color: var(--c-yellow);
    font-weight: 900;
}

.status-closed {
    color: var(--c-orange);
    font-weight: 900;
}

.footer-note {
    margin-top: 18px;
    color: var(--c-soft);
    font-size: 12px;
}

@media (max-width: 980px) {
    .app-shell,
    body.menu-expanded .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        height: auto;
        min-height: auto;
        border-right: 0;
        border-bottom: 2px solid var(--c-mid);
    }

    .nav {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    body.menu-expanded .nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body:not(.menu-expanded) .nav-item:hover::after {
        display: none;
    }

    .main {
        padding: 18px;
    }

    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }

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

    .user-pill {
        justify-items: start;
        width: 100%;
    }

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