/* ====== GLOBAL RESET & BASE ====== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html, body {
    height: 100%;
}

body {
    background: #ffffff;
    color: #1d2327;
    -webkit-font-smoothing: antialiased;
    font-size: 15px;
    line-height: 1.5;
}

/* ====== LAYOUT ====== */

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

.app-full {
    min-height: 100vh;
    padding: 0;
}

/* ====== CARD ====== */
.card {
    background: #ffffff;
    border-radius: 4px;
    box-shadow: none;
    border: 1px solid #dcdcde;
    width: 100%;
    padding: 16px;
    margin-bottom: 20px;
}

.card-narrow {
    max-width: 680px;
    margin: 40px auto;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

/* ====== TYPOGRAPHY ====== */
.title {
    font-size: 24px;
    font-weight: 600;
    color: #1d2327;
}

.subtitle {
    font-size: 15px;
    color: #3c434a;
}

.text-muted {
    color: #646970;
    font-size: 14px;
}

.mono {
    font-family: "SF Mono", ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* ====== BADGE ====== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: #1d2327;
    color: #f0f0f1;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.2px;
}

.badge span {
    margin-left: 6px;
}

/* ====== BUTTONS ====== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 18px;
    border-radius: 3px;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease, border-color 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
}

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

.btn-primary {
    background: #2271b1;
    border-color: #2271b1;
    color: #ffffff;
    box-shadow: 0 1px 0 rgba(0,0,0,0.15);
}

.btn-primary:hover {
    background: #135e96;
    border-color: #135e96;
}

.btn-ghost {
    background: #ffffff;
    color: #1d2327;
    border: 1px solid #c3c4c7;
}

.btn-ghost:hover {
    background: #f3f4f6;
}

.btn-danger {
    background: #d63638;
    border-color: #d63638;
    color: #ffffff;
}

.btn-danger:hover {
    background: #b32d2e;
    border-color: #b32d2e;
}

.btn-block {
    width: 100%;
}

.btn-xs {
    padding: 5px 10px;
    font-size: 13px;
    border-radius: 3px;
}

/* ====== SECTIONS ====== */
.section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #dcdcde;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #1d2327;
}

.section-desc {
    font-size: 14px;
    color: #3c434a;
    margin-bottom: 12px;
}

/* ====== GRID ====== */
.grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}

.grid-2 {
    grid-template-columns: minmax(0, 1fr);
}

.grid-3 {
    grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 768px) {
    .grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .grid-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ====== FORM ELEMENTS ====== */
label {
    font-size: 14px;
    color: #1d2327;
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    padding: 8px 10px;
    border-radius: 3px;
    border: 1px solid #8c8f94;
    font-size: 14px;
    background: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    color: #1d2327;
}

input::placeholder,
textarea::placeholder {
    color: #8c8f94;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px rgba(34, 113, 177, 0.4);
    background: #ffffff;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

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

/* ====== MESSAGES / ALERTS ====== */
.message {
    font-size: 14px;
    margin-bottom: 12px;
    padding: 9px 11px;
    border-radius: 3px;
    border: 1px solid transparent;
}

.message-error {
    background: #fbeaea;
    color: #b32d2e;
    border-color: #d63638;
}

.message-success {
    background: #ecf7ed;
    color: #007017;
    border-color: #00a32a;
}

.message-info {
    background: #e5f5fa;
    color: #2271b1;
    border-color: #72aee6;
}

/* ====== TABLES ====== */
.table-wrapper {
    max-height: 400px;
    overflow: auto;
    border-radius: 3px;
    border: 1px solid #c3c4c7;
    background: #ffffff;
}

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

th,
td {
    padding: 8px 11px;
    border-bottom: 1px solid #dcdcde;
    text-align: left;
}

th {
    font-size: 14px;
    text-transform: uppercase;
    color: #1d2327;
    background: #f6f7f7;
    position: sticky;
    top: 0;
    z-index: 1;
    font-weight: 700;
}

/* ====== TAGS / STATUS BADGES ====== */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}

.tag-green {
    background: #00a32a;
    color: #f6f7f7;
}

.tag-gray {
    background: #646970;
    color: #f6f7f7;
}

.tag-red {
    background: #d63638;
    color: #fef2f2;
}

.tag-blue {
    background: #2271b1;
    color: #f6f7f7;
}

/* ====== TOP RIGHT AREA ====== */
.top-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.sys-login {
    font-size: 14px;
    color: #3c434a;
}

/* ====== SMALL UTILITIES ====== */
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }

