html, body { overflow-x: hidden; }
body { background: #f1f5f9; font-family: 'Segoe UI', sans-serif; }
.admin-shell { min-height: 100vh; }
.admin-sidebar {
    width: 264px;
    background: #0f172a;
    color: #fff;
    padding: 1rem;
    padding-bottom: 5rem;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1040;
}
.admin-sidebar-brand {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    min-width: 0;
    text-align: center;
}
.admin-sidebar-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    min-width: 0;
    align-items: center;
}
.admin-sidebar-meta strong,
.admin-sidebar-meta span,
.admin-sidebar-meta small {
    overflow-wrap: anywhere;
    word-break: break-word;
    color: #cbd5e1;
    font-weight: 400;
}
.admin-sidebar-meta strong {
    color: #fff;
    font-weight: 600;
}
.admin-sidebar-meta span {
    font-size: .86rem;
}
.admin-sidebar-meta small {
    font-size: .78rem;
}
.admin-sidebar a { color: #cbd5e1; text-decoration: none; padding: .4rem .2rem; display: block; border-radius: 6px; }
.admin-sidebar a:hover { background: rgba(148,163,184,.2); color: #fff; }
.admin-sidebar a.active { background: #1d4ed8; color: #fff; font-weight: 600; }
.admin-content {
    min-width: 0;
    min-height: 100vh;
    margin-left: 264px;
    padding-top: 74px;
}
.admin-topbar {
    position: fixed;
    top: 0;
    left: 264px;
    right: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem 1.2rem;
    background: rgba(241, 245, 249, .95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #dbe5f0;
}
.admin-home-link {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    color: #0f172a;
}
.admin-home-link .logo {
    width: 40px;
    height: 40px;
}
.admin-topbar-user {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    white-space: nowrap;
}
.admin-menu-toggle {
    display: none;
}
.admin-main { min-width: 0; padding: 1.2rem; overflow: visible; }
.stat-card { background: #fff; border-radius: 14px; padding: 1rem; box-shadow: 0 10px 20px rgba(15,23,42,.06); border: 1px solid #e2e8f0; }
.admin-page-head {
    position: sticky;
    top: 73px;
    z-index: 1020;
    background: #f1f5f9;
    padding: .35rem 0 .85rem;
}
.admin-auth-brand .logo {
    width: 64px;
    height: 64px;
}
.table-responsive {
    max-width: 100%;
    overflow: visible;
}
.table-scroll-top,
.table-scroll-host {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
}
.table-scroll-top {
    margin-bottom: .75rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
}
.table-scroll-top-inner {
    height: 1px;
}
.table-scroll-host > .table {
    min-width: 100%;
}
.table-search-input {
    max-width: 320px;
}
.table-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.table-controls-top {
    margin-bottom: .75rem;
}
.table-controls-group {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}
.table-page-size {
    width: auto;
    min-width: 90px;
}
.table-pagination {
    display: flex;
    align-items: center;
    gap: .35rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.table-pagination .btn.active {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
}
.admin-sidebar-backdrop {
    display: none;
}
.password-toggle-wrap {
    position: relative;
}
.password-toggle-wrap .form-control,
.password-toggle-wrap .form-select {
    padding-right: 2.75rem;
}
.password-toggle-btn {
    position: absolute;
    top: 50%;
    right: .75rem;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #64748b;
    padding: 0;
    line-height: 1;
    z-index: 3;
}
.password-toggle-btn:hover,
.password-toggle-btn:focus {
    color: #0f172a;
}
@media (max-width: 992px) {
    .admin-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        left: 1rem;
        top: 50%;
        transform: translateY(-50%);
    }
    .admin-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        height: 100vh;
        max-width: 86vw;
        transform: translateX(-100%);
        transition: transform .25s ease;
        overflow-y: auto;
    }
    .admin-content {
        margin-left: 0;
        padding-top: 70px;
    }
    body.admin-sidebar-open .admin-sidebar {
        transform: translateX(0);
    }
    .admin-sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, .45);
        z-index: 1035;
    }
    body.admin-sidebar-open .admin-sidebar-backdrop {
        display: block;
    }
    .admin-topbar {
        left: 0;
        right: 0;
        padding: .75rem 1rem;
        justify-content: center;
    }
    .admin-topbar > div:first-child {
        width: 100%;
        justify-content: center;
    }
    .admin-home-link {
        flex-direction: row;
        align-items: center;
        gap: .5rem;
        text-align: center;
        margin: 0 auto;
    }
    .admin-home-link .brand-text {
        font-size: .95rem;
    }
    .admin-main {
        padding: 1rem;
    }
    .admin-page-head {
        top: 69px;
    }
    .table-controls {
        align-items: stretch;
    }
    .table-controls-top {
        display: flex;
        justify-content: flex-end;
    }
    .table-controls-top .table-top-group,
    .table-controls-top .table-top-pagination {
        display: none;
    }
    .table-controls-group,
    .table-pagination {
        width: 100%;
        justify-content: space-between;
    }
    .table-search-input,
    .table-page-size {
        width: 100%;
        max-width: none;
    }
    .table-scroll-top {
        display: none;
    }
}
@media (min-width: 993px) {
    .admin-sidebar {
        transform: none !important;
    }
    .admin-sidebar {
        scrollbar-width: none;
    }
    .admin-sidebar::-webkit-scrollbar {
        width: 0;
    }
    .admin-sidebar:hover {
        scrollbar-width: thin;
    }
    .admin-sidebar:hover::-webkit-scrollbar {
        width: 8px;
    }
    .admin-sidebar:hover::-webkit-scrollbar-thumb {
        background: rgba(148, 163, 184, .55);
        border-radius: 999px;
    }
    .table-responsive:hover .table-scroll-top {
        opacity: 1;
        pointer-events: auto;
    }
    .table-controls-top {
        display: grid;
        grid-template-columns: auto auto minmax(260px, 320px);
        align-items: center;
        gap: 1rem;
    }
    .table-controls-top .table-controls-group {
        width: auto;
        justify-content: flex-start;
    }
    .table-controls-top .table-pagination {
        width: auto;
        justify-content: center;
    }
    .table-controls-top .table-search-input {
        width: 100%;
        max-width: 320px;
        justify-self: end;
    }
}
