/* ============================================
   TIPFITI MASTER STYLESHEET
   Shared across all pages — admin, business, public
   ============================================ */

/* ----- Fonts ----- */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=IBM+Plex+Mono:wght@500;600&display=swap');

/* ----- CSS Variables (Theme) ----- */
:root {
    --bg: #f7f3eb;
    --surface: #fffdfa;
    --ink: #242426;
    --muted: #72706d;
    --line: #dedbd4;
    --teal: #075f5b;
    --teal2: #0d7771;
    --tint: #e1f2ef;
    --amber: #d88916;
    --amber-bg: #fbefd9;
    --risk: #c65a49;
    --risk-bg: #f8e7e2;
    --radius: 16px;
    --shadow: 0 18px 55px rgba(22, 58, 53, 0.10);
    --shadow-soft: 0 8px 30px rgba(22, 58, 53, 0.07);
    --focus: 0 0 0 4px rgba(13, 119, 113, 0.16);
    --yellow: #facd0f;
}

/* ----- Reset & Base ----- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

[hidden] {
    display: none !important;
}

html {
    scroll-behavior: smooth;
    overflow-x: clip;
}

body {
    background: var(--bg);
    color: var(--ink);
    font: 14px/1.55 'DM Sans', sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    margin: 0;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ----- Public vs Portal Body ----- */
.public-body {
    overflow-x: clip;
}

.portal-body {
    --workspace-header-height: 104px;
    --workspace-footer-height: 52px;
    height: 100dvh;
    overflow: hidden;
}

/* ----- Links ----- */
a {
    color: inherit;
    text-decoration: none;
}

/* ----- Buttons ----- */
button {
    cursor: pointer;
    border: 0;
    font: inherit;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border-radius: 10px;
    min-height: 44px;
    padding: 0 18px;
    font-size: 13px;
    font-weight: 700;
    transition: transform 0.16s, box-shadow 0.16s, background 0.16s;
    border: none;
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: scale(0.97);
}

.btn:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    box-shadow: var(--focus);
    outline: none;
}

.btn-primary {
    background: var(--teal);
    color: #fff;
    box-shadow: 0 8px 20px rgba(7, 95, 91, 0.20);
}

.btn-primary:hover {
    background: var(--teal2);
}

.btn-secondary {
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink);
}

.btn-secondary:hover {
    background: var(--bg);
}

.btn-danger {
    background: var(--risk-bg);
    color: var(--risk);
}

.btn-danger-solid {
    color: #fff;
    background: #a83f31;
    box-shadow: 0 8px 20px rgba(168, 63, 49, 0.18);
}

.btn-quiet {
    color: var(--ink);
    border: 1px solid var(--line);
    background: transparent;
}

.btn-small {
    padding: 8px 11px;
    font-size: 11px;
    min-height: 36px;
}

.btn-compact {
    white-space: nowrap;
    min-height: 36px;
    padding: 8px 12px;
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    box-shadow: none;
    transform: none;
}

/* ----- Icon Button ----- */
.icon-button {
    width: 40px;
    height: 40px;
    color: var(--muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
}

.icon-button:hover {
    color: var(--teal);
    background: var(--tint);
}

.icon-button svg {
    width: 18px;
    height: 18px;
}

/* ----- Badges ----- */
.badge {
    text-transform: uppercase;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
}

.badge.ok,
.badge.active,
.badge.success,
.badge.verified,
.badge.settled,
.badge.paid,
.badge.resolved,
.badge.approved {
    background: var(--tint);
    color: var(--teal);
}

.badge.pending,
.badge.processing,
.badge.unverified {
    background: var(--amber-bg);
    color: #8a580f;
}

.badge.risk,
.badge.failed,
.badge.rejected,
.badge.suspended,
.badge.dismissed {
    background: var(--risk-bg);
    color: var(--risk);
}

.badge.new {
    background: var(--tint);
    color: var(--teal);
}

.badge.neutral {
    color: var(--muted);
    background: #f2f5f4;
}

/* ----- Cards ----- */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    transition: border-color 0.18s, box-shadow 0.18s;
    box-shadow: 0 1px rgba(255, 255, 255, 0.8);
}

.card:hover {
    box-shadow: var(--shadow-soft);
    border-color: #cbc7be;
}

.card h2,
.card h3 {
    margin: 0 0 16px;
    font-family: 'DM Sans', sans-serif;
    letter-spacing: -0.02em;
}

/* ----- Grid System ----- */
.grid {
    gap: 18px;
    display: grid;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* ----- Container ----- */
.container {
    width: min(1240px, 100% - 40px);
    margin: 0 auto;
}

/* ----- Typography ----- */
.serif,
h1,
h2,
h3 {
    font-family: 'Fraunces', serif;
}

.mono {
    font-family: 'IBM Plex Mono', monospace;
}

.muted {
    color: var(--muted);
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--teal);
    font-size: 11px;
    font-weight: 700;
}

/* ----- Forms ----- */
.field {
    gap: 7px;
    margin: 18px 0;
    display: grid;
}

.field label {
    font-size: 12px;
    font-weight: 700;
    color: #2e3431;
}

.field input,
.field select,
.field textarea {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    outline: none;
    width: 100%;
    padding: 13px 14px;
    font: inherit;
    color: #222825;
    min-height: 48px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px var(--tint);
}

