body {
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
    background: #f5f7fb;
    margin: 0;
    color: #111;
}
.menu-group {
    display: flex;
    gap: 12px;
    margin-left: 10px;
    margin-right: 10px;
    color: #facc15;
    font-size: 14px;
}

.menu-group span {
    cursor: default;
}

body {
    margin: 0;
    background: #f3f6fb;
    font-family: Arial, sans-serif;
}

.top-header {
    height: 76px;
    background: linear-gradient(90deg, #071426, #0f2a4a);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.logo-box {
    position: absolute;
    left: 22px;
    top: 8px;
    width: 60px;
    height: 60px;
}

.logo-box img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.club-title {
    font-size: 28px;
    font-weight: bold;
    letter-spacing: 1px;
}

.layout {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    min-height: calc(100vh - 92px);
}

.layout.collapsed {
    grid-template-columns: 58px 1fr;
}

.sidebar {
    background: #0b1324;
    color: white;
    padding-top: 12px;
    overflow: hidden;
}

.content {
    padding: 18px;
    overflow-x: auto;
}

.sidebar.collapsed {
    width: auto;
}

.content.expanded {
    width: auto;
}

.sidebar.collapsed {
    width: 58px;
}

.toggle-btn {
    width: 42px;
    height: 36px;
    margin: 0 8px 12px 8px;
    border: none;
    background: #fbbf24;
    color: #111827;
    font-size: 20px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
}

.sidebar a,
.sidebar-item,
.sidebar-section {
    display: block;
    color: white;
    text-decoration: none;
    padding: 12px 18px;
    white-space: nowrap;
    font-weight: bold;
}

.sidebar a:hover,
.sidebar-item:hover {
    background: #1d4ed8;
}

.sidebar-section {
    margin-top: 18px;
    color: #fbbf24;
    border-top: 1px solid #334155;
}



.content {
    flex: 1;
    padding: 18px;
    transition: 0.25s;
    overflow-x: auto;
}

.content.expanded {
    width: calc(100vw - 58px);
}


.student-form-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.readonly-code {
    height: 36px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fef3c7;
    display: flex;
    align-items: center;
    padding: 0 10px;
    font-weight: bold;
    color: #92400e;
}

.date-wrap {
    position: relative;
    display: flex;
}

.date-wrap input[type="text"],
.date-wrap input[name="birthdate"] {
    width: 100%;
    padding-right: 42px;
}

.calendar-btn {
    position: absolute;
    right: 4px;
    top: 4px;
    height: 28px;
    width: 34px;
    border: none;
    border-radius: 5px;
    background: #fbbf24;
    cursor: pointer;
}

#hiddenDate {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.card {
    background: white;
    padding: 14px;
    border-radius: 10px;
    box-shadow: 0 1px 8px rgba(0,0,0,.08);
    margin-bottom: 14px;
}

.student-form-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.student-form-grid input,
.student-form-grid select {
    height: 36px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0 10px;
}

.readonly-code {
    height: 36px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fef3c7;
    display: flex;
    align-items: center;
    padding: 0 10px;
    font-weight: bold;
    color: #92400e;
}

.date-wrap {
    position: relative;
}

.date-wrap input[name="birthdate"] {
    width: 100%;
    box-sizing: border-box;
    padding-right: 42px;
}

.calendar-btn {
    position: absolute;
    right: 4px;
    top: 4px;
    height: 28px;
    width: 34px;
    border: none;
    border-radius: 5px;
    background: #fbbf24;
    cursor: pointer;
}

#hiddenDate {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.add-btn {
    height: 36px;
    background: #fbbf24;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
}

.search-row {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.search-row input {
    height: 34px;
    width: 260px;
    padding: 0 10px;
}

.search-row button {
    background: #fbbf24;
    border: none;
    border-radius: 6px;
    padding: 0 18px;
    font-weight: bold;
}

.danger-btn {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    font-weight: bold;
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mi {
    width: 26px;
    min-width: 26px;
    text-align: center;
    font-size: 20px;
}

.sidebar.collapsed a span:last-child {
    display: none;
}

.sidebar.collapsed .sidebar-section {
    display: block;
    height: 1px;
    padding: 0;
    margin: 14px 8px;
}


.field-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-box label {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

.field-box label span {
    color: #64748b;
    font-weight: 400;
}

.field-box label b {
    color: #ef4444;
}

.field-box input,
.field-box select {
    width: 100%;
    box-sizing: border-box;
}


.action-cell {
    display: flex;
    gap: 6px;
    justify-content: center;
    align-items: center;
}

.action-cell form {
    margin: 0;
}

.icon-btn {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    font-size: 17px;
}

.edit-btn {
    background: #fbbf24;
}

.delete-btn {
    background: #ef4444;
    color: white;
}

.modal-bg {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal-box {
    width: min(900px, 92vw);
    background: white;
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
}

.modal-box h2 {
    margin-top: 0;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.cancel-btn,
.save-btn {
    border: none;
    border-radius: 8px;
    padding: 10px 22px;
    font-weight: bold;
    cursor: pointer;
}

.cancel-btn {
    background: #e5e7eb;
}

.save-btn {
    background: #22c55e;
    color: white;
}

.action-cell {
    min-width: 90px;
    white-space: nowrap;

    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.action-cell form {
    display: inline;
    margin: 0;
}

.icon-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
}

/* ===== FIX LAG SIDEBAR ===== */

.layout {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    min-height: calc(100vh - 92px);
}

.layout.collapsed {
    grid-template-columns: 58px minmax(0, 1fr);
}

.sidebar {
    background: #0b1324;
    color: white;
    padding-top: 12px;
    overflow: hidden;
    will-change: width;
}

.content {
    padding: 18px;
    overflow-x: auto;
    min-width: 0;
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    text-decoration: none;
    padding: 12px 18px;
    white-space: nowrap;
    font-weight: bold;
}

.sidebar.collapsed a span:last-child {
    display: none;
}

.sidebar.collapsed .sidebar-section {
    display: block;
    height: 1px;
    padding: 0;
    margin: 14px 8px;
    border-top: 1px solid #334155;
}

.sidebar.collapsed .toggle-btn {
    margin-left: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    table-layout: fixed;
}

th,
td {
    border: 1px solid #e5e7eb;
    padding: 7px;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.action-cell {
    min-width: 76px;
    width: 76px;
    white-space: nowrap;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.action-cell form {
    margin: 0;
    display: inline;
}

.icon-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
}

.toast-popup {
    position: fixed;
    top: 92px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;

    min-width: 360px;
    max-width: 720px;
    padding: 12px 22px;

    background: #dcfce7;
    border: 1px solid #86efac;
    color: #14532d;

    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,.18);

    font-weight: 600;
    text-align: center;

    animation: toastIn .25s ease-out;
}

.toast-popup.hide {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
    transition: .35s ease;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.inactive-row {
    background: #e5e7eb !important;
    color: #6b7280;
}

.inactive-row td {
    background: #e5e7eb !important;
    color: #6b7280;
}

.inactive-row .icon-btn {
    opacity: 0.65;
}


.fee-form-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    align-items: end;
}

.fee-span-2 {
    grid-column: span 2;
}

.fee-span-3 {
    grid-column: span 3;
}

.fee-form-grid .field-box input,
.fee-form-grid .field-box select {
    width: 100%;
    height: 38px;
    box-sizing: border-box;
}

.check-box {
    height: 38px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #334155;
}

.check-box input {
    width: 16px;
    height: 16px;
}

.fee-save-btn {
    height: 38px;
    background: #fbbf24;
    border: none;
    border-radius: 7px;
    font-weight: bold;
}

.fee-new-form {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    align-items: end;
}

.fee-full {
    grid-column: 1 / -1;
}

.month-row {
    display: grid;
    grid-template-columns: 1fr 1fr 42px;
    gap: 10px;
    align-items: end;
    margin-bottom: 8px;
}

.plus-btn,
.remove-btn {
    width: 42px;
    height: 38px;
    border-radius: 7px;
    border: none;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
}

.plus-btn {
    background: #22c55e;
    color: white;
}

.remove-btn {
    background: #ef4444;
    color: white;
}

.suffix-wrap {
    position: relative;
}

.suffix-wrap input {
    padding-right: 42px;
}

.suffix-wrap span {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: bold;
    color: #334155;
}

.fee-save-btn {
    height: 40px;
    background: #fbbf24;
    border: none;
    border-radius: 8px;
    font-weight: bold;
}

.fee-new-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 16px;
    align-items: end;
}

.fee-new-form .field-box label {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 6px;
}

.fee-new-form input,
.fee-new-form select {
    height: 42px;
    border: 1px solid #d7deea;
    border-radius: 10px;
    background: #f8fafc;
    font-size: 14px;
    transition: .2s;
}

.fee-new-form input:focus,
.fee-new-form select:focus {
    border-color: #2563eb;
    background: white;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
    outline: none;
}

.fee-full {
    grid-column: 1 / -1;
}

.month-row {
    display: grid;
    grid-template-columns: 1fr 1fr 48px;
    gap: 12px;
    align-items: end;
    margin-bottom: 10px;
}

.plus-btn,
.remove-btn {
    height: 42px;
    border-radius: 12px;
    border: none;
    font-size: 22px;
    font-weight: 800;
}

.plus-btn {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
}

.remove-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.suffix-wrap {
    position: relative;
}

.suffix-wrap input {
    padding-right: 48px;
}

.suffix-wrap span {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 800;
    color: #2563eb;
}

.check-box {
    height: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    background: #f8fafc;
    border: 1px solid #d7deea;
    border-radius: 10px;
    font-weight: 700;
}

.fee-save-btn {
    height: 44px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #111827;
    border: none;
    border-radius: 12px;
    font-weight: 800;
    box-shadow: 0 6px 14px rgba(245, 158, 11, .28);
}

.card {
    border: 1px solid #e5eaf2;
    box-shadow: 0 8px 26px rgba(15, 23, 42, .08);
}

.fee-card {
    background: white;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 8px 26px rgba(15, 23, 42, .08);
    border: 1px solid #e5eaf2;
    margin-bottom: 14px;
}

.fee-split-form {
    display: grid;
    gap: 14px;
}

.fee-full {
    grid-column: 1 / -1;
}

.fee-panels {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: 16px;
    align-items: start;
}

.fee-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px;
}

.panel-title {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.month-row {
    display: grid;
    grid-template-columns: 1fr 1fr 46px;
    gap: 10px;
    align-items: end;
    margin-bottom: 10px;
}

.discount-line {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 10px;
}

.fee-panel .field-box {
    margin-bottom: 10px;
}

.fee-panel input,
.fee-panel select,
.fee-split-form > .field-box select {
    height: 42px;
    border: 1px solid #d7deea;
    border-radius: 10px;
    background: white;
    font-size: 14px;
}

.fee-panel input:focus,
.fee-panel select:focus,
.fee-split-form > .field-box select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
    outline: none;
}

.plus-btn,
.remove-btn {
    height: 42px;
    border-radius: 12px;
    border: none;
    font-size: 22px;
    font-weight: 900;
    cursor: pointer;
}

.plus-btn {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
}

.remove-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.suffix-wrap {
    position: relative;
}

.suffix-wrap input {
    padding-right: 48px;
}

.suffix-wrap span {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 800;
    color: #2563eb;
}

.total-box input {
    background: #eef6ff;
    color: #0f172a;
    font-weight: 800;
}

.grand-box input {
    background: #fff7ed;
    color: #9a3412;
    font-size: 17px;
}

.bank-box {
    height: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    background: white;
    border: 1px solid #d7deea;
    border-radius: 10px;
    font-weight: 800;
    margin-bottom: 10px;
}

.fee-save-btn {
    width: 100%;
    height: 44px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border: none;
    border-radius: 12px;
    font-weight: 900;
    box-shadow: 0 6px 14px rgba(245,158,11,.28);
}

.month-grid-wrap {
    display: grid;
    grid-template-columns: 1fr 46px;
    gap: 10px;
    align-items: start;
}

.month-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.month-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.month-box .field-box {
    margin-bottom: 0;
}

.month-box select {
    height: 40px;
}

.month-add-btn {
    margin-top: 24px;
}

.month-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(150px, 1fr));
    gap: 10px;
}

.month-box {
    position: relative;
    background: white;
    border: 1px solid #dbe4f0;
    border-radius: 12px;
    padding: 10px;
}

.month-title {
    text-align: center;
    font-weight: 900;
    color: #0f172a;
    margin-bottom: 8px;
}

.month-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.month-fields select {
    height: 36px;
    border-radius: 9px;
}

.month-remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 23px;
    height: 23px;
    border-radius: 50%;
    border: none;
    background: #ef4444;
    color: white;
    font-size: 15px;
    font-weight: 900;
    line-height: 23px;
    padding: 0;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(239, 68, 68, .35);
}

