/* ============================================================
   Admin panel
   ============================================================ */

:root {
    --admin-sidebar: 250px;
    --admin-navy: #0a1f3d;
    --admin-primary: #0b4fa8;
    --admin-bg: #f3f5f9;
}

.admin-body { background: var(--admin-bg); font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
.admin-wrapper { display: flex; min-height: 100vh; }

/* Sidebar */
.admin-sidebar {
    width: var(--admin-sidebar); flex-shrink: 0; background: var(--admin-navy); color: #fff;
    display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 1040;
    transition: transform .25s;
}
.admin-brand { display: flex; align-items: center; gap: .6rem; padding: 1.25rem 1.25rem; color: #fff; font-weight: 800; font-size: 1.1rem; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.08); }
.admin-brand i { font-size: 1.5rem; color: #f5b301; }
.admin-nav { padding: 1rem .75rem; display: flex; flex-direction: column; gap: .2rem; flex: 1; }
.admin-nav a {
    display: flex; align-items: center; gap: .75rem; padding: .7rem .9rem; border-radius: 10px;
    color: rgba(255,255,255,.7); text-decoration: none; font-weight: 600; font-size: .95rem; transition: background .15s, color .15s;
}
.admin-nav a i { font-size: 1.15rem; }
.admin-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.admin-nav a.active { background: var(--admin-primary); color: #fff; }
.admin-sidebar-bottom { padding: 1rem .75rem; border-top: 1px solid rgba(255,255,255,.08); }
.admin-sidebar-bottom a { display: flex; align-items: center; gap: .75rem; padding: .6rem .9rem; color: rgba(255,255,255,.6); text-decoration: none; font-size: .9rem; }
.admin-sidebar-bottom a:hover { color: #fff; }

/* Main */
.admin-main { flex: 1; margin-left: var(--admin-sidebar); display: flex; flex-direction: column; min-width: 0; }
.admin-topbar {
    display: flex; align-items: center; gap: .75rem; padding: .75rem 1.5rem; background: #fff;
    border-bottom: 1px solid #e5e9f0; position: sticky; top: 0; z-index: 1020;
}
.admin-content { padding: 1.5rem; }
.lang-switch-admin { display: inline-flex; background: var(--admin-bg); border-radius: 8px; padding: 3px; }
.lang-switch-admin a { padding: .3rem .6rem; border-radius: 6px; font-weight: 700; font-size: .8rem; color: #6b7280; text-decoration: none; }
.lang-switch-admin a.active { background: #fff; color: var(--admin-primary); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

.page-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.page-header h1 { font-size: 1.5rem; font-weight: 800; margin: 0; color: var(--admin-navy); }
.page-header > div { display: flex; gap: .5rem; }
.breadcrumb { font-size: .85rem; }

.card { border: 1px solid #e5e9f0; border-radius: 12px; box-shadow: 0 1px 3px rgba(10,31,61,.04); }
.card-header { background: #fff; border-bottom: 1px solid #e5e9f0; font-weight: 600; }
.card-footer { background: #fafbfd; border-top: 1px solid #e5e9f0; }
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: #6b7280; font-weight: 700; background: #fafbfd; border-bottom: 1px solid #e5e9f0; }
.table-row-new { background: #eef4fd; }
.table-row-new td { font-weight: 500; }
.badge.dropdown-toggle { cursor: pointer; font-size: .78rem; }
/* Dropdown menus inside tables must not be clipped by .table-responsive */
.table-responsive .dropdown-menu { z-index: 1080; }

/* Stat cards */
.stat-card {
    display: flex; align-items: center; gap: 1rem; padding: 1.25rem; background: #fff; border-radius: 12px;
    border: 1px solid #e5e9f0; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(10,31,61,.08); color: inherit; }
.stat-card-icon { width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; font-size: 1.5rem; }
.stat-primary .stat-card-icon { background: #e8f0fb; color: var(--admin-primary); }
.stat-success .stat-card-icon { background: #e6f7ee; color: #1a8f57; }
.stat-info .stat-card-icon { background: #e5f4fb; color: #0e7fa8; }
.stat-warning .stat-card-icon { background: #fff5db; color: #b47d00; }
.stat-card-value { font-size: 1.75rem; font-weight: 800; line-height: 1.1; color: var(--admin-navy); }
.stat-card-label { font-size: .85rem; color: #6b7280; }

/* Forms */
.form-label { font-weight: 600; font-size: .9rem; }
.form-control, .form-select { border-radius: 8px; }
.img-preview { max-width: 200px; max-height: 120px; object-fit: cover; border-radius: 8px; border: 1px solid #e5e9f0; }
.img-preview.rounded-circle { width: 120px; height: 120px; }
.avatar-sm { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; display: inline-grid; place-items: center; }
.avatar-placeholder { background: #e8f0fb; color: var(--admin-primary); font-weight: 800; }
.dl-view dt { color: #6b7280; font-weight: 600; font-size: .9rem; }
.dl-view dd { margin-bottom: .75rem; }

.setting-row { display: grid; grid-template-columns: 260px 1fr; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid #eef1f5; }
.setting-row:last-child { border-bottom: 0; }
.setting-label { font-weight: 600; font-size: .92rem; padding-top: .4rem; }
.setting-label code { display: block; font-size: .75rem; }
@media (max-width: 767px) { .setting-row { grid-template-columns: 1fr; gap: .4rem; } }

/* Login */
.admin-login-body {
    min-height: 100vh; display: grid; place-items: center; padding: 1rem;
    background: linear-gradient(135deg, #0a1f3d, #0b4fa8);
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 16px; padding: 2.5rem 2rem; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-brand { text-align: center; margin-bottom: 1.5rem; }
.login-brand i { font-size: 2.5rem; color: var(--admin-primary); }
.login-brand h1 { font-size: 1.4rem; font-weight: 800; margin: .5rem 0 .25rem; color: var(--admin-navy); }
.login-brand p { color: #6b7280; font-size: .9rem; margin: 0; }

.phone-link { white-space: nowrap; }
.td-message { max-width: 240px; }

/* Mobile */
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1035; }
@media (max-width: 991px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.open { transform: translateX(0); }
    .sidebar-backdrop.show { display: block; }
    .admin-main { margin-left: 0; }
    .admin-content { padding: 1rem; }
}

/* ---------- Mobil: jadvallar kartochka korinishida ---------- */
@media (max-width: 767px) {
    .admin-topbar { padding: .6rem .9rem; }
    .page-header h1 { font-size: 1.25rem; }
    .page-header .btn { padding: .4rem .8rem; font-size: .9rem; }
    .breadcrumb { margin-bottom: .75rem; }
    .stat-card { padding: .9rem 1rem; gap: .8rem; }
    .stat-card-icon { width: 44px; height: 44px; font-size: 1.25rem; }
    .stat-card-value { font-size: 1.4rem; }
    .card-body { padding: 1rem; }
    .nav-pills .nav-link { padding: .4rem .75rem; font-size: .9rem; }
    .img-preview { max-width: 100%; }

    .table-cards thead { display: none; }
    .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
    .table-cards tr { padding: .5rem .25rem; border-bottom: 1px solid #e5e9f0; }
    .table-cards tr:last-child { border-bottom: 0; }
    .table-cards td {
        display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
        padding: .35rem .5rem; border: 0; text-align: right !important; max-width: none;
    }
    .table-cards td::before {
        content: attr(data-label); flex-shrink: 0; min-width: 96px; text-align: left;
        font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; padding-top: .1rem;
    }
    .table-cards td:not([data-label])::before { content: none; }
    .table-cards td.td-actions { justify-content: flex-end; padding-top: .5rem; }
    .table-cards td.td-actions .btn { padding: .4rem .9rem; }
    .table-cards td.td-message { white-space: normal; }
    .table-row-new { border-left: 3px solid var(--admin-primary); }
    .dl-view dt { margin-top: .5rem; }
}