/* ================================================
   BHXH Vietnam - Chuẩn theo trang gốc
   Font: Arial (chuẩn gov.vn)
   Colors: Đỏ BHXH + Xanh dương chính phủ
   ================================================ */

/* === CSS Variables / Design Tokens === */
:root {
    /* Màu chuẩn trang gốc */
    --color-primary: #0056b3;
    --color-primary-light: #0d6efd;
    --color-primary-dark: #003d80;
    --color-primary-50: #e8f0fe;
    --color-on-primary: #ffffff;

    --color-red: #cc0000;
    --color-red-light: #e60000;
    --color-red-dark: #a30000;

    --color-green: #28a745;
    --color-green-dark: #1e7e34;

    --color-background: #e8ecf1;
    --color-surface: #ffffff;
    --color-foreground: #333333;
    --color-foreground-muted: #555555;
    --color-foreground-subtle: #888888;

    --color-border: #cccccc;
    --color-border-light: #e0e0e0;
    --color-border-focus: #0056b3;

    --color-destructive: #cc0000;
    --color-success: #28a745;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);

    --radius-sm: 4px;
    --radius-md: 5px;
    --radius-lg: 5px;

    --font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;
    --font-size-xs: 11px;
    --font-size-sm: 13px;
    --font-size-base: 14px;
    --font-size-md: 15px;
    --font-size-lg: 16px;
    --font-size-xl: 18px;
    --font-size-2xl: 22px;

    --container-max: 1200px;
    --nav-height: 42px;

    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
}

/* === Reset & Base === */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.5;
    color: var(--color-foreground);
    background-color: var(--color-background);
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

ul {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

input {
    font-family: inherit;
    font-size: inherit;
}

/* === Container === */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 15px;
}

/* === Animations === */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes checkBounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 50%, 90% { transform: translateX(-4px); }
    30%, 70% { transform: translateX(4px); }
}

/* === Top Bar === */
.top-bar {
    background: linear-gradient(to right, var(--color-primary-dark), var(--color-primary));
    color: var(--color-on-primary);
    font-size: var(--font-size-sm);
    padding: 5px 0;
    position: relative;
    z-index: 100;
}

.top-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.icon-phone {
    width: 14px;
    height: 14px;
    opacity: 0.8;
}

.top-bar-left strong {
    font-weight: 700;
    font-size: var(--font-size-md);
    letter-spacing: 0.5px;
}

.lang-switch {
    display: flex;
    gap: 2px;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--font-size-xs);
    padding: 3px 8px;
    border-radius: 3px;
    transition: all var(--transition-fast);
    font-weight: 500;
}

.lang-btn:hover,
.lang-btn.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

.flag-icon {
    width: 20px;
    height: 14px;
    border-radius: 2px;
}

/* === Header === */
.header {
    background: var(--color-surface);
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border-light);
    position: sticky;
    top: 0;
    z-index: 90;
    transition: box-shadow var(--transition-base);
}