.exam-line {
    display: grid;
    grid-template-columns: 1fr 160px;
    gap: 10px;
    align-items: end;
}

.exam-line .field-box {
    margin-bottom: 10px;
}

.exam-line select,
.exam-line input {
    height: 40px;
}

#examAmount {
    background: #eef6ff;
    color: #0f172a;
    font-weight: 800;
    cursor: not-allowed;
}

.tracking-filter {
    display: flex;
    gap: 10px;
    align-items: end;
    margin-bottom: 14px;
}

.tracking-filter .field-box {
    width: 160px;
}

.tracking-filter select {
    height: 38px;
    border: 1px solid #d7deea;
    border-radius: 10px;
    background: white;
}

.tracking-filter button {
    height: 38px;
    padding: 0 22px;
    border-radius: 10px;
    background: #fbbf24;
    font-weight: 800;
}

.tracking-stats {
    display: grid;
    grid-template-columns: repeat(3, 220px);
    gap: 14px;
    margin-bottom: 14px;
}

.stat-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: 0 8px 22px rgba(15,23,42,.07);
}

.stat-label {
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 22px;
    font-weight: 900;
    color: #0f172a;
}

.student-table {
    width: 100%;
    table-layout: fixed;
}

.student-table th,
.student-table td{
    text-align:center;
    vertical-align:middle;
}

.text-left{
    text-align:left !important;
}


.context-menu {
    display: none;
    position: absolute;
    z-index: 99999;
    min-width: 150px;
    background: white;
    border: 1px solid #dbe4f0;
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(15,23,42,.18);
    overflow: hidden;
}

.context-menu div {
    padding: 10px 14px;
    font-weight: 700;
    cursor: pointer;
}

.context-menu div:hover {
    background: #fef3c7;
}

.unpaid-table tbody tr {
    cursor: context-menu;
}


.context-menu{
    position:absolute;
    display:none;
    min-width:180px;
    background:white;
    border:1px solid #dbe4f0;
    border-radius:10px;
    overflow:hidden;
    z-index:99999;
    box-shadow:0 10px 25px rgba(0,0,0,.15);
}

.context-menu div{
    padding:10px 14px;
    cursor:pointer;
    font-weight:600;
}

.context-menu div:hover{
    background:#fff1f2;
    color:#dc2626;
}


.context-menu {
    display: none;
    position: absolute;
    z-index: 99999;
    min-width: 160px;
    background: white;
    border: 1px solid #dbe4f0;
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(15,23,42,.18);
    overflow: hidden;
}

.context-menu div {
    padding: 10px 14px;
    font-weight: 700;
    cursor: pointer;
}

.context-menu div:hover {
    background: #fef3c7;
}

/* ===== SIDEBAR COLLAPSED ICON ONLY ===== */

.layout.collapsed {
    grid-template-columns: 70px minmax(0, 1fr) !important;
}

.sidebar.collapsed {
    width: 70px !important;
}

.sidebar.collapsed a {
    justify-content: center;
    padding: 14px 0 !important;
    gap: 0;
}

.sidebar.collapsed a span:last-child {
    display: none !important;
}

.sidebar.collapsed .mi {
    width: 70px;
    min-width: 70px;
    margin: 0;
    text-align: center;
    font-size: 22px;
}

.sidebar.collapsed .sidebar-section {
    opacity: 1 !important;
    pointer-events: auto !important;
    display: block;
    height: 1px;
    padding: 0 !important;
    margin: 14px 12px !important;
    border-top: 1px solid #334155;
}

.sidebar.collapsed .toggle-btn {
    margin-left: 14px;
}


.page-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 10px;
}

.page-title-row h1 {
    margin: 0;
}

.finalize-btn {
    height: 38px;
    padding: 0 18px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(34, 197, 94, .25);
}

.exam-filter {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.exam-filter input,
.exam-filter select {
    height: 34px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
}

.exam-filter button {
    height: 34px;
    padding: 0 18px;
    border-radius: 8px;
    background: #fbbf24;
    font-weight: 800;
}

.exam-list-table th,
.exam-list-table td {
    text-align: center;
    vertical-align: middle;
}

.student-name-cell {
    font-weight: 700;
}

.result-combo {
    min-width: 118px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    padding: 0 12px;
    font-weight: 900;
    text-align: center;
    cursor: pointer;
    outline: none;
}

.result-combo.is-pass {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}

.result-combo.is-fail {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

.result-combo.is-absent {
    background: #fef3c7;
    color: #92400e;
    border-color: #fbbf24;
}

.finalize-modal-box {
    max-width: 760px;
}

.confirm-warning {
    font-size: 16px;
    color: #334155;
}

.result-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 16px 0;
}

.result-summary-card {
    border-radius: 14px;
    padding: 14px;
    text-align: center;
    border: 1px solid #e5e7eb;
}

.result-summary-card.pass {
    background: #dcfce7;
    color: #166534;
}

.result-summary-card.fail {
    background: #fee2e2;
    color: #991b1b;
}

.result-summary-card.absent {
    background: #fef3c7;
    color: #92400e;
}

.summary-label {
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 6px;
}

.summary-number {
    font-size: 28px;
    font-weight: 900;
}

.summary-list-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px;
    max-height: 300px;
    overflow-y: auto;
}

