/* ==========================================================================
   Detektr AI — asosiy uslublar (Bootstrap 5 ustiga)
   Zamonaviy, professional admin panel dizayni.
   ========================================================================== */

:root {
    --brand: #4f46e5;
    --brand-2: #7c3aed;
    --brand-grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --sidebar-bg: #0f172a;
    --sidebar-bg-2: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #ffffff;
    --content-bg: #f1f5f9;
    --card-radius: 16px;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, .08);
    --shadow-md: 0 4px 20px rgba(15, 23, 42, .08);
    --shadow-lg: 0 10px 40px rgba(15, 23, 42, .12);
}

* {
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

body {
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--content-bg);
    color: #1e293b;
    -webkit-font-smoothing: antialiased;
}

/* ----------------------------- Layout ----------------------------------- */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1030;
    transition: transform .25s ease;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: 1.4rem 1.5rem;
    font-weight: 700;
    font-size: 1.15rem;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.sidebar__brand .logo-badge {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: var(--brand-grad);
    display: grid;
    place-items: center;
    font-size: 1.2rem;
    box-shadow: 0 6px 16px rgba(79, 70, 229, .45);
}

.sidebar__section {
    padding: 1rem 1.5rem .4rem;
    font-size: .7rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #475569;
    font-weight: 600;
}

.sidebar__nav {
    list-style: none;
    padding: 0 .75rem;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

.sidebar__nav a {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .7rem .85rem;
    margin: .15rem 0;
    border-radius: 10px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-weight: 500;
    font-size: .925rem;
    transition: all .18s ease;
}

.sidebar__nav a i {
    font-size: 1.15rem;
    width: 22px;
    text-align: center;
}

.sidebar__nav a:hover {
    background: var(--sidebar-bg-2);
    color: #fff;
}

.sidebar__nav a.active {
    background: var(--brand-grad);
    color: #fff;
    box-shadow: 0 6px 18px rgba(79, 70, 229, .4);
}

.sidebar__footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, .06);
}

.sidebar__user {
    display: flex;
    align-items: center;
    gap: .7rem;
}

.sidebar__user .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--brand-grad);
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 600;
}

.sidebar__user small {
    color: #64748b;
}

/* ----------------------------- Main ------------------------------------- */
.main {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: 68px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.75rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.topbar__title {
    font-weight: 700;
    font-size: 1.15rem;
    margin: 0;
}

.topbar__title small {
    display: block;
    font-weight: 400;
    font-size: .8rem;
    color: #94a3b8;
}

.content {
    padding: 1.75rem;
    flex: 1;
}

.sidebar-toggle {
    border: none;
    background: transparent;
    font-size: 1.4rem;
    color: #475569;
    display: none;
}

/* ----------------------------- Cards / stats ---------------------------- */
.card {
    border: none;
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-sm);
}

.stat-card {
    background: #fff;
    border-radius: var(--card-radius);
    padding: 1.4rem 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1.1rem;
    transition: transform .18s ease, box-shadow .18s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-card__icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    color: #fff;
    flex-shrink: 0;
}

.stat-card__icon.bg-brand { background: var(--brand-grad); }
.stat-card__icon.bg-green { background: linear-gradient(135deg, #10b981, #059669); }
.stat-card__icon.bg-amber { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-card__icon.bg-red   { background: linear-gradient(135deg, #ef4444, #dc2626); }
.stat-card__icon.bg-cyan  { background: linear-gradient(135deg, #06b6d4, #0891b2); }

.stat-card__value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
    color: #0f172a;
}

.stat-card__label {
    color: #94a3b8;
    font-size: .85rem;
    font-weight: 500;
    margin-top: .25rem;
}

/* ----------------------------- Tables ----------------------------------- */
.table-card {
    background: #fff;
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.table-card__header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #eef2f6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.table-card__header h5 {
    margin: 0;
    font-weight: 700;
}

.table {
    margin: 0;
}

.table > thead th {
    background: #f8fafc;
    color: #64748b;
    font-size: .78rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    font-weight: 600;
    border-bottom: 1px solid #eef2f6;
    padding: .85rem 1.5rem;
}

.table > tbody td {
    padding: 1rem 1.5rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.table > tbody tr:hover {
    background: #f8fafc;
}

.company-logo {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    object-fit: cover;
    background: var(--brand-grad);
    display: inline-grid;
    place-items: center;
    color: #fff;
    font-weight: 700;
    flex-shrink: 0;
}

/* ----------------------------- Badges / buttons ------------------------- */
.badge-status {
    padding: .4rem .75rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: .78rem;
}

.badge-status.active {
    background: #dcfce7;
    color: #16a34a;
}

.badge-status.blocked {
    background: #fee2e2;
    color: #dc2626;
}

.btn-brand {
    background: var(--brand-grad);
    border: none;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 6px 18px rgba(79, 70, 229, .35);
}

.btn-brand:hover {
    color: #fff;
    filter: brightness(1.05);
    box-shadow: 0 8px 22px rgba(79, 70, 229, .45);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-grid;
    place-items: center;
    border-radius: 9px;
}

/* ----------------------------- Login ------------------------------------ */
.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: var(--brand-grad);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.auth-wrap::before,
.auth-wrap::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
}

.auth-wrap::before {
    width: 480px;
    height: 480px;
    top: -160px;
    right: -120px;
}

.auth-wrap::after {
    width: 340px;
    height: 340px;
    bottom: -120px;
    left: -80px;
}

.auth-card {
    background: #fff;
    border-radius: 22px;
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.auth-card__logo {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: var(--brand-grad);
    display: grid;
    place-items: center;
    font-size: 2rem;
    color: #fff;
    margin: 0 auto 1.2rem;
    box-shadow: 0 10px 28px rgba(79, 70, 229, .45);
}

.auth-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: .35rem;
}

.auth-card .subtitle {
    text-align: center;
    color: #94a3b8;
    margin-bottom: 1.75rem;
    font-size: .92rem;
}

.form-label {
    font-weight: 600;
    font-size: .85rem;
    color: #475569;
    margin-bottom: .4rem;
}

/* ----------------------------- Empty state ------------------------------ */
.empty-state {
    text-align: center;
    padding: 3.5rem 1.5rem;
    color: #94a3b8;
}

.empty-state i {
    font-size: 3.5rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
}

/* ----------------------------- Responsive ------------------------------- */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main {
        margin-left: 0;
    }
    .sidebar-toggle {
        display: block;
    }
}
