/* ===================================
   ADS Platform — iOS / Apple Style UI
   ads.codingtech.uz
   Premium glassmorphism + clean design
   =================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ===== CSS Variables — Apple Design ===== */
:root {
    --bg-primary: #000000;
    --bg-secondary: #0d0d0d;
    --bg-tertiary: #1a1a1a;
    --bg-card: rgba(28, 28, 30, 0.72);
    --bg-card-solid: #1c1c1e;
    --bg-elevated: rgba(44, 44, 46, 0.65);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --bg-glass-hover: rgba(255, 255, 255, 0.08);
    --bg-input: rgba(118, 118, 128, 0.12);
    --bg-input-focus: rgba(118, 118, 128, 0.2);

    --text-primary: #f5f5f7;
    --text-secondary: rgba(235, 235, 245, 0.6);
    --text-tertiary: rgba(235, 235, 245, 0.3);
    --text-link: #0a84ff;

    --accent: #0a84ff;
    --accent-hover: #409cff;
    --accent-glow: rgba(10, 132, 255, 0.25);
    --accent-gradient: linear-gradient(135deg, #0a84ff 0%, #5e5ce6 100%);
    --purple: #bf5af2;
    --teal: #64d2ff;

    --green: #30d158;
    --green-bg: rgba(48, 209, 88, 0.12);
    --yellow: #ffd60a;
    --yellow-bg: rgba(255, 214, 10, 0.12);
    --orange: #ff9f0a;
    --orange-bg: rgba(255, 159, 10, 0.12);
    --red: #ff453a;
    --red-bg: rgba(255, 69, 58, 0.12);
    --blue-bg: rgba(10, 132, 255, 0.12);

    --separator: rgba(84, 84, 88, 0.36);
    --separator-light: rgba(84, 84, 88, 0.18);

    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 100px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.5);
    --shadow-card: 0 2px 16px rgba(0, 0, 0, 0.25), 0 0 1px rgba(0, 0, 0, 0.15);

    --blur-amount: 40px;
    --transition-fast: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-spring: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== LIGHT THEME — Kun rejimi ===== */
[data-theme="light"] {
    --bg-primary: #f2f2f7;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e5e5ea;
    --bg-card: rgba(255, 255, 255, 0.82);
    --bg-card-solid: #ffffff;
    --bg-elevated: rgba(255, 255, 255, 0.72);
    --bg-glass: rgba(0, 0, 0, 0.03);
    --bg-glass-hover: rgba(0, 0, 0, 0.06);
    --bg-input: rgba(118, 118, 128, 0.08);
    --bg-input-focus: rgba(118, 118, 128, 0.14);

    --text-primary: #1c1c1e;
    --text-secondary: rgba(60, 60, 67, 0.7);
    --text-tertiary: rgba(60, 60, 67, 0.4);
    --text-link: #007aff;

    --accent: #007aff;
    --accent-hover: #0066d6;
    --accent-glow: rgba(0, 122, 255, 0.2);
    --accent-gradient: linear-gradient(135deg, #007aff 0%, #5856d6 100%);

    --separator: rgba(60, 60, 67, 0.18);
    --separator-light: rgba(60, 60, 67, 0.1);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.12);
    --shadow-card: 0 2px 16px rgba(0, 0, 0, 0.06), 0 0 1px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .bg-animation .orb {
    opacity: 0.06;
}

[data-theme="light"] .sidebar {
    background: rgba(255, 255, 255, 0.88);
}

[data-theme="light"] .table th {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .btn-warning {
    color: white;
}

/* ===== Theme Toggle Button ===== */
.theme-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1000;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--separator);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.theme-toggle:active {
    transform: scale(0.95);
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    letter-spacing: -0.01em;
}

a {
    color: var(--text-link);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ===== Animated Background — Subtle ===== */
.bg-animation {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bg-animation .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    animation: orbFloat 25s infinite ease-in-out;
    will-change: transform;
}

.bg-animation .orb:nth-child(1) {
    width: 600px;
    height: 600px;
    background: var(--accent);
    top: -200px;
    right: -150px;
}

.bg-animation .orb:nth-child(2) {
    width: 500px;
    height: 500px;
    background: var(--purple);
    bottom: -150px;
    left: -100px;
    animation-delay: -8s;
}

.bg-animation .orb:nth-child(3) {
    width: 350px;
    height: 350px;
    background: var(--teal);
    top: 40%;
    left: 40%;
    animation-delay: -15s;
}

@keyframes orbFloat {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(40px, -60px) scale(1.05);
    }

    66% {
        transform: translate(-30px, 40px) scale(0.95);
    }
}

/* ===== Auth Container ===== */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    position: relative;
    z-index: 1;
}

/* ===== Auth Card — iOS-style Glass ===== */
.auth-card {
    background: var(--bg-card);
    backdrop-filter: blur(var(--blur-amount)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--blur-amount)) saturate(180%);
    border: 1px solid var(--separator);
    border-radius: var(--radius-xl);
    padding: 44px 36px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    animation: cardAppear 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo {
    width: 60px;
    height: 60px;
    background: var(--accent-gradient);
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 26px;
    font-weight: 900;
    color: white;
    box-shadow: 0 4px 24px var(--accent-glow);
    position: relative;
}

.auth-logo::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: var(--accent-gradient);
    z-index: -1;
    filter: blur(16px);
    opacity: 0.4;
}

