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

:root {
    /* Neutrals */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --white: #ffffff;

    /* Brand & accents */
    --primary: #2e2a54;
    --primary-hover: #3d3868;
    --primary-light: #e8e7f0;
    --primary-bg: #f4f3f8;

    --sidebar-bg: #ffffff;
    --sidebar-hover: #f1f5f9;
    --sidebar-active: #eff6ff;
    --sidebar-text: #64748b;
    --sidebar-text-active: #1e293b;
    --sidebar-border: #e2e8f0;

    --blue: #3b82f6;
    --blue-bg: #eff6ff;
    --violet: #8b5cf6;
    --violet-bg: #f5f3ff;
    --emerald: #10b981;
    --emerald-bg: #ecfdf5;
    --amber: #f59e0b;
    --amber-bg: #fffbeb;
    --indigo: #6366f1;
    --indigo-bg: #eef2ff;
    --rose: #f43f5e;

    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --success: #22c55e;
    --success-bg: #f0fdf4;

    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
    --font: "Inter", system-ui, -apple-system, sans-serif;
    --sidebar-width: 260px;
}

html, body { height: 100%; }

body {
    font-family: var(--font);
    color: var(--gray-700);
    line-height: 1.5;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

/* ===== App layout: sidebar + main ===== */
.app-body { background: var(--gray-100); }

.app-shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 200;
    border-right: 1px solid var(--sidebar-border);
    box-shadow: 1px 0 4px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 0.75rem 0.45rem;
    text-decoration: none;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.logo-img {
    display: block;
    object-fit: contain;
}

.logo-img--sidebar {
    width: 100%;
    max-width: 120px;
    height: auto;
}

.logo-img--auth {
    width: 240px;
    max-width: 100%;
    height: auto;
    margin: 0 auto 1rem;
}

.sidebar__logo {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
    color: var(--white);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sidebar__title {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}

.sidebar__subtitle {
    display: block;
    font-size: 0.7rem;
    color: var(--gray-400);
    font-weight: 500;
}

.sidebar__nav {
    flex: 1;
    min-height: 0;
    padding: 0.35rem 0.65rem 0.65rem;
    overflow-y: auto;
}

.sidebar__section {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-500);
    padding: 0.5rem 0.75rem 0.25rem;
}

.sidebar__nav > .sidebar__section:first-child {
    padding-top: 0.15rem;
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.48rem 0.7rem;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--sidebar-text);
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    margin-bottom: 2px;
    position: relative;
}

.sidebar__link:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
}

.sidebar__link--active {
    background: var(--sidebar-active);
    color: var(--primary);
    font-weight: 600;
}

.sidebar__link--active .sidebar__icon { color: var(--primary); }

.sidebar__link--disabled {
    opacity: 0.5;
    pointer-events: none;
}

.sidebar__icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.sidebar__badge {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}

.sidebar__group {
    margin-bottom: 2px;
}

.sidebar__link--parent {
    cursor: pointer;
    width: 100%;
    border: none;
    background: transparent;
    font-family: inherit;
    text-align: left;
}

.sidebar__chevron {
    width: 15px;
    height: 15px;
    margin-left: auto;
    flex-shrink: 0;
    transition: transform 0.2s ease;
    color: var(--gray-400);
}

.sidebar__group--open .sidebar__chevron {
    transform: rotate(180deg);
}

.sidebar__subnav {
    display: none;
    flex-direction: column;
    gap: 1px;
    padding: 0.1rem 0 0.25rem 2rem;
}

.sidebar__group--open .sidebar__subnav {
    display: flex;
}

.sidebar__sublink {
    display: block;
    padding: 0.38rem 0.65rem;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--gray-500);
    font-size: 0.82rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.sidebar__sublink:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
}

.sidebar__sublink--active {
    background: var(--sidebar-active);
    color: var(--primary);
    font-weight: 600;
}

.subnav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.subnav__link {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--gray-200);
    background: var(--white);
    color: var(--gray-600);
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.subnav__link:hover {
    border-color: var(--gray-300);
    color: var(--gray-800);
}

.subnav__link--active {
    background: var(--primary-bg);
    border-color: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.stats-row a.stat-box.stat-box--link,
.stats-row a.stat-box.stat-box--link:hover,
.stats-row a.stat-box.stat-box--link .stat-box__value,
.stats-row a.stat-box.stat-box--link .stat-box__label {
    text-decoration: none;
    color: inherit;
}

.stats-row a.stat-box.stat-box--link {
    cursor: pointer;
}

.sidebar__footer {
    padding: 1rem;
    border-top: 1px solid var(--sidebar-border);
}

.sidebar__user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem;
    border-radius: var(--radius);
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
}

.sidebar__avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), #4f46e5);
    color: var(--white);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.sidebar__username {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-900);
    line-height: 1.2;
}

.sidebar__role {
    display: block;
    font-size: 0.7rem;
    color: var(--gray-500);
}

/* ===== Main area ===== */
.main-area {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.75rem;
    height: 56px;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    z-index: 150;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.topbar__breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.875rem;
}

.breadcrumb__root { color: var(--gray-400); font-weight: 500; }
.breadcrumb__sep { color: var(--gray-300); }
.breadcrumb__current { color: var(--gray-800); font-weight: 600; }

.topbar__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.topbar-clock {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.85rem;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    background: linear-gradient(180deg, #fafbfc 0%, #f3f4f6 100%);
    min-width: 0;
}

.topbar-clock__icon {
    flex-shrink: 0;
    color: var(--primary, #4f46e5);
}

.topbar-clock__body {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    line-height: 1.15;
    min-width: 0;
}

.topbar-clock__date {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--gray-500);
    white-space: nowrap;
}

.topbar-clock__time {
    font-size: 0.9375rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    color: var(--gray-800);
    white-space: nowrap;
}

/* Bildirishnomalar */
.notifications {
    position: relative;
}

.notifications__toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    background: var(--white);
    color: var(--gray-600);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.notifications__toggle:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
    color: var(--gray-800);
}

.notifications__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--white);
}

.notifications__panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(360px, calc(100vw - 2rem));
    max-height: 420px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
    z-index: 200;
}

.notifications__panel[hidden] {
    display: none !important;
}

.notifications__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--gray-100);
}

.notifications__header-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.notifications__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--gray-500);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.notifications__close:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.notifications__list {
    overflow-y: auto;
    max-height: 340px;
}

.notifications__item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--gray-50);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

.notifications__item:hover {
    background: var(--gray-50);
}

.notifications__item--unread {
    background: #fef2f2;
}

.notifications__item--unread:hover {
    background: #fee2e2;
}

.notifications__item-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-900);
}

.notifications__item-text {
    font-size: 0.8125rem;
    color: var(--gray-600);
    white-space: pre-line;
}

.notifications__item-time {
    font-size: 0.75rem;
    color: var(--gray-400);
}

.notifications__empty {
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--gray-500);
    font-size: 0.875rem;
}

.topbar__branch {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    line-height: 1.2;
    white-space: nowrap;
}

.topbar__branch-icon {
    flex-shrink: 0;
}