.field input[readonly],
.field input:disabled {
    color: #757d79;
    cursor: not-allowed;
    background: #f1f3f2;
}

.field input[aria-invalid="true"],
.field select[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
    border-color: var(--risk);
    box-shadow: 0 0 0 3px rgba(198, 90, 73, 0.12);
}

.field-help {
    color: var(--muted);
    margin: 7px 0 0;
    font-size: 12px;
}

.field-error {
    color: var(--risk);
    margin: 7px 0 0;
    font-size: 12px;
    font-weight: 600;
}

.form-row {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    display: grid;
}

.form-actions {
    align-items: center;
    gap: 12px;
    padding-top: 20px;
    display: flex;
}

.form-section {
    border-top: 1px solid var(--line);
    margin-top: 13px;
    padding-top: 13px;
}

.form-section h3 {
    margin: 0 0 10px;
    font-size: 15px;
}

/* ----- Dialogs / Modals ----- */
.ui-dialog {
    width: min(620px, 100% - 32px);
    max-height: min(86vh, 820px);
    color: var(--ink);
    background: transparent;
    border: 0;
    padding: 0;
    overflow: visible;
}

.ui-dialog-sm {
    width: min(470px, 100% - 32px);
}

.ui-dialog-md {
    width: min(620px, 100% - 32px);
}

.ui-dialog-lg {
    width: min(820px, 100% - 32px);
}

.ui-dialog::backdrop {
    backdrop-filter: blur(4px);
    background: rgba(18, 29, 28, 0.58);
}

.ui-dialog[open] {
    animation: 0.18s cubic-bezier(0.2, 0.8, 0.2, 1) dialog-in;
}

@keyframes dialog-in {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(0.985);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ui-dialog[open] {
        animation: none;
    }
}

.ui-dialog-panel {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 18px;
    max-height: min(86vh, 820px);
    overflow: auto;
    box-shadow: 0 30px 90px rgba(8, 35, 32, 0.28);
}

.ui-dialog-header {
    z-index: 2;
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
    background: rgba(255, 253, 250, 0.96);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    padding: 22px 24px 18px;
    position: sticky;
    top: 0;
}

.ui-dialog-header h2 {
    margin: 0;
    font-size: 24px;
}

.ui-dialog-header p {
    color: var(--muted);
    margin: 5px 0 0;
    font-size: 13px;
}

.ui-dialog-body {
    padding: 22px 24px 24px;
}

.dialog-actions {
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
    padding-top: 18px;
}

/* ----- Confirmation Dialog ----- */
.confirmation-callout {
    color: #704507;
    background: var(--amber-bg);
    border: 1px solid #ead3aa;
    border-radius: 12px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
}

.confirmation-callout svg {
    flex: 0 0 auto;
    width: 20px;
}

.confirmation-callout p {
    margin: 0;
}

.confirmation-reason {
    display: grid;
    gap: 7px;
    margin-top: 16px;
}

.confirmation-reason[hidden] {
    display: none;
}

.confirmation-reason label {
    font-size: 12px;
    font-weight: 700;
}

.confirmation-reason textarea {
    resize: vertical;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 9px;
    width: 100%;
    min-height: 104px;
    padding: 11px 12px;
}

/* ----- Tables ----- */
.table-wrap {
    overflow: auto;
}

.data-table {
    border-collapse: collapse;
    width: 100%;
    min-width: 720px;
    font-size: 12px;
}

.data-table th {
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
    padding: 11px;
    font-size: 10px;
    background: #fafbfa;
    height: 42px;
}

.data-table td {
    border-bottom: 1px solid var(--line);
    padding: 14px 11px;
    font-variant-numeric: tabular-nums;
}

.data-table tbody tr {
    transition: background 0.14s;
}

.data-table tbody tr:hover {
    background: rgba(225, 242, 239, 0.42);
}

.data-table td:first-child,
.data-table th:first-child {
    padding-left: 16px;
}

.data-table td:last-child,
.data-table th:last-child {
    padding-right: 16px;
}

.data-table tr:last-child td {
    border-bottom: 0;
}

