:root {
    --blue-main: #174873;
    --blue-secondary: #1F72A6;
    --blue-accent: #23A5D9;
    --cyan-accent: #23B7D9;
    --light-bg: #F2F2F2;
}

* {
    box-sizing: border-box;
}

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

.admin-shell {
    --sidebar-width-expanded: 256px;
    --sidebar-width-collapsed: 78px;
}

.admin-app {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: var(--sidebar-width-expanded);
    flex: 0 0 var(--sidebar-width-expanded);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: width .2s ease, flex-basis .2s ease;
}

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

.admin-sidebar-nav {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    max-height: 44px;
    white-space: nowrap;
    overflow: hidden;
    flex: 0 0 44px;
}

.admin-nav-short {
    display: none;
    min-width: 28px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
}

.admin-nav-full {
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-toggle-btn {
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #174873;
}

.admin-toggle-btn span {
    display: block;
    width: 16px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.admin-shell.sidebar-collapsed .admin-sidebar {
    width: var(--sidebar-width-collapsed);
    flex-basis: var(--sidebar-width-collapsed);
}

.admin-shell.sidebar-collapsed .admin-sidebar .brand-surface-sidebar {
    padding: 8px;
}

.admin-shell.sidebar-collapsed .admin-sidebar .brand-surface-sidebar img {
    height: 38px;
}

.admin-shell.sidebar-collapsed .admin-sidebar .admin-sidebar-caption {
    display: none;
}

.admin-shell.sidebar-collapsed .admin-nav-link {
    justify-content: center;
    padding-left: 10px;
    padding-right: 10px;
}

.admin-shell.sidebar-collapsed .admin-nav-full {
    display: none;
}

.admin-shell.sidebar-collapsed .admin-nav-short {
    display: inline-block;
}

.brand-surface {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.brand-surface-sidebar {
    min-height: 72px;
    padding: 10px 12px;
}

.brand-surface-public {
    min-height: 64px;
    padding: 8px 12px;
}

.brand-surface-login {
    min-height: 82px;
    padding: 10px 14px;
}

.form-input {
    display: block;
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    padding: 12px 14px;
    color: #0f172a;
    font-size: 15px;
    line-height: 1.35;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

input.form-input,
select.form-input,
input[type="file"].form-input {
    min-height: 54px;
    height: 54px;
}

textarea.form-input {
    min-height: 160px;
    resize: vertical;
}

.form-textarea-xl {
    min-height: 560px !important;
}

select.form-input {
    appearance: none;
    -webkit-appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, #334155 50%),
        linear-gradient(135deg, #334155 50%, transparent 50%);
    background-position:
        calc(100% - 22px) calc(50% - 3px),
        calc(100% - 16px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 42px;
}

input[type="file"].form-input {
    padding-top: 8px;
    padding-bottom: 8px;
}

.form-input:focus {
    border-color: var(--blue-accent);
    box-shadow: 0 0 0 3px rgba(35, 165, 217, .18);
}

.field-label {
    display: grid;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

.field-label-tight {
    gap: 4px;
}

.btn-primary,
.btn-accent,
.btn-outline,
.btn-success,
.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.btn-primary {
    background: var(--blue-secondary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--blue-main);
}

.btn-accent {
    background: var(--blue-accent);
    color: #fff;
}

.btn-accent:hover {
    background: var(--blue-secondary);
}

.btn-outline {
    border: 1px solid var(--blue-secondary);
    color: var(--blue-secondary);
    background: #fff;
}

.btn-outline:hover {
    border-color: var(--blue-main);
    color: var(--blue-main);
    background: #f8fafc;
}

.btn-success {
    background: #15803d;
    color: #fff;
}

.btn-success:hover {
    background: #166534;
}

.btn-danger {
    background: #b91c1c;
    color: #fff;
}

.btn-danger:hover {
    background: #991b1b;
}

.link {
    color: var(--blue-secondary);
    font-size: 13px;
    font-weight: 700;
}

.link:hover {
    color: var(--blue-main);
    text-decoration: underline;
}

.admin-table {
    width: 100%;
    min-width: 1400px;
    border-collapse: collapse;
    table-layout: auto;
    font-size: 13px;
}

.admin-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.admin-table td {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;
    white-space: nowrap;
}

.admin-table tr:hover td {
    background: #f8fafc;
}

@media (max-width: 767px) {
    .admin-app {
        display: block;
    }

    .admin-sidebar {
        width: 100%;
        min-height: auto;
    }

    .admin-shell.sidebar-collapsed .admin-sidebar {
        width: 100%;
        flex-basis: auto;
    }

    .admin-shell.sidebar-collapsed .admin-sidebar .admin-sidebar-caption,
    .admin-shell.sidebar-collapsed .admin-nav-full {
        display: inline;
    }

    .admin-shell.sidebar-collapsed .admin-nav-short {
        display: none;
    }

    .admin-shell.sidebar-collapsed .admin-nav-link {
        justify-content: flex-start;
        padding-left: 16px;
        padding-right: 16px;
    }

    .admin-sidebar-nav {
        gap: 8px;
    }
}

@media (max-width: 640px) {
    .btn-primary,
    .btn-accent,
    .btn-outline,
    .btn-success,
    .btn-danger {
        width: 100%;
    }
}