.topbar__branch--main {
    color: #047857;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid #6ee7b7;
    box-shadow: 0 1px 2px rgba(5, 150, 105, 0.08);
}

.topbar__branch--sub {
    color: #1d4ed8;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #93c5fd;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.08);
}

.topbar__profile {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.75rem 0.35rem 0.4rem;
    border-radius: 999px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
}

.topbar__avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), #4f46e5);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.topbar__profile-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}

.topbar__profile-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.topbar__profile-role {
    font-size: 0.7rem;
    color: var(--gray-500);
    white-space: nowrap;
}

.topbar__logout-text {
    margin-left: 0.15rem;
}

.page {
    flex: 1;
    padding: calc(56px + 1.5rem) 1.75rem 2rem;
    min-width: 0;
    max-width: 100%;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-family: var(--font);
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid transparent;
    line-height: 1.4;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

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

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

.delete-confirm {
    max-width: 480px;
    margin: 0 auto;
    text-align: center;
    padding: 2rem;
}

.delete-confirm__icon {
    color: var(--danger);
    margin-bottom: 1rem;
}

.delete-confirm h2 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.delete-confirm__warning {
    margin: 1.25rem 0;
    padding: 0.875rem 1rem;
    background: var(--danger-bg);
    color: #b91c1c;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    text-align: left;
}

.delete-confirm__actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.btn-outline {
    background: var(--white);
    color: var(--gray-700);
    border-color: var(--gray-400);
}

.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-500);
    color: var(--gray-900);
}

.btn-ghost {
    background: var(--white);
    color: var(--gray-700);
    border-color: var(--gray-300);
}

.btn-ghost:hover {
    background: var(--gray-100);
    color: var(--gray-900);
    border-color: var(--gray-400);
}

.btn-ghost--danger {
    color: var(--danger);
    border-color: #fca5a5;
}

.btn-ghost--danger:hover {
    background: var(--danger-bg);
    color: #b91c1c;
    border-color: var(--danger);
}

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-block { width: 100%; padding: 0.65rem 1rem; }

/* ===== Auth layout ===== */
.auth-body { background: var(--gray-100); }

.auth-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

.auth-layout__brand {
    background: linear-gradient(160deg, #f4f3f8 0%, #f8fafc 50%, #eef0f8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
    border-right: 1px solid var(--gray-200);
}

.auth-layout__brand::before {
    content: "";
    position: absolute;
    width: 400px;
    height: 400px;
    background: rgba(46, 42, 84, 0.04);
    border-radius: 50%;
    top: -100px;
    right: -100px;
}

.auth-layout__brand::after {
    content: "";
    position: absolute;
    width: 300px;
    height: 300px;
    background: rgba(137, 174, 227, 0.08);
    border-radius: 50%;
    bottom: -80px;
    left: -80px;
}

.auth-brand {
    position: relative;
    z-index: 1;
    max-width: 320px;
    text-align: center;
    margin: 0 auto;
}

.auth-brand__tagline {
    font-size: 0.95rem;
    color: var(--gray-500);
    margin-bottom: 2rem;
    font-weight: 500;
}

.auth-brand__features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    text-align: left;
}

.auth-brand__features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--gray-600);
    font-weight: 500;
}

.auth-brand__features svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
    flex-shrink: 0;
}

.auth-layout__form {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--gray-50);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--white);
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-md);
}

.auth-card__header { margin-bottom: 1.75rem; }

.auth-card__header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.auth-card__header p {
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* ===== Forms ===== */
.form-group { margin-bottom: 1.1rem; }

.form-group label {
    display: block;
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--gray-700);
    margin-bottom: 0.35rem;
}

.input {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 0.875rem;
    color: var(--gray-900);
    background: var(--white);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.input::placeholder { color: var(--gray-400); }

select.input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    padding-right: 2.25rem;
}

.field-error {
    display: block;
    color: var(--danger);
    font-size: 0.8rem;
    line-height: 1.45;
    margin-top: 0.4rem;
}

.field-help {
    display: block;
    color: var(--gray-500);
    font-size: 0.8rem;
    margin-top: 0.35rem;
}

.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-top: 0.5rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9375rem;
    color: var(--gray-700);
    cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--primary);
}

.form-errors-summary {
    grid-column: 1 / -1;
    padding: 0.875rem 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-md);
    color: #b91c1c;
    font-size: 0.875rem;
}

.form-errors-summary ul {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
}

.form-errors-summary li {
    margin-bottom: 0.25rem;
}

.form-group--error .input,
.form-group--error select {
    border-color: var(--danger);
    background: #fffafa;
}

.form-group--error label {
    color: var(--danger);
}

.form--grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1.25rem;
}

.form-group--full { grid-column: 1 / -1; }

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--gray-200);
}

/* ===== Dashboard ===== */
.dashboard { max-width: 1200px; }

.page-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    background: linear-gradient(135deg, var(--white) 0%, var(--primary-bg) 100%);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: 1.75rem 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.page-hero h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.02em;
    margin-bottom: 0.35rem;
}

.page-hero p {
    color: var(--gray-500);
    font-size: 0.9rem;
}

.page-hero__date {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-500);
    background: var(--white);
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    white-space: nowrap;
}

/* Stats row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-box {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s, transform 0.15s;
}

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

.stat-box__icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-box__icon svg { width: 22px; height: 22px; }

.stat-box--blue .stat-box__icon { background: var(--blue-bg); color: var(--blue); }
.stat-box--violet .stat-box__icon { background: var(--violet-bg); color: var(--violet); }
.stat-box--emerald .stat-box__icon { background: var(--emerald-bg); color: var(--emerald); }
.stat-box--amber .stat-box__icon { background: var(--amber-bg); color: var(--amber); }
.stat-box--rose .stat-box__icon { background: #fff1f2; color: var(--rose); }

.stat-box__value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
}

.stat-box__label {
    display: block;
    font-size: 0.8rem;
    color: var(--gray-500);
    font-weight: 500;
}

.section-header {
    margin-bottom: 1rem;
}

.section-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-900);
}

.section-header p {
    font-size: 0.8rem;
    color: var(--gray-500);
}

/* Module cards */
.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.module-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.15s;
    position: relative;
    overflow: hidden;
}

.module-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.module-card--blue::before { background: var(--blue); }
.module-card--violet::before { background: var(--violet); }
.module-card--emerald::before { background: var(--emerald); }
.module-card--indigo::before { background: var(--indigo); }
.module-card--amber::before { background: var(--amber, #f59e0b); }

.module-card--muted {
    opacity: 0.72;
    pointer-events: none;
}

.module-card--muted::before { background: var(--gray-300); }

.module-card:hover { box-shadow: var(--shadow); }

.module-card--link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.module-card--link:hover {
    border-color: var(--indigo);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.module-card__icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.25rem;
}

.module-card__icon svg { width: 20px; height: 20px; }

.module-card--blue .module-card__icon { background: var(--blue-bg); color: var(--blue); }
.module-card--violet .module-card__icon { background: var(--violet-bg); color: var(--violet); }
.module-card--emerald .module-card__icon { background: var(--emerald-bg); color: var(--emerald); }
.module-card--indigo .module-card__icon { background: var(--indigo-bg); color: var(--indigo); }

.module-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
}

.module-card p {
    color: var(--gray-500);
    font-size: 0.8rem;
    flex: 1;
    line-height: 1.5;
}

/* Tags */
.tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    width: fit-content;
    margin-top: 0.25rem;
}