.sortable-heading {
    color: inherit;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sortable-heading span:last-child {
    color: #9aa29e;
    font-size: 11px;
}

.sortable-heading:hover,
.sortable-heading.active,
.sortable-heading.active span:last-child {
    color: var(--teal);
}

/* ----- Table Toolbar ----- */
.table-toolbar {
    border-bottom: 1px solid var(--line);
    background: #fafbfa;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
    padding: 14px;
}

.table-toolbar-main {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 9px;
    flex: 1;
}

.table-toolbar-end {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 9px;
    flex: 0 0 auto;
}

.table-search {
    width: min(300px, 100%);
    position: relative;
}

.table-search>svg {
    color: #89918d;
    pointer-events: none;
    width: 15px;
    height: 15px;
    position: absolute;
    top: 50%;
    left: 11px;
    transform: translateY(-50%);
}

.table-search input {
    background: #fff;
    border: 1px solid #dfe3df;
    border-radius: 8px;
    width: 100%;
    min-height: 38px;
    padding: 0 36px 0 34px;
    font-size: 12px;
}

.toolbar-field {
    display: grid;
    gap: 5px;
}

.toolbar-field label {
    color: #68716d;
    letter-spacing: 0.045em;
    text-transform: uppercase;
    font-size: 9px;
    font-weight: 750;
}

.toolbar-field select,
.toolbar-field input {
    min-width: 132px;
    min-height: 38px;
    color: var(--ink);
    background-color: #fff;
    border: 1px solid #dfe3df;
    border-radius: 8px;
    padding: 0 30px 0 10px;
    font-size: 11px;
}

.rows-field select {
    min-width: 68px;
}

/* ----- Data Table Card ----- */
.data-table-card {
    padding: 0;
    overflow: hidden;
}

.data-table-toolbar-slot {
    border-bottom: 0;
}

.data-table-content {
    min-height: 116px;
    position: relative;
}

.data-table-card .table-wrap {
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.data-table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    min-height: 58px;
    padding: 10px 16px;
}

.data-table-footer>p {
    color: var(--muted);
    margin: 0;
    font-size: 10px;
}

/* ----- Table Skeleton Loading ----- */
.table-skeleton {
    padding: 8px 15px;
    display: none;
}

.data-table-card.is-loading .table-wrap,
.data-table-card.is-loading .data-table-footer {
    visibility: hidden;
    pointer-events: none;
    position: absolute;
}

.data-table-card.is-loading .table-skeleton {
    display: block;
}

.skeleton-row {
    border-bottom: 1px solid #eef0ee;
    display: grid;
    grid-auto-columns: minmax(70px, 1fr);
    grid-auto-flow: column;
    align-items: center;
    gap: 18px;
    min-height: 49px;
}

.skeleton-row span {
    display: block;
    width: var(--skeleton-width);
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(90deg, #edf0ed 25%, #f7f8f7 50%, #edf0ed 75%) 0 0 / 220% 100%;
    animation: 1.25s ease-in-out infinite table-shimmer;
}

@keyframes table-shimmer {
    to {
        background-position: -220% 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .skeleton-row span {
        background: #edf0ed;
        animation: none;
    }
}

/* ----- Pagination ----- */
.pagination {
    margin-top: 18px;
}

[role="navigation"][aria-label="Pagination Navigation"] {
    color: var(--muted);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 20px;
    font-size: 12px;
}

[role="navigation"][aria-label="Pagination Navigation"]>div:last-child {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    width: 100%;
}

[role="navigation"][aria-label="Pagination Navigation"]>div:last-child>div:last-child>span {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(16, 48, 45, 0.06);
}

[role="navigation"][aria-label="Pagination Navigation"] a,
[role="navigation"][aria-label="Pagination Navigation"] span[aria-current="page"]>span,
[role="navigation"][aria-label="Pagination Navigation"] span[aria-disabled="true"]>span {
    border-right: 1px solid var(--line);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    line-height: 1;
}

[role="navigation"][aria-label="Pagination Navigation"] span> :last-child {
    border-right: 0;
}

[role="navigation"][aria-label="Pagination Navigation"] span[aria-current="page"]>span {
    color: #fff;
    background: var(--teal);
}

[role="navigation"][aria-label="Pagination Navigation"] a:hover {
    color: var(--teal);
    background: var(--tint);
}

[role="navigation"][aria-label="Pagination Navigation"] span[aria-disabled="true"]>span {
    color: #a8afac;
    background: #f5f6f4;
}

[role="navigation"][aria-label="Pagination Navigation"] svg {
    display: block;
    width: 15px !important;
    height: 15px !important;
}

/* ----- Action Menu (dropdown) ----- */
.action-menu {
    display: inline-block;
    position: relative;
}

.action-menu-popover {
    z-index: 20;
    background: var(--surface);
    border: 1px solid var(--line);
    width: 190px;
    box-shadow: var(--shadow);
    border-radius: 12px;
    padding: 6px;
    position: absolute;
    right: 0;
}

.action-menu-portal {
    z-index: 1400;
    position: fixed;
    right: auto;
}

.action-menu-popover button {
    text-align: left;
    width: 100%;
    color: var(--ink);
    background: transparent;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 11px;
}

.action-menu-popover button:hover {
    background: var(--tint);
    color: var(--teal);
}

.action-menu-popover button.danger:hover {
    background: var(--risk-bg);
    color: var(--risk);
}

/* ----- Alerts / Notices ----- */
.alert {
    border: 1px solid;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert>svg {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-top: 1px;
}

.alert ul {
    margin: 6px 0 0;
    padding-left: 18px;
}

.alert-success {
    color: var(--teal);
    background: #edf8f5;
    border-color: #c7e7de;
}

.alert-danger {
    color: var(--risk);
    background: var(--risk-bg);
    border-color: #efcac4;
}

.alert-info {
    color: var(--teal);
    background: #eef8f5;
    border-color: #c3e2da;
}

.notice {
    border-radius: 10px;
    margin: 14px 0;
    padding: 13px 15px;
}

.notice.success {
    background: var(--tint);
    color: var(--teal);
}

.notice.danger {
    background: var(--risk-bg);
    color: var(--risk);
}

.notice.pending-note {
    background: var(--amber-bg);
    color: #7a4d0a;
}

/* ----- Header / App Top ----- */
.site-header {
    color: #fff;
    z-index: 50;
    backdrop-filter: blur(14px);
    background: rgba(7, 95, 91, 0.97);
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    display: flex;
    align-items: center;
    gap: 32px;
    height: 74px;
    padding: 0 max(24px, 50vw - 620px);
    position: sticky;
    top: 0;
    box-shadow: 0 8px 24px rgba(5, 63, 60, 0.16);
    flex-shrink: 0;
}

.brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    height: 70px;
    width: 178px;
    font-size: 0;
    background: url('tipfiti-logo.png') center / contain no-repeat;
    overflow: hidden;
    color: transparent !important;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 28px;
    margin-left: auto;
}

.site-nav a {
    font-size: 13px;
    font-weight: 600;
    transition: color 0.16s;
}

.site-nav a:not(.btn):hover {
    color: var(--yellow);
}

/* ----- App Shell (Admin/Business layout) ----- */
.app-shell {
    display: grid;
    grid-template-columns: 232px 1fr;
    min-height: 100vh;
    background: #f6f7f5;
}

.portal-body .app-shell {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
}

/* ----- Sidebar ----- */
.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 25px 16px 20px;
    position: sticky;
    top: 0;
}

.portal-body .sidebar {
    height: 100dvh;
    min-height: 0;
    padding: 0 10px 12px;
    position: relative;
    overflow: hidden;
}

.portal-body .sidebar .brand {
    height: calc(var(--workspace-header-height) - 1px);
    flex: 0 0 auto;
    align-items: center;
    margin: 0 7px;
    display: flex;
    width: 184px;
}

.sidebar.admin {
    color: #fff;
    background: radial-gradient(circle at 15% 5%, rgba(250, 205, 15, 0.10), transparent 24%),
        linear-gradient(#086762 0%, #075f5b 48%, #054b48 100%);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 12px 0 30px rgba(5, 63, 60, 0.08);
}

.sidebar-brand-divider {
    background: rgba(255, 255, 255, 0.16);
    flex: 0 0 auto;
    height: 1px;
    margin: 0 6px 15px;
}

.portal-body .sidebar-brand-divider {
    background: rgba(255, 255, 255, 0.2);
    height: 1px;
    margin: 0 6px;
}

/* ----- Sidebar Navigation ----- */
.side-nav {
    display: grid;
    gap: 3px;
    flex: 1 1 auto;
    align-content: start;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 2px 6px;
    margin: 0 -2px;
}

.portal-body .side-nav {
    scrollbar-width: thin;
    overscroll-behavior: contain;
}

.side-nav a {
    color: rgba(255, 255, 255, 0.72);
    border-radius: 9px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 11px;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.15s, color 0.15s;
    min-height: 40px;
}

.side-nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.10);
}

.side-nav a.active {
    color: #064b48;
    background: var(--yellow);
    box-shadow: 0 8px 18px rgba(3, 42, 40, 0.18);
}

.side-nav svg {
    stroke: currentColor;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
}

/* ----- Sidebar Group (collapsible) ----- */
.side-nav-group summary {
    color: rgba(255, 255, 255, 0.72);
    cursor: pointer;
    border-radius: 9px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 40px;
    padding: 7px 9px;
    font-size: 13px;
    font-weight: 600;
    list-style: none;
}

.side-nav-group summary::-webkit-details-marker {
    display: none;
}

.side-nav-group summary:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.10);
}