.summary-list-box h3 {
    margin: 8px 0;
    font-size: 15px;
}

.summary-list {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 12px;
    line-height: 1.7;
}

.empty-text {
    color: #64748b;
}


.exam-number-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    height: 34px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #f8fafc;
    overflow: hidden;
}

.exam-number-box span {
    padding-left: 12px;
    padding-right: 4px;
    font-weight: 900;
    color: #1e293b;
    white-space: nowrap;
}

.exam-number-input {
    width: 58px;
    height: 100%;
    border: none;
    outline: none;
    background: white;
    text-align: center;
    font-weight: 900;
    color: #0f172a;
}

.exam-number-input::-webkit-outer-spin-button,
.exam-number-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.exam-number-input {
    -moz-appearance: textfield;
}

.result-filter-box {
    display: grid;
    grid-template-columns: 130px 130px minmax(240px, 1fr) 160px 160px 100px;
    gap: 10px;
    align-items: end;
    margin-bottom: 14px;
    background: white;
    border: 1px solid #e5eaf2;
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .06);
}

.result-filter-box select,
.result-filter-box input {
    height: 38px;
    border: 1px solid #d7deea;
    border-radius: 10px;
    background: #f8fafc;
    padding: 0 10px;
    font-weight: 700;
}

.result-filter-box select:focus,
.result-filter-box input:focus {
    outline: none;
    border-color: #2563eb;
    background: white;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.clear-filter-btn {
    height: 38px;
    border-radius: 10px;
    background: #e5e7eb;
    color: #111827;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}

.clear-filter-btn:hover {
    background: #cbd5e1;
}

.result-table th,
.result-table td {
    text-align: center;
    vertical-align: middle;
}

.result-pill {
    display: inline-flex;
    min-width: 86px;
    height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    border: 1px solid transparent;
}

.result-pill.pass {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}

.result-pill.fail {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

.result-pill.absent {
    background: #fef3c7;
    color: #92400e;
    border-color: #fbbf24;
}

@media (max-width: 1100px) {
    .result-filter-box {
        grid-template-columns: repeat(2, minmax(160px, 1fr));
    }

    .result-name-filter {
        grid-column: 1 / -1;
    }
}

/* ===== HEADER CLUB NAME ===== */

.top-header {
    height: 92px;
    background: linear-gradient(90deg, #071426, #0f2a4a);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.logo-box {
    position: absolute;
    left: 22px;
    top: 14px;
    width: 64px;
    height: 64px;
}

.logo-box img {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.club-title-wrap {
    text-align: center;
    line-height: 1.05;
}

.club-title,
.club-subtitle {
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
    text-rendering: geometricPrecision;
    -webkit-font-smoothing: antialiased;
    font-kerning: normal;
}

.club-title {
    font-size: 27px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #ffffff;
    text-transform: uppercase;
}

.club-subtitle {
    margin-top: 6px;
    font-size: 31px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #facc15;
    text-shadow:
        1px 1px 0 #92400e,
        0 3px 8px rgba(250, 204, 21, .28);
}


/* =========================================================
   FIX FONT TIẾNG VIỆT TOÀN APP - DÁN CUỐI FILE style.css
   ========================================================= */

html,
body,
button,
input,
select,
textarea,
table,
th,
td,
a,
label,
div,
span,
p,
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: "Segoe UI", "Arial", "Tahoma", "Helvetica Neue", sans-serif !important;
    font-synthesis: none;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Tránh lỗi dấu tiếng Việt bị tách do letter-spacing */
body,
button,
input,
select,
textarea,
table,
th,
td,
label,
span,
div,
p {
    letter-spacing: 0 !important;
}

/* Emoji trong sidebar vẫn hiện đẹp */
.mi {
    font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", "Segoe UI", sans-serif !important;
}

/* ===== HEADER FIX TRIỆT ĐỂ TIẾNG VIỆT ===== */

.top-header {
    height: 120px !important;
    background: linear-gradient(90deg, #071426, #0f2a4a) !important;
    color: white !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
}

.club-title-wrap {
    text-align: center !important;
    line-height: 1.12 !important;
}

.club-title,
.club-subtitle {
    font-family: "Segoe UI", "Arial", "Tahoma", sans-serif !important;
    font-style: normal !important;
    font-synthesis: none !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    text-shadow: none !important;
    -webkit-text-stroke: 0 !important;
    transform: none !important;
}

.club-title {
    font-size: 35px !important;
    font-weight: 800 !important;
    color: #ffffff !important;
}

.club-subtitle {
    margin-top: 5px !important;
    font-size: 55px !important;
    font-weight: 800 !important;
    color: #facc15 !important;
}

/* Tạo hiệu ứng nổi bằng nền/đường viền nhẹ thay vì shadow chữ */
.club-subtitle {
    display: inline-block !important;
    padding: 1px 10px 3px !important;
    border-radius: 8px !important;
    background: rgba(250, 204, 21, 0.08) !important;
    box-shadow: 0 4px 12px rgba(250, 204, 21, 0.18) !important;
}

/* Logo giữ đều */
.logo-box {
    position: absolute !important;
    left: 22px !important;
    top: 14px !important;
    width: 100px !important;
    height: 100px !important;
}

.logo-box img {
    width: 100px !important;
    height: 100px !important;
    object-fit: contain !important;
}

/* Layout khớp header 92px */
.layout {
    min-height: calc(100vh - 92px) !important;
}

.exam-title-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-exam-btn {
    height: 38px;
    padding: 0 18px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(37, 99, 235, .25);
}

.sort-exam-btn:hover {
    filter: brightness(1.05);
}

/* =========================================================
   STUDENT DETAIL POPUP
   ========================================================= */

.student-detail-modal {
    width: min(1180px, 94vw) !important;
    max-height: 88vh;
    overflow-y: auto;
    padding: 0 !important;
    border-radius: 18px !important;
}

.detail-header {
    position: sticky;
    top: 0;
    z-index: 5;
    background: linear-gradient(90deg, #071426, #0f2a4a);
    color: white;
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.detail-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 900;
}

.detail-student-name {
    margin-top: 5px;
    color: #facc15;
    font-size: 15px;
    font-weight: 800;
}

.detail-close-btn {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: #ef4444;
    color: white;
    font-size: 26px;
    font-weight: 900;
    cursor: pointer;
}

.detail-section-title {
    margin: 18px 22px 10px;
    padding-left: 12px;
    border-left: 5px solid #fbbf24;
    font-size: 20px;
    font-weight: 900;
    color: #0f172a;
}

.detail-top-grid,
.detail-bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding: 0 22px 18px;
}

.detail-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .06);
}

.detail-card h3 {
    margin: 0 0 12px;
    font-size: 17px;
    font-weight: 900;
    color: #0f172a;
}

.detail-row {
    display: grid;
    grid-template-columns: 155px minmax(0, 1fr) 34px;
    gap: 8px;
    align-items: center;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 8px 10px;
    margin-bottom: 8px;
}

.detail-label {
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
}

.detail-value {
    color: #0f172a;
    font-size: 14px;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-edit-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: #fbbf24;
    color: #111827;
    cursor: pointer;
}

.history-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.exam-card,
.activity-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-left: 6px solid #94a3b8;
    border-radius: 14px;
    padding: 12px;
}

.exam-card.pass {
    border-left-color: #22c55e;
    background: #f0fdf4;
}

.exam-card.fail {
    border-left-color: #ef4444;
    background: #fef2f2;
}

.exam-card.absent {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.exam-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.exam-belt {
    font-size: 18px;
    font-weight: 900;
    color: #0f172a;
}

.exam-status {
    min-width: 86px;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}

.exam-meta,
.activity-meta {
    display: grid;
    gap: 5px;
    font-size: 13px;
    color: #334155;
}

.activity-title {
    font-size: 16px;
    font-weight: 900;
    color: #1d4ed8;
    margin-bottom: 8px;
}

.empty-history {
    background: white;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    padding: 18px;
    color: #64748b;
    font-weight: 800;
    text-align: center;
}

@media (max-width: 900px) {
    .detail-top-grid,
    .detail-bottom-grid {
        grid-template-columns: 1fr;
    }

    .detail-row {
        grid-template-columns: 120px minmax(0, 1fr) 34px;
    }
}

/* =========================================================
   STUDENT DETAIL - COMPACT HISTORY CARDS
   ========================================================= */

.detail-bottom-grid .detail-card {
    max-height: 300px;
    overflow-y: auto;
}

.history-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)) !important;
    gap: 10px !important;
    align-items: start;
}

.exam-card,
.activity-card {
    min-height: 98px;
    padding: 10px !important;
    border-radius: 12px !important;
}

.exam-card-top {
    margin-bottom: 6px !important;
}

.exam-belt {
    font-size: 15px !important;
    font-weight: 900 !important;
}

.exam-status {
    min-width: 64px !important;
    height: 24px !important;
    font-size: 12px !important;
    padding: 0 8px !important;
}

.exam-meta,
.activity-meta {
    gap: 3px !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
}

.activity-title {
    font-size: 14px !important;
    margin-bottom: 5px !important;
}

/* Scroll đẹp hơn */
.detail-bottom-grid .detail-card::-webkit-scrollbar {
    width: 8px;
}

.detail-bottom-grid .detail-card::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

.detail-bottom-grid .detail-card::-webkit-scrollbar-track {
    background: #f1f5f9;
}

/* =========================================================
   FINALIZE ERROR POPUP
   ========================================================= */

.finalize-error-box {
    width: min(820px, 94vw) !important;
    max-height: 86vh;
    overflow: hidden;
    padding: 0 !important;
    border-radius: 18px !important;
}

.error-modal-header {
    background: linear-gradient(90deg, #7f1d1d, #991b1b);
    color: white;
    padding: 18px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.error-modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 900;
}

.error-modal-header p {
    margin: 6px 0 0;
    color: #fee2e2;
    font-weight: 700;
}

.error-list-box {
    padding: 18px 22px;
    max-height: 52vh;
    overflow-y: auto;
    background: #fff7f7;
}

.error-item {
    background: white;
    border: 1px solid #fecaca;
    border-left: 6px solid #ef4444;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 12px;
    color: #111827;
    line-height: 1.55;
    font-weight: 700;
}

.error-item b {
    color: #991b1b;
}

.go-result-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 0 18px;
    border-radius: 10px;
    background: #2563eb;
    color: white;
    text-decoration: none;
    font-weight: 900;
}


/* =========================================================
   STUDENT DETAIL PHOTO 3x4
   ========================================================= */

.detail-photo-card {
    margin: 0 22px 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .06);
}

