:root {
    --bg: #f3f6fb;
    --nav: #0b1f36;
    --nav2: #0f2d4a;
    --surface: #ffffff;
    --surface2: #f8fafc;
    --line: #dbe5f0;
    --text: #132238;
    --muted: #64748b;
    --blue: #2563eb;
    --blue2: #1d4ed8;
    --green: #16a34a;
    --red: #e11d48;
    --orange: #f59e0b;
    --shadow: 0 18px 45px rgba(15, 45, 74, .12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
}

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

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

.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    background: linear-gradient(135deg, #071b31 0%, #0b2744 52%, #123d65 100%);
}

.login-brand {
    padding: 72px;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-brand:after {
    content: "";
    position: absolute;
    width: 460px;
    height: 460px;
    border-radius: 50%;
    right: -140px;
    bottom: -160px;
    background: rgba(37, 99, 235, .26);
}

.brand-row {
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    z-index: 1;
}

.logo {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #60a5fa, #2563eb);
    color: #fff;
    font-weight: 900;
    box-shadow: 0 18px 36px rgba(37, 99, 235, .28);
}

.logo.small {
    width: 38px;
    height: 38px;
    border-radius: 11px;
}

.brand-title {
    font-size: 17px;
    font-weight: 900;
}

.brand-sub {
    margin-top: 3px;
    color: #bfdbfe;
    font-size: 12px;
    font-weight: 700;
}

.login-brand h1 {
    position: relative;
    z-index: 1;
    margin: 68px 0 18px;
    font-size: 58px;
    line-height: .98;
    letter-spacing: -1.8px;
}

.login-brand p {
    position: relative;
    z-index: 1;
    color: #dbeafe;
    max-width: 620px;
    line-height: 1.75;
    font-weight: 700;
    font-size: 17px;
}

.login-panel-wrap {
    display: grid;
    place-items: center;
    padding: 40px;
}

.login-card {
    width: min(470px, 100%);
    background: #fff;
    border-radius: 24px;
    padding: 34px;
    box-shadow: 0 30px 80px rgba(0,0,0,.22);
}

.login-card h2 {
    margin: 26px 0 8px;
    font-size: 30px;
}

.login-card p {
    margin: 0 0 24px;
    color: var(--muted);
    font-weight: 700;
}

label {
    display: block;
    margin: 0 0 7px;
    color: #334155;
    font-size: 12px;
    letter-spacing: 1.3px;
    text-transform: uppercase;
    font-weight: 900;
}

input,
textarea,
select {
    width: 100%;
    padding: 13px 14px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: var(--text);
    outline: none;
    font-weight: 650;
}

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

input:focus,
textarea:focus,
select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(37,99,235,.10);
}

.form-group {
    margin-bottom: 15px;
}

.btn {
    border: 0;
    border-radius: 12px;
    padding: 12px 16px;
    min-height: 42px;
    background: var(--blue);
    color: #fff;
    cursor: pointer;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:hover {
    background: var(--blue2);
}

.btn.full {
    width: 100%;
}

.btn.green {
    background: var(--green);
}

.btn.red {
    background: var(--red);
}

.btn.orange {
    background: var(--orange);
}

.btn.light {
    background: #eaf2ff;
    color: #0f2d4a;
}

.btn.ghost {
    background: #eef2f7;
    color: #0f2d4a;
}

.btn.small {
    min-height: 32px;
    padding: 7px 10px;
    border-radius: 9px;
    font-size: 12px;
}

.notice {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 14px;
    font-weight: 750;
    border: 1px solid transparent;
}

.notice.ok {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

.notice.err {
    background: #ffe4e6;
    color: #9f1239;
    border-color: #fecdd3;
}

.notice.warn {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}

.app {
    display: grid;
    grid-template-columns: 248px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: linear-gradient(180deg, var(--nav), #07192c);
    color: #fff;
    padding: 18px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255,255,255,.12);
    margin-bottom: 22px;
}

.menu-section {
    font-size: 11px;
    letter-spacing: 2.4px;
    color: #93c5fd;
    font-weight: 900;
    margin: 20px 0 8px;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 12px;
    font-weight: 800;
    color: #dbeafe;
    margin-bottom: 6px;
}

.menu-link:hover,
.menu-link.active {
    background: rgba(37, 99, 235, .95);
    color: #fff;
}

.menu-icon {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(255,255,255,.10);
}

.sidebar-user {
    margin-top: 24px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(255,255,255,.08);
    color: #bfdbfe;
    font-size: 12px;
    font-weight: 700;
}

.content {
    padding: 24px 28px 44px;
}

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

.title-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.title-icon {
    width: 52px;
    height: 52px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, #60a5fa, #2563eb);
    font-weight: 900;
}

h1 {
    margin: 0;
    font-size: 32px;
    letter-spacing: -.7px;
}

.subtitle {
    color: var(--muted);
    font-weight: 700;
    margin-top: 4px;
}

.top-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px,1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.card,
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.card {
    padding: 20px;
    min-height: 136px;
}

.card-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    background: var(--blue);
    font-weight: 900;
    margin-bottom: 16px;
}

.card.green .card-icon {
    background: var(--green);
}

.card.red .card-icon {
    background: var(--red);
}

.card.orange .card-icon {
    background: var(--orange);
}

.card-title {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.card-value {
    font-size: 30px;
    font-weight: 900;
    margin-top: 4px;
}

.card-note {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
}

.grid {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 18px;
    align-items: start;
}

.grid.two {
    grid-template-columns: 440px 1fr;
}

.panel {
    padding: 22px;
}

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

.panel h2 {
    margin: 0;
    font-size: 20px;
}

.panel-sub {
    color: var(--muted);
    margin-top: 4px;
    font-weight: 650;
    font-size: 13px;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid var(--line);
    color: #475569;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 900;
}

.table td {
    padding: 13px 12px;
    border-bottom: 1px solid #eef2f7;
    vertical-align: top;
}

.strong {
    font-weight: 900;
}

.muted {
    color: var(--muted);
    font-size: 12px;
    margin-top: 4px;
    font-weight: 650;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.badge.open {
    color: #1d4ed8;
    background: #dbeafe;
}

.badge.done {
    color: #166534;
    background: #dcfce7;
}

.badge.late {
    color: #9f1239;
    background: #ffe4e6;
}

.badge.warn {
    color: #92400e;
    background: #fef3c7;
}

.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.inline-form {
    display: inline;
}

.help {
    margin-top: 12px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
    font-weight: 650;
}

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

.checkbox-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
    color: #334155;
    font-size: 14px;
    font-weight: 750;
}

.checkbox-line input {
    width: auto;
}

@media (max-width: 1180px) {
    .grid,
    .grid.two {
        grid-template-columns: 1fr;
    }

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

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

    .login-brand {
        display: none;
    }
}

@media (max-width: 760px) {
    .app {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .content {
        padding: 16px;
    }

    .topbar {
        display: block;
    }

    .top-actions {
        margin-top: 14px;
    }

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

    .table {
        display: block;
        overflow-x: auto;
    }
}