.tag--gray { background: var(--gray-100); color: var(--gray-500); }
.tag--indigo { background: var(--indigo-bg); color: var(--indigo); }
.tag--emerald { background: #d1fae5; color: #065f46; }
.tag--green { background: #dcfce7; color: #15803d; }
.tag--rose { background: #ffe4e6; color: #be123c; }

.text-danger {
    color: #be123c;
    font-weight: 600;
}

a.tag--link {
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

a.tag--link:hover {
    background: var(--indigo);
    color: var(--white);
}

/* ===== Page header ===== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}

.page-header p {
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-top: 0.15rem;
}

.page-header__actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* ===== Search ===== */
.search-bar {
    margin-bottom: 1rem;
}

.search-bar__input-wrap {
    position: relative;
    flex: 1;
    min-width: 220px;
}

.search-bar__icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    pointer-events: none;
}

.search-bar__input {
    width: 100%;
    padding-left: 2.5rem;
}

/* ===== Combobox ===== */
.combobox {
    position: relative;
}

.combobox__input-wrap {
    width: 100%;
}

.combobox__list {
    position: absolute;
    z-index: 40;
    top: calc(100% + 0.25rem);
    left: 0;
    right: 0;
    max-height: 16rem;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.combobox__option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.combobox__option:hover,
.combobox__option--active {
    background: var(--gray-50);
}

.combobox__option-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-900);
}

.combobox__option-sub {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.selected-student {
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: var(--gray-50);
    font-weight: 500;
    color: var(--gray-900);
}

/* ===== Clickable table rows ===== */
.data-table__row--clickable {
    cursor: pointer;
    transition: background 0.12s ease;
}

.data-table__row--clickable:hover {
    background: var(--gray-50);
}

.data-table__row--alert {
    background: #fffafb;
}

.data-table__row--alert:hover {
    background: #fff1f2;
}

.assignment-replace-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem 2.5rem;
    margin-bottom: 0.75rem;
    padding: 1rem 1.1rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
}

.assignment-replace-summary__item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.assignment-replace-summary__label {
    font-size: 0.8rem;
    color: var(--gray-500);
    line-height: 1.2;
}

.assignment-replace-summary__value {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-900);
    line-height: 1.3;
}

.assignment-replace-summary__value .tag {
    margin-top: 0;
}

.assignment-replace-hint {
    margin-bottom: 1rem;
}

.group-list-teacher {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.group-list-teacher .tag {
    margin-top: 0;
}

.data-table__link {
    display: inline-block;
    color: inherit;
    text-decoration: none;
}

.data-table__link:hover strong {
    color: var(--primary);
}

.data-table__link .td-muted {
    display: block;
}

/* ===== To'lov holati ===== */
.payment-status {
    display: inline-block;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.payment-status--paid {
    background: var(--emerald-bg);
    color: #047857;
}

.payment-status--partial {
    background: var(--amber-bg);
    color: #b45309;
}

.payment-status--unpaid {
    background: var(--danger-bg);
    color: #b91c1c;
}

.payment-row--paid {
    background: rgba(236, 253, 245, 0.35);
}

.payment-row--partial {
    background: rgba(255, 251, 235, 0.45);
}

.payment-row--unpaid {
    background: rgba(254, 242, 242, 0.4);
}

.payment-remaining {
    color: #b91c1c;
    font-weight: 600;
}

.payment-total-display {
    padding: 0.65rem 0.875rem;
    background: var(--primary-bg);
    border: 1px solid var(--primary-light);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
}

/* ===== Table ===== */
.table-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.table-card__title {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 0.9rem;
}

.table-card__count {
    font-size: 0.8rem;
    color: var(--gray-500);
    background: var(--white);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    border: 1px solid var(--gray-200);
}

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

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

.data-table th {
    text-align: left;
    padding: 0.7rem 1.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
}

.data-table td {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.875rem;
    color: var(--gray-700);
}

.data-table tbody tr:hover { background: var(--gray-50); }
.data-table tbody tr:last-child td { border-bottom: none; }

.data-table__section-divider td {
    padding: 0.9rem 1.25rem 0.55rem;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
    vertical-align: middle;
}

.data-table__section-divider span {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-500);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.data-table__section-divider span::before {
    content: "";
    display: inline-block;
    width: 1.5rem;
    height: 2px;
    border-radius: 2px;
    background: var(--gray-300);
}

.data-table__row--archived td {
    color: var(--gray-500);
}

.data-table tbody tr.data-table__section-divider:hover {
    background: var(--gray-50);
}

.historical-salary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
}

.historical-salary-grid__item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.historical-salary-grid__item label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-600);
}

.salary-month-input--auto {
    background: var(--gray-50);
    color: var(--gray-600);
}

.archive-steps {
    margin: 0;
    padding: 1rem 1.25rem 1.25rem 2.25rem;
    color: var(--gray-700);
    line-height: 1.7;
}

.archive-steps a {
    color: var(--indigo);
    font-weight: 600;
}

.data-table .col-seq {
    width: 3rem;
    text-align: center;
    padding-left: 1rem;
    padding-right: 0.5rem;
}

.data-table th.col-seq { text-align: center; }

.row-seq {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    height: 1.75rem;
    padding: 0 0.4rem;
    border-radius: 6px;
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 0.75rem;
    font-weight: 600;
}

.td-muted { color: var(--gray-400); font-size: 0.8rem; }

.user-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-cell__avatar {
    width: 34px;
    height: 34px;
    background: var(--primary-bg);
    color: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.user-cell__name {
    display: block;
    font-weight: 600;
    color: var(--gray-900);
    font-size: 0.875rem;
}

.user-cell__login {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-400);
}

.empty-row {
    text-align: center;
    padding: 3rem !important;
    color: var(--gray-400);
}

.empty-row svg {
    margin: 0 auto 0.75rem;
    color: var(--gray-300);
}

.empty-row p { font-size: 0.9rem; }

/* Role badges */
.role-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
}

.role-badge--superadmin { background: var(--gray-900); color: var(--white); }
.role-badge--admin { background: var(--blue-bg); color: var(--blue); }
.role-badge--moderator { background: var(--amber-bg); color: var(--amber); }
.role-badge--teacher { background: var(--violet-bg); color: var(--violet); }
.role-badge--student { background: var(--emerald-bg); color: var(--emerald); }

