﻿.file-page-shell {
    background: #f0f4f8;
    min-height: 100%;
    overflow-x: hidden;
    padding: 0 0 40px;
}

.TKB\.Admin-page {
    --app-text: #1e3a5f;
    --app-subtle: #64748b;
    --app-border: #bfdbfe;
    --app-surface: #ffffff;
    --app-surface-strong: #ffffff;
    --app-primary: #2563eb;
    --app-primary-deep: #1d4ed8;
    --app-success: #166534;
    --app-warning: #92400e;
    --app-danger: #991b1b;
    --app-info: #0369a1;
    color: var(--app-text);
    max-width: 1100px;
}

/* ════════════════════════════════════════════════════════════════
       HERO PANEL  –  đồng bộ với db-header
       ════════════════════════════════════════════════════════════════ */
.herotep-panel {
    position: relative;
    overflow: hidden;
    padding: 1rem 1.25rem 1.25rem;
    border: 2px solid #1e40af;
    border-radius: 14px;
    background: #1e3a5f;
    margin-bottom: 18px;
    text-align: center;
    border-bottom: 3px solid #2563eb;
}

    .herotep-panel::after {
        content: "";
        position: absolute;
        inset: auto -6% -40% auto;
        width: 260px;
        height: 260px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(96, 165, 250, 0.22), transparent 68%);
        pointer-events: none;
    }

.herotep-content {
    position: relative;
    
    z-index: 1;
}

.herotep-title {
    margin: 0;
    color: #e0eeff;
    font-size: clamp(1.3rem, 3vw, 1.75rem);
    font-weight: 750;
    letter-spacing: -0.02em;
}

.herotep-subtitle {
    margin: 0.75rem 0 0;
    color: #93c5fd;
    font-size: 0.92rem;
    line-height: 1.55;
}

.herotep-chip-group {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1.1rem;
    justify-content: center;
}

.herotep-chip {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0.4rem 0.9rem;
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-radius: 99px;
    background: rgba(29, 78, 216, 0.25);
    color: #93c5fd;
    font-size: 0.75rem;
    font-weight: 650;
}

/* ════════════════════════════════════════════════════════════════
       STAT CARDS  –  đúng theo Home.css pattern
       ════════════════════════════════════════════════════════════════ */
.stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 100%;
    padding: 16px 18px;
    background: #ffffff;
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    transition: border-color .15s, transform .15s;
    box-shadow: 0 2px 6px rgba(30, 58, 95, 0.06);
}

    .stat-card:hover {
        border-color: #3b82f6;
        transform: translateY(-2px);
    }

/* màu border phân loại – nhẹ hơn, vẫn Navy */
.stat-card-primary {
    border-color: #bfdbfe;
    border-bottom: solid 3px #1d4ed8
}

.stat-card-success {
    border-color: #bbf7d0;
    border-bottom: solid 3px #059669;
}

.stat-card-info {
    border-color: #bae6fd;
    border-bottom: solid 3px #0bb4d3;
}

.stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-width: 44px;
    height: 44px;
    border-radius: 11px;
    font-size: 0.85rem;
    font-weight: 750;
    letter-spacing: 0.06em;
    color: #ffffff;
    flex-shrink: 0;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.22);
}

.stat-card-success .stat-icon {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 6px 14px rgba(16, 185, 129, 0.2);
}

.stat-card-info .stat-icon {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    box-shadow: 0 6px 14px rgba(14, 165, 233, 0.2);
}

.stat-content {
    min-width: 0;
}

.stat-label {
    margin-bottom: 3px;
    color: #3b82f6;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.stat-value {
    color: #1e3a5f;
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.2;
}

.stat-footer {
    margin-top: 3px;
    color: #64748b;
    font-size: 0.72rem;
    line-height: 1.3;
}

/* ════════════════════════════════════════════════════════════════
       SECTION CARD  –  đồng bộ d-card
       ════════════════════════════════════════════════════════════════ */
.TKB\.Admin-card {
    background: #ffffff;
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(30, 58, 95, 0.06);
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 14px 18px 13px;
    border-bottom: 3px solid #eff6ff;
    background: #f8faff;
}

.section-kicker {
    margin-bottom: 4px;
    color: #3b82f6;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.section-title {
    margin: 0;
    color: #1e3a5f;
    font-size: 1.1rem;
    font-weight: 750;
}

