/* ============================================================
   Admin panel – appointment management  |  Blue theme
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

:root {
    --blue-900: #0d47a1;
    --blue-800: #1565c0;
    --blue-700: #1976d2;
    --blue-600: #1e88e5;
    --blue-50:  #e3f2fd;
}

body {
    background: #eef2fb;
    font-family: 'Segoe UI', 'Arial', sans-serif;
    font-size: 14px;
    color: #212121;
    margin: 0;
}

/* ── Navbar ──────────────────────────────────────────────── */
.admin-nav {
    background: linear-gradient(120deg, #0a3880 0%, #1565c0 45%, #1e88e5 80%, #1565c0 100%);
    background-size: 250% 250%;
    animation: navShimmer 10s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 36px;
    min-height: 76px;
    box-shadow: 0 3px 18px rgba(13,71,161,.35);
    position: sticky;
    top: 0;
    z-index: 100;
}

@@keyframes navShimmer {
    0%   { background-position: 0%   50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0%   50%; }
}

/* Logo bên trái brand */
.nav-logo {
    width: 52px; height: 52px;
    flex-shrink: 0;
    background: rgba(255,255,255,.18);
    border: 1.5px solid rgba(255,255,255,.30);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; color: #fff;
    margin-right: 16px;
    transition: transform .3s;
}
.admin-nav:hover .nav-logo { transform: rotate(-8deg) scale(1.06); }

.admin-nav-brand {
    display: flex;
    align-items: center;
    color: #fff;
    flex-shrink: 0;
}

.brand-name {
    font-weight: 800;
    font-size: 18px;
    letter-spacing: .2px;
    line-height: 1.3;
}

.brand-sub {
    font-size: 13px;
    font-weight: 400;
    opacity: .80;
    margin-top: 3px;
}

/* Phần bên phải navbar – luôn sát mép phải */
.nav-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

/* Hotline */
.nav-hotline {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #ffe066;
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,224,102,.30);
    border-radius: 20px;
    padding: 5px 13px;
    white-space: nowrap;
}
.nav-hotline i { font-size: 13px; animation: phonePulse 2s infinite; }
@@keyframes phonePulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: .55; }
}

/* User hiện tại */
.nav-user {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,.92);
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 20px;
    padding: 5px 13px;
    white-space: nowrap;
}

.btn-logout {
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.35);
    color: #fff;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(6px);
    white-space: nowrap;
    transition: background .2s, transform .15s, box-shadow .2s;
}
.btn-logout:hover {
    background: rgba(255,255,255,.28);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
}

/* Ẩn bớt trên mobile */
@media (max-width: 768px) {
    .nav-hotline { display: none; }
    .nav-user    { display: none; }
    .brand-sub   { display: none; }
    .nav-logo    { width: 40px; height: 40px; font-size: 22px; }
    .brand-name  { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .admin-nav   { padding: 10px 16px; min-height: 64px; }
    /* Cho phép brand co lại để nav-right không bị đẩy ra ngoài */
    .admin-nav-brand { flex: 1 1 0; min-width: 0; overflow: hidden; }
    .nav-right   { gap: 8px; flex-shrink: 0; }
    .nav-back-btn { font-size: 12px; padding: 4px 8px; }
    .btn-logout  { font-size: 12px; padding: 5px 10px; }
}

/* Màn hình rất nhỏ: ẩn chữ trong nút nav, chỉ giữ icon */
@media (max-width: 420px) {
    .nav-back-label { display: none; }
    .btn-logout-label { display: none; }
    .nav-back-btn .bi { margin-right: 0 !important; }
    .btn-logout .bi   { margin-right: 0 !important; }
}

/* ── Container ───────────────────────────────────────────── */
.admin-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 24px 28px 40px;
}

/* ── Stat cards ──────────────────────────────────────────── */
.stat-row {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat-card {
    flex: 1; min-width: 160px;
    background: #fff;
    border-radius: 14px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 12px rgba(13,71,161,.09);
    border-left: 4px solid transparent;
    transition: transform .22s ease, box-shadow .22s ease;
}
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 28px rgba(13,71,161,.16);
}

