html, body {
    height: 100%;
}

body {
    margin: 0;
    font-family: "Inter", "Segoe UI", sans-serif;
    background: #f0f3f9;
    color: #1b2440;
}

a {
    text-decoration: none;
}

/* ── Shell ── */
.admin-shell {
    min-height: 100vh;
    display: flex;
    position: relative;
}

/* ── Sidebar overlay backdrop (mobile) ── */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 998;
    opacity: 0;
    transition: opacity .25s;
}

    .sidebar-backdrop.open {
        display: block;
        opacity: 1;
    }

/* ── Hamburger button (mobile) ── */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: #1b2440;
    font-size: 24px;
    padding: 4px;
    line-height: 1;
    margin-right: 8px;
}

/* ── Sidebar ── */
.sidebar {
    width: 252px;
    background: #162f5f;
    color: #c4d4ef;
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-shrink: 0;
}

/* Brand */
.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    color: #fff;
    margin-bottom: 18px;
}

.brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #1db9c3;
    display: grid;
    place-items: center;
    font-size: 20px;
    color: #fff;
    flex-shrink: 0;
}

.brand-title {
    font-weight: 700;
    font-size: 15px;
    line-height: 1.2;
    color: #fff;
}

.brand-subtitle {
    font-size: 11px;
    color: #7f99c8;
    margin-top: 2px;
}

/* Separator */
.sidebar-sep {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    margin: 10px 2px;
}

/* Group title */
.nav-group-title {
    font-size: 10px;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: #6080aa;
    font-weight: 600;
    margin: 12px 0 4px 4px;
}

/* Nav links */
.sidebar-nav {
    display: grid;
    gap: 1px;
}

.nav-link-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #c0d2ee;
    padding: 9px 10px;
    border-radius: 8px;
    font-size: 13.5px;
    transition: background .15s, color .15s;
}

    .nav-link-item i {
        font-size: 17px;
        opacity: .8;
        flex-shrink: 0;
    }

    .nav-link-item span:first-of-type {
        flex: 1;
    }

    .nav-link-item:hover {
        background: rgba(255, 255, 255, 0.07);
        color: #fff;
    }

    .nav-link-item.active {
        background: #1f4a95;
        color: #fff;
    }

        .nav-link-item.active i {
            opacity: 1;
        }

/* Badge (числа) */
.nav-badge {
    background: rgba(29, 185, 195, 0.22);
    color: #6ee7ed;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    line-height: 1.5;
    display: none;
}

    .nav-badge:not(:empty) {
        display: inline-block;
    }

/* Dot (уведомление-точка) */
.nav-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #e84d6a;
    flex-shrink: 0;
    display: none;
}

    .nav-dot.visible {
        display: block;
    }

/* Footer */
.sidebar-footer {
    margin-top: auto;
    padding-top: 14px;
    font-size: 11px;
    color: #4a6390;
}

/* ── Content area ── */
.content-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ── Topbar ── */
.topbar {
    background: #fff;
    border-bottom: 1px solid #e1e8f5;
    padding: 0 28px;
    height: 52px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.page-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #1b2440;
    line-height: 1.2;
}

.page-subtitle {
    color: #6f7d9c;
    font-size: 12px;
    margin-top: 2px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Языки */
.lang-switcher {
    display: flex;
    border: 1px solid #e1e8f5;
    border-radius: 8px;
    overflow: hidden;
}

.lang-btn {
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 500;
    background: transparent;
    border: none;
    border-left: 1px solid #e1e8f5;
    color: #6f7d9c;
    cursor: pointer;
    line-height: 1.6;
    transition: background .15s, color .15s;
}

    .lang-btn:first-child {
        border-left: none;
    }

    .lang-btn:hover {
        background: #f0f3f9;
        color: #1b2440;
    }

    .lang-btn.active {
        background: #e8effe;
        color: #1f4a95;
    }

/* Переключатель компании — кастомный дропдаун */
.cs-dropdown {
    position: relative;
    user-select: none;
}

.cs-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid #e1e8f5;
    border-radius: 8px;
    background: #fff;
    color: #1b2440;
    font-size: 13px;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
    min-width: 160px;
}

    .cs-trigger:hover {
        border-color: #c5d1eb;
    }

    .cs-trigger:focus-visible {
        outline: none;
        border-color: #4066c9;
        box-shadow: 0 0 0 2px rgba(64,102,201,.15);
    }

    .cs-trigger i {
        color: #6f7d9c;
        font-size: 15px;
        flex-shrink: 0;
    }

.cs-selected {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cs-arrow {
    transition: transform .2s;
}

.cs-trigger[aria-expanded="true"] .cs-arrow {
    transform: rotate(180deg);
}

.cs-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    min-width: 100%;
    background: #fff;
    border: 1px solid #e1e8f5;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(27,36,64,.10);
    z-index: 1000;
    display: none;
    max-height: 280px;
    overflow-y: auto;
    padding: 4px;
}

    .cs-menu.open {
        display: block;
    }