/* Status */
.status-dot {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-dot::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.status-dot--active { color: var(--success); }
.status-dot--active::before { background: var(--success); }
.status-dot--inactive { color: var(--danger); }
.status-dot--inactive::before { background: var(--danger); }
.status-dot--pending { color: var(--warning); }
.status-dot--pending::before { background: var(--warning); }
.status-dot--trial { color: #d97706; }
.status-dot--trial::before { background: #f59e0b; }

.tag--amber { background: #fef3c7; color: #b45309; }

.recruitment-card {
    margin-bottom: 1rem;
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    border: 1px solid #fde68a;
    background: linear-gradient(135deg, #fffbeb 0%, #fff 100%);
}

.recruitment-card--ready {
    border-color: #86efac;
    background: linear-gradient(135deg, #f0fdf4 0%, #fff 100%);
}

.recruitment-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.recruitment-card__title {
    margin: 0.5rem 0 0.25rem;
    font-size: 1.1rem;
}

.recruitment-card__subtitle {
    margin: 0;
    color: var(--gray-500);
    font-size: 0.875rem;
}

.recruitment-card__count { text-align: right; }

.recruitment-card__value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
}

.recruitment-card__label {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.recruitment-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.recruitment-progress__bar {
    flex: 1;
    height: 8px;
    border-radius: 999px;
    background: var(--gray-200);
    overflow: hidden;
}

.recruitment-progress__fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    transition: width 0.3s ease;
}

.recruitment-card--ready .recruitment-progress__fill {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.recruitment-progress__label {
    font-size: 0.8rem;
    color: var(--gray-600);
    white-space: nowrap;
}

.recruitment-card__alert,
.recruitment-card__hint {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    font-size: 0.875rem;
    color: var(--gray-700);
}

.recruitment-card__alert--success {
    border-color: #86efac;
    background: #f0fdf4;
}

.recruitment-launch-form { margin: 0; }

/* ===== Sinov ===== */
.trial-alerts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.65rem;
    margin-bottom: 1.25rem;
    align-items: stretch;
}

.trial-alert {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    background: var(--white);
}

.trial-alert--compact {
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.75rem 0.85rem;
    border-radius: var(--radius);
    min-height: 9.5rem;
    height: 100%;
}

.trial-alert__header {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    width: 100%;
}

.trial-alert--info {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.trial-alert--warning {
    border-color: #fcd34d;
    background: #fffbeb;
}

.trial-alert--action {
    border-color: #fbbf24;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.trial-alert__icon {
    flex-shrink: 0;
    margin-top: 0.1rem;
    color: var(--gray-500);
}

.trial-alert--compact .trial-alert__icon {
    margin-top: 0.15rem;
}

.trial-alert--warning .trial-alert__icon,
.trial-alert--action .trial-alert__icon {
    color: #d97706;
}

.trial-alert__content {
    flex: 1;
    min-width: 0;
}

.trial-alert__content strong {
    display: block;
    font-size: 0.9375rem;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
    line-height: 1.35;
}

.trial-alert--compact .trial-alert__content strong {
    font-size: 0.8125rem;
    margin-bottom: 0.2rem;
}

.trial-alert__content p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--gray-600);
    line-height: 1.5;
}

.trial-alert--compact .trial-alert__content p {
    font-size: 0.75rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.trial-alert__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex-shrink: 0;
    align-items: flex-start;
    width: 100%;
}

.trial-alert--compact .trial-alert__actions {
    gap: 0.35rem;
    margin-top: auto;
    flex-direction: column;
}

.trial-alert--compact .trial-alert__actions .btn {
    flex: none;
    width: 100%;
    min-width: 0;
    padding: 0.3rem 0.5rem;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    line-height: 1.25;
}

.section-header--compact {
    margin-bottom: 0.75rem;
}

.section-header--compact h2 {
    font-size: 1.125rem;
    margin-bottom: 0.1rem;
}

.section-header--compact p {
    font-size: 0.8125rem;
}

.trial-panel {
    margin-bottom: 1.25rem;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid #fcd34d;
    background: linear-gradient(135deg, #fffbeb 0%, #fff 60%);
}

.trial-panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.trial-panel__header h2 {
    margin: 0 0 0.25rem;
    font-size: 1.125rem;
}

.trial-panel__header p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.trial-panel__steps {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.trial-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    min-width: 4rem;
}

.trial-step__num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--gray-600);
    font-weight: 700;
    font-size: 0.875rem;
}

.trial-step--done .trial-step__num {
    background: #10b981;
    color: white;
}

.trial-step__label {
    font-size: 0.75rem;
    color: var(--gray-600);
    text-align: center;
}

.trial-step__line {
    width: 2rem;
    height: 2px;
    background: var(--gray-200);
    margin-bottom: 1.25rem;
}

.trial-panel__body {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding-top: 1rem;
    border-top: 1px solid rgba(251, 191, 36, 0.3);
}

.trial-panel__status strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 0.35rem;
}

.trial-panel__status p {
    margin: 0 0 0.75rem;
    font-size: 0.875rem;
    color: var(--gray-700);
    max-width: 36rem;
}

.trial-panel__fees {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.trial-panel__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.trial-progress-cell {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.trial-progress-cell__dots {
    display: flex;
    gap: 0.35rem;
}

.trial-dot {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    background: var(--gray-300);
}

.trial-dot--done {
    background: #10b981;
}

.trial-progress-cell__label {
    font-size: 0.8125rem;
    color: var(--gray-600);
}

.trial-progress-cell__label--action {
    color: #d97706;
    font-weight: 600;
}

.trial-decision-card {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    background: var(--white);
}

.trial-decision-card--pay {
    border-color: #fcd34d;
    background: #fffbeb;
}

.trial-decision-card__icon {
    flex-shrink: 0;
    color: #d97706;
}

.trial-decision-card__body h2 {
    margin: 0 0 0.5rem;
    font-size: 1.0625rem;
}

.trial-decision-card__body p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--gray-700);
    line-height: 1.5;
}

/* ===== Lidlar ===== */
.lead-list-tabs {
    display: inline-flex;
    gap: 0.35rem;
    padding: 0.25rem;
    margin-bottom: 1rem;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: 999px;
}

.lead-list-tabs__item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-600);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.lead-list-tabs__item:hover {
    color: var(--gray-800);
    background: rgba(255, 255, 255, 0.7);
}

.lead-list-tabs__item--active {
    background: var(--white);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.lead-list-tabs__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.06);
    font-size: 0.75rem;
}

.lead-converted-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem 1.25rem;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: var(--radius-lg);
    color: #065f46;
}

.lead-converted-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex-shrink: 0;
}

.lead-converted-banner p {
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
    color: #047857;
}

.lead-student-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.lead-student-link:hover {
    text-decoration: underline;
}

.lead-stats-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    margin-bottom: 1rem;
}

.lead-stats-scroll {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    padding: 0.25rem 0.25rem 0.75rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--gray-300) transparent;
}

.lead-stats-scroll::-webkit-scrollbar {
    height: 6px;
}

.lead-stats-scroll::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 999px;
}

.lead-stat-card {
    flex: 0 0 auto;
    width: 148px;
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
    scroll-snap-align: start;
    cursor: pointer;
}

.lead-stat-card:hover {
    border-color: var(--gray-300);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.lead-stat-card__value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
}

.lead-stat-card__label {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    color: var(--gray-500);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lead-stat-card--active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--blue-bg);
}

.lead-stat-card--active .lead-stat-card__label {
    color: var(--gray-700);
    font-weight: 600;
}

