* {
    box-sizing: border-box;
}

:root {
    --ui-blue-50: #ecfdf3;
    --ui-blue-100: #d1fae5;
    --ui-blue-500: #166534;
    --ui-blue-600: #14532d;
    --ui-blue-700: #052e16;
    --ui-slate-900: #0f172a;
    --ui-slate-600: #475569;
    --ui-border: #dbe4f0;
    --ui-panel-shadow: 0 16px 40px rgba(20, 83, 45, 0.08);
}

body {
    margin: 0;
}

.auth-shell {
    position: relative;
}

.auth-bg-orb {
    position: absolute;
    border-radius: 999px;
    filter: blur(2px);
    animation: authFloat 6.5s ease-in-out infinite;
}

.auth-bg-orb-1 {
    width: 190px;
    height: 190px;
    left: 8%;
    top: 12%;
    background: radial-gradient(circle, rgba(22, 101, 52, 0.22), rgba(22, 101, 52, 0));
}

.auth-bg-orb-2 {
    width: 240px;
    height: 240px;
    right: 8%;
    bottom: 8%;
    animation-delay: 1.2s;
    background: radial-gradient(circle, rgba(20, 83, 45, 0.26), rgba(20, 83, 45, 0));
}

.auth-illustration-card {
    box-shadow: 0 16px 42px rgba(20, 83, 45, 0.1);
}

.auth-wave {
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(90deg, #ecfdf3, #d1fae5, #ecfdf3);
    background-size: 220% 100%;
    animation: waveRun 4.8s linear infinite;
}

.auth-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.42rem;
}

.auth-input {
    width: 100%;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
    border-radius: 0.9rem;
    padding: 0.78rem 0.9rem;
    font-size: 0.95rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.auth-input::placeholder {
    color: #94a3b8;
}

.auth-input:focus {
    outline: none;
    border-color: #166534;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(22, 101, 52, 0.18);
}

.auth-btn {
    width: 100%;
    border: 0;
    border-radius: 0.9rem;
    padding: 0.82rem 1rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    cursor: pointer;
    background: #166534;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    box-shadow: 0 10px 24px rgba(20, 83, 45, 0.24);
}

.auth-btn:hover {
    transform: translateY(-1px);
    background: #14532d;
    box-shadow: 0 12px 26px rgba(20, 83, 45, 0.3);
}

.auth-btn:active {
    transform: translateY(0);
}

.auth-social-btn {
    height: 36px;
    width: 36px;
    border-radius: 999px;
    border: 1px solid #d1fae5;
    background: #ecfdf3;
    color: #14532d;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.auth-social-btn:hover {
    transform: translateY(-1px);
    background: #d1fae5;
}

.input {
    width: 100%;
    border: 1px solid var(--ui-border);
    border-radius: 0.95rem;
    padding: 0.72rem 0.9rem;
    font-size: 0.95rem;
    outline: none;
    background: #fbfdff;
    color: var(--ui-slate-900);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.input:focus {
    border-color: var(--ui-blue-500);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(45, 108, 223, 0.2);
}

.input:hover {
    border-color: #b5c8ea;
}

.label {
    display: block;
    font-size: 0.83rem;
    color: #334155;
    margin-bottom: 0.35rem;
    font-weight: 600;
}

.btn-primary,
.btn-secondary,
.btn-danger {
    border: 0;
    border-radius: 0.9rem;
    padding: 0.66rem 1rem;
    cursor: pointer;
    font-size: 0.86rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--ui-blue-500), var(--ui-blue-600));
    color: #fff;
    box-shadow: 0 10px 24px rgba(20, 83, 45, 0.2);
}

.btn-primary:hover {
    transform: translateY(-1px);
    background: #14532d;
    box-shadow: 0 13px 28px rgba(20, 83, 45, 0.25);
}

.btn-secondary {
    background: #166534;
    color: #ffffff;
}

.btn-secondary:hover {
    background: #14532d;
}

.btn-danger {
    background: #166534;
    color: #ffffff;
}

.btn-danger:hover {
    background: #14532d;
}

.panel {
    background: #fff;
    border: 1px solid var(--ui-border);
    border-radius: 1.15rem;
    padding: 1.2rem;
    box-shadow: var(--ui-panel-shadow);
}

.panel-title {
    margin: 0;
    font-size: 1.04rem;
    font-weight: 700;
    color: #0b1220;
}

.panel-subtitle {
    margin-top: 0.35rem;
    margin-bottom: 0;
    color: #64748b;
    font-size: 0.82rem;
}

.ajax-search {
    position: relative;
}