.header.scrolled {
    box-shadow: var(--shadow-md);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-emblem {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.logo-svg {
    width: 100%;
    height: 100%;
}

.logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.footer-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    opacity: 0.95;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-sub {
    font-size: var(--font-size-sm);
    color: var(--color-primary);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.logo-main {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: 0;
    line-height: 1.2;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Ô tìm kiếm chuẩn gốc */
.search-box {
    display: flex;
    align-items: center;
    border: 1px solid var(--color-border);
    overflow: hidden;
    width: 240px;
    background: #fff;
}

.search-box:focus-within {
    border-color: var(--color-primary);
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 6px 10px;
    background: transparent;
    font-size: var(--font-size-base);
    color: var(--color-foreground);
}

.search-input::placeholder {
    color: #aaa;
}

.search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 34px;
    color: var(--color-primary);
    background: #f0f0f0;
    border-left: 1px solid var(--color-border);
    transition: all var(--transition-fast);
}

.search-btn:hover {
    background: var(--color-primary);
    color: var(--color-on-primary);
}

.search-btn svg {
    width: 16px;
    height: 16px;
}

/* === Navigation (chuẩn xanh dương BHXH) === */
.navbar {
    background: linear-gradient(to bottom, #0070c0, #005a9e);
    position: sticky;
    top: 84px;
    z-index: 80;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* === Realtime Clock Bar dưới Navbar === */
.realtime-clock-bar {
    background: #002d5a;
    color: #ffffff;
    padding: 5px 0;
    font-size: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.realtime-clock-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
}

.clock-display {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    color: #ffeb3b;
    letter-spacing: 0.3px;
}

.system-status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    opacity: 0.9;
}

.status-dot {
    width: 7px;
    height: 7px;
    background: #00e676;
    border-radius: 50%;
    box-shadow: 0 0 8px #00e676;
    animation: blinkDot 1.5s infinite alternate;
}

@keyframes blinkDot {
    from { opacity: 0.3; }
    to { opacity: 1; }
}

.nav-inner {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.nav-list li {
    flex: none;
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    color: #ffffff;
    font-size: var(--font-size-sm);
    font-weight: 700;
    text-transform: uppercase;
    transition: all var(--transition-fast);
    white-space: nowrap;
    position: relative;
    height: var(--nav-height);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 80%;
    height: 2px;
    background: #fff;
    transition: transform var(--transition-fast);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
}

.nav-link:hover::after {
    transform: translateX(-50%) scaleX(1);
}

.nav-home {
    padding: 0 14px;
    color: #fff;
}

.nav-home svg {
    width: 20px;
    height: 20px;
}

.nav-list li + li {
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
}

.mobile-menu-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all var(--transition-fast);
}

/* === Breadcrumb === */
.breadcrumb-bar {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border-light);
    padding: 8px 0;
}

.breadcrumb-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.breadcrumb-trail {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--font-size-sm);
}

.breadcrumb-trail a {
    color: #666;
}

.breadcrumb-trail a:hover {
    color: var(--color-primary);
}

.breadcrumb-sep {
    width: 12px;
    height: 12px;
    color: #999;
    flex-shrink: 0;
}

.breadcrumb-current {
    color: var(--color-red);
    font-weight: 700;
}

.breadcrumb-date {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #666;
    font-size: var(--font-size-sm);
}

.icon-calendar {
    width: 14px;
    height: 14px;
    color: var(--color-primary);
}

/* === Main Content === */
.main-content {
    padding: 20px 0 40px;
}

.main-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 20px;
    align-items: start;
}

/* === Section Header (thanh đỏ chuẩn gốc) === */
.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: linear-gradient(to right, #cc0000, #e60000);
    color: #ffffff;
    border-radius: 0;
    position: relative;
}

.section-header-icon svg {
    width: 20px;
    height: 20px;
    opacity: 0.9;
}

.section-title {
    font-size: var(--font-size-md);
    font-weight: 700;
}

/* === Lookup Form Card === */
.lookup-form-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-top: none;
    padding: 25px 20px;
    box-shadow: var(--shadow-sm);
}

.lookup-form-card:hover {
    box-shadow: var(--shadow-md);
}

/* === Form (layout chuẩn gốc: label + input cùng dòng) === */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 30px;
}

.form-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-label {
    font-size: var(--font-size-base);
    font-weight: 400;
    color: var(--color-foreground);
    display: flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
    min-width: 120px;
    flex-shrink: 0;
}

.required {
    color: var(--color-red);
    font-weight: 700;
}

/* Ẩn icon trong input (chuẩn gốc không có) */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
}

.input-icon {
    display: none;
}

.form-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--color-border);
    border-radius: 0;
    font-size: var(--font-size-base);
    color: var(--color-foreground);
    background: var(--color-surface);
    transition: border-color var(--transition-fast);
    outline: none;
}

.form-input::placeholder {
    color: #aaa;
    font-style: italic;
}

.form-input:hover {
    border-color: #aaa;
}

.form-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(0, 86, 179, 0.1);
}

