:root {
    --brand-red: #d41920;
    --brand-red-dark: #b3141a;
    --brand-red-light: rgba(212, 25, 32, 0.08);
    --brand-red-glow: rgba(212, 25, 32, 0.25);
    --text-main: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --bg-base: #f1f5f9;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --transition-smooth: all 0.2s ease-in-out;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-pill: 50px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* ================= HEADER CHUẨN DOANH NGHIỆP ================= */
header {
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: 72px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

/* Bên trái: Logo + Tên công ty Tiến Thành */
.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-container img {
    height: 42px;
    border-radius: 6px;
    object-fit: contain;
}

.company-name {
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--brand-red);
    line-height: 1.1;
    letter-spacing: -0.3px;
}

.company-name span {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Ở giữa: Tiêu đề chức năng */
.header-center-title {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header-center-title h2 {
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--brand-red);
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.3px;
    text-transform: uppercase;
}

.header-center-title p {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Bên phải: Nút Hệ thống + Menu tài khoản */
.header-right-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.nav-item-portal {
    background: #f8fafc;
    color: #334155;
    border: 1px solid #cbd5e1;
    padding: 8px 18px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.86rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    font-family: inherit;
    white-space: nowrap;
}

.nav-item-portal:hover {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

/* ================= THANH 3 MENU BO TRÒN DẸT ĐẸP MẮT Ở GIỮA ================= */
.segmented-nav-wrapper {
    max-width: 1280px;
    margin: 16px auto 4px;
    padding: 0 24px;
    display: flex;
    justify-content: center;
}

.segmented-nav-bar {
    display: inline-flex;
    background: #ffffff;
    padding: 5px;
    border-radius: var(--radius-pill);
    border: 1.5px solid var(--border-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.segmented-tab-btn {
    background: transparent;
    color: #475569;
    border: none;
    padding: 9px 24px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    white-space: nowrap;
}

.segmented-tab-btn:hover {
    background: #f8fafc;
    color: var(--brand-red);
}

.segmented-tab-btn.active {
    background: linear-gradient(135deg, #d41920 0%, #b3141a 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px var(--brand-red-glow);
}

.nav-badge-pill {
    background: #ffffff;
    color: var(--brand-red);
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 900;
}

.segmented-tab-btn:not(.active) .nav-badge-pill {
    background: var(--brand-red);
    color: #ffffff;
}

/* ================= NỘI DUNG CHÍNH ================= */
main {
    max-width: 1280px;
    margin: 16px auto 60px;
    padding: 0 24px;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.2s ease;
}

.tab-pane.active {
    display: block;
}

/* Card */
.app-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    overflow: hidden;
}

.card-header-bar {
    background: #fafbfc;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.card-header-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--brand-red);
}

.card-header-badge {
    background: #fee2e2;
    color: var(--brand-red);
    border: 1px solid #fecdd3;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
}

.btn-guide-link {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #334155;
    padding: 5px 14px;
    border-radius: 16px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-family: inherit;
}

.btn-guide-link:hover {
    background: #f1f5f9;
    color: var(--brand-red);
    border-color: #94a3b8;
}

/* Form */
.form-content-padding {
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-section-title {
    font-size: 0.92rem;
    font-weight: 800;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 1.5px solid #f1f5f9;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: var(--brand-red);
    color: white;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 800;
}

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

.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 0.84rem;
    font-weight: 700;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-label .req {
    color: var(--brand-red);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.9rem;
    border: 1.5px solid #cbd5e1;
    border-radius: var(--radius-md);
    background-color: #ffffff;
    color: var(--text-main);
    transition: var(--transition-smooth);
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--brand-red);
    box-shadow: 0 0 0 3px rgba(212, 25, 32, 0.1);
}

.form-control.locked {
    background-color: #f8fafc;
    color: #475569;
    cursor: not-allowed;
    border-color: #e2e8f0;
    font-weight: 600;
}

/* Time Box */
.time-box-wrapper {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.duration-indicator-pill {
    background: #fee2e2;
    border: 1px solid #fecdd3;
    padding: 9px 16px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.84rem;
    color: #991b1b;
    font-weight: 700;
}

.duration-tag {
    background: var(--brand-red);
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 800;
}

/* Nút Submit */
.btn-submit-action {
    background: var(--brand-red);
    color: #ffffff;
    font-size: 0.94rem;
    font-weight: 800;
    padding: 12px 28px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-submit-action:hover {
    background: #000000;
}

.btn-submit-action:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Bảng */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
}

.custom-table th {
    background: #f8fafc;
    color: #334155;
    font-weight: 800;
    padding: 10px 12px;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

.custom-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
    color: var(--text-main);
    vertical-align: middle;
}

.custom-table tbody tr:hover {
    background-color: #fafbfc;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.status-pending { background: #fff7ed; color: #c2410c; border: 1px solid #ffedd5; }
.status-approved { background: #f0fdf4; color: #15803d; border: 1px solid #dcfce7; }
.status-rescheduled { background: #eff6ff; color: #1d4ed8; border: 1px solid #dbeafe; }
.status-completed { background: #faf5ff; color: #7e22ce; border: 1px solid #f3e8ff; }
.status-cancelled { background: #fef2f2; color: #991b1b; border: 1px solid #fee2e2; }

.action-btn-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.btn-tgd {
    padding: 5px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-family: inherit;
}

.btn-tgd-approve { background: #16a34a; color: white; }
.btn-tgd-approve:hover { background: #15803d; }
.btn-tgd-change { background: #2563eb; color: white; }
.btn-tgd-change:hover { background: #1d4ed8; }
.btn-tgd-complete { background: #9333ea; color: white; }
.btn-tgd-complete:hover { background: #7e22ce; }
.btn-tgd-cancel { background: #dc2626; color: white; }
.btn-tgd-cancel:hover { background: #b91c1c; }

.filter-bar {
    padding: 12px 24px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.filter-btn-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-pill {
    padding: 5px 14px;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-family: inherit;
}

.filter-pill.active {
    background: var(--brand-red);
    color: white;
    border-color: var(--brand-red);
}

/* Modal */
.modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal-backdrop.active {
    display: flex;
}

.modal-dialog {
    background: #ffffff;
    width: 90%;
    max-width: 520px;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: scaleUp 0.2s ease-out;
}

.modal-header {
    background: var(--brand-red);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-body {
    padding: 22px;
}

.modal-footer {
    padding: 12px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.mock-test-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    padding: 4px 10px;
    border-radius: 8px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleUp {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@media (max-width: 992px) {
    .header-inner {
        height: auto;
        padding: 12px 16px;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    .header-right-actions {
        width: 100%;
        justify-content: center;
    }
}