.ajax-search-results {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.35rem);
    z-index: 80;
    border: 1px solid var(--ui-border);
    border-radius: 0.9rem;
    background: #ffffff;
    box-shadow: 0 16px 36px rgba(15, 69, 165, 0.12);
    overflow: hidden;
    max-height: 220px;
    overflow-y: auto;
}

#singleClassTable tr,
#singleClassTable td {
    overflow: visible;
}

.single-class-table-wrap {
    overflow: visible;
}

#singleClassTable {
    overflow: visible;
    border-collapse: separate;
    border-spacing: 0;
}

#singleClassTable tbody {
    position: relative;
}

#singleClassTable tr {
    position: relative;
    z-index: 0;
}

#singleClassTable tr:focus-within {
    z-index: 70;
}

#singleClassTable td {
    position: relative;
}

#singleClassTable .single-class-search-wrap {
    position: relative;
    z-index: 80;
}

#singleClassTable .single-class-search-wrap,
#singleClassTable .single-class-search-wrap .ajax-search-results {
    width: 100%;
}

#singleClassTable .single-class-search-wrap .ajax-search-results {
    z-index: 90;
}

.single-class-data-panel {
    position: relative;
    z-index: 30;
    overflow: visible;
}

.single-payment-panel {
    position: relative;
    z-index: 10;
}

#multiStudentsTable tr,
#multiStudentsTable td {
    overflow: visible;
}

.multi-students-table-wrap {
    overflow: visible;
}

#multiStudentsTable {
    overflow: visible;
    border-collapse: separate;
    border-spacing: 0;
}

#multiStudentsTable tbody {
    position: relative;
}

#multiStudentsTable tr {
    position: relative;
    z-index: 0;
}

#multiStudentsTable tr:focus-within {
    z-index: 70;
}

#multiStudentsTable td {
    position: relative;
}

#multiStudentsTable .ajax-search {
    position: relative;
    z-index: 80;
}

#multiStudentsTable .ajax-search .ajax-search-results {
    z-index: 90;
}

#multiStudentsTable .ajax-search,
#multiStudentsTable .ajax-search .ajax-search-results {
    width: 100%;
}

.ajax-search-item {
    width: 100%;
    display: block;
    text-align: left;
    border: 0;
    background: #fff;
    padding: 0.72rem 0.9rem;
    cursor: pointer;
    border-bottom: 1px solid #edf2f7;
}

.ajax-search-item:hover {
    background: #f6f9ff;
}

.ajax-search-item:last-child {
    border-bottom: 0;
}

.ajax-search-item-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #0f172a;
}

.ajax-search-item-meta {
    margin-top: 0.15rem;
    font-size: 0.76rem;
    color: #64748b;
}

.class-card-selected {
    border-color: var(--ui-blue-500) !important;
    background: #f6f9ff;
    box-shadow: 0 0 0 3px rgba(45, 108, 223, 0.12);
}

.hidden-panel {
    display: none;
    animation: panelDrop 0.18s ease-out;
}

.hidden-panel-open {
    display: block;
}

.panel-close-btn {
    border: 1px solid var(--ui-border);
    background: #f8fbff;
    color: #475569;
    border-radius: 999px;
    padding: 0.45rem 0.8rem;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.panel-close-btn:hover {
    background: #edf3ff;
    color: var(--ui-blue-600);
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
    border: 1px solid var(--ui-border);
    border-radius: 0.9rem;
    overflow: hidden;
}

.table th,
.table td {
    border-bottom: 1px solid #e8edf6;
    text-align: left;
    padding: 0.78rem;
    font-size: 0.84rem;
    vertical-align: top;
}

.table th {
    color: #526079;
    background: #f5f8ff;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.table tbody tr {
    transition: background-color 0.12s ease;
}

.table tbody tr:hover {
    background: #f8fbff;
}

.link {
    color: var(--ui-blue-600);
    font-weight: 600;
    text-decoration: none;
}

.link:hover {
    text-decoration: underline;
}

.card-stat {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid #dbe8ff;
    border-radius: 1.1rem;
    padding: 1.1rem;
    box-shadow: 0 14px 30px rgba(45, 108, 223, 0.08);
}

.card-stat p {
    margin: 0;
    color: #64748b;
    font-size: 0.82rem;
}

.card-stat h3 {
    margin: 0.45rem 0 0;
    font-size: 1.5rem;
    color: #0f172a;
}

.tab {
    border-radius: 0.95rem;
    padding: 0.55rem 1rem;
    text-decoration: none;
    color: #475569;
    background: #edf3ff;
    font-weight: 600;
    font-size: 0.85rem;
    border: 1px solid #dbe8ff;
}

.tab-active {
    background: linear-gradient(135deg, var(--ui-blue-500), var(--ui-blue-600));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(26, 90, 200, 0.24);
}

.side-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    border-radius: 0.95rem;
    padding: 0.72rem 0.85rem;
    color: #475569;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.15s ease;
}