.auth-header h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 400;
}

/* ===== iOS-style Form Controls ===== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 16px;
    font-weight: 400;
    transition: var(--transition-fast);
    outline: none;
    -webkit-appearance: none;
}

.form-control:focus {
    background: var(--bg-input-focus);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-control::placeholder {
    color: var(--text-tertiary);
}

/* iOS grouped inputs */
.form-grouped {
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 16px;
}

.form-grouped .form-group {
    margin-bottom: 0;
}

.form-grouped .form-group+.form-group {
    border-top: 1px solid var(--separator-light);
}

.form-grouped .form-control {
    border-radius: 0;
}

.form-grouped .form-group:first-child .form-control {
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.form-grouped .form-group:last-child .form-control {
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.form-grouped .form-group label {
    display: none;
}

/* ===== iOS Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    border: none;
    text-decoration: none;
    line-height: 1.2;
    -webkit-appearance: none;
    user-select: none;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: white;
    width: 100%;
    border-radius: var(--radius-sm);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: scale(1.01);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
    width: auto;
    border-radius: var(--radius-xs);
}

.btn-success {
    background: var(--green);
    color: white;
}

.btn-success:hover {
    filter: brightness(1.1);
}

.btn-warning {
    background: var(--orange);
    color: #1c1c1e;
}

.btn-warning:hover {
    filter: brightness(1.1);
}

.btn-danger {
    background: var(--red);
    color: white;
}

.btn-danger:hover {
    filter: brightness(1.1);
}

.btn-outline {
    background: var(--bg-glass);
    color: var(--text-secondary);
    border: 1px solid var(--separator);
}

.btn-outline:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
}

.btn-text {
    background: transparent;
    color: var(--accent);
    padding: 8px 12px;
}

.btn-text:hover {
    background: var(--blue-bg);
}

/* ===== Toast Notifications (Fixed, bottom-right) ===== */
.flash-messages {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    max-width: 400px;
}

.alert {
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
        toastOut 0.4s ease 4s forwards;
    cursor: pointer;
}

.alert:hover {
    opacity: 1 !important;
    animation-play-state: paused;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.8);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
        max-height: 80px;
    }

    to {
        opacity: 0;
        transform: translateX(120%);
        max-height: 0;
        padding: 0;
        margin: 0;
        overflow: hidden;
    }
}

.alert::before {
    font-size: 16px;
    flex-shrink: 0;
}

.alert-success {
    background: rgba(48, 209, 88, 0.15);
    color: #30d158;
    border-color: rgba(48, 209, 88, 0.25);
}

.alert-success::before {
    content: '✓';
}

.alert-warning {
    background: rgba(255, 159, 10, 0.15);
    color: #ff9f0a;
    border-color: rgba(255, 159, 10, 0.25);
}

.alert-warning::before {
    content: '⚠';
}

.alert-error {
    background: rgba(255, 69, 58, 0.15);
    color: #ff453a;
    border-color: rgba(255, 69, 58, 0.25);
}

.alert-error::before {
    content: '✕';
}

.alert-info {
    background: rgba(100, 210, 255, 0.15);
    color: #64d2ff;
    border-color: rgba(100, 210, 255, 0.25);
}

.alert-info::before {
    content: 'ℹ';
}

/* ===== Auth Footer ===== */
.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-tertiary);
}

.auth-footer a {
    color: var(--accent);
    font-weight: 500;
}

.auth-footer a:hover {
    color: var(--accent-hover);
    text-decoration: none;
}

