/* admin.css — SA Vietnam Admin Panel styles
 * Extracted from admin.html for maintainability.
 * Loaded by admin.html via <link rel="stylesheet">.
 */

/* ── Reset & Base (unchanged, keep existing styles) ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "DM Sans", sans-serif; background: #f0efed; color: #1c1c1c; min-height: 100vh; }

/* Brand gradient reused */
.login-brand-hdr { width: 100%; max-width: 400px; border-radius: 12px; overflow: hidden; position: relative; height: 72px; display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; box-shadow: 0 4px 20px rgba(0,0,0,0.10); background: linear-gradient(to right, #f5e8e8 0%, #faf2ee 25%, #ffffff 50%, #eef5f0 75%, #e8eef5 100%); }
.login-brand-band-top { position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(to right, #DA251D, #FFCD00 30%, #ffffff 50%, #007A4D 70%, #0032A0); }
.login-brand-band-bot { position: absolute; bottom: 0; left: 0; right: 0; height: 4px; background: linear-gradient(to right, #DA251D, #FFCD00 30%, #ffffff 50%, #007A4D 70%, #0032A0); }
.login-brand-inner { position: relative; z-index: 2; text-align: center; padding: 0 1rem; }
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem; background: #f0efed; }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 16px; border: 0.5px solid rgba(0,0,0,0.07); box-shadow: 0 2px 20px rgba(0,0,0,0.06); overflow: hidden; }
.login-card-accent { height: 4px; background: linear-gradient(to right, #DA251D, #FFCD00 30%, #ffffff 50%, #007A4D 70%, #0032A0); }
.login-head { padding: 1.75rem 1.75rem 1.25rem; display: flex; align-items: center; gap: 14px; border-bottom: 0.5px solid rgba(0,0,0,0.07); }
.login-head-icon { width: 42px; height: 42px; border-radius: 10px; flex-shrink: 0; background: linear-gradient(135deg, #1a3e8c, #0f6e56); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.login-head-title { font-size: 17px; font-weight: 700; color: #1c1c1c; line-height: 1.2; }
.login-head-sub   { font-size: 12px; color: #555; margin-top: 3px; }
.login-body { padding: 1.5rem 1.75rem 1.75rem; }
.login-err { background: #fdecea; border: 0.5px solid #f5c4c4; border-left: 4px solid #DA251D; border-radius: 8px; padding: 10px 13px; font-size: 13px; color: #c0241c; margin-bottom: 1rem; display: none; }
.fg { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.fg label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; color: #444; }
.fg input, .fg select, .fg textarea { width: 100%; font-family: inherit; font-size: 13px; border: 0.5px solid #ddd; border-radius: 8px; padding: 10px 12px; outline: none; background: #fff; transition: border-color 0.15s, box-shadow 0.15s; }
.fg input:focus, .fg select:focus, .fg textarea:focus { border-color: #1a3e8c; box-shadow: 0 0 0 3px rgba(26,62,140,0.09); }
.btn { font-family: inherit; font-size: 13px; font-weight: 600; padding: 9px 18px; border-radius: 8px; border: none; cursor: pointer; transition: opacity 0.15s; display: inline-flex; align-items: center; gap: 7px; justify-content: center; letter-spacing: 0.2px; white-space: nowrap; }
.btn-primary { background: linear-gradient(135deg, #1a3e8c, #0f6e56); color: #fff; }
.btn-primary:hover { opacity: 0.88; }
.btn-secondary { background: #fff; color: #1c1c1c; border: 0.5px solid #ccc; }
.btn-secondary:hover { background: #f8f8f6; }
.btn-danger { background: #fdecea; color: #c0241c; border: 0.5px solid #f5c4c4; }
.btn-danger:hover { background: #fad4d0; }
.btn-sm { font-size: 12px; padding: 6px 13px; border-radius: 7px; }
.btn-full { width: 100%; }
.app { display: none; min-height: 100vh; }
.app.hidden { display: none !important; }
.topbar { position: sticky; top: 0; z-index: 200; background: #fff; border-bottom: 0.5px solid rgba(0,0,0,0.07); box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.topbar-accent { height: 4px; background: linear-gradient(to right, #DA251D, #FFCD00 30%, #ffffff 50%, #007A4D 70%, #0032A0); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; padding: 0 2rem; height: 52px; }
.topbar-brand { font-size: 15px; font-weight: 700; color: #1c1c1c; letter-spacing: 0.3px; text-transform: uppercase; }
.topbar-brand em { font-style: normal; color: #1a3e8c; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-user { font-size: 13px; font-weight: 600; color: #444; }
.app-body { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 56px); }
.sidebar { background: #fff; border-right: 0.5px solid rgba(0,0,0,0.07); padding: 1rem 0.5rem; position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; }
.nav-section { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: #aaa; padding: 10px 14px 5px; }
.sidebar a { display: flex; align-items: center; gap: 9px; padding: 9px 14px; border-radius: 10px; font-size: 13px; font-weight: 500; color: #444; text-decoration: none; cursor: pointer; transition: background 0.13s; margin-bottom: 1px; }
.sidebar a:hover { background: #f5f4f0; color: #1c1c1c; }
.sidebar a.active { background: #eef4ff; color: #1a3e8c; font-weight: 600; }
.nav-icon { font-size: 15px; width: 20px; text-align: center; }
.main { padding: 1.75rem 2rem; overflow-y: auto; }
.panel { display: none; }
.panel.active { display: block; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 0.75rem; }
.panel-head-left { display: flex; align-items: center; gap: 12px; }
.panel-icon { width: 38px; height: 38px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 18px; box-shadow: 0 1px 4px rgba(0,0,0,0.12); }
.panel-icon.blue  { background: linear-gradient(135deg, #1a3e8c, #2457b3); }
.panel-icon.red   { background: linear-gradient(135deg, #c0241c, #e02d23); }
.panel-icon.green { background: linear-gradient(135deg, #0f6e56, #17916e); }
.panel-icon.amber { background: linear-gradient(135deg, #8a5500, #c47d00); }
.panel-icon.dark  { background: linear-gradient(135deg, #2a2a2a, #444); }
.panel-title { font-size: 17px; font-weight: 700; color: #1c1c1c; }
.panel-sub   { font-size: 12px; color: #555; margin-top: 2px; }
.section-card { background: #fff; border-radius: 16px; border: 0.5px solid rgba(0,0,0,0.07); box-shadow: 0 2px 20px rgba(0,0,0,0.06); overflow: hidden; margin-bottom: 1.5rem; }
.section-card-accent { height: 4px; background: linear-gradient(to right, #DA251D, #FFCD00 30%, #ffffff 50%, #007A4D 70%, #0032A0); }
.section-card-header { display: flex; align-items: center; gap: 14px; padding: 1.1rem 1.5rem; border-bottom: 0.5px solid rgba(0,0,0,0.07); }
.section-card-icon { width: 38px; height: 38px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 18px; box-shadow: 0 1px 4px rgba(0,0,0,0.12); }
.section-card-icon.blue  { background: linear-gradient(135deg, #1a3e8c, #2457b3); }
.section-card-icon.green { background: linear-gradient(135deg, #0f6e56, #17916e); }
.section-card-title { font-size: 15px; font-weight: 700; }
.section-card-sub { font-size: 12px; color: #555; margin-top: 2px; }
.section-card-actions { margin-left: auto; display: flex; gap: 8px; }
.section-card-body { padding: 1.25rem 1.5rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: #fff; border-radius: 14px; border: 0.5px solid rgba(0,0,0,0.07); box-shadow: 0 2px 12px rgba(0,0,0,0.05); padding: 1.1rem 1.25rem; }
.stat-value { font-size: 26px; font-weight: 700; line-height: 1; margin-bottom: 5px; }
.stat-label { font-size: 11px; color: #777; font-weight: 500; }
.stat-value.blue { color: #1a3e8c; }
.stat-value.green { color: #0f6e56; }
.stat-value.red { color: #c0241c; }
.stat-value.amber { color: #c47d00; }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; padding: 1rem 1.5rem; border-bottom: 0.5px solid rgba(0,0,0,0.06); background: #fafaf8; align-items: center; }
.filter-bar input, .filter-bar select { font-family: inherit; font-size: 13px; border: 0.5px solid #ddd; border-radius: 8px; padding: 8px 11px; background: #fff; outline: none; transition: border-color 0.15s; }
.filter-bar input:focus, .filter-bar select:focus { border-color: #1a3e8c; box-shadow: 0 0 0 3px rgba(26,62,140,0.08); }
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead tr { border-bottom: 0.5px solid rgba(0,0,0,0.09); }
th { text-align: left; padding: 10px 12px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: #777; background: #fafaf8; white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 0.5px solid #f2f2ef; vertical-align: middle; }
tbody tr:hover td { background: #f8f8f6; }
.mono { font-family: "DM Mono", monospace; font-size: 12px; letter-spacing: 0.3px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; }
.badge-booked    { background: #fef3dc; color: #8a5500; border: 0.5px solid #f0d898; }
.badge-confirmed { background: #e8f5e9; color: #2e7d32; border: 0.5px solid #b8ddc0; }
.badge-dispatched, .badge-in-transit { background: #e3f2fd; color: #1565c0; border: 0.5px solid #b8d8f5; }
.badge-delivered { background: #e0f4ec; color: #0f6e56; border: 0.5px solid #b8ddc8; }
.badge-cancelled { background: #fdecea; color: #c0241c; border: 0.5px solid #f5c4c4; }
.badge-verified  { background: #e0f4ec; color: #0f6e56; border: 0.5px solid #b8ddc0; }
.badge-rejected  { background: #fdecea; color: #c0241c; border: 0.5px solid #f5c4c4; }
.badge-active    { background: #e0f4ec; color: #0f6e56; border: 0.5px solid #b8ddc0; }
.badge-pending   { background: #fef3dc; color: #8a5500; border: 0.5px solid #f0d898; }
.badge-packed    { background: #f3e8ff; color: #6b21a8; border: 0.5px solid #d8b4fe; }
.badge-customs   { background: #fdecea; color: #9a3412; border: 0.5px solid #fca5a5; }
.badge-inactive  { background: #f5f4f0; color: #888; border: 0.5px solid #ddd; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.35); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.form-row.single { grid-template-columns: 1fr; }
.form-row.thirds { grid-template-columns: 1fr 1fr 1fr; }
.form-section-label { font-size: 11px; font-weight: 700; letter-spacing: 0.7px; text-transform: uppercase; color: #777; padding-top: 1rem; padding-bottom: 0.4rem; border-top: 0.5px solid rgba(0,0,0,0.07); margin-top: 0.5rem; margin-bottom: 0.5rem; }
.config-tabs { display: flex; gap: 0; border-bottom: 0.5px solid rgba(0,0,0,0.09); margin-bottom: 1.25rem; overflow-x: auto; }
.config-tab { padding: 9px 18px; font-size: 13px; font-weight: 600; cursor: pointer; color: #777; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color 0.15s; white-space: nowrap; }
.config-tab:hover { color: #1c1c1c; }
.config-tab.active { color: #1a3e8c; border-bottom-color: #1a3e8c; }
.config-section { display: none; padding: 0.25rem 0; }
.config-section.active { display: block; }
.modal-bg { position: fixed; inset: 0; background: rgba(28,28,28,0.55); z-index: 500; display: none; align-items: center; justify-content: center; padding: 1rem; }
.modal-bg.open { display: flex; }
.modal { background: #fff; border-radius: 16px; max-width: 740px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: 0 8px 40px rgba(0,0,0,0.18); }
.modal-accent { height: 4px; background: linear-gradient(to right, #DA251D, #FFCD00 30%, #fff 50%, #007A4D 70%, #0032A0); }
.modal-head { padding: 1rem 1.5rem; border-bottom: 0.5px solid rgba(0,0,0,0.07); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: #fff; }
.modal-head h3 { font-size: 16px; font-weight: 700; color: #1c1c1c; letter-spacing: 0.1px; }
.modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: #aaa; width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: #f5f4f0; }
.modal-body { padding: 1.25rem 1.5rem; }
.modal-footer { padding: 0.9rem 1.5rem; border-top: 0.5px solid rgba(0,0,0,0.07); display: flex; gap: 8px; justify-content: flex-end; position: sticky; bottom: 0; background: #fff; }
.divider { height: 0.5px; background: rgba(0,0,0,0.08); margin: 1rem 0; }
.empty-state { text-align: center; padding: 3rem 1rem; color: #bbb; font-size: 14px; letter-spacing: 0.2px; }
.info-box { background: #f0f7ff; border: 0.5px solid #b8d4f8; border-left: 4px solid #1a3e8c; border-radius: 10px; padding: 0.9rem 1.1rem; font-size: 13px; margin-bottom: 1rem; }
.warn-box { background: #fffbeb; border: 0.5px solid #f0d070; border-left: 4px solid #FFCD00; border-radius: 10px; padding: 0.9rem 1.1rem; margin-bottom: 1rem; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px); background: #1c1c1c; color: #fff; padding: 11px 20px; border-radius: 10px; font-size: 13px; font-weight: 500; z-index: 9999; transition: transform 0.28s; pointer-events: none; white-space: nowrap; }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { background: #0f6e56; }
.toast.error { background: #DA251D; }
.checkbox-col { width: 28px; text-align: center; }
.bulk-bar { background: #eef4ff; border-radius: 10px; border: 0.5px solid #c5d8f8; padding: 8px 16px; margin-bottom: 1rem; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* ── Enhancements from suggestions #1–16 ──────────────────── */

/* Dashboard revenue section */
#dashboard-revenue .stat-card { box-shadow: none; border: 0.5px solid #ededea; }

/* Dashboard quick-link alerts — clickable */
#dashboard-alerts a { text-decoration: none; }
#dashboard-alerts a:hover { text-decoration: underline; }

/* Flight capacity bar */
.capacity-bar { height: 6px; background: #eee; border-radius: 3px; margin-top: 4px; overflow: hidden; }
.capacity-bar-fill { height: 100%; border-radius: 3px; transition: width 0.3s; }
.capacity-bar-fill.ok   { background: #0f6e56; }
.capacity-bar-fill.warn { background: #c47d00; }
.capacity-bar-fill.over { background: #c0241c; }

/* Booking history tab */
#bk-tab-history { max-height: 380px; overflow-y: auto; padding-right: 4px; }
#bk-history-list > div:last-child { border-bottom: none; }

/* Discount row — expiry warnings */
#discounts-tbody tr.expiring-soon { background: #fffbeb; }
#discounts-tbody tr.expired       { opacity: 0.55; }

/* POP mismatch highlight */
#pop-tbody tr.mismatch { background: #fff8f0; }

/* Config pricing preview */
#pricing-preview .info-box { border-left: 3px solid #FFCD00; }

/* Config diff table */
.diff-table { width: 100%; font-size: 12px; margin-top: 8px; border-collapse: collapse; }
.diff-table th { text-align: left; padding: 4px 8px; background: #f8f8f6; font-weight: 600; font-size: 11px; }
.diff-table td { padding: 5px 8px; border-top: 0.5px solid #f0f0ec; }
.diff-was  { color: #c0241c; }
.diff-now  { color: #0f6e56; }

/* Booking edit — activity log tab title */
.config-tab { cursor: pointer; }

/* Analytics modal table */
#bk-modal-body table { width: 100%; font-size: 12px; border-collapse: collapse; }
#bk-modal-body table th { text-align: left; padding: 5px 8px; background: #f8f8f6; font-size: 11px; font-weight: 600; }
#bk-modal-body table td { padding: 5px 8px; border-top: 0.5px solid #f0f0ec; }

/* POP quick-approve button */
.btn-primary.btn-sm { font-size: 11px; }

/* Notify customer checkbox row */
#bk-modal-body label[for="edit-notify"] { font-weight: 400; color: #555; }

/* Stat value size adjustment for long numbers (revenue) */
.stat-value[style*="14px"] { letter-spacing: -0.3px; }

/* Hide main site header and top navigation when admin mode is active */
body.admin-mode .hdr,
body.admin-mode .site-nav {
  display: none !important;
}
/* Hide main site header and navigation on the admin page (login screen) */
.hdr,
.site-nav {
  display: none !important;
}