/* Øl admin portal: clean CRUD dashboard (white sidebar, grey canvas, blue accent) */
:root {
    --a-bg: #f1f3f6;
    --a-surface: #ffffff;
    --a-line: #e4e7ec;
    --a-line-strong: #d0d5dd;
    --a-text: #1d2433;
    --a-muted: #667085;
    --a-primary: #1a73e8;
    --a-primary-hover: #155fc4;
    --a-primary-soft: #e8f1fd;
    --a-danger: #d92d20;
    --a-success: #12b76a;
    --a-warning: #f79009;
    --a-radius: 10px;
    --a-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
    --a-side-w: 248px;
    --a-top-h: 64px;
}

body.admin {
    background: var(--a-bg);
    color: var(--a-text);
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: .9375rem;
    -webkit-font-smoothing: antialiased;
}
.admin h1, .admin h2, .admin h3 { font-family: inherit; font-weight: 700; letter-spacing: -.01em; color: var(--a-text); }
:where(.admin a:not(.btn)) { color: var(--a-primary); }
.ai { width: 20px; height: 20px; flex: 0 0 auto; vertical-align: -4px; }
.ai-sm { width: 16px; height: 16px; vertical-align: -3px; }
.admin-skip { position: absolute; left: 1rem; top: .5rem; z-index: 2000; background: #fff; padding: .5rem 1rem; border-radius: 6px; }

/* ---------- Bootstrap tuning ---------- */
.admin .btn { border-radius: 8px; font-weight: 600; font-size: .875rem; padding: .5rem .9rem; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; }
.admin .btn-sm { padding: .3rem .6rem; font-size: .8125rem; }
.admin .btn-primary { background: var(--a-primary); border-color: var(--a-primary); color: #fff; }
.admin .btn-primary:hover, .admin .btn-primary:focus { background: var(--a-primary-hover); border-color: var(--a-primary-hover); color: #fff; }
.admin .btn-outline-secondary { color: var(--a-text); border-color: var(--a-line-strong); background: #fff; }
.admin .btn-outline-secondary:hover { background: #f9fafb; color: var(--a-text); border-color: var(--a-line-strong); }
.admin .btn-outline-danger { color: var(--a-danger); border-color: #fda29b; background: #fff; }
.admin .btn-outline-danger:hover { background: #fef3f2; color: var(--a-danger); }
.admin .btn-danger { background: var(--a-danger); border-color: var(--a-danger); }
.admin .btn-link { text-decoration: none; font-weight: 500; }
.admin .form-control, .admin .form-select { border-radius: 8px; border-color: var(--a-line-strong); font-size: .9375rem; padding: .55rem .8rem; }
.admin .form-control:focus, .admin .form-select:focus, .admin .form-check-input:focus { border-color: #84b4f4; box-shadow: 0 0 0 4px rgba(26, 115, 232, .15); }
.admin .form-check-input:checked { background-color: var(--a-primary); border-color: var(--a-primary); }
.admin .form-label { font-weight: 600; font-size: .875rem; margin-bottom: .35rem; }
.admin .form-text { color: var(--a-muted); }
.admin .badge { font-weight: 600; border-radius: 999px; padding: .35em .7em; }
.admin-alert { display: flex; align-items: center; gap: .5rem; border-radius: var(--a-radius); }
.admin-alert .btn-close { margin-left: auto; position: static; padding: .5rem; }
.admin-alert.alert-dismissible { padding-right: 1rem; }

/* ---------- Sidebar ---------- */
.admin-side {
    position: fixed; inset: 0 auto 0 0; z-index: 1040;
    width: var(--a-side-w);
    display: flex; flex-direction: column;
    background: var(--a-surface);
    border-right: 1px solid var(--a-line);
    transition: transform .25s ease;
}
.admin-side-head { display: flex; align-items: center; justify-content: space-between; height: var(--a-top-h); padding: 0 1rem 0 1.25rem; border-bottom: 1px solid var(--a-line); flex: 0 0 auto; }
.admin-brand { display: flex; align-items: center; gap: .6rem; color: var(--a-text) !important; text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.admin-side-nav { flex: 1 1 auto; overflow-y: auto; padding: .75rem .75rem 1rem; }
.admin-side-nav ul { list-style: none; margin: 0; padding: 0; }
.admin-nav-heading { margin: 1.1rem .75rem .35rem; font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #98a2b3; }
.admin-nav-subheading { margin: .6rem .75rem .2rem 1.6rem; font-size: .72rem; font-weight: 600; color: #667085; }
.admin-side-nav ul.admin-nav-sub { padding-left: .85rem; }
.admin-nav-sub .admin-nav-link { padding-top: .45rem; padding-bottom: .45rem; font-size: .875rem; }
.admin-nav-link {
    display: flex; align-items: center; gap: .75rem; width: 100%;
    padding: .55rem .75rem; margin: 1px 0;
    border: 0; border-radius: 8px; background: none;
    color: #344054 !important; text-decoration: none; font-weight: 500; font-size: .9rem; text-align: left;
}
.admin-nav-link .ai { color: #667085; }
.admin-nav-link:hover { background: #f5f7fa; }
.admin-nav-link.active { background: var(--a-primary-soft); color: var(--a-primary) !important; font-weight: 600; }
.admin-nav-link.active .ai { color: var(--a-primary); }
.admin-side-foot { flex: 0 0 auto; padding: .75rem; border-top: 1px solid var(--a-line); }
.admin-backdrop { position: fixed; inset: 0; z-index: 1035; background: rgba(16, 24, 40, .45); }

/* ---------- Top bar + content ---------- */
.admin-body { min-height: 100vh; display: flex; flex-direction: column; transition: margin-left .25s ease; }
.admin-signed-in .admin-body { margin-left: var(--a-side-w); }
.admin-top {
    position: sticky; top: 0; z-index: 1020;
    display: flex; align-items: center; gap: .75rem;
    height: var(--a-top-h); padding: 0 1.5rem;
    background: rgba(255, 255, 255, .92); backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--a-line);
}
.admin-top-title { font-weight: 600; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-top-right { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.admin-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; border-radius: 8px; background: none; color: #344054; }
.admin-icon-btn:hover { background: #f2f4f7; }
.admin-top-link { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .7rem; border-radius: 8px; color: #344054 !important; text-decoration: none; font-weight: 500; font-size: .875rem; }
.admin-top-link:hover { background: #f2f4f7; }
.admin-user { display: flex; align-items: center; gap: .6rem; padding: .3rem .5rem .3rem .3rem; border: 0; border-radius: 999px; background: none; color: var(--a-text); text-align: left; }
.admin-user:hover { background: #f2f4f7; }
.admin-avatar { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, #1a73e8, #5b9cf3); color: #fff; font-weight: 700; }
.admin-user-text { flex-direction: column; line-height: 1.15; max-width: 200px; }
.admin-user-text strong { font-size: .85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-user-text small { color: var(--a-muted); font-size: .75rem; }
.admin-dropdown { border-radius: var(--a-radius); border-color: var(--a-line); box-shadow: 0 12px 24px rgba(16, 24, 40, .12); padding: .4rem; min-width: 210px; }
.admin-dropdown .dropdown-item { display: flex; align-items: center; gap: .6rem; border-radius: 6px; padding: .5rem .65rem; font-size: .875rem; }
.admin-main { flex: 1; width: 100%; max-width: 1400px; padding: 1.75rem 1.75rem 3rem; }

/* Desktop: the menu button collapses the sidebar. */
@media (min-width: 992px) {
    .admin-nav-collapsed .admin-side { transform: translateX(-100%); }
    .admin-nav-collapsed .admin-body { margin-left: 0; }
}
/* Phones and tablets: sidebar becomes a slide-out drawer. */
@media (max-width: 991.98px) {
    .admin-side { transform: translateX(-100%); box-shadow: 0 0 40px rgba(16, 24, 40, .2); width: min(84vw, 300px); }
    .admin-nav-open .admin-side { transform: none; }
    .admin-nav-open { overflow: hidden; }
    .admin-signed-in .admin-body { margin-left: 0; }
    .admin-top { padding: 0 .75rem; }
    .admin-main { padding: 1.25rem 1rem 2.5rem; }
}
@media (prefers-reduced-motion: reduce) { .admin-side, .admin-body { transition: none; } }

/* ---------- Page header ---------- */
.admin-head { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: flex-end; margin-bottom: 1.25rem; }
.admin-head h1 { margin: 0; font-size: 1.5rem; }
.admin-head-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.admin-intro { color: var(--a-muted); margin: .35rem 0 0; max-width: 70ch; }
.admin-back { display: inline-flex; align-items: center; gap: .25rem; font-weight: 500; text-decoration: none; font-size: .875rem; margin-bottom: .35rem; }

/* ---------- Cards ---------- */
.admin-card, .admin-form, .admin-empty, .admin-panel {
    background: var(--a-surface); border: 1px solid var(--a-line); border-radius: var(--a-radius); box-shadow: var(--a-shadow);
}
.admin-card, .admin-form, .admin-empty { padding: 1.5rem; }
.admin-empty { text-align: center; padding: 3rem 1.5rem; color: var(--a-muted); }
.admin-empty > .ai { width: 40px; height: 40px; color: #98a2b3; margin-bottom: .75rem; }
.admin-form .req { color: var(--a-danger); }
.admin-form-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--a-line); }
.admin-card .admin-form-actions:first-child { margin-top: 0; }

/* ---------- Data table panel (list pages) ---------- */
.admin-panel { overflow: hidden; }
.admin-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--a-line); }
.admin-search { position: relative; flex: 1 1 260px; max-width: 360px; margin: 0; }
.admin-search .ai { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: #98a2b3; pointer-events: none; }
.admin-search .form-control { padding-left: 2.4rem; }
.admin-toolbar-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: .5rem; }
.admin-table { width: 100%; margin: 0; border-collapse: collapse; }
.admin-table thead th {
    background: var(--a-primary-soft); color: #344054;
    font-size: .8125rem; font-weight: 600; white-space: nowrap;
    padding: .5rem .85rem; border-bottom: 1px solid #d5e4fa;
}
.admin-table td { padding: .3rem .85rem; border-bottom: 1px solid var(--a-line); vertical-align: middle; font-size: .875rem; line-height: 1.35; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover td { background: #fafbfc; }
.admin-table .col-actions { text-align: right; white-space: nowrap; width: 1%; }
.admin-cell-clip { display: block; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-thumb { width: 30px; height: 30px; object-fit: cover; border-radius: 8px; border: 1px solid var(--a-line); background: #f2f4f7; }
.admin-dot { display: inline-flex; align-items: center; gap: .45rem; font-weight: 500; }
.admin-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--a-success); }
.admin-dot.off::before { background: var(--a-danger); }
.admin-act { display: inline-flex; gap: .15rem; }
.admin-act a, .admin-act button {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 6px; border: 0; background: none; color: #475467;
}
.admin-act a:hover, .admin-act button:hover { background: #f2f4f7; color: var(--a-primary); }
.admin-act .danger { color: var(--a-danger); }
.admin-act .danger:hover { background: #fef3f2; color: var(--a-danger); }
.admin-act .ai { width: 16px; height: 16px; }
.admin-table-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; padding: .85rem 1.25rem; border-top: 1px solid var(--a-line); color: var(--a-muted); font-size: .875rem; }
.admin-pager { display: flex; align-items: center; gap: .25rem; margin: 0; padding: 0; list-style: none; }
.admin-pager a, .admin-pager span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 34px; height: 34px; padding: 0 .55rem; border-radius: 8px;
    color: #344054; text-decoration: none; font-weight: 500; font-size: .8125rem;
}
.admin-pager a:hover { background: #f2f4f7; }
.admin-pager .current { background: var(--a-primary); color: #fff; }
.admin-pager .disabled { color: #c0c6d0; }

/* Phones: each table row becomes a stacked card with labels. */
@media (max-width: 767.98px) {
    .admin-toolbar { padding: .85rem; }
    .admin-search { max-width: none; flex-basis: 100%; }
    .admin-toolbar-actions { margin-left: 0; width: 100%; }
    .admin-toolbar-actions .btn { flex: 1 1 auto; }
    .admin-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; }
    .admin-table tr { padding: .5rem .85rem; border-bottom: 1px solid var(--a-line); }
    .admin-table tbody tr:last-child { border-bottom: 0; }
    .admin-table td { display: flex; justify-content: space-between; gap: 1rem; padding: .15rem 0; border: 0; text-align: right; }
    .admin-table td::before { content: attr(data-label); color: var(--a-muted); font-weight: 500; text-align: left; flex: 0 0 auto; }
    .admin-table td.col-first { font-weight: 600; }
    .admin-table td.col-actions { width: 100%; justify-content: flex-end; padding-top: .3rem; margin-top: .25rem; border-top: 1px dashed var(--a-line); }
    .admin-table td.col-actions::before { content: none; }
    .admin-table tbody tr:hover td { background: none; }
    .admin-cell-clip { max-width: 60vw; }
    .admin-table-foot { justify-content: center; text-align: center; }
}

/* ---------- Details ---------- */
.admin-details { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; margin: 0; }
.admin-details dt, .admin-details dd { padding: .8rem 0; border-bottom: 1px solid var(--a-line); margin: 0; }
.admin-details dt { color: var(--a-muted); font-weight: 500; padding-right: 1rem; }
.admin-details dt:last-of-type, .admin-details dd:last-of-type { border-bottom: 0; }
@media (max-width: 575.98px) {
    .admin-details { grid-template-columns: 1fr; }
    .admin-details dt { border-bottom: 0; padding-bottom: .1rem; }
    .admin-details dd { padding-top: 0; }
}
.admin-image-field { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; }
.admin-image-preview { width: 110px; height: 110px; object-fit: cover; border-radius: var(--a-radius); border: 1px solid var(--a-line); }

/* ---------- Dashboard ---------- */
.admin-tile {
    display: flex; align-items: flex-start; gap: 1rem; height: 100%;
    background: var(--a-surface); border: 1px solid var(--a-line); border-radius: var(--a-radius); box-shadow: var(--a-shadow);
    padding: 1.15rem 1.25rem; text-decoration: none; color: inherit !important; transition: box-shadow .15s, border-color .15s;
}
.admin-tile:hover { border-color: #b9d3f8; box-shadow: 0 6px 16px rgba(16, 24, 40, .08); }
.admin-tile-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 10px; background: var(--a-primary-soft); color: var(--a-primary); flex: 0 0 auto; }
.admin-tile.attention .admin-tile-icon { background: #fff4e5; color: var(--a-warning); }
.admin-tile-body { display: flex; flex-direction: column; min-width: 0; }
.admin-tile-label { color: var(--a-muted); font-size: .85rem; font-weight: 500; }
.admin-tile-value { font-size: 1.75rem; font-weight: 700; line-height: 1.2; }
.admin-tile-note { color: var(--a-primary); font-size: .8125rem; font-weight: 500; margin-top: .25rem; }

/* ---------- Gallery ---------- */
.admin-upload { margin-bottom: 1.25rem; }
.admin-gallery { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.admin-gallery figure { margin: 0; background: var(--a-surface); border: 1px solid var(--a-line); border-radius: var(--a-radius); overflow: hidden; box-shadow: var(--a-shadow); }
.admin-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.admin-gallery figcaption { display: flex; justify-content: space-between; align-items: center; padding: .4rem .4rem .4rem .75rem; font-size: .85rem; font-weight: 500; }
@media (max-width: 575.98px) { .admin-gallery { grid-template-columns: repeat(2, 1fr); gap: .6rem; } }

/* ---------- Sign-in pages ---------- */
.admin-guest .admin-main { display: flex; justify-content: center; align-items: flex-start; max-width: none; }
.admin-login { width: 100%; max-width: 420px; margin: 2.5rem auto; background: var(--a-surface); border: 1px solid var(--a-line); border-radius: 14px; box-shadow: 0 12px 32px rgba(16, 24, 40, .08); padding: 2rem; text-align: center; }
.admin-login img { width: 72px; height: 72px; }
.admin-login form { text-align: left; }
.admin-login h1 { font-size: 1.5rem; margin: 1rem 0 .5rem; }
.admin-login .btn { width: 100%; }
.admin-login .btn-link { width: auto; }
@media (max-width: 575.98px) { .admin-login { margin: 1rem auto; padding: 1.5rem 1.25rem; } }

/* Long text in list grids (e.g. FAQ answers): wrap, show up to 3 lines */
.admin-cell-wrap { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-width: 220px; max-width: 560px; white-space: normal; line-height: 1.35; }
@media (max-width: 767.98px) { .admin-cell-wrap { min-width: 0; max-width: 62vw; text-align: right; } }

/* ---------- Expenses ---------- */
.exp-periods { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.exp-pills { display: flex; flex-wrap: wrap; gap: .25rem; background: var(--a-surface); border: 1px solid var(--a-line); border-radius: 10px; padding: .25rem; }
.exp-pills a { padding: .4rem .75rem; border-radius: 7px; font-size: .8125rem; font-weight: 500; color: #475467 !important; text-decoration: none; white-space: nowrap; }
.exp-pills a:hover { background: #f2f4f7; }
.exp-pills a.active { background: var(--a-primary); color: #fff !important; }
.exp-range { display: flex; align-items: center; gap: .4rem; }
.exp-range .form-control { width: auto; padding: .35rem .5rem; font-size: .8125rem; }
.exp-stat {
    display: flex; flex-direction: column; height: 100%; padding: 1rem 1.15rem;
    background: var(--a-surface); border: 1px solid var(--a-line); border-left: 4px solid #98a2b3;
    border-radius: var(--a-radius); box-shadow: var(--a-shadow); color: inherit !important; text-decoration: none;
}
a.exp-stat:hover { box-shadow: 0 6px 16px rgba(16, 24, 40, .08); }
.exp-stat.paid { border-left-color: var(--a-success); }
.exp-stat.unpaid { border-left-color: var(--a-warning); }
.exp-stat.overdue { border-left-color: var(--a-danger); }
.exp-stat.overdue .exp-stat-value { color: var(--a-danger); }
.exp-stat-label { color: var(--a-muted); font-size: .8125rem; font-weight: 500; }
.exp-stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; }
.exp-stat-note { color: var(--a-muted); font-size: .8125rem; }
.exp-filters .form-select { width: auto; max-width: 200px; font-size: .875rem; padding-top: .5rem; padding-bottom: .5rem; }
.exp-amount { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.exp-badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.exp-badge.paid { background: #ecfdf3; color: #027a48; }
.exp-badge.unpaid { background: #fef3f2; color: #b42318; }
.exp-badge.overdue { background: #d92d20; color: #fff; }
.exp-cats ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.exp-cat-row { display: flex; justify-content: space-between; gap: .75rem; font-size: .8125rem; margin-bottom: .3rem; }
.exp-cat-row strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.exp-bar { height: 6px; background: #eef2f6; border-radius: 999px; overflow: hidden; }
.exp-bar span { display: block; height: 100%; background: var(--a-primary); border-radius: 999px; }
.admin .modal-content { border-radius: 14px; border: 0; }
.admin .modal-header, .admin .modal-footer { border-color: var(--a-line); }
.admin .input-group-text { border-color: var(--a-line-strong); background: #f9fafb; border-radius: 8px 0 0 8px; }
.admin .input-group .form-control { border-radius: 0 8px 8px 0; }
@media (max-width: 767.98px) {
    .exp-periods { flex-direction: column; align-items: stretch; }
    .exp-periods > * { min-width: 0; max-width: 100%; }
    .exp-pills { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
    .exp-range .form-control { min-width: 0; }
    .exp-range { flex-wrap: wrap; }
    .exp-range .form-control { flex: 1 1 120px; }
    .exp-filters .form-select { max-width: none; flex: 1 1 45%; }
    .exp-stat-value { font-size: 1.2rem; }
}
.admin-section-title { font-size: .8125rem !important; font-weight: 600 !important; text-transform: uppercase; letter-spacing: .06em; color: var(--a-muted) !important; margin: 0 0 .75rem; }
.admin .form-select { padding-right: 2.25rem; }
.exp-cats ul { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); column-gap: 2rem; }
.exp-badge.auto { background: var(--a-primary-soft); color: var(--a-primary); margin-left: .35rem; }
/* Same width for Paid / Unpaid / Overdue so the Auto-pay label lines up in one column on every row */
.exp-badge.paid, .exp-badge.unpaid, .exp-badge.overdue { min-width: 4.75rem; text-align: center; }

/* Vendor form: fixed-size address box */
textarea#f_Address { resize: none; height: calc(1.5em + 1.1rem + 2px); min-height: 0; overflow-y: auto; }

/* Show/hide password button inside the password field */
.admin-pw { position: relative; }
.admin-pw .form-control { padding-right: 2.75rem; }
.admin-pw-toggle { position: absolute; top: 50%; right: .35rem; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center;
    width: 2rem; height: 2rem; border: 0; border-radius: 6px; background: none; color: var(--a-muted, #667085); }
.admin-pw-toggle:hover { background: #f2f4f7; color: var(--a-primary); }
.admin-pw-toggle:focus-visible { outline: 2px solid var(--a-primary); outline-offset: 1px; }
.admin-pw-toggle .ai { width: 18px; height: 18px; }
.admin-pw-toggle .pw-hide, .admin-pw-toggle[aria-pressed="true"] .pw-show { display: none; }
.admin-pw-toggle[aria-pressed="true"] .pw-hide { display: inline-block; }

/* Confirm popup for deletes */
.admin-confirm { border: 0; border-radius: 12px; }
.admin-confirm .modal-body { padding: 1.5rem 1.5rem 1rem; text-align: center; }
.admin-confirm .modal-footer { border-top: 0; padding: 0 1.5rem 1.5rem; display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.admin-confirm .modal-footer > * { margin: 0; }
.admin-confirm-icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin-bottom: .75rem;
    border-radius: 50%; background: #fef3f2; color: var(--a-danger); }
.admin-confirm-icon .ai { width: 22px; height: 22px; }

/* Yes/no list columns shown as a check mark ([ShowInList(CheckMark = true)]) */
.admin-check { display: inline-flex; color: #039855; }
.admin-check .ai { width: 18px; height: 18px; stroke-width: 2.5; }

/* Sales grid */
.sales-scroll { max-height: 70vh; }
.sales-table { border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
.sales-table td, .sales-table th { white-space: nowrap; }
.sales-table thead th {
    position: sticky; top: 0; z-index: 2;
    background: #f8fafc; color: #475467; font-size: .72rem; font-weight: 600;
    letter-spacing: .05em; text-transform: uppercase; padding-top: .7rem; padding-bottom: .7rem;
    border-bottom: 1px solid var(--a-line);
}
.sales-table td { padding-top: .55rem; padding-bottom: .55rem; }
.sales-table tbody tr:nth-child(even) td { background: #fbfcfe; }
.sales-table tbody tr.is-weekend td.sales-date { box-shadow: inset 3px 0 0 #b2ccff; }
.sales-table tbody tr:hover td { background: #f2f6ff; }
/* Date column stays in view when scrolling sideways */
.sales-table th:first-child, .sales-table td:first-child { position: sticky; left: 0; z-index: 1; background: #fff; }
.sales-table thead th:first-child { z-index: 3; background: #f8fafc; }
.sales-date { line-height: 1.15; }
.sales-dow { display: block; font-size: .68rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #98a2b3; }
.sales-day { font-weight: 600; color: #1d2939; }
.sales-table .num.is-zero { color: #c0c6d0; }
.sales-table td.c-amount { font-weight: 600; color: #1d2939; }
.sales-table td.c-cashtips { color: #667085; font-style: italic; }
.sales-table td.c-disc:not(.is-zero) { color: #c4320a; }
.sales-table td.c-fees:not(.is-zero), .sales-table td.c-tax:not(.is-zero) { color: #475467; }
.sales-table td.c-net { font-weight: 700; color: #067647; background: #f3fbf6 !important; }
.sales-table thead th:last-child { color: #067647; }
.sales-table tfoot th, .sales-table tfoot td {
    position: sticky; bottom: 0; z-index: 1;
    font-weight: 700; color: #101828; background: #eef4ff; border-top: 2px solid #c7d7fe; padding-top: .7rem; padding-bottom: .7rem;
}
.sales-table tfoot th:first-child { z-index: 3; }
.sales-table tfoot td.c-net { background: #dcfae6 !important; color: #05603a; }
.sales-table tfoot td.c-disc { color: #c4320a; }
.sales-days { display: block; font-size: .68rem; font-weight: 500; color: #667085; letter-spacing: .02em; }
.sales-table thead th[draggable="true"]:hover { color: var(--a-primary); }
.sales-table thead th[draggable="true"]::before { content: "⋮⋮"; letter-spacing: -2px; margin-right: .35rem; color: #c0c6d0; opacity: 0; transition: opacity .15s; }
.sales-table thead th[draggable="true"]:hover::before, .sales-table thead th[draggable="true"]:focus-visible::before { opacity: 1; }
@media (max-width: 767.98px) {
    .sales-scroll { max-height: none; }
    .sales-table th:first-child, .sales-table td:first-child, .sales-table thead th, .sales-table tfoot th, .sales-table tfoot td { position: static; }
    .sales-table tbody tr:nth-child(even) td, .sales-table td.c-net { background: none !important; }
    .sales-table tfoot { display: block; width: 100%; }
    .sales-table tfoot tr { padding: .75rem 1.1rem; background: #eef4ff; border-top: 2px solid #c7d7fe; }
    .sales-table tfoot th, .sales-table tfoot td { display: flex; justify-content: space-between; width: 100%; border: 0; padding: .15rem 0; background: none !important; }
    .sales-table tfoot td::before { content: attr(data-label); color: var(--a-muted); font-weight: 500; }
    .sales-date .sales-dow { display: inline; margin-right: .3rem; }
}
.sales-table thead th[draggable="true"] { cursor: grab; user-select: none; }
.sales-table thead th.col-dragging { opacity: .45; }
.sales-table thead th.col-drop-left { box-shadow: inset 3px 0 0 var(--a-primary); }
.sales-table thead th.col-drop-right { box-shadow: inset -3px 0 0 var(--a-primary); }
.sales-calc { color: var(--a-primary); font-weight: 700; margin-left: 2px; cursor: help; }
.sales-table tbody tr.is-today td.sales-date .sales-day::after { content: "Today"; margin-left: .4rem; padding: .05rem .4rem; border-radius: 999px; font-size: .65rem; font-weight: 600; background: var(--a-primary); color: #fff; vertical-align: 1px; }
@media (min-width: 768px) {
    .sales-table thead th { white-space: normal; line-height: 1.25; vertical-align: bottom; letter-spacing: .04em; }
    .sales-table thead th.text-end { min-width: 5.5rem; }
    .sales-table td, .sales-table th { padding-left: .7rem; padding-right: .7rem; }
}
.sales-table tfoot th:first-child { background: #eef4ff; }
@media (max-width: 767.98px) {
    .sales-table td.sales-date { justify-content: flex-start; gap: .35rem; }
    .sales-table td.sales-date::before { margin-right: auto; }
    .sales-table tfoot th:first-child { background: none; }
}
.admin-days { display: flex; flex-wrap: wrap; gap: .4rem; }
.admin-days .btn { min-width: 6.25rem; border-radius: 999px; }
.admin-days.is-invalid ~ .invalid-feedback { display: block; }
.sales-table td.c-events:not(.is-zero) { color: #b54708; }
.exp-stat-value.sales-avg { color: #067647; }

/* Employee page */
.emp-name { font-weight: 600; text-decoration: none; }
.emp-name:hover, .emp-name[aria-current] { text-decoration: underline; }
.emp-shifts-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .85rem 1rem; border-bottom: 1px solid var(--bs-border-color-translucent, rgba(0,0,0,.08)); }
.emp-est { color: var(--bs-secondary-color, #6c757d); margin-left: .15rem; }
.emp-badge { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .7rem; font-weight: 600; font-style: normal; background: #dcfae6; color: #05603a; vertical-align: 1px; }
.emp-table thead th:last-child { color: inherit; }
.emp-table thead th:nth-child(8) { color: #067647; }
.sales-table td.c-hours { font-weight: 600; color: #1d2939; }
.sales-table tbody tr.is-overtime td { background: #fef3f2 !important; }
.sales-table tbody tr.is-overtime td.sales-date { box-shadow: inset 3px 0 0 #d92d20; }
.sales-table td.emp-over { color: #b42318; font-weight: 700; }
.emp-over-flag { display: inline-flex; align-items: center; justify-content: center; width: 1.1rem; height: 1.1rem; margin-right: .4rem; border-radius: 50%; background: #d92d20; color: #fff; font-size: .7rem; font-weight: 700; vertical-align: 1px; }
.emp-table tbody tr.is-selected td { background: #eef4ff !important; }
.emp-unit { font-size: .55em; font-weight: 500; color: var(--a-muted, #667085); }
.emp-badge-over { background: #fee4e2; color: #b42318; }
.sales-cancelled { display: inline-block; margin-left: .4rem; padding: .05rem .45rem; border-radius: 999px; font-size: .65rem; font-weight: 600; font-style: normal; background: #fee4e2; color: #b42318; vertical-align: 1px; }

/* Stats page */
.stats-controls { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.stats-custom { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem; }
.stats-taxopt { display: flex; align-items: center; align-self: center; padding: .35rem .75rem; background: var(--a-surface); border: 1px solid var(--a-line); border-radius: 10px; font-size: .875rem; }
.stats-taxopt .form-check-label { font-weight: 500; }
.exp-taxopt { display: flex; align-items: center; gap: .4rem; white-space: nowrap; font-size: .875rem; }
.exp-taxopt .form-check-label { font-weight: 500; }
.stats-custom fieldset { display: flex; align-items: center; gap: .35rem; margin: 0; }
.stats-custom legend { float: none; width: auto; font-size: .72rem; font-weight: 600; color: var(--a-muted); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 .2rem; padding: 0; }
.stats-custom fieldset { flex-wrap: wrap; }
.stats-custom legend { width: 100%; }
.stats-custom input[type=date] { width: 9.5rem; }
.stats-vs { color: var(--a-muted); font-size: .85rem; padding-bottom: .35rem; }
.stats-periods { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; font-size: .9rem; margin-bottom: 1rem; }
.stats-swatch { display: inline-block; width: .7rem; height: .7rem; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.stats-swatch.sw-a { background: #257de0; }
.stats-swatch.sw-b { background: #a3acb9; }
.stats-kpi-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .15rem; }
.stats-change { display: inline-flex; align-items: center; gap: .2rem; padding: .08rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.stats-change.good { background: #dcfae6; color: #05603a; }
.stats-change.bad { background: #fee4e2; color: #b42318; }
.stats-change.flat { background: #f2f4f7; color: #475467; }
.stats-chart header, .stats-table-head { padding: .9rem 1rem .25rem; }
.stats-chart header h2, .stats-table-head h2 { font-size: 1rem; margin: 0; }
.stats-chart header p { font-size: .8rem; color: var(--a-muted); margin: .1rem 0 0; }
.stats-canvas { position: relative; height: 280px; padding: .25rem .75rem .75rem; }
.stats-canvas-wide { height: 320px; }
.stats-table th[scope=row] { font-weight: 500; }
.stats-table tr.is-strong th, .stats-table tr.is-strong td.num { font-weight: 700; }
.stats-table tr.is-strong td { border-top: 1px solid var(--a-line-strong); }
.stats-table th[scope=row] { padding-left: 1rem; }
@media (max-width: 767.98px) {
    /* Stats: keep the side-by-side table as a real table on phones */
    .stats-table { display: table; width: 100%; }
    .stats-table thead { position: static; width: auto; height: auto; overflow: visible; clip: auto; display: table-header-group; }
    .stats-table tbody { display: table-row-group; }
    .stats-table tr { display: table-row; padding: 0; border: 0; }
    .stats-table th, .stats-table td { display: table-cell; width: auto; padding: .35rem .5rem; border-bottom: 1px solid var(--a-line); font-size: .8rem; }
    .stats-table td::before { content: none !important; }
    .stats-table th[scope=row] { padding-left: .75rem; }
    .stats-controls .exp-pills { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; }
    .stats-custom { width: 100%; }
    .stats-custom input[type=date] { width: 8.6rem; }
}

/* Passwords (vault) */
.vault-filter { display: flex; gap: .5rem; align-items: center; }
.vault-filter select { max-width: 13rem; }
.vault-name { font-weight: 600; text-decoration: none; }
.vault-name:hover { text-decoration: underline; }
.vault-site { display: block; font-size: .78rem; color: var(--a-muted) !important; text-decoration: none; }
.vault-site:hover { text-decoration: underline; }
.vault-cat { display: inline-block; padding: .1rem .5rem; border-radius: 999px; background: #f2f4f7; color: #344054; font-size: .75rem; font-weight: 500; white-space: nowrap; }
.vault-secret { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .05em; color: #475467; }
.vault-secret.is-shown { color: var(--a-text); background: #fffaeb; padding: 0 .3rem; border-radius: 4px; user-select: all; }
pre.vault-secret { white-space: pre-wrap; font-size: .85rem; padding: .5rem .75rem; background: #f9fafb; border: 1px solid var(--a-line); border-radius: 8px; }
pre.vault-secret.is-shown { background: #fffaeb; }
.vault-act { font-size: .8rem; text-decoration: none; }
.vault-soon { color: #b54708; font-weight: 600; }
.vault-key { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.vault-key code { background: #fff; padding: .3rem .5rem; border-radius: 6px; word-break: break-all; user-select: all; }
.vault-history { list-style: none; margin: 0; padding: 0 1rem 1rem; font-size: .875rem; }
.vault-history li { padding: .35rem 0; border-bottom: 1px solid var(--a-line); }
.vault-history li:last-child { border-bottom: 0; }
.vault-history time { color: var(--a-muted); margin-left: .35rem; }
.vault-hist-action { font-weight: 600; }
.admin-form-actions .ms-auto { margin-left: auto; }
.admin-foot-info { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; }
.admin-pagesize { display: inline-flex; align-items: center; gap: .35rem; margin: 0; font-size: .8125rem; color: var(--a-muted); }
.admin-pagesize .form-select { width: auto; padding-top: .15rem; padding-bottom: .15rem; font-size: .8125rem; }
.admin-dot.locked { color: #b42318; }
.admin-dot.locked::before { background: var(--a-danger); }
.admin-act button.admin-unlock { width: auto; padding: 0 .55rem; gap: .3rem; color: #b42318; border: 1px solid #fecdca; background: #fef3f2; font-size: .8rem; font-weight: 600; }
.admin-act button.admin-unlock:hover { background: #fee4e2; color: #912018; }
.admin-you { display: inline-block; margin-left: .35rem; padding: .05rem .45rem; border: 1px solid var(--a-line-strong); border-radius: 999px; font-size: .7rem; font-weight: 600; color: #475467; background: #f9fafb; vertical-align: 1px; }

/* Sign-in log */
.signin-result { display: inline-block; padding: .08rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.signin-result.fail { background: #fee4e2; color: #b42318; }
.signin-result.ok { background: #dcfae6; color: #05603a; }
.signin-ips { list-style: none; margin: 0; padding: 0 1rem 1rem; font-size: .875rem; }
.signin-ips li { position: relative; padding: .5rem 2.5rem .5rem 0; border-bottom: 1px solid var(--a-line); }
.signin-ips li:last-child { border-bottom: 0; }
.signin-ips a { font-weight: 600; text-decoration: none; font-variant-numeric: tabular-nums; }
.signin-ip-count { position: absolute; right: 0; top: .5rem; min-width: 1.8rem; text-align: center; padding: .05rem .45rem; border-radius: 999px; background: #fee4e2; color: #b42318; font-weight: 700; font-size: .75rem; }
@media (min-width: 768px) { .signin-table td { white-space: nowrap; } }