/* ===== Dashboard Layout ===== */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ===== Sidebar — iOS Style ===== */
.sidebar {
    width: 260px;
    background: rgba(13, 13, 13, 0.85);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border-right: 1px solid var(--separator-light);
    padding: 16px 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    padding: 8px 20px 20px;
    border-bottom: 1px solid var(--separator-light);
    margin-bottom: 8px;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.sidebar-logo:hover {
    text-decoration: none;
}

.sidebar-logo-icon {
    width: 36px;
    height: 36px;
    background: var(--accent-gradient);
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 15px;
    color: white;
}

.sidebar-logo-text {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.sidebar-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 16px 20px 8px;
}

.sidebar-nav {
    flex: 1;
    padding: 0 8px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-xs);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-fast);
    margin-bottom: 2px;
}

.nav-item:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
    text-decoration: none;
}

.nav-item.active {
    background: var(--accent-glow);
    color: var(--accent);
}

.nav-item .icon {
    font-size: 18px;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.nav-badge {
    margin-left: auto;
    background: var(--red);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    min-width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 12px 8px;
    border-top: 1px solid var(--separator-light);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-xs);
    transition: var(--transition-fast);
}

.user-info:hover {
    background: var(--bg-glass-hover);
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 11px;
    color: var(--text-tertiary);
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 32px 40px;
    min-height: 100vh;
}

.page-header {
    margin-bottom: 28px;
}

.page-header h1 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 4px;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 15px;
}

/* ===== Stats Cards — iOS Widget Style ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border: 1px solid var(--separator-light);
    border-radius: var(--radius-lg);
    padding: 22px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card.accent::before {
    background: var(--accent-gradient);
}

.stat-card.success::before {
    background: linear-gradient(90deg, #30d158, #34c759);
}

.stat-card.warning::before {
    background: linear-gradient(90deg, #ff9f0a, #ffd60a);
}

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

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 14px;
}

.stat-card.accent .stat-icon {
    background: var(--blue-bg);
}

.stat-card.success .stat-icon {
    background: var(--green-bg);
}

.stat-card.warning .stat-icon {
    background: var(--orange-bg);
}

.stat-value {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.stat-label {
    font-size: 13px;
    color: var(--text-tertiary);
    font-weight: 500;
}

/* ===== Table Card ===== */
.table-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border: 1px solid var(--separator-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--separator-light);
}

.table-header h2 {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.table-responsive {
    overflow-x: auto;
}

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

.table th {
    text-align: left;
    padding: 12px 22px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: rgba(0, 0, 0, 0.2);
}

.table td {
    padding: 14px 22px;
    font-size: 14px;
    border-bottom: 1px solid var(--separator-light);
    color: var(--text-primary);
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr {
    transition: var(--transition-fast);
}

.table tr:hover td {
    background: var(--bg-glass);
}

/* ===== Badges — iOS Pill Style ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.badge-active {
    background: var(--green-bg);
    color: var(--green);
}

.badge-active::before {
    content: '●';
    font-size: 8px;
}

.badge-pending {
    background: var(--yellow-bg);
    color: var(--yellow);
}

.badge-pending::before {
    content: '●';
    font-size: 8px;
}

.badge-admin {
    background: var(--blue-bg);
    color: var(--accent);
}

/* ===== Action Buttons ===== */
.action-buttons {
    display: flex;
    gap: 6px;
}

.action-btn {
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    border: none;
    font-family: inherit;
    letter-spacing: 0.01em;
}

.action-btn:active {
    transform: scale(0.95);
}

.action-btn-activate {
    background: var(--green-bg);
    color: var(--green);
}

.action-btn-activate:hover {
    background: var(--green);
    color: white;
}

.action-btn-deactivate {
    background: var(--orange-bg);
    color: var(--orange);
}

.action-btn-deactivate:hover {
    background: var(--orange);
    color: #1c1c1e;
}

.action-btn-delete {
    background: var(--red-bg);
    color: var(--red);
}

.action-btn-delete:hover {
    background: var(--red);
    color: white;
}

/* ===== Welcome Card ===== */
.welcome-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px) saturate(150%);
    border: 1px solid var(--separator-light);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    text-align: center;
}

.welcome-emoji {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.welcome-card h2 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
}

.welcome-card p {
    color: var(--text-secondary);
    font-size: 15px;
    max-width: 420px;
    margin: 0 auto;
}

/* ===== Form Errors ===== */
.field-errors {
    list-style: none;
    margin-top: 6px;
}

.field-errors li {
    font-size: 12px;
    color: var(--red);
    margin-top: 3px;
    font-weight: 500;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 15px;
}