.form-input.error {
    border-color: var(--color-red);
    box-shadow: 0 0 0 2px rgba(204, 0, 0, 0.1);
}

/* === Captcha === */
.captcha-group {
    grid-column: 1 / -1;
    justify-content: center;
}

.captcha-box {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    background: #f9f9f9;
    transition: border-color var(--transition-fast);
    max-width: 340px;
}

.captcha-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.captcha-check {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.captcha-check input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 26px;
    height: 26px;
    border: 2px solid #c1c1c1;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    background: #fff;
    flex-shrink: 0;
}

.checkmark svg {
    width: 14px;
    height: 14px;
    opacity: 0;
    color: #fff;
    transition: all var(--transition-fast);
}

.captcha-check input:checked + .checkmark {
    background: var(--color-green);
    border-color: var(--color-green);
}

.captcha-check input:checked + .checkmark svg {
    opacity: 1;
    animation: checkBounce 0.3s ease;
}

.captcha-text {
    font-size: var(--font-size-base);
    color: var(--color-foreground);
}

.captcha-brand {
    display: flex;
    align-items: center;
    gap: 6px;
}

.recaptcha-icon {
    width: 28px;
    height: 28px;
}

.captcha-brand-text {
    display: flex;
    flex-direction: column;
    font-size: 10px;
    color: #999;
    line-height: 1.3;
}

.captcha-brand-text span {
    font-weight: 600;
    color: #777;
    font-size: 11px;
}

/* === Form Actions (nút chuẩn gốc: hình chữ nhật bo nhẹ) === */
.form-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
    padding-top: 0;
    border-top: none;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 35px;
    font-size: var(--font-size-md);
    font-weight: 700;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    min-width: 140px;
    justify-content: center;
    border: none;
    cursor: pointer;
}

.btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Nút Tra cứu: đỏ chuẩn gốc */
.btn-primary {
    background: var(--color-red);
    color: #ffffff;
    box-shadow: none;
}

.btn-primary:hover {
    background: var(--color-red-dark);
    transform: none;
    box-shadow: 0 2px 6px rgba(204, 0, 0, 0.3);
}

.btn-primary:active {
    background: #8b0000;
}

/* Nút Nhập lại: xanh lá chuẩn gốc */
.btn-secondary {
    background: var(--color-green);
    color: #ffffff;
    box-shadow: none;
}

.btn-secondary:hover {
    background: var(--color-green-dark);
    transform: none;
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
}

.btn-secondary:active {
    background: #196f2e;
}

.btn::after {
    display: none;
}

/* === Results Area === */
.results-area {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border-light);
    animation: fadeIn 0.4s ease;
}

.results-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: var(--color-green);
}

.results-header svg {
    width: 24px;
    height: 24px;
}

.results-header h3 {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-foreground);
}

.results-table {
    border: 1px solid var(--color-border);
    overflow: hidden;
}

.result-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    border-bottom: 1px solid var(--color-border-light);
}

.result-row:last-child {
    border-bottom: none;
}

.result-row:hover {
    background: #f5f8ff;
}

.result-label {
    padding: 8px 12px;
    background: #f5f5f5;
    font-weight: 700;
    font-size: var(--font-size-base);
    color: var(--color-foreground);
    border-right: 1px solid var(--color-border-light);
}

.result-value {
    padding: 8px 12px;
    font-size: var(--font-size-base);
    color: var(--color-foreground-muted);
}

.result-value.highlight {
    color: var(--color-green);
    font-weight: 700;
}

.result-value.warning {
    color: var(--color-red);
    font-weight: 700;
}

/* === Sidebar === */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sidebar-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.sidebar-card:hover {
    box-shadow: var(--shadow-md);
}

/* Sidebar header: chuẩn gốc với text đỏ */
.sidebar-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    border-bottom: none;
    position: relative;
}

.sidebar-card-header svg {
    width: 22px;
    height: 22px;
    color: var(--color-primary);
    flex-shrink: 0;
}