.student-photo-frame {
    width: 120px;
    height: 160px;
    border-radius: 14px;
    border: 2px solid #cbd5e1;
    background: white;
    overflow: hidden;
    position: relative;
    flex: 0 0 auto;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .12);
}

.student-photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.student-photo-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px;
    color: #64748b;
    font-weight: 900;
    background: linear-gradient(180deg, #ffffff, #f1f5f9);
}

.student-photo-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.student-photo-title {
    font-size: 18px;
    font-weight: 900;
    color: #0f172a;
}

.student-photo-note {
    color: #64748b;
    font-weight: 700;
}

.student-photo-upload-btn {
    width: fit-content;
    height: 38px;
    padding: 0 18px;
    border-radius: 10px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(37, 99, 235, .25);
}

.student-photo-upload-btn:hover {
    filter: brightness(1.05);
}

/* =========================================================
   HEADER CLOCK
   ========================================================= */

.top-header {
    position: relative;
}

.header-clock-box {
    position: absolute;
    right: 22px;
    top: 50%;
    transform: translateY(-50%);
    min-width: 170px;
    min-height: 58px;
    padding: 8px 14px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(250, 204, 21, 0.55);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.header-clock-time {
    font-size: 22px;
    line-height: 1;
    font-weight: 900;
    color: #facc15;
    letter-spacing: 1px;
}

.header-clock-date {
    margin-top: 6px;
    font-size: 12px;
    font-weight: 800;
    color: #e5e7eb;
    white-space: nowrap;
}

/* Tablet */
@media (max-width: 1050px) {
    .header-clock-box {
        right: 12px;
        min-width: 135px;
        padding: 7px 10px;
    }

    .header-clock-time {
        font-size: 18px;
    }

    .header-clock-date {
        font-size: 11px;
    }
}

/* Điện thoại: ẩn để không đè tiêu đề */
@media (max-width: 760px) {
    .header-clock-box {
        display: none;
    }
}

/* =========================================================
   FEES PAGE - 2 PANELS + BOTTOM PAYMENT PANEL
   ========================================================= */

.fee-panels-top {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 16px;
    align-items: stretch;
}

.fee-bottom-panel {
    margin-top: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px;

    display: grid;
    grid-template-columns: 1.15fr 180px minmax(260px, 1fr) 180px;
    gap: 12px;
    align-items: end;
}

.fee-bottom-panel .field-box {
    margin-bottom: 0;
}

.fee-bottom-panel input {
    height: 42px;
    border: 1px solid #d7deea;
    border-radius: 10px;
    background: white;
    font-size: 14px;
}

.fee-bottom-panel .grand-box input {
    background: #fff7ed;
    color: #9a3412;
    font-size: 17px;
    font-weight: 900;
}

.fee-bottom-panel .bank-box {
    margin-bottom: 0;
    height: 42px;
}

.fee-bottom-panel .fee-save-btn {
    margin: 0;
    height: 42px;
}

.dan-line {
    margin-top: 12px;
}

.exam-total-box {
    margin-top: 4px;
}

.exam-total-box input {
    background: #eef6ff;
    color: #0f172a;
    font-weight: 900;
}

@media (max-width: 1100px) {
    .fee-panels-top {
        grid-template-columns: 1fr;
    }

    .fee-bottom-panel {
        grid-template-columns: 1fr 1fr;
    }

    .fee-bottom-panel .fee-save-btn {
        grid-column: 1 / -1;
    }
}

@media (max-width: 700px) {
    .fee-bottom-panel {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   FEES PAGE - HOC PHI / THI CAP DANG / PAYMENT
   ========================================================= */

.fee-panels-top {
    display: grid !important;
    grid-template-columns: 1.18fr 0.82fr !important;
    gap: 16px !important;
    align-items: stretch !important;
}

.fee-tuition-panel,
.fee-exam-panel {
    min-height: 252px;
}

.fee-exam-panel .exam-line {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 150px !important;
    gap: 10px !important;
    align-items: end !important;
}

.fee-exam-panel .field-box {
    margin-bottom: 10px !important;
}

.dan-line {
    margin-top: 8px !important;
}

.exam-total-box {
    margin-top: 0 !important;
}

.exam-total-box input,
#examAmount,
#danAmount {
    background: #eef6ff !important;
    color: #0f172a !important;
    font-weight: 900 !important;
    cursor: not-allowed !important;
}

.fee-bottom-panel {
    margin-top: 16px !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 14px !important;
    padding: 14px !important;

    display: grid !important;
    grid-template-columns: 1.15fr 170px minmax(240px, 1fr) 180px !important;
    gap: 12px !important;
    align-items: end !important;
}

.fee-bottom-panel .field-box {
    margin-bottom: 0 !important;
}

.fee-bottom-panel input {
    height: 42px !important;
    border: 1px solid #d7deea !important;
    border-radius: 10px !important;
    background: white !important;
    font-size: 14px !important;
    box-sizing: border-box !important;
}

.fee-bottom-panel .grand-box input {
    background: #fff7ed !important;
    color: #9a3412 !important;
    font-size: 17px !important;
    font-weight: 900 !important;
}

.fee-bottom-panel .bank-box {
    margin-bottom: 0 !important;
    height: 42px !important;
    background: white !important;
}

.fee-bottom-panel .fee-save-btn {
    margin: 0 !important;
    height: 42px !important;
}

.month-grid-wrap {
    min-height: 74px !important;
}

.month-box {
    min-height: 52px !important;
}

@media (max-width: 1100px) {
    .fee-panels-top {
        grid-template-columns: 1fr !important;
    }

    .fee-bottom-panel {
        grid-template-columns: 1fr 1fr !important;
    }

    .fee-bottom-panel .fee-save-btn {
        grid-column: 1 / -1 !important;
    }
}

@media (max-width: 700px) {
    .fee-bottom-panel {
        grid-template-columns: 1fr !important;
    }

    .fee-exam-panel .exam-line {
        grid-template-columns: 1fr !important;
    }
}

/* =========================================================
   MONTH BOX - TITLE TOP, MONTH + YEAR SAME ROW
   ========================================================= */

.month-grid-wrap {
    display: grid !important;
    grid-template-columns: 1fr 46px !important;
    gap: 12px !important;
    align-items: start !important;
}

.month-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(210px, 210px)) !important;
    gap: 12px !important;
    align-items: start !important;
}