.side-nav-group summary>svg {
    width: 18px;
    height: 18px;
}

.side-nav-group .submenu-chevron {
    width: 14px;
    height: 14px;
    margin-left: auto;
    transition: transform 0.16s;
}

.side-nav-group[open] .submenu-chevron {
    transform: rotate(180deg);
}

.side-subnav {
    border-left: 1px solid rgba(255, 255, 255, 0.18);
    display: grid;
    gap: 2px;
    margin: 3px 0 7px 21px;
    padding-left: 13px;
}

.side-subnav a {
    color: rgba(255, 255, 255, 0.62);
    border-radius: 7px;
    padding: 6px 10px;
    font-size: 11px;
    min-height: 31px;
}

.side-subnav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.side-subnav a.active {
    color: #063f3c;
    background: var(--yellow);
}

/* ----- Sidebar Footer ----- */
.sidebar-workspace-meta {
    height: var(--workspace-footer-height);
    color: rgba(255, 255, 255, 0.68);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    flex: 0 0 auto;
    display: grid;
    gap: 2px;
    margin: auto 6px 0;
    padding: 9px 4px 0;
    font-size: 10px;
}

.sidebar-workspace-meta strong {
    color: #fff;
    font-size: 12px;
}

/* ----- Nav Count Badge ----- */
.nav-count {
    background: var(--yellow);
    color: #14302e;
    border-radius: 999px;
    flex: 0 0 auto;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 22px;
    height: 22px;
    margin-left: auto;
    padding: 0 7px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
}

.side-nav a.active .nav-count {
    color: #fff;
    background: #075f5b;
}

/* ----- Main Content Area ----- */
.main {
    min-width: 0;
    padding: 30px clamp(24px, 3.2vw, 48px) 56px;
    background: #f7f8f7;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.portal-body .main {
    width: 100%;
    max-width: none;
    height: 100dvh;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    flex: 1;
}