.stat-wait   { border-color: #f9a825; }
.stat-done   { border-color: var(--blue-700); }
.stat-cancel { border-color: #c62828; }
.stat-total  { border-color: var(--blue-900); }

.stat-icon { font-size: 26px; flex-shrink: 0; }
.stat-wait   .stat-icon { color: #f9a825; }
.stat-done   .stat-icon { color: var(--blue-700); }
.stat-cancel .stat-icon { color: #c62828; }
.stat-total  .stat-icon { color: var(--blue-900); }

.stat-num {
    font-size: 26px;
    font-weight: 800;
    line-height: 1.1;
}
.stat-label {
    font-size: 12px;
    color: #757575;
    font-weight: 500;
}

/* ── Filter bar ──────────────────────────────────────────── */
.filter-bar {
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 16px rgba(13,71,161,.11);
    border: 1px solid rgba(25,118,210,.12);
    overflow: hidden;
}

.filter-bar-title {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 22px;
    background: linear-gradient(120deg, var(--blue-900) 0%, var(--blue-700) 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .4px;
}

.filter-bar-title i { font-size: 14px; opacity: .9; }

.filter-form {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: flex-end;
    padding: 18px 22px;
    background: linear-gradient(135deg, #f3f8ff 0%, #ffffff 55%, #f6faff 100%);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 140px;
}

.filter-search { flex: 1; min-width: 220px; }

.filter-group label {
    font-size: 12px;
    font-weight: 700;
    color: var(--blue-800);
    display: flex;
    align-items: center;
    gap: 5px;
}

.filter-group label i { font-size: 11px; color: var(--blue-600); }

.filter-input {
    border: 1.5px solid #c8ddf5;
    border-radius: 9px;
    padding: 7px 11px;
    font-size: 13px;
    background: #fafdff;
    color: #1a2533;
    width: 100%;
    height: 36px;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.filter-input:focus {
    outline: none;
    border-color: var(--blue-700);
    box-shadow: 0 0 0 3px rgba(25,118,210,.14);
    background: #fff;
}

/* Ô tìm kiếm có icon bên trong */
.filter-search-wrap { position: relative; }

.filter-search-icon {
    position: absolute;
    left: 10px; top: 50%;
    transform: translateY(-50%);
    color: #aac4df;
    font-size: 13px;
    pointer-events: none;
    transition: color .2s;
}
.filter-search-wrap:focus-within .filter-search-icon { color: var(--blue-700); }

.filter-input-icon { padding-left: 30px; }

.filter-actions {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.btn-filter-search {
    background: linear-gradient(135deg, var(--blue-800), var(--blue-600));
    color: #fff;
    border: none;
    border-radius: 9px;
    padding: 7px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    height: 36px;
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(25,118,210,.30);
    transition: background .2s, box-shadow .2s, transform .15s;
}
.btn-filter-search:hover {
    background: linear-gradient(135deg, var(--blue-900), var(--blue-800));
    box-shadow: 0 4px 16px rgba(25,118,210,.42);
    transform: translateY(-1px);
}

.btn-filter-reset {
    background: #fff;
    color: #555;
    border: 1.5px solid #ddd;
    border-radius: 9px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    height: 36px;
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: border-color .2s, color .2s;
}
.btn-filter-reset:hover { border-color: var(--blue-600); color: var(--blue-800); }

.btn-export-excel {
    background: linear-gradient(135deg, #1b5e20, #2e7d32);
    color: #fff;
    border: none;
    border-radius: 9px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    height: 36px;
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(46,125,50,.32);
    transition: background .2s, box-shadow .2s, transform .15s;
}
.btn-export-excel:hover {
    background: linear-gradient(135deg, #145a18, #1b5e20);
    box-shadow: 0 4px 16px rgba(46,125,50,.45);
    transform: translateY(-1px);
    color: #fff;
    text-decoration: none;
}

/* ── Table card ──────────────────────────────────────────── */
.table-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(13,71,161,.09);
    overflow: hidden;
}

.appt-table {
    width: 100%;
    border-collapse: collapse;
}

.appt-table thead tr {
    background: linear-gradient(90deg, var(--blue-900) 0%, var(--blue-700) 100%);
    color: #fff;
}

.appt-table thead th {
    padding: 12px 14px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .3px;
    white-space: nowrap;
    border: none;
}

.appt-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background .15s;
}
.appt-table tbody tr:hover { background: #f0f7ff; }
.appt-table tbody tr.row-cancel { opacity: .65; }

.appt-table td {
    padding: 10px 14px;
    vertical-align: top;
    font-size: 13px;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Cột cố định – không xuống dòng */
.nowrap-cell {
    white-space: nowrap;
    vertical-align: middle;
}

.code-cell {
    font-weight: 700;
    color: var(--blue-900);
    font-size: 12.5px;
    white-space: nowrap;
    vertical-align: middle;
}

/* Cột text dài – tự wrap, giới hạn chiều rộng tối đa */
.name-cell {
    font-weight: 600;
    min-width: 120px;
    max-width: 200px;
}

.service-cell {
    min-width: 110px;
    max-width: 180px;
}

.dept-cell {
    min-width: 90px;
    max-width: 150px;
}

.date-small { font-size: 12px; color: #757575; }

.operator-cell {
    min-width: 110px;
    max-width: 160px;
}
.operator-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--blue-800);
    display: flex;
    align-items: flex-start;
    gap: 4px;
    white-space: normal;
    word-break: break-word;
}
.operator-name i { color: var(--blue-600); font-size: 12px; flex-shrink: 0; margin-top: 1px; }

/* ── Status badges ───────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
}

.badge-warning {
    background: #fff8e1;
    color: #e65100;
    border: 1px solid #ffe082;
}

.badge-success {
    background: var(--blue-50);
    color: var(--blue-900);
    border: 1px solid #90caf9;
}

.badge-danger {
    background: #ffebee;
    color: #b71c1c;
    border: 1px solid #ef9a9a;
}

/* ── Action buttons ──────────────────────────────────────── */
.action-cell { white-space: nowrap; }

.btn-duyet {
    background: var(--blue-50);
    color: var(--blue-900);
    border: 1.5px solid #90caf9;
    border-radius: 7px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, color .2s, border-color .2s, box-shadow .2s;
}
.btn-duyet:hover {
    background: var(--blue-700);
    color: #fff;
    border-color: var(--blue-700);
    box-shadow: 0 2px 10px rgba(25,118,210,.38);
}

.btn-huy {
    background: #ffebee;
    color: #b71c1c;
    border: 1.5px solid #ef9a9a;
    border-radius: 7px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, color .2s, border-color .2s;
}
.btn-huy:hover {
    background: #b71c1c;
    color: #fff;
    border-color: #b71c1c;
}

/* ── Empty state ─────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #9e9e9e;
}
.empty-state i {
    font-size: 52px;
    display: block;
    margin-bottom: 14px;
    opacity: .5;
}
.empty-state p { font-size: 15px; }

/* ── Pagination ──────────────────────────────────────────── */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 20px;
    border-top: 1px solid #f0f0f0;
    background: #fafcff;
}

.page-info {
    font-size: 13px;
    color: #5f6b7a;
}

.page-info strong { color: var(--blue-800); }

.page-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--blue-800);
    background: #fff;
    border: 1.5px solid #c8ddf5;
    text-decoration: none;
    transition: background .15s, border-color .15s, color .15s, transform .12s;
    cursor: pointer;
}
.page-btn:hover {
    background: var(--blue-50);
    border-color: var(--blue-600);
    color: var(--blue-900);
    transform: translateY(-1px);
}
.page-btn.active {
    background: linear-gradient(135deg, var(--blue-800), var(--blue-600));
    border-color: var(--blue-700);
    color: #fff;
    box-shadow: 0 2px 8px rgba(25,118,210,.30);
    pointer-events: none;
}

.page-ellipsis {
    font-size: 13px;
    color: #aaa;
    padding: 0 4px;
    line-height: 34px;
}

/* ── Note cell ───────────────────────────────────────────── */
.note-cell {
    min-width: 120px;
    max-width: 220px;
}

.btn-note {
    background: #f5f5f5;
    border: 1.5px solid #e0e0e0;
    border-radius: 7px;
    padding: 4px 8px;
    font-size: 13px;
    color: #bdbdbd;
    cursor: pointer;
    vertical-align: middle;
    transition: background .2s, border-color .2s, color .2s;
    flex-shrink: 0;
}
.btn-note:hover {
    background: var(--blue-50);
    border-color: var(--blue-600);
    color: var(--blue-700);
}
.btn-note.has-note {
    background: var(--blue-50);
    border-color: #90caf9;
    color: var(--blue-700);
}

.note-text {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #5f6b7a;
    line-height: 1.45;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* ── Session timeout toast ───────────────────────────────── */
.session-toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9999;
    max-width: 390px;
    width: calc(100vw - 48px);
}

.session-toast-inner {
    background: #fff;
    border-radius: 14px;
    border-left: 5px solid #f9a825;
    box-shadow: 0 4px 24px rgba(0,0,0,.18);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    animation: toastSlide .3s ease;
}

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

.session-toast-inner > i {
    font-size: 30px;
    color: #f9a825;
    flex-shrink: 0;
}

.toast-stay-btn {
    background: linear-gradient(135deg, var(--blue-800), var(--blue-600));
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background .2s;
}
.toast-stay-btn:hover {
    background: linear-gradient(135deg, var(--blue-900), var(--blue-800));
}

/* ── Nav back button (Dashboard link) ────────────────────── */
.nav-back-btn {
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,.90);
    background: rgba(255,255,255,.13);
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 8px;
    padding: 5px 13px;
    text-decoration: none;
    white-space: nowrap;
    transition: background .2s, transform .15s;
}
.nav-back-btn:hover {
    background: rgba(255,255,255,.24);
    color: #fff;
    transform: translateY(-1px);
}

/* ── Dashboard welcome ───────────────────────────────────── */
.dashboard-welcome {
    display: flex;
    align-items: center;
    gap: 18px;
    background: linear-gradient(120deg, var(--blue-900) 0%, var(--blue-700) 100%);
    color: #fff;
    border-radius: 16px;
    padding: 26px 32px;
    margin-bottom: 28px;
    box-shadow: 0 4px 20px rgba(13,71,161,.22);
}

.dashboard-welcome > i {
    font-size: 40px;
    opacity: .85;
    flex-shrink: 0;
}

.dw-title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
}

.dw-sub {
    font-size: 13px;
    opacity: .80;
    margin-top: 4px;
}

/* ── Dashboard grid ──────────────────────────────────────── */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.dash-card {
    background: #fff;
    border-radius: 16px;
    padding: 28px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    text-decoration: none;
    color: #212121;
    box-shadow: 0 2px 14px rgba(13,71,161,.09);
    border: 1.5px solid rgba(25,118,210,.10);
    transition: transform .22s ease, box-shadow .22s ease, border-color .2s;
    position: relative;
    overflow: hidden;
}
.dash-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 60%, rgba(25,118,210,.04) 100%);
    pointer-events: none;
}
.dash-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 32px rgba(13,71,161,.18);
    border-color: rgba(25,118,210,.30);
    color: #212121;
    text-decoration: none;
}

.dash-card-icon {
    width: 60px; height: 60px;
    flex-shrink: 0;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
}

.dc-blue { background: linear-gradient(135deg, var(--blue-800), var(--blue-600)); }
.dc-teal { background: linear-gradient(135deg, #00695c, #00897b); }

.dash-card-body { flex: 1; }

.dash-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a2533;
    margin-bottom: 5px;
}

.dash-card-desc {
    font-size: 13px;
    color: #6b7c93;
    line-height: 1.5;
}

.dash-card-arrow {
    font-size: 22px;
    color: #c8ddf5;
    flex-shrink: 0;
    transition: color .2s, transform .2s;
}
.dash-card:hover .dash-card-arrow {
    color: var(--blue-600);
    transform: translateX(3px);
}

/* ── Settings cards ──────────────────────────────────────── */
.settings-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 14px rgba(13,71,161,.09);
    border: 1.5px solid rgba(25,118,210,.10);
    margin-bottom: 20px;
    overflow: hidden;
}

.settings-card-header {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 13px 22px;
    background: linear-gradient(120deg, var(--blue-900) 0%, var(--blue-700) 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .3px;
}

.settings-card-body { padding: 22px 22px 18px; }

.settings-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.settings-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.settings-group label {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--blue-800);
    display: flex;
    align-items: center;
    gap: 5px;
}

.settings-input {
    border: 1.5px solid #c8ddf5;
    border-radius: 9px;
    padding: 8px 12px;
    font-size: 13.5px;
    background: #fafdff;
    color: #1a2533;
    width: 100%;
    height: 38px;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.settings-input:focus {
    outline: none;
    border-color: var(--blue-700);
    box-shadow: 0 0 0 3px rgba(25,118,210,.14);
    background: #fff;
}

/* Textarea tự co giãn – trông như input nhưng wrap khi text dài */
.settings-input-auto {
    height: auto !important;
    min-height: 38px;
    resize: none;
    overflow: hidden;
    line-height: 1.55;
    box-sizing: border-box;
    display: block;
    word-break: break-word;
    overflow-wrap: break-word;
    font-family: inherit;
}

.settings-qr-preview {
    max-width: 120px;
    max-height: 120px;
    border-radius: 10px;
    border: 2px solid #c8ddf5;
    object-fit: contain;
}

.settings-hour-preview {
    background: linear-gradient(120deg, #f3f8ff 0%, #eef5ff 100%);
    border: 1px solid #c8ddf5;
    border-radius: 9px;
    padding: 10px 16px;
    font-size: 13px;
    color: #4a5568;
}

/* ── Settings actions ────────────────────────────────────── */
.settings-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 8px 0 16px;
}

.btn-settings-save {
    background: linear-gradient(135deg, var(--blue-800), var(--blue-600));
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 28px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 10px rgba(25,118,210,.32);
    transition: background .2s, box-shadow .2s, transform .15s;
}
.btn-settings-save:hover {
    background: linear-gradient(135deg, var(--blue-900), var(--blue-800));
    box-shadow: 0 4px 18px rgba(25,118,210,.44);
    transform: translateY(-1px);
}

.btn-settings-cancel {
    background: #fff;
    color: #555;
    border: 1.5px solid #ddd;
    border-radius: 10px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: border-color .2s, color .2s;
}
.btn-settings-cancel:hover { border-color: var(--blue-600); color: var(--blue-800); }

/* ── Settings alert ──────────────────────────────────────── */
.settings-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 12px;
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
}

.settings-alert-ok {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1.5px solid #a5d6a7;
}
.settings-alert-ok i { font-size: 18px; }

.settings-alert-err {
    background: #fff3e0;
    color: #e65100;
    border: 1.5px solid #ffcc80;
    align-items: flex-start;
    font-size: 13px;
    font-weight: 400;
}
.settings-alert-err strong { font-size: 14px; font-weight: 700; }
.settings-alert-err i { font-size: 18px; flex-shrink: 0; margin-top: 1px; }

/* ── Processed lock label ────────────────────────────────── */
.processed-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #9e9e9e;
    white-space: nowrap;
}
.processed-label i { font-size: 11px; }

