* {
    box-sizing: border-box
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Arial, sans-serif;
    background: #f2f4f8;
    color: #172033;
    -webkit-font-smoothing: antialiased
}

h1,
h2,
h3 {
    margin-top: 0;
    letter-spacing: -.01em
}

h1 {
    font-weight: 700
}

h2 {
    font-weight: 600;
    font-size: 17px
}

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

.sidebar {
    background: #13224d;
    color: #fff;
    padding: 28px 20px;
    display: flex;
    flex-direction: column
}

.sidebar h1 {
    margin: 0 0 2px;
    font-family: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
    font-size: 30px;
    font-weight: 400;
    letter-spacing: .02em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .35)
}

.sidebar p {
    opacity: .65;
    font-size: 13px;
    margin-bottom: 32px
}

.sidebar nav {
    display: grid;
    gap: 7px
}

.sidebar button {
    border: 0;
    border-left: 3px solid transparent;
    background: transparent;
    color: rgba(255, 255, 255, .8);
    text-align: left;
    padding: 11px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background .15s ease, color .15s ease
}

.sidebar nav button {
    border: 1px solid rgba(255, 255, 255, .12);
    border-top-color: rgba(255, 255, 255, .3);
    border-bottom-color: rgba(0, 0, 0, .4);
    padding: 11px 13px;
    border-radius: 9px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .03));
    box-shadow: 0 2px 4px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .14);
    transition: transform .12s ease, box-shadow .12s ease, background .15s ease, color .15s ease
}

.sidebar nav button:hover:not(.active) {
    background: linear-gradient(180deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, .07));
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .18)
}

.sidebar nav button.active {
    background: linear-gradient(180deg, rgba(240, 180, 0, .16), rgba(240, 180, 0, .05));
    color: #fff;
    font-weight: 600;
    border-color: rgba(0, 0, 0, .3);
    border-left: 3px solid #F0B400;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, .5)
}

.sidebar nav button:active {
    transform: translateY(0);
    box-shadow: inset 0 3px 7px rgba(0, 0, 0, .55)
}

.secondary-side {
    margin-top: auto;
    border: 1px solid rgba(255, 255, 255, .2) !important
}

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

#crumbs {
    color: #667085;
    font-size: 14px;
    margin-bottom: 16px
}

#crumbs button {
    border: 0;
    background: none;
    color: #1E3CA5;
    padding: 0;
    cursor: pointer
}

.muted {
    color: #667085
}

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

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

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

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