/* ----- App Top (header inside main) ----- */
.app-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    min-height: 51px;
}

.portal-body .app-top {
    z-index: 45;
    min-height: var(--workspace-header-height);
    height: var(--workspace-header-height);
    flex: 0 0 var(--workspace-header-height);
    background: #f7f8f7;
    border-bottom: 0;
    align-items: center;
    margin: 0;
    padding: 0 clamp(24px, 3.2vw, 48px);
    position: relative;
}

.portal-body .app-top::after {
    content: '';
    background: #dfe3df;
    height: 1px;
    position: absolute;
    bottom: 0;
    left: clamp(24px, 3.2vw, 48px);
    right: clamp(24px, 3.2vw, 48px);
}

.app-top h1 {
    margin: 0;
    font-size: clamp(25px, 2.1vw, 31px);
    font-family: 'DM Sans', sans-serif;
    letter-spacing: -0.025em;
    font-weight: 650;
    line-height: 1.18;
    max-width: 760px;
}

.app-top-subtitle {
    max-width: 720px;
    color: var(--muted);
    margin: 4px 0 0;
    font-size: 11px;
    line-height: 1.35;
}

.app-top-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
}

/* ----- Top Account Menu ----- */
.top-account-menu {
    z-index: 65;
    position: relative;
}

.top-account-menu>summary {
    border: 1px solid var(--line);
    cursor: pointer;
    background: #fff;
    border-radius: 11px;
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    padding: 4px 8px 4px 5px;
    list-style: none;
}

.top-account-menu>summary::-webkit-details-marker {
    display: none;
}

.top-account-menu>summary:hover {
    border-color: #cbd4cf;
    box-shadow: 0 4px 12px rgba(12, 52, 48, 0.06);
}

.top-account-menu>summary:focus-visible {
    box-shadow: var(--focus);
    outline: none;
}

.top-account-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--yellow);
    color: #075f5b;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 10px;
}

.top-account-name {
    text-align: left;
    display: grid;
    gap: 1px;
    min-width: 0;
}

.top-account-name strong {
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 120px;
    font-size: 11px;
    overflow: hidden;
}

.top-account-name small {
    color: var(--muted);
    font-size: 9px;
}

.top-account-menu>summary>svg {
    width: 14px;
    height: 14px;
    color: var(--muted);
    transition: transform 0.16s;
}

.top-account-menu[open]>summary>svg {
    transform: rotate(180deg);
}

.top-account-popover {
    width: 240px;
    color: var(--ink);
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 13px;
    padding: 8px;
    position: absolute;
    top: calc(100% + 9px);
    right: 0;
    box-shadow: 0 20px 50px rgba(12, 42, 39, 0.16);
}

.top-account-identity {
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 3px;
    padding: 10px 10px 12px;
}

.top-account-identity strong {
    font-size: 12px;
}

.top-account-identity span {
    color: var(--muted);
    text-overflow: ellipsis;
    font-size: 10px;
    overflow: hidden;
}

.top-account-popover nav {
    display: grid;
    gap: 2px;
    padding: 7px 0;
}

.top-account-popover a,
.top-account-popover button {
    width: 100%;
    min-height: 37px;
    color: var(--ink);
    text-align: left;
    background: transparent;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 9px;
    font-size: 11px;
    font-weight: 650;
}

.top-account-popover a:hover,
.top-account-popover button:hover {
    color: var(--teal);
    background: var(--tint);
}

.top-account-popover svg {
    width: 16px;
    height: 16px;
}

.top-account-popover form {
    border-top: 1px solid var(--line);
    padding-top: 7px;
}

.top-account-popover form button {
    color: var(--risk);
}

/* ----- Workspace Scroll (portal) ----- */
.portal-body .workspace-scroll {
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow: hidden auto;
}

.portal-body .workspace-content {
    display: flex;
    flex-direction: column;
    flex: 1 0 auto;
    width: 100%;
    min-height: 0;
    padding: 24px clamp(24px, 3.2vw, 48px);
}

/* ----- Admin Footer ----- */
.admin-footer {
    color: var(--muted);
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 28px;
    margin-top: auto;
    padding-top: 34px;
    font-size: 10px;
}

.portal-body .admin-footer {
    min-height: var(--workspace-footer-height);
    height: var(--workspace-footer-height);
    background: #f7f8f7;
    border-top: 0;
    flex: 0 0 auto;
    margin: 0;
    padding: 8px clamp(24px, 3.2vw, 48px);
    position: relative;
    transform: none;
}

.portal-body .admin-footer::before {
    background: var(--line);
    content: '';
    height: 1px;
    position: absolute;
    top: 0;
    left: clamp(24px, 3.2vw, 48px);
    right: clamp(24px, 3.2vw, 48px);
}

.admin-footer nav {
    display: flex;
    align-items: center;
    gap: 18px;
}

.admin-footer a {
    font-weight: 650;
}

.admin-footer a:hover {
    color: var(--teal);
}

.admin-footer-utility {
    justify-content: flex-end;
    display: flex;
}

.admin-footer-utility nav,
.admin-footer-utility small {
    justify-self: auto;
}

/* ----- Mobile Bar (portal) ----- */
.mobile-bar {
    display: none;
}

.portal-body .mobile-bar {
    display: none;
}