/* ── Nav-logo khi dùng ảnh thực ────────────────────────────── */
.nav-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

/* ── Settings: upload ảnh logo & banner ─────────────────────── */
.settings-img-upload-wrap {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    flex-wrap: wrap;
}

.settings-img-preview-box {
    width: 110px;
    height: 80px;
    flex-shrink: 0;
    border: 2px dashed #c8ddf5;
    border-radius: 10px;
    background: #f3f8ff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.settings-img-preview-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.settings-img-preview-box .placeholder-icon {
    font-size: 36px;
    color: #a0bcd8;
}

.settings-img-preview-box.logo-box {
    width: 80px;
    height: 80px;
    border-radius: 50%;
}

.settings-img-controls {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-upload-img {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--blue-800), var(--blue-600));
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    width: fit-content;
    transition: background .2s, transform .15s;
}
.btn-upload-img:hover {
    background: linear-gradient(135deg, var(--blue-900), var(--blue-800));
    transform: translateY(-1px);
}

.settings-input-url {
    border: 1.5px solid #c8ddf5;
    border-radius: 9px;
    padding: 7px 12px;
    font-size: 13px;
    background: #fafdff;
    color: #1a2533;
    width: 100%;
    height: 36px;
    transition: border-color .2s, box-shadow .2s;
}
.settings-input-url:focus {
    outline: none;
    border-color: var(--blue-700);
    box-shadow: 0 0 0 3px rgba(25,118,210,.14);
    background: #fff;
}