.sidebar-card-header h2 {
    font-size: var(--font-size-md);
    font-weight: 700;
    color: var(--color-red);
    letter-spacing: 0;
}

.sidebar-card-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 15px;
    right: 15px;
    height: 2px;
    background: var(--color-primary);
}

/* === Sidebar Link List === */
.sidebar-link-list {
    padding: 5px 0;
}

.sidebar-link {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    padding: 8px 15px;
    font-size: var(--font-size-base);
    color: var(--color-foreground);
    transition: all var(--transition-fast);
    border-bottom: 1px solid #f0f0f0;
    line-height: 1.4;
}

.sidebar-link-list li:last-child .sidebar-link {
    border-bottom: none;
}

.sidebar-link:hover {
    color: var(--color-primary);
    background: #f5f8ff;
}

.sidebar-link.active {
    color: var(--color-primary);
    font-weight: 700;
    background: #eef3ff;
    border-left: 3px solid var(--color-primary);
}

.link-arrow {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--color-red);
    margin-top: 2px;
}

/* === Quick Access Cards === */
.sidebar-quick-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quick-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.quick-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary);
}

.qc-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.qc-icon svg {
    width: 22px;
    height: 22px;
}

.qc-org .qc-icon {
    background: #e8f4fd;
    color: var(--color-primary);
}

.qc-lookup .qc-icon {
    background: #e8f8ee;
    color: var(--color-green);
}

.qc-service .qc-icon {
    background: #e8f4fd;
    color: #0284c7;
}

.qc-hotline .qc-icon {
    background: #fef3cd;
    color: #d97706;
}

.qc-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.qc-text strong {
    font-size: var(--font-size-base);
    font-weight: 700;
    color: var(--color-foreground);
}

.qc-text span {
    font-size: var(--font-size-base);
    color: var(--color-primary);
    font-weight: 700;
}

/* === Sidebar Info === */
.info-header svg {
    color: var(--color-primary) !important;
}

.info-header h2 {
    color: var(--color-red) !important;
}

.info-section {
    padding: 10px 15px;
    border-bottom: 1px solid #f0f0f0;
}

.info-section:last-child {
    border-bottom: none;
}

.info-category {
    font-size: var(--font-size-base);
    font-weight: 700;
    color: var(--color-red);
    margin-bottom: 5px;
}

.info-list li {
    padding: 3px 0;
}

.info-list li::before {
    content: '▸';
    color: var(--color-red);
    margin-right: 6px;
    font-weight: 700;
}

.info-list a {
    font-size: var(--font-size-base);
    color: var(--color-foreground);
}

.info-list a:hover {
    color: var(--color-primary);
}

/* === Footer === */
.footer {
    background: linear-gradient(180deg, var(--color-primary-dark) 0%, #001a40 100%);
    color: rgba(255, 255, 255, 0.85);
    margin-top: auto;
}

.footer-top {
    padding: 35px 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 30px;
}

.footer-logo-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.footer-emblem {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
}

.footer-logo-group strong {
    font-size: var(--font-size-base);
    color: #fff;
    display: block;
    line-height: 1.3;
}

.footer-logo-group span {
    font-size: var(--font-size-xs);
    opacity: 0.6;
}

.footer-desc {
    font-size: var(--font-size-sm);
    line-height: 1.6;
    opacity: 0.7;
}

.footer-col h4 {
    font-size: var(--font-size-base);
    font-weight: 700;
    color: #fff;
    margin-bottom: 15px;
    position: relative;
    padding-bottom: 8px;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 35px;
    height: 2px;
    background: var(--color-red);
}

.footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 5px 0;
    font-size: var(--font-size-sm);
}

.footer-contact svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.6;
    margin-top: 2px;
}

.footer-links li {
    padding: 4px 0;
}

.footer-links a {
    font-size: var(--font-size-sm);
    opacity: 0.7;
    transition: all var(--transition-fast);
}

.footer-links a:hover {
    opacity: 1;
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 0;
}

.footer-bottom-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: var(--font-size-xs);
    opacity: 0.6;
}