/* ----- Sidebar Scrim (mobile overlay) ----- */
.sidebar-scrim {
    display: none;
}

/* ----- Page Toolbar ----- */
.page-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 22px;
}

.page-toolbar p {
    margin: 0;
}

.page-toolbar .eyebrow {
    margin-bottom: 4px;
}

/* ----- Panel Heading ----- */
.panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 8px;
}

.panel-heading h2 {
    margin: 0;
    font-family: 'DM Sans', sans-serif;
    font-size: 17px;
    letter-spacing: -0.015em;
}

.panel-heading a {
    color: var(--teal);
    font-size: 12px;
    font-weight: 700;
}

/* ----- Metrics ----- */
.metric-label {
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.metric-value {
    margin-top: 8px;
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 30px;
    letter-spacing: -0.025em;
}

/* ----- Reports & Metrics Cards ----- */
.report-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.report-metric-card {
    background: linear-gradient(145deg, #fff 0%, #fbfdfc 100%);
    border: 1px solid #dce5e2;
    border-radius: 15px;
    min-height: 132px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(18, 45, 41, 0.043);
}

.report-metric-card::after {
    content: '';
    background: rgba(8, 118, 109, 0.055);
    border-radius: 50%;
    width: 94px;
    height: 94px;
    position: absolute;
    bottom: -34px;
    right: -24px;
}

.metric-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.report-metric-card .metric-marker {
    color: #08766d;
    letter-spacing: 0.04em;
    background: #e8f4f1;
    border-radius: 9px;
    display: grid;
    place-items: center;
    width: 29px;
    height: 29px;
    font-size: 10px;
    font-weight: 700;
}

.report-metric-card strong {
    color: #172321;
    letter-spacing: -0.035em;
    margin-top: 14px;
    font-size: clamp(22px, 2vw, 29px);
    line-height: 1.05;
    display: block;
}

.report-metric-card small {
    color: #6c7976;
    margin-top: 9px;
    font-size: 11px;
    display: block;
}

/* ----- Charts ----- */
.report-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
    gap: 14px;
}

.report-chart-card {
    background: #fff;
    border: 1px solid #dce5e2;
    border-radius: 15px;
    min-width: 0;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(18, 45, 41, 0.04);
}

.report-chart-card>header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
}

.report-chart-card h2 {
    color: #172321;
    margin: 0;
    font-size: 16px;
    line-height: 1.25;
}

.report-chart-card p {
    color: #6c7976;
    margin: 5px 0 0;
    font-size: 11px;
    line-height: 1.45;
}

.chart-key {
    color: #08766d;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: #e8f4f1;
    border-radius: 7px;
    flex: 0 0 auto;
    padding: 5px 8px;
    font-size: 9px;
    font-weight: 700;
}

.chart-canvas-wrap {
    min-width: 0;
    height: 250px;
    position: relative;
}

/* ----- Lists ----- */
.list {
    display: grid;
}

.list-row {
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
}

.list-row:last-child {
    border-bottom: 0;
}

/* ----- Profile Details ----- */
.profile-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 18px 0 0;
}

.profile-details>div {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 9px;
    min-width: 0;
    padding: 11px 12px;
}

