/* ============================================================
   Colombo Marathon 2026 — Admin Panel Stylesheet (admin.css)
   Loaded ALONGSIDE assets/css/style.css (never instead of it),
   so every :root variable, .btn, .field-input, .alert, .acc-*
   accent, etc. from the public site is already available here.
   This file only adds admin-specific layout and components —
   it never redefines or overrides anything from style.css.
============================================================ */

/* ---------------- Admin shell / layout ---------------- */
.admin-shell {
    flex: 1;
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
    padding: 28px 20px 60px;
}
.admin-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 24px;
}
.admin-page-head h1 { font-size: 22px; font-weight: 700; color: var(--ink); margin: 0 0 4px; }
.admin-page-head p { font-size: 13px; color: var(--ink-soft); margin: 0; }

/* ---------------- Stat cards (dashboard) ---------------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow);
    padding: 20px 22px;
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--acc, var(--blue));
}
.stat-card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.stat-card-icon {
    width: 42px; height: 42px;
    border-radius: 11px;
    background: var(--acc-tint, var(--blue-light));
    color: var(--acc, var(--blue));
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.stat-card-value { font-size: 30px; font-weight: 800; color: var(--ink); font-family: 'Poppins', sans-serif; line-height: 1; margin-bottom: 6px; }
.stat-card-label { font-size: 12.5px; color: var(--ink-soft); font-weight: 600; }
.stat-card-sub { font-size: 11px; color: var(--ink-faint); margin-top: 3px; }

.stat-hero {
    background: linear-gradient(120deg, var(--blue-deep) 0%, var(--blue-dark) 60%, var(--blue) 130%);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    padding: 26px 28px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 22px;
}
.stat-hero-value { font-size: 42px; font-weight: 800; font-family: 'Poppins', sans-serif; line-height: 1; }
.stat-hero-label { font-size: 13px; color: #cfe1f1; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 6px; }
.stat-hero-split { display: flex; gap: 28px; flex-wrap: wrap; }
.stat-hero-split-item { text-align: center; }
.stat-hero-split-item .n { font-size: 24px; font-weight: 800; font-family: 'Poppins', sans-serif; }
.stat-hero-split-item .l { font-size: 11px; color: #cfe1f1; text-transform: uppercase; letter-spacing: 0.4px; margin-top: 2px; }

/* ---------------- Breakdown cards (country / age / gender) ---------------- */
.breakdown-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 18px;
    margin-bottom: 22px;
    align-items: start;
}
.breakdown-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow);
    padding: 22px 24px;
}
.breakdown-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.breakdown-card-head .bc-icon {
    width: 34px; height: 34px;
    border-radius: 9px;
    background: var(--blue-light);
    color: var(--blue);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.breakdown-card-head h3 { font-size: 15px; font-weight: 700; color: var(--ink); margin: 0; }
.breakdown-card-head p { font-size: 11.5px; color: var(--ink-soft); margin: 1px 0 0; }

.bc-row { margin-bottom: 13px; }
.bc-row:last-child { margin-bottom: 0; }
.bc-row-top { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; margin-bottom: 5px; }
.bc-row-top .bc-name { color: var(--ink); font-weight: 600; }
.bc-row-top .bc-count { color: var(--ink-soft); font-weight: 700; }
.bc-bar-track { height: 8px; border-radius: 6px; background: var(--page-bg); overflow: hidden; }
.bc-bar-fill { height: 100%; border-radius: 6px; background: var(--blue); transition: width 0.3s ease; }
.bc-scroll { max-height: 320px; overflow-y: auto; padding-right: 4px; }
.bc-scroll::-webkit-scrollbar { width: 6px; }
.bc-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }
.bc-empty { text-align: center; color: var(--ink-faint); font-size: 13px; padding: 20px 0; }

/* Gender split bar */
.gender-split-bar {
    display: flex;
    height: 34px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 14px;
}
.gender-split-bar div { display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; color: #fff; }
.gender-split-legend { display: flex; gap: 20px; flex-wrap: wrap; }
.gender-split-legend-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-soft); }
.gender-split-legend-dot { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }

/* ---------------- Filter bar (users list) ---------------- */
.filter-bar {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow);
    padding: 16px 20px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 18px;
}
.filter-bar .field { margin-bottom: 0; flex: 1; min-width: 160px; }
.filter-bar .field.filter-search { flex: 2; min-width: 220px; }
.filter-bar label { display: block; font-size: 11px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 6px; }