.footer-emc {
    display: flex;
    align-items: center;
    gap: 6px;
}

.emc-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-green);
    animation: pulse 2s infinite;
}

/* === Loading Overlay === */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(2px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    background: #fff;
    padding: 30px 40px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.spinner-ring {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-spinner span {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: #666;
}

/* === Toast === */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #fff;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    animation: slideDown 0.3s ease;
    min-width: 300px;
    border-left: 4px solid var(--color-green);
}

.toast.error {
    border-left-color: var(--color-red);
}

.toast.warning {
    border-left-color: #f59e0b;
}

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast-message {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-foreground);
    flex: 1;
}

.toast-close {
    color: #999;
    padding: 3px;
    border-radius: 3px;
    transition: all var(--transition-fast);
}

.toast-close:hover {
    color: var(--color-foreground);
    background: #f0f0f0;
}

.toast-close svg {
    width: 14px;
    height: 14px;
}

/* === Responsive === */

@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        order: 2;
    }

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

    .footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }

    .header-inner {
        flex-wrap: wrap;
        gap: 10px;
    }

    .logo-main {
        font-size: var(--font-size-lg);
    }

    .logo-emblem {
        width: 44px;
        height: 44px;
    }

    .search-box {
        width: 100%;
        order: 3;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .nav-list {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #005a9e;
        box-shadow: var(--shadow-lg);
        z-index: 100;
    }

    .nav-list.open {
        display: flex;
    }

    .nav-link {
        height: auto;
        justify-content: flex-start;
        padding: 10px 20px;
    }

    .nav-link::after {
        display: none;
    }

    .nav-list li + li {
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .navbar {
        position: relative;
        top: 0;
    }

    .breadcrumb-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

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

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

    .form-label {
        min-width: auto;
    }

    .input-wrapper {
        width: 100%;
    }

    .lookup-form-card {
        padding: 15px;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .captcha-inner {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .result-row {
        grid-template-columns: 1fr;
    }

    .result-label {
        border-right: none;
        border-bottom: 1px solid var(--color-border-light);
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .footer-bottom-inner {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }

    .sidebar-quick-cards {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .quick-card {
        flex-direction: column;
        text-align: center;
        padding: 12px;
    }
}

/* === 6-Button Portal Grid (Chuẩn trang mẫu) === */
.portal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.portal-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: #0d2847;
    border: 2px solid #234d7a;
    border-radius: 4px;
    color: #ffffff;
    text-decoration: none;
    transition: all 200ms ease;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.portal-btn:hover,
.portal-btn.active {
    background: #11345c;
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(13, 40, 71, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.portal-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.portal-icon svg {
    width: 38px;
    height: 38px;
}

.p-icon-pink { color: #e91e63; }
.p-icon-yellow { color: #fbc02d; }
.p-icon-cyan { color: #00bcd4; }
.p-icon-green { color: #76ff03; }
.p-icon-orange { color: #ff9800; }
.p-icon-purple { color: #ba68c8; }

.portal-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.portal-text strong {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #ffffff;
}

.portal-text span {
    font-size: 13px;
    font-weight: 600;
    color: #e0f2fe;
    letter-spacing: 0.3px;
}

/* === Statistics Cards Section === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: #1e456c;
    border: 1px solid #2b5c8f;
    border-radius: 4px;
    padding: 16px;
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}

.stat-card-title {
    font-size: 13px;
    font-weight: 700;
    color: #64b5f6;
    text-align: center;
    margin-bottom: 14px;
    letter-spacing: 0.3px;
    line-height: 1.3;
}

.stat-counts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
    text-align: center;
}

.stat-count-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-label {
    font-size: 11px;
    color: #bbdefb;
    font-weight: 600;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.1;
}

.stat-unit {
    font-size: 11px;
    color: #90caf9;
}

.stat-badge-box {
    background: #143353;
    border-radius: 4px;
    padding: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.badge-percent {
    font-size: 26px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
}

.badge-text {
    font-size: 11px;
    color: #b0bec5;
    margin-top: 4px;
}

/* Pie Chart */
.chart-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}

.pie-chart-svg {
    width: 110px;
    height: 110px;
    transform: rotate(-90deg);
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 11px;
    color: #e0e0e0;
}

.chart-legend li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-orange { background-color: #ff6d00; }
.dot-purple { background-color: #d500f9; }
.dot-red { background-color: #ff1744; }
.dot-yellow { background-color: #ffd600; }
.dot-cyan { background-color: #00e5ff; }

/* === Auth Buttons (Đăng nhập / Đăng ký) === */
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-auth {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    transition: all 150ms ease;
    border: 1px solid transparent;
    white-space: nowrap;
}

.btn-auth svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.btn-login {
    background: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
}

.btn-login:hover {
    background: var(--color-primary-dark);
    box-shadow: 0 2px 6px rgba(0, 86, 179, 0.3);
}

.btn-register {
    background: var(--color-red);
    color: #ffffff;
    border-color: var(--color-red);
}

.btn-register:hover {
    background: var(--color-red-dark);
    box-shadow: 0 2px 6px rgba(204, 0, 0, 0.3);
}

.user-profile-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #e8f0fe;
    color: var(--color-primary);
    font-size: 13px;
    font-weight: 700;
    border-radius: 4px;
    border: 1px solid #c5d9f8;
}

.user-profile-badge svg {
    width: 16px;
    height: 16px;
}

.btn-logout {
    background: #64748b;
    color: #ffffff;
    border-color: #64748b;
}

.btn-logout:hover {
    background: #475569;
}

/* Modal Backdrop & Card */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 15px;
    animation: fadeIn 200ms ease;
}

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

.modal-card {
    background: #ffffff;
    border-radius: 6px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideDown 250ms ease;
}

.modal-header {
    background: linear-gradient(to right, #0056b3, #0070c0);
    color: #ffffff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-header-icon {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
}

.modal-title-group h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.modal-title-group span {
    font-size: 11px;
    opacity: 0.85;
    display: block;
}

.modal-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.8;
    line-height: 1;
    padding: 0 4px;
}

.modal-close:hover {
    opacity: 1;
}

.modal-body {
    padding: 20px;
}

.modal-tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 18px;
}

.tab-btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 700;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    color: #666;
    cursor: pointer;
}

.tab-btn.active {
    color: #0056b3;
    border-bottom-color: #0056b3;
}

.mb-3 {
    margin-bottom: 14px;
}

.w-100 {
    width: 100%;
}

.modal-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 18px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #444;
    cursor: pointer;
}

.forgot-pass {
    color: #0056b3;
    font-weight: 600;
    text-decoration: underline;
}

.modal-footer {
    margin-top: 15px;
}

@media (max-width: 768px) {
    .portal-grid {
        grid-template-columns: 1fr;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* === Focus === */
*:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* === Reduced motion === */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* === Print === */
@media print {
    .top-bar, .navbar, .sidebar, .footer, .search-box, .form-actions {
        display: none;
    }
    body {
        background: #fff;
    }
    .main-grid {
        grid-template-columns: 1fr;
    }
}

/* === Modal Xem Kê Khai Hồ Sơ === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.kekhai-modal-card {
    background: #ffffff;
    width: 92%;
    max-width: 680px;
    max-height: 85vh;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header-banner {
    background: linear-gradient(135deg, #0056b3, #003d80);
    color: #ffffff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px solid #ffcc00;
}

.kekhai-title-group {
    display: flex;
    flex-direction: column;
}

.kekhai-sub {
    font-size: 11px;
    letter-spacing: 1px;
    opacity: 0.85;
    font-weight: 600;
}

.kekhai-title {
    font-size: 15px;
    font-weight: 700;
    margin-top: 2px;
    text-transform: uppercase;
}

.kekhai-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.kekhai-close-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

.kekhai-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    font-size: 13.5px;
    line-height: 1.6;
    color: #333;
}

.kekhai-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #e6f4ea;
    color: #137333;
    border: 1px solid #ceead6;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 12px;
    margin-bottom: 16px;
}

.kekhai-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 20px;
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.kekhai-item {
    display: flex;
    flex-direction: column;
}

.kekhai-item.full-width {
    grid-column: 1 / -1;
}

.kekhai-label {
    font-size: 11.5px;
    color: #666;
    text-transform: uppercase;
    font-weight: 600;
}

.kekhai-value {
    font-size: 14px;
    font-weight: 600;
    color: #111;
    margin-top: 2px;
    word-break: break-word;
}

.kekhai-photos-section {
    margin-top: 18px;
}

.kekhai-photos-title {
    font-size: 13px;
    font-weight: 700;
    color: #0056b3;
    margin-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 4px;
}

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

.kekhai-photo-card {
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    text-align: center;
    padding: 6px;
}

.kekhai-photo-card img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s;
}

.kekhai-photo-card img:hover {
    transform: scale(1.04);
}

.kekhai-photo-label {
    font-size: 11px;
    color: #555;
    margin-top: 4px;
    font-weight: 600;
}

.kekhai-footer {
    padding: 14px 20px;
    background: #f1f3f5;
    border-top: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.btn-kekhai-edit {
    background: linear-gradient(135deg, #0056b3, #004085);
    color: #fff;
    border: none;
    padding: 9px 18px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.btn-kekhai-edit:hover {
    background: #003366;
}

.btn-kekhai-close {
    background: #6c757d;
    color: #fff;
    border: none;
    padding: 9px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.btn-kekhai-close:hover {
    background: #5a6268;
}

@media (max-width: 600px) {
    .kekhai-grid {
        grid-template-columns: 1fr;
    }
    .kekhai-photos-grid {
        grid-template-columns: 1fr;
    }
}

/* ================================================
   CHUẨN MÀU THƯƠNG HIỆU BHXH VIỆT NAM (KHÔNG VIỀN & BẰNG NHAU)
   ================================================ */
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-profile-badge,
.btn-auth {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 29px;
    padding: 0 12px;
    border-radius: 4px;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1;
    border: none !important;
    outline: none;
    box-sizing: border-box;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12);
    transition: all 0.2s ease;
}

.user-profile-badge svg,
.btn-auth svg {
    width: 14px;
    height: 14px;
    stroke: #ffffff;
    flex-shrink: 0;
}

.user-profile-badge {
    background: linear-gradient(135deg, #0056b3, #003366);
    color: #ffffff;
    cursor: default;
}

.user-name-display {
    color: #ffffff;
    font-weight: 700;
    white-space: nowrap;
}

.btn-auth {
    cursor: pointer;
}

.btn-auth.btn-login {
    background: #0056b3;
    color: #ffffff;
}
.btn-auth.btn-login:hover {
    background: #003d80;
}

.btn-auth.btn-register {
    background: #28a745;
    color: #ffffff;
}
.btn-auth.btn-register:hover {
    background: #218838;
}

.btn-auth.btn-logout {
    background: linear-gradient(135deg, #c62828, #b71c1c);
    color: #ffffff;
}
.btn-auth.btn-logout:hover {
    background: #8e0000;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(198, 40, 40, 0.35);
}

/* ================================================
   HUY HIỆU NỔI CỐ ĐỊNH "ĐÃ KẾT NỐI EMC" GÓC MÀN HÌNH
   ================================================ */
.fixed-emc-badge {
    position: fixed;
    bottom: 0;
    left: 24px;
    z-index: 99999;
    background: #e53935;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    padding: 5px 14px 5px 6px;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -3px 10px rgba(0, 0, 0, 0.25);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.2px;
    cursor: default;
    user-select: none;
    transition: transform 0.2s ease;
}

.fixed-emc-badge:hover {
    transform: translateY(-2px);
}

.emc-circle-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 7px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.emc-text {
    color: #ffffff;
    font-weight: 700;
    white-space: nowrap;
}