.side-link:hover {
    color: #14532d;
    background: #ecfdf3;
}

.side-link-active {
    background: linear-gradient(135deg, #166534, #14532d);
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(20, 83, 45, 0.28);
}

.mobile-tab-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    min-height: 48px;
    border-radius: 0.9rem;
    text-decoration: none;
    color: #64748b;
    font-weight: 600;
    line-height: 1;
}

.mobile-tab-link-active {
    background: #ecfdf3;
    color: #14532d;
}

.mobile-tab-link span {
    font-size: 0.64rem;
    letter-spacing: 0.01em;
}

.dashboard-hero {
    background: linear-gradient(130deg, #14532d 0%, #166534 50%, #15803d 100%);
    color: #fff;
    border-radius: 1.2rem;
    padding: 1.15rem;
    box-shadow: 0 18px 34px rgba(20, 83, 45, 0.24);
}

.dashboard-hero p {
    margin: 0;
    opacity: 0.94;
    font-size: 0.88rem;
}

.dashboard-hero h2 {
    margin: 0.32rem 0 0;
    font-size: 1.15rem;
    line-height: 1.35;
}

.sales-graph {
    display: grid;
    gap: 0.8rem;
}

.sales-graph-row {
    display: grid;
    gap: 0.35rem;
}

.sales-graph-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.sales-graph-label {
    font-size: 0.83rem;
    color: #334155;
    font-weight: 600;
}

.sales-graph-value {
    font-size: 0.79rem;
    color: #14532d;
    font-weight: 700;
}

.sales-graph-track {
    width: 100%;
    height: 11px;
    border-radius: 999px;
    background: #dcfce7;
    overflow: hidden;
}

.sales-graph-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #166534, #16a34a);
}

input[type='checkbox'],
input[type='radio'] {
    accent-color: #166534;
}

textarea.input {
    resize: vertical;
}

@media (max-width: 768px) {
    .panel {
        border-radius: 1rem;
        padding: 1rem;
    }

    .card-stat {
        padding: 1rem;
    }

    .btn-primary,
    .btn-secondary,
    .btn-danger {
        min-height: 40px;
    }
}

@media (max-width: 640px) {
    .table {
        min-width: 0;
        border: 0;
        display: block;
        background: transparent;
    }

    .table thead {
        display: none;
    }

    .table tbody,
    .table tr,
    .table td {
        display: block;
        width: 100%;
    }

    .table tr {
        border: 1px solid var(--ui-border);
        border-radius: 0.95rem;
        background: #fff;
        box-shadow: 0 8px 24px rgba(15, 69, 165, 0.08);
        margin-bottom: 0.7rem;
        overflow: hidden;
    }

    .table td {
        border-bottom: 1px dashed #e8edf6;
        padding: 0.58rem 0.75rem;
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 0.7rem;
        text-align: right;
        font-size: 0.8rem;
    }

    .table td:last-child {
        border-bottom: 0;
    }

    .table td::before {
        content: attr(data-label);
        color: #526079;
        font-weight: 700;
        text-align: left;
        flex: 0 0 42%;
    }

    .table td > * {
        max-width: 56%;
        text-align: right;
    }

    .table td form {
        width: auto;
    }

    .table td .flex {
        justify-content: flex-end;
    }

    .table td[colspan] {
        display: block;
        text-align: left;
    }

    .table td[colspan]::before {
        content: none;
    }

    .table.no-stack-table {
        display: table;
        min-width: 760px;
        border: 1px solid var(--ui-border);
        background: #fff;
    }

    .table.no-stack-table thead {
        display: table-header-group;
    }

    .table.no-stack-table tbody {
        display: table-row-group;
    }

    .table.no-stack-table tr {
        display: table-row;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        margin-bottom: 0;
        overflow: visible;
    }

    .table.no-stack-table td,
    .table.no-stack-table th {
        display: table-cell;
        width: auto;
        text-align: left;
        padding: 0.78rem;
    }

    .table.no-stack-table td::before {
        content: none;
    }

    .table.no-stack-table td > * {
        max-width: 100%;
        text-align: left;
    }
}

@keyframes authFloat {
    0%,
    100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-12px);
    }
}

@keyframes waveRun {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 200% 50%;
    }
}

@keyframes panelDrop {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
