/* Custom dashboard styling for the tuition management system */

:root {
    --app-bg: #eef3f9;
    --sidebar-bg: #0f172a;
    --sidebar-soft: #1e293b;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --accent: #2563eb;
    --accent-soft: rgba(37, 99, 235, 0.12);
    --border: rgba(15, 23, 42, 0.08);
    --shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    color: var(--text-main);
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 35%),
        radial-gradient(circle at top right, rgba(14, 165, 233, 0.12), transparent 30%),
        linear-gradient(180deg, #f8fbff 0%, var(--app-bg) 100%);
    min-height: 100vh;
}

.dashboard-body {
    overflow-x: hidden;
}

.app-shell {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100%;
    padding: 24px;
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, #111827 100%);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, #38bdf8, #2563eb);
    display: grid;
    place-items: center;
    font-weight: 800;
    color: #fff;
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.35);
}

.brand-name {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.brand-subtitle {
    color: rgba(226, 232, 240, 0.72);
    font-size: 0.9rem;
}

.role-box {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 16px;
}

.sidebar-nav {
    display: grid;
    gap: 8px;
}

.nav-link-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(226, 232, 240, 0.9);
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 14px;
    transition: 0.2s ease;
}

.nav-link-item:hover,
.nav-link-item.active {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    transform: translateX(2px);
}

.main-content {
    padding: 24px;
    min-width: 0;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
}

.page-title {
    font-size: clamp(1.5rem, 2vw, 2.25rem);
    font-weight: 800;
    margin-bottom: 4px;
}

.page-subtitle {
    color: var(--text-muted);
}

.user-pill {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 10px 16px;
    box-shadow: var(--shadow);
    font-weight: 600;
}

.stat-card,
.panel-card,
.auth-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.stat-card {
    padding: 18px;
    /* height: 100%; */
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-main);
}

.panel-card {
    padding: 20px;
    margin-bottom: 2px;
    min-width: 0;
}

.page-hero {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    padding: 28px;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.14), transparent 28%),
        linear-gradient(135deg, #0f172a 0%, #1d4ed8 55%, #0ea5e9 100%);
    color: #fff;
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.22);
    min-width: 0;
}

.page-hero::after {
    content: "";
    position: absolute;
    inset: auto -80px -120px auto;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    filter: blur(8px);
}

.hero-kicker,
.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.76rem;
    font-weight: 800;
}

.hero-kicker {
    color: rgba(255, 255, 255, 0.78);
}

.hero-title {
    margin: 10px 0 10px;
    font-size: clamp(1.8rem, 3vw, 3rem);
    line-height: 1.05;
    font-weight: 900;
    max-width: 14ch;
}

.hero-text {
    max-width: 760px;
    color: rgba(255, 255, 255, 0.82);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-metrics {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 22px;
}

.metric-tile {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(10px);
}

.metric-label {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-value {
    margin-top: 6px;
    font-size: 1.4rem;
    font-weight: 900;
}

.module-card {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--border);
    border-radius: 26px;
    box-shadow: var(--shadow);
    padding: 24px;
    min-width: 0;
}

.module-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.soft-note {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(14, 165, 233, 0.08));
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-radius: 18px;
    padding: 16px;
}

.section-card {
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.92), rgba(255, 255, 255, 0.98));
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 22px;
    padding: 18px;
}

.section-card + .section-card {
    margin-top: 16px;
}

.section-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.section-title {
    font-size: 1.02rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.section-text {
    color: var(--text-muted);
    margin-bottom: 0;
}

.preview-card {
    position: sticky;
    top: 24px;
    background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
    color: #e2e8f0;
    border-radius: 26px;
    padding: 24px;
    box-shadow: 0 28px 55px rgba(15, 23, 42, 0.25);
    overflow: hidden;
    min-width: 0;
}

.preview-card .panel-text,
.preview-card .section-text,
.preview-card .text-muted {
    color: rgba(226, 232, 240, 0.72) !important;
}

.preview-card .section-title,
.preview-card .panel-title {
    color: #fff;
}

.preview-list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.preview-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px dashed rgba(226, 232, 240, 0.16);
}

.preview-row:last-child {
    border-bottom: 0;
}

.preview-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(226, 232, 240, 0.6);
}

.preview-value {
    text-align: right;
    font-weight: 700;
    color: #fff;
}

.class-toolbar {
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 18px;
    box-shadow: var(--shadow);
    min-width: 0;
}

.class-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
}

.class-card {
    position: relative;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--border);
    border-radius: 26px;
    padding: 22px;
    box-shadow: var(--shadow);
    overflow: hidden;
    min-width: 0;
}

.class-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #2563eb, #0ea5e9);
}

.class-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.class-title {
    font-size: 1.1rem;
    font-weight: 900;
    margin-bottom: 6px;
}

.class-subtitle {
    color: var(--text-muted);
    margin-bottom: 0;
}

.class-price {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--text-main);
}