.upload-hint {
    font-size: 11.5px;
    color: #8a9bb0;
    line-height: 1.4;
}

/* ==================== LOADING OVERLAY ==================== */
#admin-loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(240, 245, 255, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 9000;
    align-items: center;
    justify-content: center;
}
#admin-loading-overlay.al-visible {
    display: flex;
}

.al-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    background: #fff;
    border-radius: 14px;
    padding: 28px 40px;
    box-shadow: 0 8px 32px rgba(13,71,161,0.14);
    border: 1px solid #dce8f8;
}

.al-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #dce8f8;
    border-top-color: var(--blue-700);
    border-radius: 50%;
    animation: al-spin 0.75s linear infinite;
}

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

.al-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--blue-900);
    letter-spacing: 0.2px;
}

/* Spinner nhỏ trong nút */
.al-btn-spinner {
    display: inline-block;
    width: 13px;
    height: 13px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: al-spin 0.75s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

/* ── Login page ─────────────────────────────────────────────── */
.login-page-body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle, rgba(0,91,153,.055) 1px, transparent 1px),
        radial-gradient(ellipse 65% 55% at 6% 10%,  rgba(0,119,194,.09) 0%, transparent 65%),
        radial-gradient(ellipse 55% 65% at 94% 90%, rgba(0,168,150,.07) 0%, transparent 65%),
        linear-gradient(150deg, #e8f2fc 0%, #f0f9f7 55%, #e6f6f6 100%);
    background-size: 26px 26px, 100% 100%, 100% 100%, 100% 100%;
    padding: 24px 16px;
}