.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

.text-right { text-align: right; }
.text-center { text-align: center; }

.hidden { display: none !important; }

/* =========================================================
   SYSADMIN ADMIN LAYOUT
   ========================================================= */

.admin-layout {
    display: flex;
    gap: 0;
    margin: 0;
    max-width: none;
}

@media (max-width: 960px) {
    .admin-layout {
        flex-direction: column;
    }
}

.admin-sidebar {
    width: 240px;
    background: #1d2327;
    border-radius: 0;
    padding: 16px 0;
    color: #f0f0f1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-size: 13px;
}

@media (max-width: 960px) {
    .admin-sidebar {
        width: 100%;
        border-radius: 0;
        padding: 12px 0;
        min-height: auto;
    }
}

.admin-main {
    flex: 1;
    padding: 24px 24px 40px 24px;
}

/* Brand / logo blok */
.admin-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px 12px 16px;
    border-bottom: 1px solid #2c3338;
    margin-bottom: 12px;
}

.admin-logo {
    width: 32px;
    height: 32px;
    border-radius: 3px;
    background: #2271b1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    color: #f0f0f1;
}

.admin-brand-text {
    display: flex;
    flex-direction: column;
}

.admin-brand-title {
    font-weight: 600;
    font-size: 14px;
    color: #ffffff;
}

.admin-brand-sub {
    font-size: 13px;
    color: #a7aaad;
}

/* Foydalanuvchi box */
.admin-user-box {
    padding: 10px 16px;
    border-top: 1px solid #2c3338;
    border-bottom: 1px solid #2c3338;
    margin-bottom: 8px;
}

.admin-user-name {
    font-weight: 600;
    font-size: 13px;
    color: #ffffff;
}

.admin-user-role {
    font-size: 13px;
    color: #a7aaad;
}

/* Sidebar menu */
.admin-menu {
    flex: 1 1 auto;
    padding: 8px 0;
}

.menu-link {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: #cbcbcb;
    font-size: 16px;
}
.menu-sublink {
    display: block;
    padding: 10px 20px;
    text-decoration: none;
    color: #cbcbcb;
    font-size: 14px;
    margin-top: 5px;
    margin-bottom: 5px;
}

/* Bo‘lim nomlari – to‘liq ko‘k */
.menu-link.is-section {
    cursor: default;
    font-weight: 500;
    background: #2271b1;
    color: #ffffff;
}

/* Bo‘lim nomlari hoverda o‘zgarmas */
.menu-link.is-section:hover {
    background: #2271b1;
    color: #ffffff;
}

/* Linklar hover */
.menu-link:hover,
.menu-sublink:hover {
    background: #2c3338;
    color: #ffffff;
}

/* Aktiv linklar – fon sidebar bilan bir xil,
   faqat shrift biroz qalinroq */
.menu-link.is-active,
.menu-sublink.is-active {
    background: #1d2327;
    color: #ffffff;
    font-weight: 600;
}

/* Sub-linklar – biroz ichkariga */
.menu-sublink {
    padding-left: 32px;
}

.menu-sublink.disabled {
    opacity: 0.6;
    pointer-events: none;
}

/* Guruhlar orasida bo‘shliqni yo‘qotish */
.menu-group {
    margin-top: 0;
    margin-bottom: 0;
}

/* Logout pastda */
.admin-logout-form {
    padding: 12px 16px 4px 16px;
    margin-top: auto;
}

.admin-logout-form .btn {
    width: 100%;
}

/* ====== DASHBOARD STAT KARTALAR ====== */
.stat-card {
    background: #ffffff;
    border-radius: 4px;
    padding: 12px 14px;
    border: 1px solid #dcdcde;
}

.stat-label {
    font-size: 14px;
    color: #3c434a;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 2px;
    color: #1d2327;
}

.stat-sub {
    font-size: 14px;
    color: #646970;
}

/* ====== TEZKOR LINKLAR ====== */
.quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.quick-link {
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #ffffff;
    text-decoration: none;
    color: #1d2327;
    border: 1px solid #c3c4c7;
    white-space: nowrap;
}

.quick-link:hover {
    background: #f3f4f6;
}