.month-box {
    width: 210px !important;
    min-height: 76px !important;
    box-sizing: border-box !important;

    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;

    padding: 12px 12px 10px !important;
    border-radius: 16px !important;
    border: 1px solid #dbe4f0 !important;
    background: linear-gradient(180deg, #ffffff, #f8fafc) !important;
    box-shadow: 0 6px 16px rgba(15, 23, 42, .07) !important;
}

.month-box:hover {
    border-color: #93c5fd !important;
    box-shadow: 0 8px 20px rgba(37, 99, 235, .13) !important;
}

.month-title {
    width: 100% !important;
    text-align: center !important;
    font-size: 15px !important;
    line-height: 1 !important;
    font-weight: 900 !important;
    color: #0f172a !important;
    margin: 0 0 10px 0 !important;
}

.month-fields {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
}

.month-fields select {
    width: 100% !important;
    height: 30px !important;
    min-height: 30px !important;
    padding: 0 7px !important;

    border: 1px solid #cbd5e1 !important;
    border-radius: 9px !important;
    background: #ffffff !important;

    font-size: 12px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    outline: none !important;
}

.month-fields select:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, .12) !important;
}

.month-remove-btn {
    position: absolute !important;
    top: -8px !important;
    right: -8px !important;

    width: 22px !important;
    height: 22px !important;
    line-height: 22px !important;
    padding: 0 !important;

    border: none !important;
    border-radius: 50% !important;
    background: #ef4444 !important;
    color: white !important;

    font-size: 14px !important;
    font-weight: 900 !important;
    cursor: pointer !important;
    box-shadow: 0 4px 10px rgba(239, 68, 68, .35) !important;
}

.month-add-btn {
    width: 42px !important;
    height: 42px !important;
    margin-top: 18px !important;
    border-radius: 13px !important;
    font-size: 24px !important;
}

/* ===== HEADER CLOCK PERFORMANCE FIX ===== */

.header-clock-box {
    contain: layout paint style;
    isolation: isolate;
}

.header-clock-time,
.header-clock-date {
    font-variant-numeric: tabular-nums;
    text-rendering: geometricPrecision;
}

/* =========================================================
   ADMIN HEADER - LOGO BO GÓC GIỐNG STUDENT/COACH
========================================================= */

.top-header .logo-box {
    width: 100px !important;
    height: 100px !important;
    left: 22px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;

    border-radius: 18px !important;
    background: #ffffff !important;
    padding: 8px !important;
    overflow: hidden !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.top-header .logo-box img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    display: block !important;
}

/* =========================================================
   UNIFIED CLUB HEADER — ADMIN / COACH / STUDENT
   Nguồn chuẩn dùng chung cho cả 3 giao diện.
========================================================= */
:root {
    --club-header-height: 120px;
    --club-header-bg-start: #071426;
    --club-header-bg-end: #0f2a4a;
    --club-header-yellow: #facc15;
    --club-header-logo-size: 100px;
    --club-header-side-gap: 22px;
    --club-header-clock-width: 170px;
}

.top-header {
    width: 100% !important;
    height: var(--club-header-height) !important;
    min-height: var(--club-header-height) !important;
    padding: 0 215px !important;
    background: linear-gradient(90deg, var(--club-header-bg-start), var(--club-header-bg-end)) !important;
    color: #fff !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: visible !important;
    box-shadow: none !important;
}

.top-header .logo-box {
    position: absolute !important;
    left: var(--club-header-side-gap) !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: var(--club-header-logo-size) !important;
    height: var(--club-header-logo-size) !important;
    min-width: var(--club-header-logo-size) !important;
    min-height: var(--club-header-logo-size) !important;
    padding: 8px !important;
    border-radius: 18px !important;
    background: #fff !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: none !important;
}

.top-header .logo-box img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    display: block !important;
}

.top-header .club-title-wrap {
    width: min(920px, 62vw) !important;
    max-width: min(920px, 62vw) !important;
    min-width: 0 !important;
    margin: 0 auto !important;
    text-align: center !important;
    line-height: 1.12 !important;
}