.profile-details dt {
    color: var(--muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 10px;
    font-weight: 700;
}

.profile-details dd {
    overflow-wrap: anywhere;
    margin: 4px 0 0;
    font-size: 12px;
    font-weight: 600;
}

.profile-details-wide {
    grid-column: 1 / -1;
}

/* ----- Avatar ----- */
.avatar {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: linear-gradient(145deg, #d1eae5, #89bbb1);
    color: var(--teal);
    display: grid;
    place-items: center;
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 28px;
}

.avatar.avatar-image {
    background: var(--tint);
    overflow: hidden;
}

.avatar.avatar-image img {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

.profile-avatar {
    object-fit: cover;
    border: 1px solid var(--line);
    background: var(--tint);
    border-radius: 50%;
    flex: 0 0 auto;
    width: 84px;
    height: 84px;
}

.profile-avatar-small {
    width: 46px;
    height: 46px;
}

.profile-avatar-fallback {
    color: var(--teal);
    display: grid;
    place-items: center;
    font: 600 24px 'Fraunces', serif;
}

/* ----- QR Code Display ----- */
.qr-wrap {
    border: 1px solid var(--line);
    background: #fff;
    display: grid;
    place-items: center;
    width: 220px;
    min-height: 220px;
    margin: 20px auto;
    padding: 15px;
}

.fake-qr {
    aspect-ratio: 1/1;
    background: repeating-conic-gradient(#222 0deg 25%, #fff 0deg 50%) 50% / 18px 18px;
    border: 12px solid #fff;
    outline: 2px solid #222;
    width: 210px;
    margin: 20px auto;
}

/* ----- Account Lookup Status ----- */
.account-lookup-status {
    min-height: 42px;
    color: var(--muted);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 9px;
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 2px 0 14px;
    padding: 10px 12px;
    font-size: 11px;
}

.account-lookup-status svg {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
}

.account-lookup-status.existing,
.account-lookup-status.new {
    color: var(--teal);
    background: var(--tint);
    border-color: #bfe0da;
}

.account-lookup-status.blocked,
.account-lookup-status.error {
    color: var(--risk);
    background: var(--risk-bg);
    border-color: #edc9c3;
}

/* ----- Preview Notice ----- */
.preview-notice {
    color: var(--teal);
    background: linear-gradient(90deg, #e5f3f0, #f5faf8);
    border: 1px solid #c8e2dd;
    border-radius: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    padding: 14px 16px 14px 18px;
}

.preview-title-row {
    display: flex;
    align-items: center;
    gap: 9px;
}

.preview-total {
    color: var(--teal);
    background: var(--tint);
    white-space: nowrap;
    border-radius: 999px;
    padding: 4px 7px;
    font-size: 9px;
    font-weight: 750;
}

/* ----- Empty State ----- */
.empty-state {
    min-height: 220px;
    color: var(--muted);
    text-align: center;
    display: grid;
    align-content: center;
    place-items: center;
    gap: 8px;
    padding: 40px 20px;
}

.empty-state-icon {
    width: 42px;
    height: 42px;
    color: var(--teal);
    background: #edf4f1;
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin-bottom: 4px;
}

.empty-state-icon svg {
    width: 20px;
    height: 20px;
}

.empty-state strong {
    color: #2d3431;
    font-size: 14px;
}

.empty-state p {
    max-width: 380px;
    margin: 0;
    font-size: 13px;
}

.empty-state-action {
    margin-top: 10px;
}

/* ----- Utility ----- */
.sr-only {
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    position: absolute !important;
    overflow: hidden !important;
}

[x-cloak] {
    display: none !important;
}

/* ----- Mobile Responsive Overrides ----- */
@media (max-width: 760px) {
    .portal-body {
        --mobile-bar-height: 66px;
        --workspace-header-height: 82px;
        --workspace-footer-height: 48px;
    }

    .portal-body .mobile-bar {
        display: flex;
        height: var(--mobile-bar-height);
        color: #fff;
        background: radial-gradient(circle at 15% 5%, rgba(250, 205, 15, 0.10), transparent 28%),
            linear-gradient(90deg, #086762 0%, #075f5b 58%, #054b48 100%);
        border-bottom-color: rgba(255, 255, 255, 0.14);
        position: relative;
        top: auto;
        box-shadow: 0 8px 24px rgba(5, 63, 60, 0.14);
        justify-content: space-between;
        align-items: center;
        padding: 0 16px;
    }

    .portal-body .app-shell {
        height: calc(100dvh - var(--mobile-bar-height));
        display: block;
    }

    .portal-body .sidebar {
        z-index: 90;
        position: fixed;
        inset: var(--mobile-bar-height) auto 0 0;
        width: min(84vw, 320px);
        height: calc(100dvh - var(--mobile-bar-height));
        opacity: 0;
        visibility: hidden;
        padding: 12px 10px;
        transform: translate(-100%);
        transition: transform 0.22s cubic-bezier(0.215, 0.61, 0.355, 1),
            opacity 0.18s,
            visibility 0s linear 0.22s;
    }

    .portal-body .sidebar.open {
        opacity: 1;
        visibility: visible;
        transition-delay: 0s;
        transform: translate(0);
    }

    .portal-body .sidebar>.brand,
    .portal-body .sidebar-brand-divider {
        display: none;
    }

    .portal-body .side-nav {
        padding-top: 0;
    }

    .portal-body .main {
        height: calc(100dvh - var(--mobile-bar-height));
    }

    .portal-body .app-top {
        min-height: var(--workspace-header-height);
        height: var(--workspace-header-height);
        flex: 0 0 var(--workspace-header-height);
        padding: 0 16px;
    }

    .portal-body .workspace-content {
        padding: 18px 16px;
    }

    .portal-body .admin-footer {
        min-height: var(--workspace-footer-height);
        height: auto;
        margin: 0;
        padding: 10px 16px 12px;
    }

    .portal-body .admin-footer-utility {
        justify-content: flex-end;
    }

    .sidebar-scrim {
        z-index: 80;
        backdrop-filter: blur(2px);
        background: rgba(18, 30, 28, 0.46);
        display: block;
        position: fixed;
        inset: 0;
    }

    .mobile-bar .brand {
        height: 60px;
        width: 138px;
    }

    .mobile-menu-button {
        background: rgba(255, 255, 255, 0.08) !important;
        border: 1px solid rgba(255, 255, 255, 0.18);
        color: #fff;
        width: 44px !important;
        height: 44px !important;
        border-radius: 10px;
        display: grid;
        place-items: center;
    }

    .mobile-menu-button:hover {
        background: rgba(255, 255, 255, 0.16) !important;
    }

    /* Menu icon (hamburger) */
    .menu-icon {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 19px;
        height: 14px;
    }

    .menu-icon i {
        display: block;
        transform-origin: 50% center;
        background: currentColor;
        border-radius: 2px;
        width: 100%;
        height: 1.5px;
        transition: transform 0.18s cubic-bezier(0.215, 0.61, 0.355, 1), opacity 0.14s;
    }

    .menu-icon.open i:first-child {
        transform: translateY(6.25px) rotate(45deg);
    }

    .menu-icon.open i:nth-child(2) {
        opacity: 0;
    }

    .menu-icon.open i:last-child {
        transform: translateY(-6.25px) rotate(-45deg);
    }

    .app-shell .sidebar {
        display: none;
    }

    .app-shell .sidebar.open {
        display: flex;
    }

    .app-top {
        display: none;
    }

    .portal-body .app-top {
        display: flex;
    }

    .main {
        padding: 24px 18px 50px;
    }

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .report-metrics {
        grid-template-columns: 1fr 1fr;
    }

    .page-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-toolbar .btn {
        width: 100%;
    }

    .dialog-actions {
        flex-direction: column-reverse;
    }

    .dialog-actions .btn {
        width: 100%;
    }

    .ui-dialog-header {
        padding: 18px 18px 15px;
    }

    .ui-dialog-body {
        padding: 18px;
    }

    .profile-details {
        grid-template-columns: 1fr;
    }

    .profile-details-wide {
        grid-column: auto;
    }

    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .table-toolbar-main,
    .table-toolbar-end,
    .table-search {
        width: 100%;
    }

    .toolbar-field select,
    .toolbar-field input {
        width: 100%;
        min-width: 0;
    }

    .data-table-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .report-metrics {
        grid-template-columns: 1fr;
    }

    .report-metric-card {
        min-height: 112px;
        padding: 16px;
    }
}

/* ----- Alpine.js x-cloak support ----- */
[x-cloak] {
    display: none !important;
}

/* ============================================================
   MODAL (CSS :target) - Reusable pure CSS modals
   Usage: <a href="#modal-id">Open</a>
          <div id="modal-id" class="modal-overlay"> ... </div>
          Close: <a href="#" class="modal-close">×</a>
   ============================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
    padding: 15px;
    box-sizing: border-box;
}
.modal-overlay:target {
    opacity: 1;
    visibility: visible;
}
.modal-box {
    width: min(92vw, 480px);
    max-height: 90vh;
    overflow-y: auto;
    background: var(--surface, #fffdfa);
    border: 1px solid var(--line, #dedbd4);
    border-radius: var(--radius, 16px);
    padding: 0;
    box-shadow: var(--shadow, 0 18px 55px rgba(22,58,53,0.10));
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease, opacity 0.3s ease;
    box-sizing: border-box;
}
.modal-overlay:target .modal-box {
    transform: scale(1) translateY(0);
}
/* Wider modal */
.modal-box-lg {
    max-width: 640px;
}
/* Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 24px;
    border-bottom: 1px solid var(--line, #dedbd4);
    position: sticky;
    top: 0;
    background: var(--surface, #fffdfa);
    z-index: 2;
    border-radius: var(--radius, 16px) var(--radius, 16px) 0 0;
}
.modal-header h2 {
    font-family: 'Fraunces', serif;
    font-size: 22px;
    margin: 0;
    color: var(--ink, #242426);
}
.modal-header p {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--muted, #72706d);
}
/* Close button (anchor) */
.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    text-decoration: none;
    font-size: 28px;
    color: #555;
    flex-shrink: 0;
    margin-top: -6px;
    margin-right: -8px;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}
.modal-close:hover {
    background: var(--bg, #f7f3eb);
    color: var(--risk, #c65a49);
}
/* Body */
.modal-body {
    padding: 24px;
}
.modal-body .field {
    margin-bottom: 18px;
}
.modal-body .field label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: var(--ink, #242426);
    margin-bottom: 5px;
}
.modal-body .field input,
.modal-body .field textarea,
.modal-body .field select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line, #dedbd4);
    border-radius: 8px;
    font-size: 15px;
    background: #ffffff;
    box-sizing: border-box;
    font-family: inherit;
}
.modal-body .field textarea {
    resize: vertical;
    min-height: 80px;
}
.modal-body .field .field-help {
    font-size: 12px;
    color: var(--muted, #72706d);
    margin-top: 4px;
}
/* Dialog actions (buttons) */
.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--line, #dedbd4);
    margin-top: 16px;
}
.dialog-actions .btn {
    padding: 10px 20px;
    min-height: 44px;
}
/* Profile details inside modals */
.modal-body .profile-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
    margin-bottom: 16px;
}
.modal-body .profile-details dt {
    font-weight: 600;
    color: var(--muted, #72706d);
    font-size: 13px;
}
.modal-body .profile-details dd {
    margin: 0;
    font-size: 15px;
    color: var(--ink, #242426);
}
/* Responsive */
@media (max-width: 640px) {
    .modal-box {
        width: min(100%, 100%);
        max-height: 95vh;
        border-radius: 12px;
    }
    .modal-header {
        padding: 16px 18px;
    }
    .modal-header h2 {
        font-size: 20px;
    }
    .modal-body {
        padding: 18px;
    }
    .modal-body .profile-details {
        grid-template-columns: 1fr;
    }
    .dialog-actions {
        flex-direction: column-reverse;
    }
    .dialog-actions .btn {
        width: 100%;
    }
}
/* kesh add for albums */
.album-badge {
    background: #6f42c1;
    color: #fff;
    font-size: 0.6rem;
    padding: 2px 10px;
    border-radius: 999px;
    display: inline-block;
    margin-bottom: 4px;
}
.track-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--line);
}
.track-list .track-number {
    font-weight: 700;
    color: var(--muted);
    min-width: 30px;
}
.track-list .track-name {
    flex: 1;
}