.card {
    background: linear-gradient(180deg, #fff, #fafbfe);
    border: 1px solid #e2e7f0;
    border-bottom-color: #d5dbe6;
    border-radius: 14px;
    padding: 20px;
    box-shadow: inset 0 1px 0 #fff, 0 6px 18px rgba(16, 24, 40, .09), 0 1px 3px rgba(16, 24, 40, .06);
    transition: box-shadow .15s ease, transform .15s ease
}

.click {
    cursor: pointer
}

.click:hover {
    box-shadow: inset 0 1px 0 #fff, 0 12px 28px rgba(16, 24, 40, .14), 0 2px 6px rgba(16, 24, 40, .08);
    transform: translateY(-2px)
}

.metric {
    font-size: 30px;
    font-weight: 700;
    margin-top: 8px;
    color: #13224d;
    letter-spacing: -.02em
}

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

.btn {
    border: 1px solid #d4dae3;
    border-bottom-color: #bcc4d0;
    background: linear-gradient(180deg, #fff, #f2f4f8);
    padding: 10px 14px;
    border-radius: 9px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    color: #172033;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .08), inset 0 1px 0 #fff;
    transition: transform .1s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease
}

.btn:hover {
    border-color: #1E3CA5;
    box-shadow: 0 2px 6px rgba(16, 24, 40, .13), inset 0 1px 0 #fff
}

.btn:active {
    transform: translateY(1px);
    box-shadow: inset 0 2px 4px rgba(16, 24, 40, .16)
}

.btn.primary {
    background: linear-gradient(180deg, #38b638, #2a962a);
    color: #fff;
    border-color: #268a26;
    border-bottom-color: #1f7a1f;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(38, 138, 38, .3), inset 0 1px 0 rgba(255, 255, 255, .35)
}

.btn.primary:hover {
    background: linear-gradient(180deg, #2f9e2f, #24831f);
    border-color: #1f7a1f;
    box-shadow: 0 4px 12px rgba(47, 163, 47, .35), inset 0 1px 0 rgba(255, 255, 255, .35)
}

.btn.primary:active {
    transform: translateY(1px);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, .28)
}

.btn.danger {
    color: #c8101f;
    border-color: #f3c6c6
}

.btn.danger:hover {
    background: #fce8e8;
    border-color: #c8101f
}

.btn.gold {
    color: #8a6100;
    border-color: #f0d999
}

.btn.gold:hover {
    background: #fff3d6;
    border-color: #F0B400
}

.btn.blue {
    color: #1E3CA5;
    border-color: #c2cdea
}

.btn.blue:hover {
    background: #eaeffb;
    border-color: #1E3CA5
}

.badge {
    display: inline-block;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .01em;
    background: #eaeffb;
    color: #1E3CA5
}

.warn {
    background: #fff3d6;
    color: #966600
}

.ok {
    background: #e8f7e8;
    color: #1f8a2e
}

.danger-badge {
    background: #fce8e8;
    color: #c8101f
}

.danger-text {
    color: #c8101f;
    font-weight: 600
}

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

thead th {
    background: #f7f8fb;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #667085;
    font-weight: 600
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid #eef0f4;
    text-align: left;
    vertical-align: top
}

tbody tr:hover {
    background: #fafbfd
}

tbody tr[data-open] {
    cursor: pointer
}

tbody tr[data-open]:hover {
    background: #f5f7fb
}

.tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 18px 0
}

.tabs button {
    border: 1px solid #d4dae3;
    border-bottom-color: #bcc4d0;
    background: linear-gradient(180deg, #fff, #f2f4f8);
    padding: 9px 14px;
    border-radius: 9px;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .08), inset 0 1px 0 #fff;
    transition: transform .1s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease
}

.tabs button:hover:not(.active) {
    border-color: #1E3CA5;
    box-shadow: 0 2px 6px rgba(16, 24, 40, .13), inset 0 1px 0 #fff
}

.tabs button.active {
    background: linear-gradient(180deg, #2f4fbf, #1E3CA5);
    color: #fff;
    border-color: #1a3690;
    font-weight: 600;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, .28)
}

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

.field label {
    display: block;
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 6px
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #dbe0e8;
    border-radius: 9px;
    background: #fff;
    font-family: inherit;
    font-size: 14px;
    transition: border-color .15s ease, box-shadow .15s ease
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: #1E3CA5;
    box-shadow: 0 0 0 3px rgba(30, 60, 165, .12)
}

.field textarea {
    min-height: 90px
}

.search-box {
    margin-bottom: 14px
}

.search-box input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #dbe0e8;
    border-radius: 9px;
    background: #fff;
    font-size: 14px;
    transition: border-color .15s ease, box-shadow .15s ease
}

.search-box input:focus {
    outline: none;
    border-color: #1E3CA5;
    box-shadow: 0 0 0 3px rgba(30, 60, 165, .12)
}

.actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px
}

.summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px
}

.notice {
    background: #eaeffb;
    color: #1E3CA5;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 14px
}

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

.item {
    border: 1px solid #dfe4ea;
    border-radius: 10px;
    padding: 12px;
    background: #fff
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    display: grid;
    place-items: center;
    padding: 20px
}

.modal.hidden {
    display: none
}

.hidden {
    display: none !important
}

.login-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(160deg, #0f1c3f 0%, #13224d 55%, #1E3CA5 130%);
    padding: 20px
}

.login-card {
    background: #fff;
    border-radius: 18px;
    padding: 36px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .35);
    border-top: 4px solid #1E3CA5
}

.login-card h1 {
    margin: 0 0 4px;
    font-family: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
    font-size: 34px;
    font-weight: 500;
    letter-spacing: .015em;
    color: #13224d
}

.login-card .muted {
    margin-bottom: 20px
}

.login-card .field {
    margin-bottom: 14px
}

.login-card .btn {
    width: 100%;
    margin-top: 6px
}

.login-error {
    background: #fdecea;
    color: #b3261e;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    margin-bottom: 14px
}

.user-box {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, .15);
    display: flex;
    flex-direction: column;
    gap: 8px
}

.user-box button {
    border: 1px solid rgba(255, 255, 255, .2) !important
}

.modal-card {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    max-width: 760px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .3), 0 6px 16px rgba(0, 0, 0, .18)
}

.close {
    position: absolute;
    right: 14px;
    top: 10px;
    border: 0;
    background: none;
    font-size: 28px;
    cursor: pointer
}

.filebox {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 20px;
    text-align: center
}

.status-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap
}

.status-group .badge {
    margin-bottom: 4px
}

#toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    background: #172033;
    color: #fff;
    padding: 12px 15px;
    border-radius: 9px;
    display: none
}

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

    .sidebar {
        display: none
    }

    .g2,
    .g3,
    .g4,
    .form,
    .summary {
        grid-template-columns: 1fr
    }
}