.top-header .club-title {
    display: block !important;
    margin: 0 !important;
    color: #fff !important;
    font-family: "Segoe UI", Arial, Tahoma, sans-serif !important;
    font-size: 35px !important;
    font-weight: 800 !important;
    line-height: 1.04 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    text-shadow: none !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.top-header .club-subtitle {
    display: inline-block !important;
    max-width: 100% !important;
    margin: 5px auto 0 !important;
    padding: 1px 10px 3px !important;
    border-radius: 8px !important;
    background: rgba(250, 204, 21, .08) !important;
    box-shadow: 0 4px 12px rgba(250, 204, 21, .18) !important;
    color: var(--club-header-yellow) !important;
    font-family: "Segoe UI", Arial, Tahoma, sans-serif !important;
    font-size: 55px !important;
    font-weight: 800 !important;
    line-height: 1.02 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    text-shadow: none !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.top-header .header-clock-box {
    position: absolute !important;
    right: var(--club-header-side-gap) !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    min-width: var(--club-header-clock-width) !important;
    min-height: 58px !important;
    padding: 8px 14px !important;
    border: 1px solid rgba(250, 204, 21, .55) !important;
    border-radius: 14px !important;
    background: rgba(15, 23, 42, .55) !important;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .22) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
}

.top-header .header-clock-time {
    color: var(--club-header-yellow) !important;
    font-size: 22px !important;
    line-height: 1 !important;
    font-weight: 900 !important;
    letter-spacing: 1px !important;
    font-variant-numeric: tabular-nums !important;
}

.top-header .header-clock-date {
    margin-top: 6px !important;
    color: #e5e7eb !important;
    font-size: 12px !important;
    line-height: 1.15 !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
}

.layout {
    min-height: calc(100vh - var(--club-header-height)) !important;
}

@media (max-width: 1050px) {
    :root {
        --club-header-height: 96px;
        --club-header-logo-size: 76px;
        --club-header-side-gap: 12px;
        --club-header-clock-width: 135px;
    }

    .top-header { padding: 0 165px !important; }
    .top-header .logo-box { padding: 7px !important; border-radius: 16px !important; }
    .top-header .club-title { font-size: 24px !important; }
    .top-header .club-subtitle { font-size: 34px !important; }
    .top-header .header-clock-box { padding: 7px 10px !important; }
    .top-header .header-clock-time { font-size: 18px !important; }
    .top-header .header-clock-date { font-size: 11px !important; }
}

@media (max-width: 760px) {
    :root {
        --club-header-height: 86px;
        --club-header-logo-size: 56px;
        --club-header-side-gap: 10px;
    }

    .top-header { padding: 0 70px !important; }
    .top-header .logo-box { padding: 5px !important; border-radius: 14px !important; }
    .top-header .club-title-wrap { width: 62vw !important; max-width: 62vw !important; }
    .top-header .club-title { font-size: 14px !important; }
    .top-header .club-subtitle { margin-top: 3px !important; font-size: 22px !important; }
    .top-header .header-clock-box { display: none !important; }
}



/* =========================================================
   HEADER ADMIN — LẤY STUDENT LÀM MẪU CHÍNH
   Khối cuối file để khóa toàn bộ kích thước và bảo đảm đồng hồ luôn hiện.
========================================================= */
:root {
    --student-master-header-h: 120px;
    --student-master-logo: 100px;
    --student-master-gap: 22px;
    --student-master-clock: 170px;
}

.top-header {
    width: 100% !important;
    height: var(--student-master-header-h) !important;
    min-height: var(--student-master-header-h) !important;
    padding: 0 215px !important;
    background: linear-gradient(90deg, #071426, #0f2a4a) !important;
    color: #fff !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: visible !important;
    box-shadow: none !important;
}

.top-header > .logo-box {
    position: absolute !important;
    left: var(--student-master-gap) !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: var(--student-master-logo) !important;
    height: var(--student-master-logo) !important;
    min-width: var(--student-master-logo) !important;
    min-height: var(--student-master-logo) !important;
    padding: 8px !important;
    border-radius: 18px !important;
    background: #fff !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: none !important;
}

.top-header > .logo-box > img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    display: block !important;
}

.top-header > .club-title-wrap {
    width: min(920px, 62vw) !important;
    max-width: min(920px, 62vw) !important;
    min-width: 0 !important;
    margin: 0 auto !important;
    text-align: center !important;
    line-height: 1.12 !important;
}

.top-header > .club-title-wrap > .club-title {
    display: block !important;
    margin: 0 !important;
    color: #fff !important;
    font-family: "Segoe UI", Arial, Tahoma, sans-serif !important;
    font-size: 35px !important;
    font-weight: 800 !important;
    line-height: 1.04 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    text-shadow: none !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.top-header > .club-title-wrap > .club-subtitle {
    display: inline-block !important;
    max-width: 100% !important;
    margin: 5px auto 0 !important;
    padding: 1px 10px 3px !important;
    border-radius: 8px !important;
    background: rgba(250, 204, 21, .08) !important;
    box-shadow: 0 4px 12px rgba(250, 204, 21, .18) !important;
    color: #facc15 !important;
    font-family: "Segoe UI", Arial, Tahoma, sans-serif !important;
    font-size: 55px !important;
    font-weight: 800 !important;
    line-height: 1.02 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    text-shadow: none !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.top-header > .header-clock-box {
    position: absolute !important;
    right: var(--student-master-gap) !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    min-width: var(--student-master-clock) !important;
    min-height: 58px !important;
    padding: 8px 14px !important;
    border: 1px solid rgba(250, 204, 21, .55) !important;
    border-radius: 14px !important;
    background: rgba(15, 23, 42, .55) !important;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .22) !important;
    color: #fff !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    z-index: 5 !important;
}

.top-header .header-clock-time {
    color: #facc15 !important;
    font-size: 22px !important;
    line-height: 1 !important;
    font-weight: 900 !important;
    letter-spacing: 1px !important;
    font-variant-numeric: tabular-nums !important;
}

.top-header .header-clock-date {
    margin-top: 6px !important;
    color: #e5e7eb !important;
    font-size: 12px !important;
    line-height: 1.15 !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
}

.layout {
    min-height: calc(100vh - var(--student-master-header-h)) !important;
}

@media (max-width: 1050px) and (min-width: 761px) {
    :root {
        --student-master-header-h: 96px;
        --student-master-logo: 76px;
        --student-master-gap: 12px;
        --student-master-clock: 135px;
    }

    .top-header { padding: 0 165px !important; }
    .top-header > .logo-box { padding: 7px !important; border-radius: 16px !important; }
    .top-header > .club-title-wrap > .club-title { font-size: 24px !important; }
    .top-header > .club-title-wrap > .club-subtitle { font-size: 34px !important; }
    .top-header > .header-clock-box {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        padding: 7px 10px !important;
    }
    .top-header .header-clock-time { font-size: 18px !important; }
    .top-header .header-clock-date { font-size: 11px !important; }
}

@media (max-width: 760px) {
    :root {
        --student-master-header-h: 86px;
        --student-master-logo: 56px;
        --student-master-gap: 10px;
    }

    .top-header { padding: 0 70px !important; }
    .top-header > .logo-box { padding: 5px !important; border-radius: 14px !important; }
    .top-header > .club-title-wrap { width: 62vw !important; max-width: 62vw !important; }
    .top-header > .club-title-wrap > .club-title { font-size: 14px !important; }
    .top-header > .club-title-wrap > .club-subtitle {
        margin-top: 3px !important;
        font-size: 22px !important;
    }
    .top-header > .header-clock-box { display: none !important; }
}


/* =========================================================
   BACKUP & RESTORE CENTER
   ========================================================= */

.restore-security-page,
.backup-center-page {
    width: min(1280px, 100%);
    margin: 0 auto;
    box-sizing: border-box;
}

.restore-security-page {
    min-height: calc(100vh - 160px);
    padding: 28px 12px 60px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.restore-security-card {
    width: min(570px, 100%);
    margin-top: 20px;
    padding: 30px;
    border: 1px solid #dbe4f0;
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 22px 60px rgba(15, 23, 42, .14);
    box-sizing: border-box;
}

.restore-security-icon {
    width: 78px;
    height: 78px;
    margin: 0 auto 18px;
    border-radius: 24px;
    background: linear-gradient(135deg, #0f2a4a, #1d4ed8);
    color: #facc15;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 14px 30px rgba(29, 78, 216, .28);
}

.restore-security-icon i {
    font-size: 36px;
}

.restore-security-heading {
    text-align: center;
}

.restore-security-heading > span {
    color: #2563eb;
    font-size: 12px;
    font-weight: 950;
}

.restore-security-heading h1 {
    margin: 7px 0 8px;
    color: #0f172a;
    font-size: 30px;
    font-weight: 950;
}

.restore-security-heading p {
    max-width: 470px;
    margin: 0 auto;
    color: #64748b;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.6;
}

.restore-security-warning,
.restore-security-locked {
    margin-top: 22px;
    padding: 14px 16px;
    border-radius: 15px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.restore-security-warning {
    border: 1px solid #fde68a;
    background: #fffbeb;
    color: #92400e;
}

.restore-security-locked {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.restore-security-warning > i,
.restore-security-locked > i {
    margin-top: 2px;
    font-size: 20px;
}

.restore-security-warning div,
.restore-security-locked div {
    display: grid;
    gap: 5px;
}

.restore-security-warning b,
.restore-security-locked b {
    font-size: 14px;
    font-weight: 950;
}

.restore-security-warning span,
.restore-security-locked span {
    font-size: 13px;
    font-weight: 750;
    line-height: 1.45;
}

.restore-security-form {
    margin-top: 22px;
    display: grid;
    gap: 16px;
}

.restore-password-field {
    display: grid;
    gap: 7px;
}

.restore-password-field label {
    color: #334155;
    font-size: 13px;
    font-weight: 900;
}

.restore-password-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.restore-password-input-wrap > i {
    position: absolute;
    left: 14px;
    z-index: 2;
    color: #64748b;
}

.restore-password-input-wrap input {
    width: 100%;
    height: 48px;
    padding: 0 50px 0 42px;
    border: 1px solid #cbd5e1;
    border-radius: 13px;
    background: #f8fafc;
    color: #0f172a;
    font-size: 15px;
    font-weight: 750;
    box-sizing: border-box;
    outline: none;
}

.restore-password-input-wrap input:focus {
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}

.restore-password-toggle {
    position: absolute;
    right: 7px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #475569;
    cursor: pointer;
}

.restore-password-toggle:hover {
    background: #e2e8f0;
}

.restore-security-submit {
    min-height: 48px;
    margin-top: 4px;
    padding: 0 18px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    font-size: 14px;
    font-weight: 950;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(37, 99, 235, .26);
}

.restore-security-submit:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.restore-security-back {
    min-height: 44px;
    margin-top: 18px;
    border-radius: 13px;
    background: #e2e8f0;
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    font-weight: 900;
}

.restore-security-rule {
    margin-top: 19px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.restore-security-rule div {
    padding: 10px;
    border-radius: 12px;
    background: #f8fafc;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 850;
}

/* =========================
   BACKUP MAIN PAGE
   ========================= */

.backup-center-page {
    padding-bottom: 50px;
}

.backup-center-header {
    margin-bottom: 16px;
    padding: 22px;
    border-radius: 20px;
    background:
        radial-gradient(
            circle at right top,
            rgba(37, 99, 235, .28),
            transparent 36%
        ),
        linear-gradient(135deg, #071426, #0f2a4a);
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    box-shadow: 0 18px 38px rgba(15, 42, 74, .22);
}

.backup-center-kicker {
    color: #facc15;
    font-size: 12px;
    font-weight: 950;
}

.backup-center-header h1 {
    margin: 6px 0 7px;
    font-size: 31px;
    font-weight: 950;
}

.backup-center-header p {
    max-width: 720px;
    margin: 0;
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.55;
}

.backup-header-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 0 0 auto;
}

.backup-header-actions form {
    margin: 0;
}

.backup-action-btn {
    min-height: 41px;
    padding: 0 15px;
    border: 0;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    font-weight: 900;
    cursor: pointer;
}

.backup-action-btn.refresh {
    background: #facc15;
    color: #172033;
}

.backup-action-btn.lock {
    background: rgba(239, 68, 68, .18);
    border: 1px solid rgba(254, 202, 202, .35);
    color: #ffffff;
}

.backup-security-strip {
    margin-bottom: 16px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.backup-security-item {
    min-width: 0;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
    display: flex;
    align-items: center;
    gap: 11px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .06);
}

.backup-security-icon {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: #e8efff;
    color: #1d4ed8;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.backup-security-item.success .backup-security-icon {
    background: #dcfce7;
    color: #15803d;
}

.backup-security-item > div:last-child {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.backup-security-item span {
    color: #64748b;
    font-size: 11px;
    font-weight: 850;
}

.backup-security-item b {
    color: #0f172a;
    font-size: 14px;
    font-weight: 950;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.backup-error-box {
    margin-bottom: 16px;
    padding: 14px 16px;
    border: 1px solid #fecaca;
    border-radius: 15px;
    background: #fef2f2;
    color: #991b1b;
    display: flex;
    align-items: center;
    gap: 12px;
}

.backup-error-box > i {
    font-size: 21px;
}

.backup-error-box > div {
    flex: 1;
    display: grid;
    gap: 3px;
}

.backup-error-box a {
    padding: 8px 13px;
    border-radius: 10px;
    background: #991b1b;
    color: #ffffff;
    text-decoration: none;
    font-weight: 900;
}

.backup-section-card,
.backup-history-card {
    margin-bottom: 16px;
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .07);
}

.backup-section-title {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.backup-section-title span {
    color: #2563eb;
    font-size: 11px;
    font-weight: 950;
}

.backup-section-title h2 {
    margin: 4px 0 0;
    color: #0f172a;
    font-size: 21px;
    font-weight: 950;
}

.backup-remote-label {
    max-width: 420px;
    padding: 8px 11px;
    border-radius: 11px;
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.backup-file-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.backup-file-card {
    min-width: 0;
    padding: 16px;
    border: 1px solid #dbe4f0;
    border-radius: 18px;
    background: #f8fafc;
    position: relative;
    overflow: hidden;
}

.backup-file-card.latest {
    border-color: #60a5fa;
    background:
        linear-gradient(
            180deg,
            rgba(219, 234, 254, .72),
            #ffffff 44%
        );
    box-shadow: 0 12px 28px rgba(37, 99, 235, .13);
}

.backup-file-card.latest::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: #2563eb;
}

.backup-file-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.backup-file-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: #e8efff;
    color: #1d4ed8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.backup-file-icon i {
    font-size: 22px;
}

.backup-file-status {
    display: grid;
    justify-items: end;
    gap: 5px;
}

.backup-status-badge {
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 950;
}

.backup-status-badge.latest {
    background: #2563eb;
    color: #ffffff;
}

.backup-status-badge.safe {
    background: #dcfce7;
    color: #166534;
}

.backup-file-order {
    color: #64748b;
    font-size: 10px;
    font-weight: 850;
}

.backup-file-name {
    margin: 14px 0 12px;
    color: #0f172a;
    font-size: 14px;
    font-weight: 950;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.backup-file-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.backup-file-info-grid > div {
    padding: 9px;
    border: 1px solid #e2e8f0;
    border-radius: 11px;
    background: #ffffff;
    display: grid;
    gap: 4px;
}

.backup-file-info-grid span {
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
}

.backup-file-info-grid b {
    color: #0f172a;
    font-size: 12px;
    font-weight: 950;
}

.backup-content-list {
    margin-top: 12px;
    display: grid;
    gap: 7px;
}

.backup-content-list > div {
    min-height: 34px;
    padding: 0 9px;
    border-radius: 10px;
    background: #ffffff;
    display: grid;
    grid-template-columns: 23px minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
}

.backup-content-list i {
    color: #2563eb;
}

.backup-content-list span {
    color: #475569;
    font-size: 11px;
    font-weight: 800;
}

.backup-content-list b {
    color: #15803d;
    font-size: 10px;
    font-weight: 950;
}

.backup-file-actions {
    margin-top: 14px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.backup-detail-btn,
.backup-restore-disabled {
    min-height: 38px;
    border: 0;
    border-radius: 11px;
    font-size: 11px;
    font-weight: 950;
}

.backup-detail-btn {
    background: #2563eb;
    color: #ffffff;
    cursor: pointer;
}

.backup-restore-disabled {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
}

.backup-empty-state {
    padding: 45px 20px;
    text-align: center;
}

.backup-empty-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 15px;
    border-radius: 20px;
    background: #f1f5f9;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
}

.backup-empty-icon i {
    font-size: 31px;
}

.backup-empty-state h3 {
    margin: 0 0 7px;
    color: #0f172a;
    font-size: 19px;
}

.backup-empty-state p {
    max-width: 560px;
    margin: 0 auto 16px;
    color: #64748b;
    line-height: 1.55;
}

.backup-empty-state a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 15px;
    border-radius: 11px;
    background: #2563eb;
    color: #ffffff;
    text-decoration: none;
    font-weight: 900;
}

.backup-roadmap-grid {
    margin-bottom: 16px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.backup-roadmap-card {
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    background: #ffffff;
    display: grid;
    gap: 5px;
}

.backup-roadmap-card.active {
    border-color: #86efac;
    background: #f0fdf4;
}

.backup-roadmap-card span {
    color: #2563eb;
    font-size: 10px;
    font-weight: 950;
}

.backup-roadmap-card b {
    color: #0f172a;
    font-size: 13px;
    font-weight: 950;
}

.backup-roadmap-card p {
    margin: 0;
    color: #64748b;
    font-size: 11px;
    font-weight: 750;
}

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

.backup-history-table {
    min-width: 760px;
    table-layout: auto;
}

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

.backup-history-status {
    display: inline-flex;
    min-width: 78px;
    min-height: 27px;
    padding: 0 9px;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 950;
}

.backup-history-status.success {
    background: #dcfce7;
    color: #166534;
}

.backup-history-status.failed {
    background: #fee2e2;
    color: #991b1b;
}

.backup-history-status.blocked {
    background: #fef3c7;
    color: #92400e;
}

.backup-history-empty {
    padding: 25px;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    color: #64748b;
    text-align: center;
    font-weight: 850;
}

/* =========================
   BACKUP PREVIEW MODAL
   ========================= */

.backup-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    padding: 18px;
    background: rgba(2, 6, 23, .68);
    display: none;
    align-items: center;
    justify-content: center;
}

.backup-preview-modal.show {
    display: flex;
}

.backup-preview-box {
    width: min(650px, 96vw);
    max-height: 88vh;
    border-radius: 20px;
    background: #ffffff;
    overflow: hidden;
    box-shadow: 0 26px 80px rgba(0, 0, 0, .38);
}

.backup-preview-header {
    padding: 18px 20px;
    background: linear-gradient(135deg, #071426, #0f2a4a);
    color: #ffffff;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
}

.backup-preview-header span {
    color: #facc15;
    font-size: 10px;
    font-weight: 950;
}

.backup-preview-header h2 {
    margin: 5px 0 0;
    font-size: 18px;
    font-weight: 950;
    overflow-wrap: anywhere;
}

.backup-preview-header button {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: #ef4444;
    color: #ffffff;
    font-size: 25px;
    cursor: pointer;
    flex: 0 0 auto;
}

.backup-preview-body {
    padding: 18px;
}

.backup-preview-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.backup-preview-summary > div {
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 13px;
    background: #f8fafc;
    display: grid;
    gap: 5px;
}

.backup-preview-summary span {
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
}

.backup-preview-summary b {
    color: #0f172a;
    font-size: 14px;
    font-weight: 950;
}

.backup-preview-content {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
}

.backup-preview-content h3 {
    margin: 0 0 12px;
    color: #0f172a;
    font-size: 15px;
    font-weight: 950;
}

.backup-preview-content > div {
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
}

.backup-preview-content > div:last-child {
    border-bottom: 0;
}

.backup-preview-content i {
    color: #2563eb;
    font-size: 17px;
}

.backup-preview-content span {
    color: #64748b;
    font-size: 12px;
    line-height: 1.45;
}

.backup-preview-content span b {
    display: block;
    color: #0f172a;
}

.backup-preview-note {
    margin-top: 13px;
    padding: 11px 13px;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    background: #eff6ff;
    color: #1e40af;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 12px;
    font-weight: 750;
    line-height: 1.5;
}

.backup-preview-footer {
    padding: 13px 18px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
}

.backup-preview-footer button {
    min-height: 39px;
    padding: 0 21px;
    border: 0;
    border-radius: 11px;
    background: #0f172a;
    color: #ffffff;
    font-weight: 900;
    cursor: pointer;
}

/* =========================
   RESPONSIVE BACKUP CENTER
   ========================= */

@media (max-width: 1080px) {
    .backup-security-strip {
        grid-template-columns: repeat(2, 1fr);
    }

    .backup-file-grid {
        grid-template-columns: 1fr;
    }

    .backup-roadmap-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 760px) {
    .restore-security-page {
        padding: 16px 0 40px;
    }

    .restore-security-card {
        margin-top: 0;
        padding: 20px 16px;
        border-radius: 18px;
    }

    .restore-security-heading h1 {
        font-size: 25px;
    }

    .restore-security-rule {
        grid-template-columns: 1fr;
    }

    .backup-center-header {
        padding: 17px;
        flex-direction: column;
    }

    .backup-center-header h1 {
        font-size: 25px;
    }

    .backup-header-actions {
        width: 100%;
    }

    .backup-header-actions > *,
    .backup-header-actions form,
    .backup-action-btn {
        flex: 1;
    }

    .backup-security-strip {
        grid-template-columns: 1fr;
    }

    .backup-section-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .backup-remote-label {
        max-width: 100%;
    }

    .backup-roadmap-grid {
        grid-template-columns: 1fr;
    }

    .backup-preview-summary {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   BACKUP MANIFEST + STUDENT COMPARE
   ========================================================= */

.backup-action-btn.manifests {
    background: #ffffff;
    color: #1d4ed8;
}

.manifest-list-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.manifest-list-card {
    min-width: 0;
    padding: 16px;
    border: 1px solid #dbe4f0;
    border-radius: 17px;
    background: #f8fafc;
}

.manifest-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.manifest-file-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: #dbeafe;
    color: #1d4ed8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
}

.manifest-badges {
    display: flex;
    gap: 5px;
}

.manifest-type-badge,
.manifest-status-badge {
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 950;
}

.manifest-type-badge {
    background: #e2e8f0;
    color: #334155;
}

.manifest-status-badge.completed,
.manifest-status-badge.success {
    background: #dcfce7;
    color: #166534;
}

.manifest-status-badge.pending {
    background: #fef3c7;
    color: #92400e;
}

.manifest-list-card h3 {
    margin: 13px 0;
    font-size: 14px;
    font-weight: 950;
    overflow-wrap: anywhere;
}

.manifest-info-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}

.manifest-info-list > div {
    padding: 9px;
    border-radius: 10px;
    background: #ffffff;
    display: grid;
    gap: 3px;
}

.manifest-info-list span {
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
}

.manifest-info-list b {
    color: #0f172a;
    font-size: 12px;
    font-weight: 950;
}

.manifest-open-btn {
    min-height: 39px;
    margin-top: 12px;
    border-radius: 11px;
    background: #2563eb;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 950;
}

.manifest-summary-grid,
.compare-summary-grid {
    margin-bottom: 15px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.manifest-summary-card {
    padding: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    background: #ffffff;
    display: grid;
    gap: 5px;
}

.manifest-summary-card span {
    color: #64748b;
    font-size: 11px;
    font-weight: 850;
}

.manifest-summary-card b {
    color: #0f172a;
    font-size: 20px;
    font-weight: 950;
}

.manifest-table-grid {
    display: grid;
    gap: 9px;
}

.manifest-table-card {
    min-width: 0;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
    display: grid;
    grid-template-columns: 43px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
}

.manifest-table-icon {
    width: 43px;
    height: 43px;
    border-radius: 12px;
    background: #dbeafe;
    color: #1d4ed8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.manifest-table-icon.storage {
    background: #fef3c7;
    color: #b45309;
}

.manifest-table-main {
    min-width: 0;
}

.manifest-table-main h3 {
    margin: 0 0 5px;
    color: #0f172a;
    font-size: 14px;
    font-weight: 950;
}

.manifest-table-meta {
    display: flex;
    gap: 10px;
    color: #64748b;
    font-size: 11px;
    font-weight: 750;
}

.manifest-table-meta span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.manifest-compare-btn,
.manifest-compare-disabled {
    min-height: 36px;
    padding: 0 13px;
    border: 0;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 950;
}

.manifest-compare-btn {
    background: #2563eb;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.manifest-compare-disabled {
    background: #e2e8f0;
    color: #94a3b8;
}

/* Compare */

.compare-source-box {
    margin-bottom: 14px;
    padding: 13px;
    border: 1px solid #bfdbfe;
    border-radius: 15px;
    background: #eff6ff;
    display: grid;
    grid-template-columns: 1.3fr 1fr .5fr;
    gap: 9px;
}

.compare-source-box > div {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.compare-source-box span {
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
}

.compare-source-box b {
    color: #1e3a8a;
    font-size: 12px;
    font-weight: 950;
    overflow-wrap: anywhere;
}

.compare-summary-grid {
    grid-template-columns: repeat(5, 1fr);
}

.compare-summary-card {
    padding: 13px;
    border: 2px solid transparent;
    border-radius: 14px;
    background: #ffffff;
    cursor: pointer;
    display: grid;
    gap: 4px;
    text-align: left;
}

.compare-summary-card span {
    color: #64748b;
    font-size: 10px;
    font-weight: 850;
}

.compare-summary-card b {
    color: #0f172a;
    font-size: 22px;
    font-weight: 950;
}

.compare-summary-card.active {
    border-color: #2563eb;
    box-shadow: 0 8px 20px rgba(37, 99, 235, .14);
}

.compare-summary-card.add {
    background: #f0fdf4;
}

.compare-summary-card.update {
    background: #fffbeb;
}

.compare-summary-card.unchanged {
    background: #f8fafc;
}

.compare-summary-card.current-only {
    background: #fef2f2;
}

.compare-notice-box {
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid #bfdbfe;
    border-radius: 13px;
    background: #eff6ff;
    color: #1e40af;
    display: flex;
    gap: 9px;
}

.compare-notice-box div {
    display: grid;
    gap: 3px;
}

.compare-notice-box b {
    font-size: 13px;
}

.compare-notice-box span {
    font-size: 12px;
}

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

.compare-student-table {
    min-width: 800px;
    table-layout: auto;
}

.compare-student-table th,
.compare-student-table td {
    padding: 9px;
    text-align: center;
}

.compare-row-status {
    display: inline-flex;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    align-items: center;
    font-size: 10px;
    font-weight: 950;
}

.compare-row-status.unchanged {
    background: #dcfce7;
    color: #166534;
}

.student-change-list {
    display: grid;
    gap: 12px;
}

.student-change-card {
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    overflow: hidden;
}

.student-change-head {
    padding: 12px 14px;
    background: #fffbeb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.student-change-head span {
    color: #92400e;
    font-size: 10px;
    font-weight: 950;
}

.student-change-head h3 {
    margin: 3px 0 0;
    color: #0f172a;
    font-size: 15px;
}

.student-change-head > b {
    padding: 5px 9px;
    border-radius: 999px;
    background: #f59e0b;
    color: #ffffff;
    font-size: 10px;
}

.student-field-change-list {
    padding: 10px;
    display: grid;
    gap: 7px;
}

.student-field-change {
    padding: 9px;
    border-radius: 11px;
    background: #f8fafc;
    display: grid;
    grid-template-columns:
        120px
        minmax(0, 1fr)
        30px
        minmax(0, 1fr);
    align-items: center;
    gap: 7px;
}

.student-change-field {
    color: #334155;
    font-size: 11px;
    font-weight: 950;
}

.student-change-value {
    min-width: 0;
    padding: 8px;
    border-radius: 9px;
    display: grid;
    gap: 3px;
}

.student-change-value.backup {
    background: #dcfce7;
}

.student-change-value.current {
    background: #fee2e2;
}

.student-change-value span {
    color: #64748b;
    font-size: 9px;
    font-weight: 850;
}

.student-change-value b {
    color: #0f172a;
    font-size: 11px;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.student-change-arrow {
    color: #64748b;
    text-align: center;
}

@media (max-width: 1080px) {
    .manifest-list-grid {
        grid-template-columns: 1fr 1fr;
    }

    .compare-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 760px) {
    .manifest-list-grid,
    .manifest-summary-grid {
        grid-template-columns: 1fr;
    }

    .manifest-table-card {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .manifest-compare-btn,
    .manifest-compare-disabled {
        grid-column: 1 / -1;
        justify-content: center;
    }

    .compare-source-box {
        grid-template-columns: 1fr;
    }

    .student-field-change {
        grid-template-columns: 1fr;
    }

    .student-change-arrow {
        transform: rotate(90deg);
    }
}

/* =========================================================
   GENERIC BACKUP TABLE COMPARE
   ========================================================= */

.manifest-key-note {
    margin-top: 5px;
    color: #64748b;
    font-size: 10px;
    font-weight: 750;
}

.manifest-key-note b {
    color: #1d4ed8;
    font-weight: 950;
}

.compare-generic-table {
    min-width: 850px;
    table-layout: auto;
}

.compare-generic-table th,
.compare-generic-table td {
    padding: 9px 10px;
    vertical-align: top;
    text-align: center;
}

.compare-json-details {
    min-width: 180px;
}

.compare-json-details summary {
    width: fit-content;
    padding: 6px 10px;
    border-radius: 9px;
    background: #e2e8f0;
    color: #334155;
    cursor: pointer;
    font-size: 11px;
    font-weight: 900;
    list-style-position: inside;
}

.compare-json-details[open] summary {
    margin-bottom: 8px;
    background: #dbeafe;
    color: #1d4ed8;
}

.compare-json-details pre {
    max-width: 650px;
    max-height: 310px;
    margin: 0;
    padding: 12px;
    border: 1px solid #dbe4f0;
    border-radius: 11px;
    background: #0f172a;
    color: #e2e8f0;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    text-align: left;
    font-family: Consolas, monospace !important;
    font-size: 11px;
    line-height: 1.5;
}

.compare-row-raw {
    padding: 0 10px 10px;
}

.compare-raw-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.compare-raw-grid > div {
    min-width: 0;
}

.compare-raw-grid > div > span {
    display: block;
    margin-bottom: 5px;
    color: #475569;
    font-size: 11px;
    font-weight: 950;
}

.compare-raw-grid pre {
    max-width: none;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 760px) {
    .compare-raw-grid {
        grid-template-columns: 1fr;
    }
}