.lead-stat-card--active.lead-stat-card--new { border-color: #0369a1; box-shadow: 0 0 0 3px #e0f2fe; }
.lead-stat-card--active.lead-stat-card--contacted { border-color: #6d28d9; box-shadow: 0 0 0 3px #ede9fe; }
.lead-stat-card--active.lead-stat-card--interested { border-color: #1d4ed8; box-shadow: 0 0 0 3px #dbeafe; }
.lead-stat-card--active.lead-stat-card--callback { border-color: #b45309; box-shadow: 0 0 0 3px #fef3c7; }
.lead-stat-card--active.lead-stat-card--trial_scheduled { border-color: #4338ca; box-shadow: 0 0 0 3px #e0e7ff; }
.lead-stat-card--active.lead-stat-card--trial_done { border-color: #047857; box-shadow: 0 0 0 3px #d1fae5; }
.lead-stat-card--active.lead-stat-card--negotiation { border-color: #be185d; box-shadow: 0 0 0 3px #fce7f3; }
.lead-stat-card--active.lead-stat-card--enrolled { border-color: #15803d; box-shadow: 0 0 0 3px #dcfce7; }
.lead-stat-card--active.lead-stat-card--rejected { border-color: #b91c1c; box-shadow: 0 0 0 3px #fee2e2; }
.lead-stat-card--active.lead-stat-card--no_answer { border-color: #4b5563; box-shadow: 0 0 0 3px #f3f4f6; }
.lead-stat-card--active.lead-stat-card--lost { border-color: #6b7280; box-shadow: 0 0 0 3px #f3f4f6; }

.leads-filter-bar .form-group--grow {
    flex: 1;
    min-width: 200px;
}

.leads-filter-bar .search-bar__input-wrap {
    position: relative;
}

.leads-filter-bar .search-bar__input {
    width: 100%;
    padding-left: 2.5rem;
}

.lead-phone {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
}

.lead-phone:hover {
    text-decoration: underline;
}

.lead-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.3;
}

.lead-badge--new { background: #e0f2fe; color: #0369a1; }
.lead-badge--contacted { background: #ede9fe; color: #6d28d9; }
.lead-badge--interested { background: #dbeafe; color: #1d4ed8; }
.lead-badge--callback { background: #fef3c7; color: #b45309; }
.lead-badge--trial_scheduled { background: #e0e7ff; color: #4338ca; }
.lead-badge--trial_done { background: #d1fae5; color: #047857; }
.lead-badge--negotiation { background: #fce7f3; color: #be185d; }
.lead-badge--enrolled { background: #dcfce7; color: #15803d; }
.lead-badge--rejected { background: #fee2e2; color: #b91c1c; }
.lead-badge--no_answer { background: #f3f4f6; color: #4b5563; }
.lead-badge--lost { background: #f3f4f6; color: #6b7280; }

.lead-row--overdue {
    background: #fff5f5;
}

.lead-row--overdue:hover {
    background: #fee2e2 !important;
}

.td-danger {
    color: var(--danger);
    font-size: 0.75rem;
    font-weight: 600;
}

.leads-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 3rem 1.5rem;
    color: var(--gray-500);
    text-align: center;
}

.leads-empty svg {
    color: var(--gray-300);
}

.data-table--leads td {
    vertical-align: middle;
}

.data-table--leads .td-actions {
    white-space: nowrap;
}

.modal[hidden] {
    display: none !important;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.modal__dialog {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
}

.modal__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--gray-900);
}

.modal__close {
    border: none;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0.15rem 0.35rem;
}

.modal__close:hover {
    color: var(--gray-700);
}

.modal__body {
    padding: 1.25rem;
}

.modal__lead-name {
    margin: 0 0 1rem;
    font-weight: 600;
    color: var(--gray-800);
}

.modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-100);
}

.lead-status-quick {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.lead-status-quick__btn {
    width: 100%;
    justify-content: center;
}

@media (max-width: 640px) {
    .lead-status-quick {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .lead-stat-card {
        width: 132px;
        padding: 0.875rem 1rem;
    }

    .lead-stat-card__value {
        font-size: 1.25rem;
    }

    .leads-filter-bar .filter-bar__fields {
        flex-direction: column;
        width: 100%;
    }
}

/* ===== Form card ===== */
.form-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    max-width: 720px;
}

.form-card__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    font-weight: 600;
    color: var(--gray-800);
    font-size: 0.9rem;
}

.form-card__header svg { color: var(--primary); }

.form-card .form {
    padding: 1.5rem;
}

/* ===== Alerts ===== */
.messages { margin-bottom: 1rem; }

.alert {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.alert--success {
    background: var(--success-bg);
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.alert--success svg { color: var(--success); }

.alert--error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid #fecaca;
}

/* ===== Filter bar ===== */
.filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding: 1rem 1.25rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
}

.filter-bar__fields {
    display: flex;
    gap: 1rem;
    flex: 1;
}

.filter-bar .form-group {
    margin-bottom: 0;
    min-width: 140px;
}

.chart-range-wrap {
    margin-bottom: 1.25rem;
}

.chart-range-wrap__label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

.filter-bar--chart-range {
    margin-bottom: 0;
}

.filter-bar__sep {
    display: flex;
    align-items: flex-end;
    padding-bottom: 0.65rem;
    color: var(--gray-400);
    font-weight: 600;
}

.stats-row--compact {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    max-width: none;
    margin-bottom: 1.25rem;
}

.payment-stats {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.payment-stats .stat-box {
    padding: 1rem 1rem 1rem 0.9rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    border-left: 3px solid var(--gray-300);
}

.payment-stats .stat-box--emerald { border-left-color: var(--emerald); }
.payment-stats .stat-box--amber { border-left-color: var(--amber); }
.payment-stats .stat-box--rose { border-left-color: var(--rose); }
.payment-stats .stat-box--blue { border-left-color: var(--blue); }
.payment-stats .stat-box--violet { border-left-color: var(--violet); }

.payment-stats .stat-box__value {
    font-size: 1.25rem;
    line-height: 1.2;
    word-break: break-word;
}

.payment-stats .stat-box__label {
    font-size: 0.72rem;
    color: var(--gray-500);
    line-height: 1.3;
}

.payment-stats a.stat-box.stat-box--link,
.payment-stats a.stat-box.stat-box--link:hover,
.payment-stats a.stat-box.stat-box--link:visited,
.payment-stats a.stat-box.stat-box--link:focus,
.payment-stats a.stat-box.stat-box--link .stat-box__value,
.payment-stats a.stat-box.stat-box--link .stat-box__label,
.payment-stats a.stat-box.stat-box--link .stat-box__info {
    text-decoration: none;
    color: inherit;
}

.payment-stats a.stat-box.stat-box--link {
    cursor: pointer;
    transition: box-shadow 0.15s, transform 0.15s, background 0.15s;
}

.payment-stats a.stat-box.stat-box--link:hover {
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.payment-stats .stat-box--active {
    background: var(--gray-50);
    box-shadow: inset 0 0 0 2px var(--primary);
}

.payment-stats .stat-box--active.stat-box--emerald { background: var(--emerald-bg); }
.payment-stats .stat-box--active.stat-box--amber { background: var(--amber-bg); }
.payment-stats .stat-box--active.stat-box--rose { background: #fff1f2; }
.payment-stats .stat-box--active.stat-box--blue { background: var(--blue-bg); }
.payment-stats .stat-box--active.stat-box--violet { background: var(--violet-bg); }

.table-card__header .btn { margin-left: auto; }

@media (max-width: 1200px) {
    .payment-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .payment-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ===== Reports ===== */
.report-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.report-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    border-top: 3px solid var(--gray-300);
}

.report-card--income { border-top-color: var(--emerald); }
.report-card--expense { border-top-color: var(--amber); }
.report-card--salary { border-top-color: var(--violet); }
.report-card--profit { border-top-color: var(--blue); }
.report-card--loss { border-top-color: var(--danger); }

a.report-card--link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

a.report-card--link:hover {
    border-color: var(--gray-300);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

a.report-card--link:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

.report-card__label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
}

.report-card__value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}

.report-card__unit {
    font-size: 0.8rem;
    color: var(--gray-500);
}

.report-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.chart-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
}

.chart-card--page {
    margin-bottom: 1.25rem;
}

.chart-card--wide {
    min-width: 0;
}

.chart-card__header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0 0 0.25rem;
}

.chart-card__header p {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin: 0 0 1rem;
}

.chart-card__body {
    position: relative;
    height: 280px;
}

.chart-card__body--doughnut {
    height: 260px;
    max-width: 320px;
    margin: 0 auto;
}

.chart-card__body--bar {
    height: 320px;
}

.report-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ===== Detail ===== */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.detail-list {
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-100);
}

.detail-item:last-child { border-bottom: none; padding-bottom: 0; }
.detail-item--stacked { align-items: flex-start; }
.detail-item--stacked p { margin: 0.35rem 0 0; font-size: 0.85rem; }

.profit-summary-row td {
    border-top: 2px solid var(--gray-200);
    background: var(--gray-50);
}

.profit-hero {
    margin-bottom: 1.25rem;
    padding: 1.75rem 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    background: var(--white);
    text-align: center;
}

.profit-hero--ok {
    background: linear-gradient(180deg, #ecfdf5 0%, #ffffff 55%);
    border-color: #a7f3d0;
}

.profit-hero--loss {
    background: linear-gradient(180deg, #fef2f2 0%, #ffffff 55%);
    border-color: #fecaca;
}

.profit-hero__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.profit-hero--ok .profit-hero__badge {
    background: #d1fae5;
    color: #065f46;
}

.profit-hero--loss .profit-hero__badge {
    background: #fee2e2;
    color: #991b1b;
}

.profit-hero__title {
    margin: 0 0 0.5rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.35;
}

.profit-hero__message {
    margin: 0 auto 1rem;
    max-width: 36rem;
    color: var(--gray-600);
    font-size: 0.95rem;
    line-height: 1.5;
}

.profit-hero__amount {
    font-size: 2.25rem;
    font-weight: 800;
    color: #059669;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.profit-hero__amount span {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-500);
    margin-left: 0.35rem;
}

.profit-hero__amount--loss {
    color: #dc2626;
}

.profit-hero__period {
    margin: 0.75rem 0 0;
    font-size: 0.8rem;
    color: var(--gray-500);
}

.stat-box--danger {
    border-left: 3px solid #ef4444;
}

.stat-box--danger .stat-box__value {
    color: #dc2626;
}

.proration-info {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.proration-info strong {
    display: block;
    color: #1e40af;
    margin-bottom: 0.25rem;
}

.proration-info--warning {
    background: #fffbeb;
    border-color: #fcd34d;
}

.proration-info--warning strong {
    color: #92400e;
}

.proration-info--success {
    background: #ecfdf5;
    border-color: #6ee7b7;
}

.proration-info--success strong {
    color: #065f46;
}

.detail-item span { color: var(--gray-500); font-size: 0.85rem; }
.detail-item strong { color: var(--gray-900); }

.field-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 0.25rem;
}

/* ===== Dars jadvali ===== */
.schedule-week {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.schedule-day {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.schedule-day__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1rem;
    background: linear-gradient(to right, var(--primary-bg), #fff);
    border-bottom: 1px solid var(--gray-200);
}

.schedule-day__header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-900);
}

.schedule-day__count {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--primary);
    background: var(--primary-light);
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
}

.schedule-day__lessons {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.schedule-day__empty {
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--gray-400);
    font-size: 0.85rem;
}

.schedule-lesson {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: #fff;
    border-left: 3px solid var(--primary);
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.schedule-lesson:hover {
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.07);
    border-color: var(--gray-300);
}

.schedule-lesson__time {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 3.5rem;
    padding: 0.4rem 0.5rem;
    background: var(--primary-bg);
    border-radius: var(--radius-sm);
    text-align: center;
}

.schedule-lesson__clock {
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--primary);
    line-height: 1.25;
    font-variant-numeric: tabular-nums;
}

.schedule-lesson__clock-sep {
    font-size: 0.6rem;
    color: var(--gray-400);
    line-height: 1;
    margin: 0.1rem 0;
}

.schedule-lesson__content {
    flex: 1;
    min-width: 0;
    padding-top: 0.1rem;
}

.schedule-lesson__title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
}

.schedule-lesson__title strong {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-900);
    line-height: 1.3;
}

.schedule-lesson__meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.schedule-lesson__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: var(--gray-500);
    line-height: 1.3;
}

.schedule-lesson__meta-item svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.schedule-lesson__actions {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
    padding-top: 0.1rem;
}

.schedule-lesson__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-sm);
    color: var(--gray-500);
    border: 1px solid var(--gray-200);
    background: var(--gray-50);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.schedule-lesson__btn:hover {
    background: var(--gray-100);
    color: var(--gray-700);
    border-color: var(--gray-300);
}

.schedule-lesson__btn--danger:hover {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: #fecaca;
}

/* ===== Oylik dars jadvali ===== */
.schedule-filter .filter-bar__fields {
    flex-wrap: wrap;
}

.schedule-stats {
    margin-bottom: 1.25rem;
}

.schedule-month {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.schedule-month__weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.schedule-month__weekday {
    padding: 0.65rem 0.5rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.schedule-month__week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 1px solid var(--gray-100);
}

.schedule-month__week:last-child {
    border-bottom: none;
}

.schedule-month__day {
    min-height: 120px;
    padding: 0.5rem;
    border-right: 1px solid var(--gray-100);
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.schedule-month__day:last-child {
    border-right: none;
}

.schedule-month__day--muted {
    background: var(--gray-50);
}

.schedule-month__day--today {
    background: var(--primary-bg);
}

.schedule-month__day--today .schedule-month__day-num {
    background: var(--primary);
    color: #fff;
}

.schedule-month__day-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem;
}

.schedule-month__day-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-700);
    border-radius: 999px;
}

.schedule-month__day-count {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light);
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
}

.schedule-month__lessons {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex: 1;
    overflow: hidden;
}

.schedule-month__lesson {
    display: block;
    padding: 0.35rem 0.45rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
    border-left: 3px solid var(--primary);
    background: #fff;
    text-decoration: none;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.schedule-month__lesson:hover {
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
    border-color: var(--gray-300);
}

.schedule-month__lesson--static {
    cursor: default;
}

.schedule-month__lesson--static:hover {
    box-shadow: none;
    border-color: var(--gray-200);
}

.schedule-weekly-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    text-decoration: none;
    color: inherit;
    border-radius: var(--radius-sm);
    padding: 0.15rem 0.25rem;
    margin: -0.15rem -0.25rem;
    transition: background 0.15s ease;
}

.schedule-weekly-link:hover {
    background: var(--gray-50);
}

.schedule-weekly-link strong {
    color: var(--primary);
}

.schedule-month__lesson-time {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.schedule-month__lesson-subject {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--gray-900);
    line-height: 1.25;
    margin-top: 0.1rem;
}

.schedule-month__lesson-group {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 500;
    color: var(--indigo);
    background: var(--indigo-bg);
    padding: 0.05rem 0.35rem;
    border-radius: 999px;
    margin-top: 0.15rem;
}

.schedule-month__lesson-teacher {
    display: block;
    font-size: 0.65rem;
    color: var(--gray-500);
    margin-top: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.schedule-create__top {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: end;
}

.schedule-create__preset {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
    align-items: end;
    padding: 1rem;
    margin-bottom: 1.5rem;
    background: var(--primary-bg);
    border: 1px solid var(--primary-light);
    border-radius: var(--radius-lg);
}

.schedule-create__preset-info {
    grid-column: 1 / -1;
    align-self: center;
}

.schedule-month-preview {
    grid-column: 1 / -1;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    background: #fff;
    border: 1px solid #bfdbfe;
}

.schedule-month-preview strong {
    display: block;
    color: #1e40af;
    margin-bottom: 0.35rem;
}

.schedule-month-preview p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--gray-800);
    line-height: 1.5;
}

.schedule-create__grid-wrap {
    margin-bottom: 1.5rem;
}

.schedule-create__grid {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
}

.schedule-create__grid th,
.schedule-create__grid td {
    padding: 0.65rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-100);
}

.schedule-create__grid th {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-500);
    background: var(--gray-50);
}

.schedule-create__day {
    font-weight: 600;
    color: var(--gray-800);
    width: 140px;
}

.schedule-create__row--selected {
    background: var(--indigo-bg);
}

.schedule-create__row--selected .schedule-create__day {
    color: var(--indigo);
}

.schedule-create__grid .input {
    width: 100%;
    min-width: 120px;
}

.schedule-create__grid td .field-error {
    margin-top: 0.25rem;
}

.form-group--checkbox {
    padding-bottom: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.today-lessons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.today-lesson-card {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 1rem;
    padding: 1.25rem;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--primary);
}

.today-lesson-card--alert {
    border-left-color: #e11d48;
    background: #fffafb;
}

.today-lesson-card--alert .today-lesson-card__clock {
    color: #e11d48;
}

.today-lesson-card__time {
    display: flex;
    align-items: flex-start;
}

.today-lesson-card__clock {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.today-lesson-card__info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.today-lesson-card__teacher {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 0.75rem;
}

.today-lesson-card__students {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.today-lesson-card__label {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-right: 0.25rem;
}

.student-chip {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: var(--gray-100);
    border-radius: 999px;
    font-size: 0.75rem;
    color: var(--gray-700);
}

.schedule-chips {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.schedule-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.55rem;
    background: var(--primary-bg);
    border: 1px solid var(--primary-light);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--gray-600);
    width: fit-content;
}

.schedule-chip strong {
    color: var(--primary);
    font-weight: 600;
}

.archive-payments-td {
    white-space: nowrap;
    vertical-align: middle;
}

.modal__dialog--wide {
    max-width: 520px;
}

.archive-payments-modal__meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    font-size: 0.9rem;
    color: var(--gray-800);
}

.archive-payments-modal__scroll {
    max-height: min(60vh, 420px);
    overflow: auto;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
}

.archive-payments-modal__scroll .data-table {
    margin: 0;
}

.archive-payments-modal__scroll .data-table th,
.archive-payments-modal__scroll .data-table td {
    white-space: nowrap;
}

.today-lesson-card__empty {
    font-size: 0.8rem;
    color: var(--gray-400);
    font-style: italic;
}

.empty-state-card {
    padding: 2rem;
    text-align: center;
    background: #fff;
    border: 1px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    color: var(--gray-500);
}

.empty-state-card .btn {
    margin-top: 0.75rem;
}

.module-card--rose .module-card__icon { background: #fce7f3; color: #db2777; }

.task-status {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.task-status--pending { background: #fef3c7; color: #b45309; }
.task-status--awaiting { background: #dbeafe; color: #1d4ed8; }
.task-status--completed { background: #d1fae5; color: #047857; }
.task-status--missed { background: #fee2e2; color: #b91c1c; }

.td-actions { white-space: nowrap; }
.inline-form { display: inline; }

.attendance-date-bar { margin-bottom: 1rem; }

.attendance-groups {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.attendance-group {
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 12px;
    overflow: hidden;
}

.attendance-group__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    list-style: none;
    font-weight: 600;
}

.attendance-group__summary::-webkit-details-marker { display: none; }

.attendance-group__title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem;
}

.attendance-group__subject { color: var(--primary, #4f46e5); }

.attendance-group__badge {
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: #fef3c7;
    color: #b45309;
}

.attendance-group__badge--done {
    background: #d1fae5;
    color: #047857;
}

.attendance-group__form {
    padding: 0 1.25rem 1.25rem;
    border-top: 1px solid var(--border, #e5e7eb);
}

.attendance-group__body {
    padding: 0 1.25rem 1.25rem;
    border-top: 1px solid var(--border, #e5e7eb);
}

.attendance-group__times {
    margin: 0.75rem 0 0;
    font-size: 0.8rem;
}

.attendance-group__toolbar {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.75rem;
}

.attendance-lesson-panel {
    margin: 1rem 0;
    padding: 1rem;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    background: var(--gray-50);
}

.attendance-lesson-form__fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: start;
}

.attendance-lesson-field label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
}

.attendance-lesson-display {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 0.75rem 0.85rem;
}

.attendance-lesson-display__text {
    margin: 0 0 0.5rem;
    color: var(--gray-800);
    line-height: 1.45;
    white-space: pre-wrap;
}

.attendance-lesson-edit-form {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 0;
}

.attendance-lesson-edit-form .input,
.attendance-lesson-edit-form textarea {
    flex: 1;
    min-width: 0;
}

.attendance-lesson-edit-form[hidden] {
    display: none !important;
}

.attendance-lesson-display[hidden] {
    display: none !important;
}

.attendance-group__homework-input {
    min-height: 2.5rem;
    resize: vertical;
}

.attendance-lesson-panel__footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--gray-200);
}

.attendance-mark-all-form {
    margin: 0;
}

.attendance-row__name {
    min-width: 10rem;
    vertical-align: middle;
}

.attendance-row--saved .attendance-row__name strong {
    color: #047857;
}

.attendance-table__grade-head,
.attendance-row__grade-cell {
    text-align: right;
    width: 9rem;
}

.attendance-row__action-cell {
    width: 6.5rem;
    text-align: right;
    vertical-align: middle;
}

.attendance-row__status-cell {
    vertical-align: middle;
}

.attendance-row-form {
    display: contents;
}

.attendance-row__grade-panel {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.attendance-saved-grade {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.45rem;
    border-radius: 8px;
    background: #eef2ff;
    font-size: 1rem;
    font-weight: 700;
    color: #4338ca;
    line-height: 1;
}

.attendance-saved-grade--none {
    background: #f3f4f6;
    color: #9ca3af;
    font-size: 0.9rem;
}

.attendance-row__grade {
    width: 5rem;
    min-width: 5rem;
    text-align: center;
}

.attendance-row__save {
    white-space: nowrap;
}

.lesson-notes-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0 1rem 1rem;
}

.lesson-note-card {
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    overflow: hidden;
    background: var(--gray-50);
}

.lesson-note-card__header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
}

.lesson-note-card__body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 1rem;
}

.lesson-note-card__label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-500);
    margin-bottom: 0.35rem;
}

.lesson-note-card__item p {
    margin: 0;
    color: var(--gray-800);
    white-space: pre-wrap;
}

.attendance-status-toggle {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.35rem;
}

.attendance-status-toggle input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.attendance-status-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #6b7280;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    user-select: none;
}

.attendance-status-btn--active[data-status="present"] {
    background: #d1fae5;
    color: #047857;
    border-color: #6ee7b7;
}

.attendance-status-btn--active[data-status="late"] {
    background: #fef3c7;
    color: #b45309;
    border-color: #fcd34d;
}

.attendance-status-btn--active[data-status="absent"] {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fca5a5;
}

@media (max-width: 640px) {
    .attendance-lesson-form__fields,
    .lesson-note-card__body {
        grid-template-columns: 1fr;
    }

    .attendance-lesson-panel__footer {
        flex-direction: column;
        align-items: stretch;
    }

    .attendance-lesson-panel__footer .btn,
    .attendance-mark-all-form .btn {
        width: 100%;
    }

    .attendance-table thead {
        display: none;
    }

    .attendance-row,
    .attendance-row-form {
        display: block;
    }

    .attendance-row__name,
    .attendance-row__status-cell,
    .attendance-row__grade-cell,
    .attendance-row__action-cell {
        display: block;
        width: 100%;
        padding: 0.35rem 0;
    }

    .attendance-row__grade-panel {
        justify-content: flex-start;
    }

    .attendance-status-toggle {
        width: 100%;
        justify-content: space-between;
    }

    .attendance-status-btn {
        flex: 1;
        padding-left: 0.35rem;
        padding-right: 0.35rem;
    }

    .attendance-row__grade,
    .attendance-row__save {
        width: 100%;
    }
}

.form-section {
    margin-top: 0.5rem;
    padding-top: 0.25rem;
}

.form-section__title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.form-section__optional {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray-400);
}

.form-section__hint {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin: 0;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .report-grid { grid-template-columns: repeat(2, 1fr); }
    .report-charts-grid { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s;
    }

    .main-area { margin-left: 0; }

    .topbar { left: 0; }

    .auth-layout { grid-template-columns: 1fr; }
    .auth-layout__brand { padding: 2rem; min-height: auto; }
    .auth-brand h1 { font-size: 1.75rem; }
    .auth-brand__features { display: none; }

    .stats-row { grid-template-columns: 1fr 1fr; }
    .page-hero { flex-direction: column; padding: 1.25rem; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .form--grid { grid-template-columns: 1fr; }
    .form-actions { flex-direction: column; }
    .page { padding: calc(56px + 1rem) 1rem 1rem; }
    .report-grid { grid-template-columns: 1fr; }
    .report-charts-grid { grid-template-columns: 1fr; }
    .chart-card__body--doughnut { max-width: none; }

    .topbar { padding: 0 1rem; }
    .topbar-clock__date { display: none; }
    .topbar-clock { padding: 0.35rem 0.65rem; }
    .topbar__profile-info { display: none; }
    .topbar__profile { padding: 0.25rem; border-radius: 50%; }
    .topbar__logout-text { display: none; }
    .topbar__branch { font-size: 0.75rem; padding: 0.35rem 0.6rem; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
    .report-links { grid-template-columns: 1fr; }
    .filter-bar { flex-direction: column; align-items: stretch; }
    .today-lesson-card { grid-template-columns: 1fr; }
    .schedule-week { grid-template-columns: 1fr; }
    .schedule-create__top { grid-template-columns: 1fr; }
    .schedule-create__preset { grid-template-columns: 1fr 1fr; }
    .schedule-month__day { min-height: 90px; }
    .schedule-month__lesson-teacher { display: none; }
}

@media (max-width: 640px) {
    .schedule-month__weekdays,
    .schedule-month__week {
        grid-template-columns: repeat(7, minmax(0, 1fr));
    }
    .schedule-month__lesson-subject {
        font-size: 0.65rem;
    }
    .schedule-month__lesson-group {
        display: none;
    }
}

@media (max-width: 480px) {
    .stats-row { grid-template-columns: 1fr; }
}

/* ===== Audit loglari ===== */
.audit-filter-bar {
    margin-bottom: 1.25rem;
}

.audit-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.audit-item {
    display: grid;
    grid-template-columns: 12px 1fr;
    gap: 0.75rem;
    align-items: start;
}

.audit-item__marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-top: 1.1rem;
}

.audit-item__card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1rem 1.15rem;
    box-shadow: var(--shadow-sm);
}

.audit-item__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.audit-item__time {
    font-size: 0.8125rem;
    color: var(--gray-500);
    white-space: nowrap;
}

.audit-item__title {
    margin: 0 0 0.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-900);
}

.audit-item__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.audit-meta-chip {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--gray-100);
    color: var(--gray-700);
}

.audit-meta-chip--branch {
    background: #ecfdf5;
    color: #047857;
    font-weight: 600;
}

.audit-meta-chip--muted {
    color: var(--gray-500);
}

.audit-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
}

.audit-badge--create { background: #dcfce7; color: #15803d; }
.audit-badge--update { background: #dbeafe; color: #1d4ed8; }
.audit-badge--delete { background: #fee2e2; color: #b91c1c; }
.audit-badge--login { background: #ede9fe; color: #6d28d9; }
.audit-badge--payment_in { background: #ecfdf5; color: #047857; }
.audit-badge--payment_out { background: #fff7ed; color: #c2410c; }

.audit-item__changes {
    margin-top: 0.65rem;
    font-size: 0.8125rem;
    color: var(--gray-600);
}

.audit-item__changes summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--gray-700);
}

.audit-item__changes ul {
    margin: 0.5rem 0 0;
    padding-left: 1.1rem;
}

.audit-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.25rem;
}

.audit-pagination__info {
    font-size: 0.875rem;
    color: var(--gray-600);
}