.login-card {
    background: #fff;
    border-radius: 22px;
    box-shadow:
        0 2px 6px  rgba(0,91,153,.06),
        0 12px 40px rgba(0,91,153,.12),
        0 40px 80px rgba(0,91,153,.07);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
    border: 1px solid rgba(0,91,153,.08);
    animation: loginSlideUp .45s cubic-bezier(.22,.68,0,1.2) both;
}

@@keyframes loginSlideUp {
    from { opacity: 0; transform: translateY(28px) scale(.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1);   }
}

.login-header {
    background: linear-gradient(120deg, #003d6b 0%, #005b99 55%, #0077c2 100%);
    background-size: 200% 200%;
    animation: loginShimmer 8s ease-in-out infinite;
    padding: 34px 28px 26px;
    text-align: center;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.login-header::after {
    content: '';
    position: absolute;
    bottom: -18px; left: -10%; right: -10%;
    height: 40px;
    background: #fff;
    border-radius: 50% 50% 0 0 / 30px 30px 0 0;
}

@@keyframes loginShimmer {
    0%   { background-position: 0%   50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0%   50%; }
}

.login-icon-wrap {
    width: 72px;
    height: 72px;
    margin: 0 auto 14px;
    background: rgba(255,255,255,.18);
    border: 2px solid rgba(255,255,255,.35);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: #fff;
    backdrop-filter: blur(6px);
    overflow: hidden;
    transition: transform .3s;
}

.login-card:hover .login-icon-wrap { transform: rotate(-6deg) scale(1.06); }

.login-icon-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 14px;
}

.login-header h1 {
    font-size: 1rem;
    font-weight: 800;
    margin: 0 0 4px;
    letter-spacing: .3px;
    line-height: 1.35;
}

.login-header p {
    font-size: .82rem;
    opacity: .85;
    margin: 0;
}

.login-body {
    padding: 36px 28px 28px;
}

.login-label {
    font-size: .82rem;
    font-weight: 700;
    color: #005b99;
    margin-bottom: 5px;
    display: block;
}

.login-field-wrap {
    position: relative;
}

.login-field-wrap .field-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #aac4df;
    font-size: 15px;
    pointer-events: none;
    transition: color .2s;
}

