/* assets/style.css */

/* Global reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    background: radial-gradient(circle at top, #1f2937 0, #020617 45%, #000 100%);
    color: #e5e7eb;
    -webkit-font-smoothing: antialiased;
}

a {
    color: #60a5fa;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

.app-shell {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 32px 16px;
}

.app-card {
    width: 100%;
    max-width: 420px;
    background: rgba(15, 23, 42, 0.95);
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.75),
        0 0 0 1px rgba(15, 23, 42, 0.8);
    padding: 28px 24px 24px;
}

.app-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-bottom: 6px;
}

.app-subtitle {
    font-size: 14px;
    color: #9ca3af;
    margin-bottom: 20px;
}

form {
    margin-top: 10px;
}

.form-group {
    margin-bottom: 14px;
}

.form-label {
    font-size: 13px;
    margin-bottom: 6px;
    display: block;
    color: #9ca3af;
}

.form-input {
    width: 100%;
    padding: 10px 11px;
    border-radius: 10px;
    border: 1px solid #374151;
    background: rgba(15, 23, 42, 0.9);
    color: #e5e7eb;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.form-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.7);
    background: rgba(15, 23, 42, 1);
}

.form-input::placeholder {
    color: #6b7280;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: white;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.45);
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 24px rgba(37, 99, 235, 0.6);
}

.btn-secondary {
    background: transparent;
    border: 1px solid #4b5563;
    color: #e5e7eb;
}

.btn-secondary:hover {
    background: rgba(31, 41, 55, 0.9);
}

.alert-error {
    background: rgba(185, 28, 28, 0.18);
    border: 1px solid rgba(248, 113, 113, 0.55);
    color: #fecaca;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 13px;
    margin-bottom: 12px;
}

.alert-success {
    background: rgba(22, 163, 74, 0.2);
    border: 1px solid rgba(74, 222, 128, 0.6);
    color: #bbf7d0;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 13px;
    margin-bottom: 12px;
}

.auth-footer {
    margin-top: 16px;
    font-size: 13px;
    color: #9ca3af;
    text-align: center;
}

.layout {
    max-width: 1180px;
    margin: 0 auto;
    width: 100%;
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: 18px;
}

.sidebar {
    background: rgba(15, 23, 42, 0.95);
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    padding: 18px 16px 16px;
    box-shadow:
        0 16px 30px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(15, 23, 42, 0.8);
}

.sidebar-title {
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 4px;
}

.sidebar-sub {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 18px;
}

.sidebar-section-title {
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 8px;
}

.nav-list {
    list-style: none;
    margin-bottom: 16px;
}

.nav-item {
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 10px;
    font-size: 14px;
    color: #e5e7eb;
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.nav-link:hover {
    background: rgba(31, 41, 55, 0.9);
    border-color: rgba(55, 65, 81, 0.8);
    transform: translateY(-1px);
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(129, 140, 248, 0.18));
    border-color: rgba(59, 130, 246, 0.85);
}

.main {
    background: rgba(15, 23, 42, 0.95);
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    padding: 18px 18px 22px;
    box-shadow:
        0 18px 34px rgba(0, 0, 0, 0.75),
        0 0 0 1px rgba(15, 23, 42, 0.9);
}

.main-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.main-title {
    font-size: 20px;
    font-weight: 600;
}

.main-sub {
    font-size: 13px;
    color: #9ca3af;
}

.stat-card {
    border-radius: 14px;
    background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.25), transparent 55%),
                rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(96, 165, 250, 0.45);
    padding: 14px 14px 12px;
    margin-bottom: 18px;
}

.stat-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #bfdbfe;
    margin-bottom: 4px;
}

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

.table-wrapper {
    margin-top: 4px;
    border-radius: 14px;
    border: 1px solid rgba(55, 65, 81, 0.9);
    overflow: hidden;
    background: rgba(15, 23, 42, 0.96);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table th,
.table td {
    padding: 9px 10px;
    text-align: left;
}

.table th {
    background: rgba(15, 23, 42, 0.96);
    border-bottom: 1px solid rgba(55, 65, 81, 1);
    color: #9ca3af;
    font-weight: 500;
    font-size: 12px;
}

.table tr:nth-child(even) td {
    background: rgba(17, 24, 39, 0.96);
}

.table tr:hover td {
    background: rgba(31, 41, 55, 0.95);
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
}

.badge-success {
    background: rgba(22, 163, 74, 0.18);
    color: #bbf7d0;
}

.badge-pending {
    background: rgba(234, 179, 8, 0.16);
    color: #facc15;
}

.badge-danger {
    background: rgba(220, 38, 38, 0.18);
    color: #fecaca;
}

.form-card {
    max-width: 520px;
}

@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr;
    }
    .sidebar {
        order: 1;
    }
    .main {
        order: 2;
    }
}

@media (max-width: 600px) {
    .app-shell {
        padding: 18px 12px;
    }
    .app-card {
        padding: 22px 18px 18px;
    }

    .layout {
        gap: 12px;
    }

    .main-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .table th,
    .table td {
        padding: 7px 8px;
    }
}

.tier-card {
    background: #111827;
    border: 1px solid #1f2937;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.tier-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.tier-id {
    font-weight: bold;
    color: #9CA3AF;
    width: 60px;
}

.tier-input {
    flex: 1;
    min-width: 120px;
}

.tier-actions {
    display: flex;
    gap: 8px;
}

/* === Asosiy layout (desktop) === */
.app-shell {
    min-height: 100vh;
}

.layout {
    display: flex;
    align-items: stretch;
}

/* Sidebar kengligi desktopda */
.sidebar {
    width: 260px;
    flex-shrink: 0;
}

/* Asosiy kontent */
.main {
    flex: 1;
    padding: 20px 24px;
}

/* Stat kartalar uchun grid (desktop) */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

/* Jadval qatori juda keng bo'lsa scroll bo'lishi uchun */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

/* === Mobil / planshet uchun breakpoint === */
@media (max-width: 900px) {
    /* Layoutni ustma-ust qilib qo'yamiz */
    .layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #1f2937;
    }

    .main {
        padding: 14px 12px;
    }

    /* Stat kartalar 1 yoki 2 ustunli bo'lib qoladi */
    .stat-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 12px;
    }

    /* Jadval matnini biroz kichraytirish */
    .table th,
    .table td {
        padding: 6px 8px;
        font-size: 13px;
        white-space: nowrap; /* ustunlar yonma-yon ketadi, scroll bilan ko'rinadi */
    }

    /* Form kartalarini ekranga moslab */
    .form-card,
    .stat-card {
        padding: 12px;
    }

    .main-header {
        flex-direction: column;
        gap: 6px;
    }
}

/* Juda kichik ekranlar uchun (masalan eski telefonlar) */
@media (max-width: 480px) {
    .main-title {
        font-size: 18px;
    }

    .main-sub {
        font-size: 13px;
    }

    .btn {
        width: 100%;
        text-align: center;
    }
}