.section-text {
    margin: 5px 0 0;
    color: #64748b;
    font-size: 0.88rem;
    line-height: 1.6;
    max-width: 680px;
}

.section-heading-table .table-summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    min-height: 28px;
    padding: 0.3rem 0.7rem;
    border-radius: 99px;
    background: rgba(37, 99, 235, 0.08);
    color: #2563eb;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.TKB\.Admin-card-body {
    padding: 16px;
}

/* ════════════════════════════════════════════════════════════════
   GRID 3 THẺ TẠO TỆP — CÂN ĐỐI CHIỀU CAO
   ════════════════════════════════════════════════════════════════ */
.action-grid {
    align-items: stretch; /* 3 thẻ trong 1 hàng luôn cao bằng nhau */
}

.action-box {
    display: flex;
    flex-direction: column; /* cho phép đẩy nút xuống đáy bằng margin-top: auto */
    height: 100%;
    padding: 18px 20px;
    border: 1px solid #bfdbfe;
    border-radius: 13px;
    background: #ffffff;
    transition: transform .15s, box-shadow .15s;
}

    .action-box:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(30, 58, 95, 0.08);
    }

/* ════════════════════════════════════════════════════════════════
   BADGE THEO MÀU CHỨC NĂNG (Navy + Orange)
   ════════════════════════════════════════════════════════════════ */
.action-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    margin-bottom: 0.9rem;
    padding: 0.38rem 0.85rem;
    border-radius: 99px;
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.action-badge-success {
    background: rgba(16,185,129,0.12);
    color: #059669;
}

.action-badge-info {
    background: rgba(37,99,235,0.12);
    color: #1e3a5f;
}

.action-badge-warning {
    background: rgba(249,115,22,0.12);
    color: #c2410c;
}

.action-title {
    color: #1e3a5f;
    font-size: 0.98rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.action-description {
    margin: 0.4rem 0 1rem;
    color: #64748b;
    font-size: 0.85rem;
    line-height: 1.6;
}

/* ════════════════════════════════════════════════════════════════
   FIELD SPACING ĐỒNG NHẤT
   ════════════════════════════════════════════════════════════════ */
.field-group {
    margin-bottom: 0.85rem;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.input-label {
    display: block;
    margin-bottom: 4px;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 600;
}

/* ════════════════════════════════════════════════════════════════
   AUTO-CREATE INFO LIST
   ════════════════════════════════════════════════════════════════ */
.auto-create-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0.5rem 0 1rem;
    padding: 12px 16px;
    background: #f8faff;
    border-radius: 10px;
    font-size: 12px;
}

.auto-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #475569;
    font-size: 0.82rem;
}

    .auto-item i {
        color: #10b981;
    }

/* ════════════════════════════════════════════════════════════════
   ACTION-ACTIONS — DÙNG CHUNG CHO CẢ 3 THẺ
   Luôn dính đáy thẻ + căn hàng ngang bằng nhau nhờ .action-box
   là flex-column và .action-grid align-items: stretch
   ════════════════════════════════════════════════════════════════ */
.action-actions {
    margin-top: auto; /* đẩy cụm nút xuống sát đáy, bất kể nội dung phía trên dài/ngắn */
    padding-top: 12px; /* khoảng cách tối thiểu với nội dung ngay phía trên */
    display: flex;
    flex-direction: column;
    gap: 8px;
}

    .action-actions .btn {
        margin: 0; /* tránh cộng dồn margin cũ (mt-2, mt-3...) nếu còn sót trong markup */
    }

/* ════════════════════════════════════════════════════════════════
   NÚT OUTLINE (toggle bảng chỉnh môn học) + NÚT INFO (thẻ auto)
   ════════════════════════════════════════════════════════════════ */
.btn-app-outline {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #1e3a5f;
}

    .btn-app-outline:hover {
        border-color: #f97316;
        color: #c2410c;
    }

.btn-app-info {
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    color: #ffffff;
    border: none;
}

/* ════════════════════════════════════════════════════════════════
   VIỀN TRÁI ACCENT PHÂN BIỆT 3 LOẠI THẺ
   ════════════════════════════════════════════════════════════════ */
.action-box-create {
    border-left: 4px solid #10b981;
}

.action-box-auto {
    border-left: 4px solid #2563eb;
}

.action-box-backup {
    border-left: 4px solid #f97316;
}