/* ===== Mobile Toggle ===== */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 200;
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--separator);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 18px;
    align-items: center;
    justify-content: center;
}

/* ===== Responsive ===== */

/* ── Sidebar overlay backdrop ── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
}

/* ── Tablet (≤1024px) ── */
@media (max-width: 1024px) {
    .main-content {
        padding: 28px 24px;
    }

    .stat-value {
        font-size: 28px;
    }

    .welcome-card {
        padding: 36px 28px;
    }
}

/* ── Mobile (≤768px) ── */
@media (max-width: 768px) {

    /* Sidebar — slide in/out */
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        box-shadow: none;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 8px 0 32px rgba(0, 0, 0, 0.5);
    }

    .sidebar-overlay {
        display: block;
    }

    /* Main content — full width */
    .main-content {
        margin-left: 0;
        padding: 20px 16px;
        padding-top: 60px;
        /* hamburger tugma uchun joy */
    }

    /* Mobile hamburger */
    .mobile-toggle {
        display: flex !important;
    }

    /* Theme toggle */
    .theme-toggle {
        top: 12px;
        right: 12px;
        width: 38px;
        height: 38px;
        font-size: 17px;
    }

    /* Page header */
    .page-header h1 {
        font-size: 22px;
    }

    .page-header p {
        font-size: 13px;
    }

    /* Stats cards */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-card {
        padding: 16px;
        border-radius: var(--radius-md);
    }

    .stat-icon {
        width: 34px;
        height: 34px;
        font-size: 17px;
        margin-bottom: 10px;
    }

    .stat-value {
        font-size: 24px;
    }

    .stat-label {
        font-size: 11px;
    }

    /* Table card */
    .table-card {
        border-radius: var(--radius-md);
    }

    .table-header {
        padding: 14px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .table-header h2 {
        font-size: 15px;
    }

    /* Table cells */
    .table th,
    .table td {
        padding: 10px 14px;
        font-size: 13px;
    }

    .table th {
        font-size: 10px;
    }

    /* Action buttons */
    .action-buttons {
        flex-wrap: wrap;
    }

    .action-btn {
        padding: 5px 10px;
        font-size: 11px;
    }

    /* Auth card */
    .auth-card {
        padding: 32px 20px;
        border-radius: var(--radius-lg);
    }

    .auth-header h1 {
        font-size: 24px;
    }

    /* Toast notifications */
    .flash-messages {
        left: 12px;
        right: 12px;
        bottom: 16px;
        max-width: none;
    }

    .alert {
        font-size: 13px;
        padding: 12px 16px;
    }

    /* Welcome card */
    .welcome-card {
        padding: 32px 20px;
        border-radius: var(--radius-lg);
    }

    .welcome-card h2 {
        font-size: 22px;
    }

    .welcome-emoji {
        font-size: 40px;
    }

    /* Buttons */
    .btn {
        padding: 12px 20px;
        font-size: 15px;
    }

    .btn-sm {
        padding: 7px 14px;
        font-size: 13px;
    }

    /* Form controls */
    .form-control {
        font-size: 16px;
        /* 16px prevents iOS zoom on focus */
        padding: 12px 14px;
    }

    /* Badges */
    .badge {
        font-size: 11px;
        padding: 3px 8px;
    }

    /* Empty state */
    .empty-state {
        padding: 40px 16px;
    }
}

/* ── Small phones (≤480px) ── */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 16px 12px;
        padding-top: 56px;
    }

    .page-header h1 {
        font-size: 20px;
    }

    .stat-card {
        padding: 14px;
    }

    .stat-value {
        font-size: 22px;
    }

    .table th,
    .table td {
        padding: 8px 12px;
        font-size: 12px;
    }

    .auth-card {
        padding: 24px 16px;
    }

    .auth-header h1 {
        font-size: 22px;
    }

    .auth-logo {
        width: 50px;
        height: 50px;
        font-size: 22px;
        margin-bottom: 16px;
    }
}

/* ===== Password toggle ===== */
.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    transition: var(--transition-fast);
}

.password-toggle:hover {
    color: var(--text-secondary);
}

/* ===== Divider ===== */
.divider {
    height: 1px;
    background: var(--separator-light);
    margin: 20px 0;
}

/* ===== Logout button in sidebar ===== */
.logout-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-xs);
    color: var(--red);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-fast);
    width: 100%;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

.logout-btn:hover {
    background: var(--red-bg);
    text-decoration: none;
}

.logout-btn .icon {
    font-size: 18px;
    width: 22px;
    text-align: center;
}