.login-field-wrap:focus-within .field-icon { color: #0077c2; }

.login-field-wrap .login-input {
    border-radius: 10px;
    border: 1.5px solid #c8d6e5;
    padding: 10px 13px 10px 38px;
    font-size: .9rem;
    width: 100%;
    background: #fafdff;
    color: #1a2533;
    box-sizing: border-box;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

/* Input mật khẩu có thêm chỗ cho nút mắt bên phải */
.login-input-pwd { padding-right: 40px; }

/* Nút toggle hiện/ẩn mật khẩu */
.pwd-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px 5px;
    cursor: pointer;
    color: #8a9bb0;
    line-height: 1;
    transition: color .2s;
    border-radius: 6px;
}
.pwd-toggle:hover  { color: #0077c2; }
.pwd-toggle:focus  { outline: none; }
.pwd-toggle i      { font-size: 16px; display: block; }

.login-input:focus {
    outline: none;
    border-color: #0077c2;
    box-shadow: 0 0 0 3px rgba(0,119,194,.15);
    background: #fff;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #005b99 0%, #00a896 100%);
    border: none;
    border-radius: 11px;
    color: #fff;
    font-weight: 700;
    font-size: .95rem;
    letter-spacing: .4px;
    cursor: pointer;
    margin-top: 8px;
    box-shadow: 0 4px 14px rgba(0,91,153,.30);
    transition: background .2s, box-shadow .2s, transform .15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-login:hover {
    background: linear-gradient(135deg, #003d6b 0%, #007d6e 100%);
    box-shadow: 0 6px 20px rgba(0,91,153,.42), 0 0 20px rgba(0,168,150,.2);
    transform: translateY(-1px);
}

.btn-login:active { transform: translateY(0); box-shadow: 0 2px 8px rgba(0,91,153,.25); }

.login-error-msg {
    background: #fff0f0;
    border: 1px solid #ffa8a8;
    border-radius: 10px;
    padding: 10px 14px;
    color: #c0392b;
    font-size: .855rem;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-footer {
    text-align: center;
    font-size: .78rem;
    color: #8a9bb0;
    margin-top: 18px;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .admin-container { padding: 12px; }
    .stat-row { gap: 10px; }
    .stat-card { min-width: 130px; padding: 12px 14px; }
    .stat-num  { font-size: 22px; }
    .filter-form { flex-direction: column; padding: 14px 16px; }
    .filter-group, .filter-search { min-width: unset; width: 100%; }
    /* Filter actions: tìm kiếm full-width, đặt lại + xuất excel chia đôi hàng dưới */
    .filter-actions { width: 100%; flex-wrap: wrap; gap: 8px; }
    .btn-filter-search { flex: 1 1 100%; justify-content: center; }
    .btn-filter-reset, .btn-export-excel { flex: 1; justify-content: center; min-width: 0; }
    .filter-bar-title { padding: 10px 16px; }
    .dashboard-welcome { padding: 20px; gap: 14px; }
    .dw-title { font-size: 17px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .settings-row { grid-template-columns: 1fr; }
    .settings-actions { flex-direction: column; align-items: stretch; }
    .btn-settings-save, .btn-settings-cancel { justify-content: center; }
    .settings-img-upload-wrap { flex-direction: column; }
}
