/* ══════════════════════════════════════════════
   DASHBOARD PAGE — dashboard.css
   Requires: base.css loaded before this file.
   ══════════════════════════════════════════════ */


/* ── LAYOUT SHELL ────────────────────────────────────────────────────────────── */
.page-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
}


/* ── TOP ROW: KPI CARDS ──────────────────────────────────────────────────────── */
.db-top-row {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}

.db-stat {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: border-color .15s ease, transform .15s ease, background .15s ease;
}

.db-stat:hover {
    border-color: rgba(249, 115, 22, .35);
    transform: translateY(-1px);
}

/* Top accent line — default grey */
.db-stat::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: #f3f4f6;
    border-radius: 10px 10px 0 0;
}

/* Orange accent on the primary KPI */
.db-stat--accent::before {
    background: var(--color-accent, #F97316);
}

.db-stat--attention::before {
    background: #F97316;
}

.db-stat--success::before {
    background: #16a34a;
}

.db-stat__label {
    font-size: 10px;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: .07em;
}

.db-stat__val {
    font-size: 26px;
    font-weight: 700;
    color: var(--color-primary, #2E3A4D);
    line-height: 1.1;
    letter-spacing: -.02em;
}

.db-stat__val--money {
    font-size: 20px;
    line-height: 1.2;
}

.db-stat__sub {
    font-size: 11px;
    color: #c0c0c0;
    margin-top: 2px;
}

.db-stat__sub strong {
    color: var(--color-primary, #2E3A4D);
    font-weight: 600;
}

.db-summary-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.db-mini-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.db-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.db-metric {
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid #f0f0f0;
    border-radius: 7px;
    background: #fafafa;
}

.db-metric span {
    display: block;
    font-size: 10px;
    color: #9ca3af;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0;
    white-space: nowrap;
}

.db-metric strong {
    display: block;
    margin-top: 3px;
    font-size: 15px;
    line-height: 1.2;
    color: var(--color-primary, #2E3A4D);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.db-mini-note {
    font-size: 11px;
    color: #9ca3af;
    line-height: 1.35;
}


/* ── SHARED CARD ─────────────────────────────────────────────────────────────── */
.db-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.db-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.db-card__title {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--color-primary, #2E3A4D);
}

.db-pill {
    font-size: 10px;
    font-weight: 500;
    color: #9ca3af;
    background: #f3f4f6;
    padding: 2px 9px;
    border-radius: 20px;
    white-space: nowrap;
}

.db-pill--live {
    color: #15803d;
    background: #f0fdf4;
}


/* ── MID ROW: BREAKDOWN + CHART ──────────────────────────────────────────────── */
.db-mid-row {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.9fr);
    gap: 12px;
}


/* ── BOOKING BREAKDOWN BARS ──────────────────────────────────────────────────── */
.db-seg-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.db-seg {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.db-seg__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.db-seg__name {
    font-size: 12px;
    font-weight: 500;
    color: #374151;
}

.db-seg__count {
    font-size: 11px;
    color: #9ca3af;
}

.db-seg__sep {
    color: #e5e7eb;
    margin: 0 3px;
}

.db-seg__track {
    height: 5px;
    background: #f3f4f6;
    border-radius: 99px;
    overflow: hidden;
}

.db-seg__fill {
    height: 100%;
    border-radius: 99px;
    transition: width .6s ease;
}


/* ── DAILY CHART ─────────────────────────────────────────────────────────────── */
.db-chart-wrap {
    position: relative;
    width: 100%;
    height: 190px;
}


/* ── BOTTOM ROW ──────────────────────────────────────────────────────────────── */
.db-bottom-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
}


/* ── RECENT BOOKINGS TABLE ───────────────────────────────────────────────────── */
.db-tbl-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.db-tbl-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.db-tbl-wrap {
    overflow-x: auto;
}

.db-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.db-table thead th {
    text-align: left;
    padding: 8px 14px;
    font-size: 10px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: .06em;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
    white-space: nowrap;
}

.db-table tbody tr {
    border-bottom: 1px solid #f9f9f9;
    transition: background .12s;
}

.db-table tbody tr:last-child {
    border-bottom: none;
}

.db-table tbody tr:hover td {
    background: #fafafa;
}

.db-table tbody td {
    padding: 10px 14px;
    color: #374151;
    vertical-align: middle;
    white-space: nowrap;
}

.db-ref {
    font-family: var(--font-reference);
    font-variant-numeric: tabular-nums;
    font-size: 11px;
    font-weight: 600;
    background: #f1f5f9;
    color: var(--color-primary, #2E3A4D);
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0;
}

.db-muted {
    font-size: 11px;
    color: #9ca3af;
}

.db-empty-row td {
    text-align: center;
    color: #d1d5db;
    padding: 40px 20px !important;
    font-size: 12px;
}

.db-empty-row i {
    font-size: 24px;
    display: block;
    margin-bottom: 8px;
    color: #e5e7eb;
}


/* ── STATUS BADGES ───────────────────────────────────────────────────────────── */
.db-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 10.5px;
    font-weight: 500;
    white-space: nowrap;
}

.db-badge::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
}

.db-badge--pending   { background: #fef9ec; color: #92650a; }
.db-badge--approved  { background: #f0fdf4; color: #15803d; }
.db-badge--completed { background: #eff6ff; color: #1d4ed8; }
.db-badge--rejected  { background: #fff1f1; color: #b91c1c; }
.db-badge--cancelled { background: #f3f4f6; color: #6b7280; }

.db-badge--pending::before   { background: #ca8a04; }
.db-badge--approved::before  { background: #16a34a; }
.db-badge--completed::before { background: #2563eb; }
.db-badge--rejected::before  { background: #ef4444; }
.db-badge--cancelled::before { background: #9ca3af; }


/* ── ACTIVITY FEED ───────────────────────────────────────────────────────────── */
.db-activity {
    display: flex;
    flex-direction: column;
}

.db-act {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 10px 0;
    border-bottom: 1px solid #f9f9f9;
}

.db-act:last-child {
    border-bottom: none;
}

.db-act__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}

.db-act__body {
    flex: 1;
    min-width: 0;
}

.db-act__text {
    font-size: 12px;
    color: #374151;
    line-height: 1.4;
}

.db-act__text b {
    color: var(--color-primary, #2E3A4D);
    font-weight: 600;
}

.db-act__detail {
    font-size: 11.5px;
    color: #64748b;
    line-height: 1.35;
    margin-top: 1px;
}

.db-act__time {
    font-size: 11px;
    color: #c0c0c0;
    margin-top: 2px;
}

.db-act--empty {
    padding: 18px 0;
}

.db-insights-card {
    gap: 12px;
}

.db-insights-sub {
    margin: -4px 0 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.45;
}

.db-insights-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.db-insight {
    min-width: 0;
    display: flex;
    gap: 10px;
    padding: 12px;
    border: 1px solid #eef2f7;
    border-radius: 8px;
    background: #fafafa;
    color: inherit;
    text-decoration: none;
    transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.db-insight:hover {
    border-color: rgba(249, 115, 22, .32);
    background: #fff;
    transform: translateY(-1px);
}

.db-insight--wide {
    grid-column: 1 / -1;
}

.db-insight__icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: rgba(59, 130, 246, .1);
    color: #2563eb;
    font-size: 13px;
}

.db-insight__icon--attention {
    background: rgba(249, 115, 22, .12);
    color: #ea580c;
}

.db-insight__icon--verify {
    background: rgba(124, 58, 237, .1);
    color: #7c3aed;
}

.db-insight__icon--success {
    background: rgba(22, 163, 74, .1);
    color: #16a34a;
}

.db-insight__body {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.db-insight__label {
    color: #94a3b8;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.db-insight__body strong {
    color: var(--color-primary, #2E3A4D);
    font-size: 17px;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.db-insight__body span:last-child {
    color: #64748b;
    font-size: 11.5px;
    line-height: 1.35;
}

.db-insights-list {
    display: grid;
    gap: 8px;
}

.db-insight-row {
    min-width: 0;
    display: flex;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid #eef2f7;
    border-radius: 8px;
    background: #fafafa;
    color: inherit;
    text-decoration: none;
}

a.db-insight-row {
    transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

a.db-insight-row:hover {
    border-color: rgba(249, 115, 22, .32);
    background: #fff;
    transform: translateY(-1px);
}

.db-insight__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.db-insight__top strong {
    color: var(--color-primary, #2E3A4D);
    font-size: 12.5px;
    line-height: 1.25;
}

.db-insight-row .db-insight__body > span:not(.db-insight__top):not(.db-insight-actions) {
    color: #64748b;
    font-size: 11.5px;
    line-height: 1.4;
}

.db-insight-pill {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 9.5px;
    font-weight: 800;
    white-space: nowrap;
}

.db-insight-pill.is-good {
    background: rgba(22, 163, 74, .1);
    color: #15803d;
}

.db-insight-pill.is-warning {
    background: rgba(249, 115, 22, .12);
    color: #c2410c;
}

.db-insight-pill.is-neutral {
    background: rgba(100, 116, 139, .1);
    color: #64748b;
}

.db-insight-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.db-insight-actions a {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    background: rgba(249, 115, 22, .1);
    color: #c2410c;
    font-size: 10.5px;
    font-weight: 800;
    text-decoration: none;
}

.db-empty-inline {
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 12px;
    border: 1px dashed #e5e7eb;
    border-radius: 8px;
    background: #fafafa;
}


/* ── RESPONSIVE ──────────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .db-top-row { grid-template-columns: repeat(3, 1fr); }
    .db-summary-row { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .db-mid-row,
    .db-bottom-row { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .db-top-row { grid-template-columns: repeat(2, 1fr); }
    .db-stat__val { font-size: 22px; }
    .db-stat__val--money { font-size: 17px; }
    .db-metrics { grid-template-columns: 1fr; }
    .db-insights-grid { grid-template-columns: 1fr; }
    .db-insight--wide { grid-column: auto; }
}

/* Dashboard readability polish */
.db-stat,
.db-card,
.db-tbl-card {
    border-radius: 8px;
    box-shadow: none;
}

.db-stat {
    min-height: 116px;
    justify-content: space-between;
}

.db-stat__label,
.db-card__title {
    letter-spacing: 0;
}

.db-stat__val {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
}

.db-seg__track {
    height: 7px;
}

.db-chart-wrap {
    min-height: 210px;
}

.db-table tbody td {
    padding-top: 12px;
    padding-bottom: 12px;
}

.db-activity {
    gap: 2px;
}

.db-act {
    padding: 12px 0;
}

body.admin-dark-mode-active .db-stat,
body.admin-dark-mode-active .db-card,
body.admin-dark-mode-active .db-tbl-card,
body.admin-dark-mode-active .db-mini-card {
    background: #1b2233;
    border-color: rgba(148, 163, 184, .18);
}

body.admin-dark-mode-active .db-stat:hover {
    border-color: rgba(249, 115, 22, .45);
}

body.admin-dark-mode-active .db-stat::before {
    background: rgba(148, 163, 184, .14);
}

body.admin-dark-mode-active .db-stat--accent::before {
    background: var(--color-accent);
}

body.admin-dark-mode-active .db-stat__val,
body.admin-dark-mode-active .db-card__title,
body.admin-dark-mode-active .db-seg__name,
body.admin-dark-mode-active .db-act__text,
body.admin-dark-mode-active .db-act__text b,
body.admin-dark-mode-active .db-ref,
body.admin-dark-mode-active .db-metric strong,
body.admin-dark-mode-active .db-insight__body strong,
body.admin-dark-mode-active .db-insight__top strong {
    color: #f1f5f9;
}

body.admin-dark-mode-active .db-stat__label,
body.admin-dark-mode-active .db-stat__sub,
body.admin-dark-mode-active .db-seg__count,
body.admin-dark-mode-active .db-act__detail,
body.admin-dark-mode-active .db-muted,
body.admin-dark-mode-active .db-metric span,
body.admin-dark-mode-active .db-mini-note,
body.admin-dark-mode-active .db-insights-sub,
body.admin-dark-mode-active .db-insight__body span:last-child,
body.admin-dark-mode-active .db-insight-row .db-insight__body > span:not(.db-insight__top):not(.db-insight-actions) {
    color: #94a3b8;
}

body.admin-dark-mode-active .db-pill,
body.admin-dark-mode-active .db-ref,
body.admin-dark-mode-active .db-seg__track,
body.admin-dark-mode-active .db-metric,
body.admin-dark-mode-active .db-empty-inline,
body.admin-dark-mode-active .db-insight,
body.admin-dark-mode-active .db-insight-row {
    background: #252d3f;
}

body.admin-dark-mode-active .db-metric,
body.admin-dark-mode-active .db-empty-inline,
body.admin-dark-mode-active .db-insight,
body.admin-dark-mode-active .db-insight-row {
    border-color: rgba(148, 163, 184, .14);
}

body.admin-dark-mode-active .db-insight:hover,
body.admin-dark-mode-active a.db-insight-row:hover {
    background: #1f293b;
    border-color: rgba(249, 115, 22, .32);
}

body.admin-dark-mode-active .db-insight-pill.is-good {
    background: rgba(34, 197, 94, .14);
    color: #86efac;
}

body.admin-dark-mode-active .db-insight-pill.is-warning {
    background: rgba(249, 115, 22, .16);
    color: #fdba74;
}

body.admin-dark-mode-active .db-insight-pill.is-neutral {
    background: rgba(148, 163, 184, .14);
    color: #cbd5e1;
}

body.admin-dark-mode-active .db-insight-actions a {
    background: rgba(249, 115, 22, .16);
    color: #fdba74;
}

body.admin-dark-mode-active .db-tbl-head,
body.admin-dark-mode-active .db-table thead th,
body.admin-dark-mode-active .db-table tbody tr,
body.admin-dark-mode-active .db-act {
    border-color: rgba(148, 163, 184, .12);
}
.schedule-warning-card {
    margin: 16px 0;
}

.schedule-missing-days {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.schedule-missing-days span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(249, 115, 22, .1);
    color: #c2410c;
    font-size: 12px;
    font-weight: 700;
}