.class-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.class-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid rgba(37, 99, 235, 0.12);
    font-size: 0.82rem;
    font-weight: 700;
}

.class-chip.soft {
    background: #f8fafc;
    color: var(--text-main);
}

.class-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.class-meta {
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    padding: 12px;
}

.class-meta-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 5px;
}

.class-meta-value {
    font-weight: 800;
    color: var(--text-main);
}

.class-action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.class-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 800;
}

.class-status-pill.home {
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
}

.class-status-pill.center {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.class-status-pill.online {
    background: rgba(14, 165, 233, 0.12);
    color: #0284c7;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.panel-title {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.panel-text {
    color: var(--text-muted);
    margin-bottom: 0;
}

.table-responsive {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
    border-radius: 18px;
}

.table-responsive .table {
    margin-bottom: 0;
}

.dataTables_wrapper {
    width: 100%;
}

.dataTables_wrapper .row {
    --bs-gutter-x: 0.75rem;
}

.dataTables_wrapper .dataTables_scroll {
    width: 100%;
}

.dataTables_wrapper .dataTables_scrollHead,
.dataTables_wrapper .dataTables_scrollBody {
    width: 100%;
}

.dataTables_wrapper .dataTables_scrollBody {
    overflow: auto;
}

.dataTables_wrapper table.dataTable {
    width: 100% !important;
}

.classes-table {
    min-width: 1560px;
}

.classes-table th,
.classes-table td {
    vertical-align: top;
}

.classes-table .text-muted.small {
    white-space: normal;
}

table.dataTable th,
table.dataTable td {
    vertical-align: middle;
}

table.dataTable tbody td {
    word-break: break-word;
}

table thead th {
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-control,
.form-select {
    border-radius: 14px;
    border-color: rgba(15, 23, 42, 0.12);
    min-height: 46px;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(37, 99, 235, 0.5);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.12);
}

.btn {
    border-radius: 14px;
    padding: 0.7rem 1rem;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

.auth-body {
    min-height: 100vh;
}

.auth-wrapper {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card {
    max-width: 560px;
    width: 100%;
    padding: 28px;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    color: #fff;
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.demo-box {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(14, 165, 233, 0.08));
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-radius: 18px;
    padding: 16px;
}

@media (max-width: 991px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        height: auto;
        padding: 18px;
    }

    .main-content {
        padding: 18px;
    }

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

    .sidebar-nav {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .page-hero,
    .module-card,
    .preview-card,
    .class-card,
    .class-toolbar {
        border-radius: 22px;
    }

    .class-meta-grid {
        grid-template-columns: 1fr;
    }

    .preview-card {
        position: static;
    }
}

@media (max-width: 767px) {
    .main-content {
        padding: 14px;
    }

    .sidebar {
        gap: 16px;
    }

    .brand-block {
        align-items: flex-start;
    }

    .brand-icon {
        width: 44px;
        height: 44px;
        border-radius: 14px;
    }

    .page-hero {
        padding: 20px;
        border-radius: 22px;
    }

    .page-hero::after {
        width: 220px;
        height: 220px;
    }

    .hero-title {
        max-width: none;
        font-size: clamp(1.5rem, 6vw, 2.25rem);
    }

    .hero-actions,
    .panel-head,
    .module-card-head,
    .section-card-head,
    .class-card-head,
    .class-action-row,
    .preview-row,
    .topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-actions .btn,
    .panel-head .btn,
    .module-card-head .btn,
    .section-card-head .btn {
        width: 100%;
    }

    .hero-metrics {
        grid-template-columns: 1fr;
    }

    .sidebar-nav {
        grid-template-columns: 1fr;
    }

    .nav-link-item {
        width: 100%;
        justify-content: flex-start;
    }

    .user-pill {
        width: 100%;
        justify-content: center;
    }

    .stat-card,
    .panel-card,
    .module-card {
        padding: 16px;
    }

    .section-card,
    .class-card,
    .class-toolbar {
        padding: 14px;
    }

    .class-grid {
        grid-template-columns: 1fr;
    }

    .class-meta-grid {
        grid-template-columns: 1fr;
    }

    .preview-value {
        text-align: left;
    }

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        width: 100%;
        text-align: left;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: 100%;
        margin-left: 0;
    }

    .dataTables_wrapper .dataTables_length select {
        max-width: 100%;
    }

    .dataTables_wrapper .dataTables_paginate {
        display: flex;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 6px;
    }

    .table-responsive table.dataTable {
        min-width: 720px;
    }
}

@media (max-width: 575px) {
    .hero-title {
        font-size: 1.45rem;
    }

    .brand-name {
        font-size: 0.98rem;
    }

    .brand-subtitle,
    .page-subtitle {
        font-size: 0.88rem;
    }

    .stat-value,
    .metric-value {
        font-size: 1.35rem;
    }

    .form-control,
    .form-select {
        min-height: 42px;
    }
}