/* ---------------- Data table ---------------- */
.table-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.table-responsive { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 820px; }
.data-table th {
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 13px 16px;
    background: var(--page-bg);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.data-table td {
    padding: 13px 16px;
    font-size: 13px;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
    white-space: nowrap;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--blue-light); }
.data-table .reg-no-cell { font-weight: 700; color: var(--blue-deep); font-family: 'Poppins', sans-serif; }
.data-table .name-cell { font-weight: 600; }
.data-table .muted-cell { color: var(--ink-soft); }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    background: var(--acc-tint, var(--blue-light));
    color: var(--acc, var(--blue-deep));
    white-space: nowrap;
}
.badge-status-active { background: var(--green-tint); color: #00863d; }
.badge-status-inactive { background: var(--red-tint); color: var(--red); }
.badge-gender-male { background: var(--blue-light); color: var(--blue-deep); }
.badge-gender-female { background: #fbe7f0; color: #b3184f; }

.table-empty { text-align: center; padding: 50px 20px; color: var(--ink-soft); }
.table-empty .te-icon { color: var(--ink-faint); margin: 0 auto 12px; }

/* ---------------- Pagination ---------------- */
.admin-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--line);
    font-size: 12.5px;
    color: var(--ink-soft);
}
.pagination-links { display: flex; gap: 6px; }
.pagination-links a, .pagination-links span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
    border: 1px solid var(--line);
}
.pagination-links a:hover { border-color: var(--blue); color: var(--blue); }
.pagination-links .current { background: var(--blue); color: #fff; border-color: var(--blue); }
.pagination-links .disabled { opacity: 0.4; pointer-events: none; }

/* ---------------- View Profile action button ---------------- */
.btn-sm { padding: 7px 14px; font-size: 12.5px; border-radius: 8px; }

/* ---------------- Admin login lockout note ---------------- */
.lockout-note {
    background: var(--red-tint);
    color: var(--red);
    border: 1px solid #f3c2c5;
    border-radius: var(--r-sm);
    padding: 12px 15px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 20px;
}

/* ---------------- User detail page ---------------- */
.detail-shell {
    flex: 1;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    padding: 28px 20px 60px;
}
.detail-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
    margin-bottom: 16px;
}
.detail-back:hover { color: var(--blue); }

.detail-header {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow);
    padding: 26px 28px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.detail-avatar {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: var(--acc, var(--blue));
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; font-weight: 700;
    font-family: 'Poppins', sans-serif;
    flex-shrink: 0;
}
.detail-header h1 { font-size: 19px; font-weight: 700; color: var(--ink); margin: 0 0 4px; }
.detail-header .dh-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.detail-header-actions { margin-left: auto; }

.detail-section {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow);
    padding: 22px 26px;
    margin-bottom: 18px;
}
.detail-section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.detail-section-head .ds-icon {
    width: 32px; height: 32px;
    border-radius: 9px;
    background: var(--blue-light);
    color: var(--blue);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.detail-section-head h3 { font-size: 14.5px; font-weight: 700; color: var(--ink); margin: 0; }

.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 24px; }
.detail-item .di-label { font-size: 11px; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 5px; }
.detail-item .di-value { font-size: 14px; color: var(--ink); font-weight: 500; }
.detail-item .di-value.empty { color: var(--ink-faint); font-style: italic; font-weight: 400; }

.doc-link-row { display: flex; align-items: center; gap: 12px; background: var(--page-bg); border-radius: var(--r-md); padding: 13px 16px; }
.doc-link-row .dl-icon {
    width: 36px; height: 36px;
    border-radius: 9px;
    background: var(--surface);
    color: var(--blue);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: var(--shadow);
}
.doc-link-row .dl-text { font-size: 13px; font-weight: 600; color: var(--ink); flex: 1; }
.doc-link-row .dl-missing { font-size: 13px; color: var(--ink-faint); font-style: italic; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1100px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .breakdown-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .stat-hero { flex-direction: column; align-items: flex-start; }
    .detail-grid { grid-template-columns: 1fr; }
    .detail-header { flex-direction: column; align-items: flex-start; }
    .detail-header-actions { margin-left: 0; width: 100%; }
    .detail-header-actions .btn { width: 100%; }
}

@media (max-width: 560px) {
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .stat-card-value { font-size: 24px; }
    .filter-bar .field { min-width: 100%; }
}