/* ════════════════════════════════════════════════════════════════
   FORM RIÊNG: CHỈNH NHANH SỐ TIẾT MÔN HỌC
   ════════════════════════════════════════════════════════════════ */
.subform-card {
    border-color: #fdba74;
}

.btn-close-panel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
}

    .btn-close-panel:hover {
        background: rgba(0,0,0,0.05);
        color: #1e3a5f;
    }

.khoi-select-row {
    max-width: 260px;
}

.form-control-mini {
    max-width: 100px;
    margin: 0 auto;
}

.row-changed {
    background: rgba(249,115,22,0.06);
}

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE — 1 BREAKPOINT DUY NHẤT
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .field-row {
        grid-template-columns: 1fr;
    }

    .action-box {
        padding: 16px;
    }
}

/* ==== Nút outline cho toggle bảng ==== */
.btn-app-outline {
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    color: #ffffff;
}

    .btn-app-outline:hover {
        border-color: #f97316;
        color: #c2410c;
    }

.btn-app-info {
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    color: #ffffff;
    border: none;
}

/* ==== Form riêng: chỉnh nhanh số tiết ==== */
.subform-card {
    border-color: #fdba74;
}

.btn-close-panel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
}

    .btn-close-panel:hover {
        background: rgba(0,0,0,0.05);
        color: #1e3a5f;
    }

.khoi-select-row {
    max-width: 260px;
}

.form-control-mini {
    max-width: 100px;
    margin: 0 auto;
}

.row-changed {
    background: rgba(249,115,22,0.06);
}


/* ════════════════════════════════════════════════════════════════
       FILE TABLE
       ════════════════════════════════════════════════════════════════ */
.file-table-wrap {
    padding: 0 0 6px;
}

.file-table {
    margin: 0;
    --bs-table-bg: transparent;
}

    .file-table thead th {
        padding: 9px 10px;
        border-bottom: 1px solid #dbeafe;
        background: #eff6ff;
        color: #2563eb;
        font-size: 0.75rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.08em;
    }

    .file-table tbody tr {
        transition: background-color .15s;
    }

        .file-table tbody tr:hover {
            background: #f8faff;
        }

    .file-table td {
        padding: 10px;
        border-bottom: 1px solid #f1f5f9;
        vertical-align: middle;
    }

    .file-table tbody tr.is-current {
        background: linear-gradient(90deg, rgba(16, 185, 129, 0.08), transparent);
    }

.file-name-cell {
    min-width: 220px;
}

.file-name-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.file-name-text {
    color: #1e3a5f;
    font-size: 0.75rem;
    font-weight: 600;
    word-break: break-word;
}

.file-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.55rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.file-badge-current {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.file-badge-locked {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.metric-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #2563eb;
}

.table-date {
    display: inline-flex;
    align-items: center;
    padding: 2px 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #334155;
}

/* ════════════════════════════════════════════════════════════════
       BUTTONS
       ════════════════════════════════════════════════════════════════ */
.file-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.45rem;
}

.btn-app {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-width: 92px;
    height: 36px;
    padding: 0 0.8rem;
    border: none;
    border-radius: 9px;
    font-size: 0.65rem;
    font-weight: 600;
    color: #ffffff;
    overflow: hidden;
    isolation: isolate;
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.10), inset 0 1px 1px rgba(255,255,255,0.22);
    margin-bottom: 8px;
}

    .btn-app::before {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(180deg, rgba(255,255,255,0.16), rgba(255,255,255,0.01));
        pointer-events: none;
    }

    .btn-app:hover:not(:disabled) {
        transform: translateY(-1px);
        box-shadow: 0 7px 16px rgba(15, 23, 42, 0.14);
    }

    .btn-app:active:not(:disabled) {
        transform: translateY(0);
    }

    .btn-app:disabled {
        opacity: 0.6;
        box-shadow: none;
    }

    .btn-app i {
        font-size: 0.75rem;
        line-height: 1;
    }

/* Colors – aligned with Home.css tones */
.btn-app-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.28);
}

.btn-app-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
}

.btn-app-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.28);
}

.btn-app-danger {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.25);
}