.cs-option {
    padding: 6px 10px;
    font-size: 13px;
    color: #1b2440;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background .1s;
}

    .cs-option:hover {
        background: #f0f4fe;
    }

    .cs-option:active {
        background: #e0e8f8;
    }

/* Пользователь */
.topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 10px;
    border-left: 1px solid #e1e8f5;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e8effe;
    color: #1f4a95;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.user-name {
    font-size: 13px;
    font-weight: 500;
    color: #1b2440;
}

.user-role {
    font-size: 11px;
    color: #6f7d9c;
}

/* Logout */
.topbar-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    border-radius: 6px;
    color: #6f7d9c;
    font-size: 18px;
    transition: background .15s, color .15s;
}

    .topbar-logout:hover {
        background: #f0f3f9;
        color: #c24c5b;
    }

/* Main content */
.content-area {
    padding: 24px;
    flex: 1;
}

/* ── Cards & Tables ── */
.section-card {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e2e8f4;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .04);
}

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

    .table-admin th,
    .table-admin td {
        padding: 12px 14px;
        border-bottom: 1px solid #edf1f8;
        font-size: 14px;
    }

    .table-admin th {
        color: #6f7d9c;
        font-weight: 600;
    }

.badge-soft {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    border-radius: 999px;
    padding: 4px 10px;
}

.badge-success {
    color: #2f9558;
    background: #e7f7ee;
}

.badge-danger {
    color: #c24c5b;
    background: #fbe8ea;
}

.badge-warning {
    color: #b3771c;
    background: #fff2dd;
}

/* ── Responsive ── */
@media (max-width: 1199px) {
    .sidebar {
        width: 220px;
    }
}

@media (max-width: 991px) {
    .topbar {
        padding: 0 16px;
    }

    .content-area {
        padding: 16px;
    }

    .topbar-actions {
        gap: 6px;
    }

    .cs-trigger {
        min-width: 130px;
    }
}

@media (max-width: 768px) {
    .sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 999;
        width: 280px;
        transform: translateX(-100%);
        transition: transform .25s ease;
        overflow-y: auto;
    }

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

    .content-wrap {
        width: 100%;
    }

    .topbar {
        padding: 0 12px;
        height: 48px;
    }

        .topbar > div:first-child {
            display: flex;
            align-items: center;
            min-width: 0;
        }

    .page-title {
        font-size: 14px;
    }

    .page-subtitle {
        font-size: 11px;
    }

    .topbar-actions {
        gap: 5px;
    }

    .user-info {
        display: none;
    }

    .cs-trigger {
        min-width: 110px;
        font-size: 12px;
    }

    .content-area {
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 100%;
    }

    .lang-switcher {
        display: none;
    }

    .cs-trigger {
        min-width: 80px;
        font-size: 11px;
        padding: 4px 8px;
    }
}

/* ── Dashboard responsive ── */
@media (max-width: 768px) {
    .display-6 {
        font-size: 1.5rem;
    }
}

/* ── Error page ── */
.le-error-page {
    background: #f0f3f9;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 16px;
}

.le-error-container {
    text-align: center;
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e2e8f4;
    padding: 48px 32px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .04);
}

.le-error-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #fbe8ea;
    color: #c24c5b;
    font-size: 28px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.le-error-title {
    font-size: 22px;
    font-weight: 700;
    color: #1b2440;
    margin: 0 0 8px;
}

.le-error-text {
    font-size: 14px;
    color: #6f7d9c;
    margin: 0 0 24px;
    line-height: 1.6;
}

.le-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s;
}

.le-btn-primary {
    background: #1f3864;
    color: #fff;
    border: none;
}

    .le-btn-primary:hover {
        background: #162b50;
        color: #fff;
    }

@media (max-width: 480px) {
    .le-error-container {
        padding: 32px 20px;
    }

    .le-error-title {
        font-size: 18px;
    }

    .le-error-text {
        font-size: 13px;
    }
}

/* ── Toast notifications ── */
#notify-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    max-width: 420px;
}

.notify-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #fff;
    box-shadow: 0 6px 20px rgba(0,0,0,.15);
    pointer-events: auto;
    transform: translateX(120%);
    transition: transform .3s cubic-bezier(.4,0,.2,1), opacity .3s;
    opacity: 0;
}

    .notify-toast.notify-visible {
        transform: translateX(0);
        opacity: 1;
    }

    .notify-toast i {
        font-size: 1.2rem;
        flex-shrink: 0;
    }

.notify-error {
    background: #dc3545;
}

.notify-warning {
    background: #f59e0b;
    color: #1b2440;
}

.notify-success {
    background: #10b981;
}

.notify-info {
    background: #3b82f6;
}