.btn-app-muted {
    color: #334155;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

/* ════════════════════════════════════════════════════════════════
       RENAME INLINE
       ════════════════════════════════════════════════════════════════ */
.rename-inline {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.rename-actions {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

/* ════════════════════════════════════════════════════════════════
       QUICK-EDIT TABLE (sửa môn học)
       ════════════════════════════════════════════════════════════════ */
/* ════════════════════════════════════════════════════════════════
   QUICK EDIT
   ════════════════════════════════════════════════════════════════ */

.quick-layout {
    display: grid;
    gap: 12px;
    margin-top: 12px;
    width: 100%;
    min-width: 0;
}

    .quick-layout.collapsed {
        grid-template-columns: 1fr;
    }

    .quick-layout.expanded {
        grid-template-columns: 240px minmax(0,1fr);
    }

.quick-left-panel,
.quick-right-panel {
    background: #fff;
    border: 1px solid #dbeafe;
    border-radius: 14px;
}

.quick-left-panel {
    padding: 14px;
    height: fit-content;
    position: sticky;
    top: 12px;
}

.quick-right-panel {
    padding: 12px;
    overflow-x: auto;
}

.quick-edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.quick-edit-title {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    color: #2563eb;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.quick-left-panel .form-control,
.quick-left-panel .form-select {
    min-height: 36px;
    font-size: .75rem;
    padding: .38rem .7rem;
    border-radius: 8px;
}

    .quick-left-panel .form-control:focus,
    .quick-left-panel .form-select:focus,
    .form-control-mini:focus {
        border-color: #3b82f6;
        box-shadow: 0 0 0 .18rem rgba(37,99,235,.12);
    }

/* ===== TABLE ===== */

.table-app {
    width: 100%;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

    .table-app thead th {
        background: #eff6ff;
        color: #2563eb;
        font-size: .75rem;
        font-weight: 700;
        padding: 8px 10px;
        white-space: nowrap;
        border-bottom: 1px solid #dbeafe;
    }

    .table-app tbody td {
        padding: 7px 10px;
        font-size: .75rem;
        vertical-align: middle;
        border-bottom: 1px solid #f1f5f9;
    }

    .table-app tbody tr:hover {
        background: #f8fbff;
    }

.monhoc-name {
    font-weight: 600;
    color: #1e3a5f;
    line-height: 1.35;
    word-break: break-word;
}

.form-control-mini {
    height: 32px !important;
    min-height: 32px !important;
    padding: 4px 6px;
    text-align: center;
    font-size: .75rem;
    border-radius: 7px;
}

.row-changed {
    background: #fffbeb;
}

.badge.bg-secondary {
    font-size: .75rem;
    padding: .35rem .55rem;
}
/* ════════════════════════════════════════════════════════════════
       STATUS BANNER
       ════════════════════════════════════════════════════════════════ */
.status-banner {
    padding: 0.9rem 1.1rem;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.08);
}

/* ════════════════════════════════════════════════════════════════
       EMPTY STATE
       ════════════════════════════════════════════════════════════════ */
.empty-state {
    padding: 2.2rem 1rem;
    text-align: center;
}

.empty-state-title {
    color: #1e3a5f;
    font-size: 0.95rem;
    font-weight: 750;
}

.empty-state-text {
    margin-top: 0.4rem;
    color: #64748b;
    font-size: 0.88rem;
}

/* ════════════════════════════════════════════════════════════════
       RESPONSIVE
       ════════════════════════════════════════════════════════════════ */
@media (max-width: 991px) {
    .quick-layout {
        grid-template-columns: 1fr;
    }

    .quick-left-panel {
        position: static;
    }

    .table-app {
        min-width: 480px;
    }
}

@media (max-width: 767.98px) {
    .file-actions {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
    }

        .file-actions .btn-app {
            width: 100%;
        }

    .herotep-title {
        font-size: 0.8rem;
    }

    .herotep-subtitle {
        font-size: 0.8rem;
    }

    .stat-card {
        padding: 12px 14px;
    }

    .stat-value {
        font-size: 1.2rem;
    }

    .TKB\.Admin-card-body {
        padding: 14px;
    }

    .section-heading {
        padding: 12px 14px 11px;
    }

    .file-table thead th,
    .file-table td {
        padding: 8px;
    }
}

@media (max-width: 576px) {
    .quick-right-panel {
        padding: 6px;
    }

    .table-app {
        min-width: 440px;
    }

        .table-app thead th,
        .table-app tbody td {
            font-size: 0.7rem;
            padding: 4px 6px;
        }

    .form-control-mini {
        min-height: 27px !important;
        font-size: 0.7rem;
    }
}

