@font-face {
    font-family: "Noto Sans Bengali";
    src: url("/assets/NotoSansBengali.ttf") format("truetype");
    font-weight: 100 900;
    font-display: swap;
}

/* ============================================================
   Design tokens
   ============================================================ */
:root {
    --brand-50: #eff8f2;
    --brand-100: #d9ede1;
    --brand-200: #b7dcc5;
    --brand-300: #86c1a0;
    --brand-400: #52a37b;
    --brand-500: #2f8560;
    --brand-600: #1f6a4c;
    --brand-700: #18553e;
    --brand-800: #123f30;
    --brand-900: #0d2c23;
    --accent: #c99a3f;

    --ink: #14251d;
    --muted: #6b7f75;
    --paper: #f3f7f4;
    --surface: #ffffff;
    --surface-2: #fafcfb;
    --border: #e3eae5;
    --border-strong: #d2ddd6;
    --ring: rgba(31, 106, 76, 0.18);

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;
    --radius-pill: 999px;

    --shadow-xs: 0 1px 2px rgba(14, 40, 29, 0.05);
    --shadow-sm: 0 1px 2px rgba(14, 40, 29, 0.05), 0 2px 6px rgba(14, 40, 29, 0.04);
    --shadow-md: 0 6px 16px -6px rgba(14, 40, 29, 0.14), 0 2px 4px rgba(14, 40, 29, 0.04);
    --shadow-lg: 0 26px 50px -28px rgba(9, 34, 24, 0.45);

    --sidebar-w: 258px;
    --topbar-h: 74px;
    --ease: 160ms cubic-bezier(0.4, 0, 0.2, 1);

    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    html:not([data-bs-theme="light"]) {
        --brand-50: #12241c;
        --brand-100: #163023;
        --brand-200: #1d4432;
        --brand-300: #2a6647;
        --brand-400: #3a8e63;
        --brand-500: #46a675;
        --brand-600: #52b783;
        --brand-700: #7ecfa3;
        --brand-800: #a9e0c1;
        --brand-900: #d5f2e1;

        --ink: #e7f0eb;
        --muted: #9aafa4;
        --paper: #0c1311;
        --surface: #131c19;
        --surface-2: #17221e;
        --border: #223029;
        --border-strong: #2e4037;
        --ring: rgba(82, 183, 131, 0.24);

        --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 10px 22px -10px rgba(0, 0, 0, 0.6);
        --shadow-lg: 0 26px 50px -28px rgba(0, 0, 0, 0.8);

        color-scheme: dark;
    }
}

[data-bs-theme="dark"] {
    --brand-50: #12241c;
    --brand-100: #163023;
    --brand-200: #1d4432;
    --brand-300: #2a6647;
    --brand-400: #3a8e63;
    --brand-500: #46a675;
    --brand-600: #52b783;
    --brand-700: #7ecfa3;
    --brand-800: #a9e0c1;
    --brand-900: #d5f2e1;

    --ink: #e7f0eb;
    --muted: #9aafa4;
    --paper: #0c1311;
    --surface: #131c19;
    --surface-2: #17221e;
    --border: #223029;
    --border-strong: #2e4037;
    --ring: rgba(82, 183, 131, 0.24);

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 22px -10px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 26px 50px -28px rgba(0, 0, 0, 0.8);

    color-scheme: dark;
}

/* ============================================================
   Base
   ============================================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system,
        "Noto Sans Bengali", Arial, sans-serif;
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--ink);
    background-color: var(--paper);
    background-image: radial-gradient(900px 420px at 8% -10%, rgba(47, 133, 96, 0.09), transparent 60%),
        radial-gradient(700px 380px at 100% 0%, rgba(201, 154, 63, 0.07), transparent 55%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
    margin: 0 0 0.5rem;
    color: var(--ink);
    letter-spacing: -0.02em;
}

h3 {
    font-size: 1rem;
    font-weight: 650;
}

a {
    color: var(--brand-600);
    text-decoration: none;
    transition: color var(--ease);
}

a:hover {
    color: var(--brand-700);
    text-decoration: underline;
    text-underline-offset: 2px;
}

:focus-visible {
    outline: 2px solid var(--brand-500);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

::selection {
    background: var(--brand-200);
    color: var(--brand-900);
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border: 3px solid transparent;
    border-radius: var(--radius-pill);
    background-clip: content-box;
}

.muted {
    color: var(--muted);
}

.preserve-lines {
    white-space: pre-wrap;
}

.no-print {
    /* purely a print helper — see the print block at the end of this file */
}

/* ============================================================
   Shell — sidebar, topbar, footer
   ============================================================ */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-w);
    padding: 26px 16px 96px;
    overflow-y: auto;
    background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
    border-right: 1px solid var(--border);
    box-shadow: 1px 0 0 rgba(14, 40, 29, 0.02);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 6px;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.06em;
    color: var(--brand-600);
}

.brand:hover {
    color: var(--brand-700);
    text-decoration: none;
}

.brand > span {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    font-size: 15px;
    color: #fff;
    background: linear-gradient(140deg, var(--brand-500), var(--brand-700));
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.brand strong {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.brand-sub {
    margin: 12px 8px 26px;
    font-size: 8.5px;
    font-weight: 600;
    letter-spacing: 0.16em;
    color: var(--muted);
    text-transform: uppercase;
}

.nav-section {
    margin: 22px 10px 8px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: var(--muted);
    text-transform: uppercase;
    opacity: 0.85;
}

.nav-item {
    position: relative;
    display: block;
    padding: 9px 12px;
    margin: 2px 0;
    font-size: 13px;
    color: var(--ink);
    border-radius: var(--radius-sm);
    transition: background var(--ease), color var(--ease), transform var(--ease);
}

.nav-item:hover {
    color: var(--brand-700);
    background: var(--brand-50);
    text-decoration: none;
    transform: translateX(2px);
}

.nav-item.selected {
    color: var(--brand-700);
    background: linear-gradient(90deg, var(--brand-100), var(--brand-50));
    font-weight: 650;
    text-decoration: none;
}

.nav-item.selected::before {
    content: "";
    position: absolute;
    inset: 8px auto 8px -8px;
    width: 3px;
    background: var(--brand-500);
    border-radius: var(--radius-pill);
}

.side-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 31;
    display: flex;
    align-items: center;
    gap: 10px;
    width: var(--sidebar-w);
    padding: 14px 18px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(8px);
}

.side-footer > div {
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
}

.side-footer small {
    display: block;
    margin-top: 2px;
    font-size: 10px;
    font-weight: 500;
    color: var(--muted);
}

.side-footer > a {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    margin-left: auto;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all var(--ease);
}

.side-footer > a:hover {
    color: var(--brand-600);
    border-color: var(--brand-300);
    text-decoration: none;
}

.avatar {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    overflow: hidden;
    font-size: 14px;
    font-weight: 700;
    color: var(--brand-700);
    background: linear-gradient(140deg, var(--brand-100), var(--brand-50));
    border: 1px solid var(--brand-200);
    border-radius: 50%;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar.mini {
    width: 26px;
    height: 26px;
    font-size: 11px;
}

/* The sidebar avatar is the profile link, not a toolbar button. */
.side-footer > a.avatar {
    width: 36px;
    height: 36px;
    margin-left: 0;
    color: var(--brand-700);
    background: linear-gradient(140deg, var(--brand-100), var(--brand-50));
    border: 1px solid var(--brand-200);
    border-radius: 50%;
}

.profile-photo {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 24px;
}

.profile-photo .avatar {
    width: 84px;
    height: 84px;
    font-size: 30px;
}

.profile-photo .remove-photo {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 8px;
    font-size: 12.5px;
}

.workspace {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
}

/* Topbar ------------------------------------------------------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: var(--topbar-h);
    padding: 0 34px;
    font-size: 12.5px;
    background: rgba(255, 255, 255, 0.82);
    border-bottom: 1px solid var(--border);
    backdrop-filter: saturate(160%) blur(12px);
}

[data-bs-theme="dark"] .topbar {
    background: rgba(19, 28, 25, 0.85);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.topbar-business {
    overflow: hidden;
    color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-sep {
    color: var(--border-strong);
}

.topbar-left strong {
    overflow: hidden;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
}

.topbar form {
    margin: 0;
}

.date-pill {
    padding: 5px 11px;
    font-size: 11.5px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
}

.live-dot {
    width: 7px;
    height: 7px;
    background: var(--brand-400);
    border-radius: 50%;
    animation: live-pulse 2.6s ease-out infinite;
}

@keyframes live-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(82, 163, 123, 0.5);
    }
    70% {
        box-shadow: 0 0 0 7px rgba(82, 163, 123, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(82, 163, 123, 0);
    }
}

.link-button {
    padding: 6px 11px;
    font-size: 12.5px;
    font-weight: 550;
    color: var(--muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--ease);
}

.link-button:hover {
    color: var(--brand-600);
    background: var(--brand-50);
    border-color: var(--brand-200);
}

.theme-toggle {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    font-size: 14px;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--ease);
}

.theme-toggle:hover {
    color: var(--brand-600);
    border-color: var(--brand-300);
    transform: rotate(-12deg);
}

/* Interface language switcher ------------------------------------------ */
.lang-switch {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
}

.lang-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 550;
    color: var(--muted);
    text-decoration: none;
    border-radius: var(--radius-pill);
    transition: all var(--ease);
}

.lang-option b {
    font-size: 10px;
    letter-spacing: 0.08em;
}

.lang-option span {
    white-space: nowrap;
}

.lang-option:hover {
    color: var(--brand-600);
    background: var(--brand-50);
}

.lang-option.selected {
    color: #fff;
    background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
    box-shadow: var(--shadow-xs);
}

[data-bs-theme="dark"] .lang-option.selected {
    color: var(--paper);
}

@media (prefers-color-scheme: dark) {
    html:not([data-bs-theme="light"]) .lang-option.selected {
        color: var(--paper);
    }
}

.menu-button {
    display: none;
}

/* Content ------------------------------------------------------ */
main {
    max-width: 1600px;
    margin: 0 auto;
    padding: 34px 34px 18px;
}

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.page-heading h1 {
    margin: 6px 0;
    font-size: 27px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.035em;
}

.page-heading p {
    margin: 0;
    font-size: 13px;
}

.eyebrow {
    display: inline-block;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.16em;
    color: var(--brand-500);
    text-transform: uppercase;
}

.page-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 26px;
    margin-top: 34px;
    padding: 18px 2px 10px;
    color: var(--muted);
    font-size: 10.5px;
    border-top: 1px solid var(--border);
}

.footer-brand strong {
    color: var(--ink);
    font-weight: 650;
}

.footer-credit a {
    color: var(--muted);
    text-decoration: underline;
    text-decoration-color: var(--border-strong);
    text-underline-offset: 2px;
}

.footer-credit a:hover {
    color: var(--brand-600);
}

/* Buttons ------------------------------------------------------ */
.btn {
    --bs-btn-border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.01em;
    border-radius: var(--radius-sm);
    transition: transform var(--ease), box-shadow var(--ease), background var(--ease),
        border-color var(--ease), color var(--ease);
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    --bs-btn-bg: var(--brand-600);
    --bs-btn-border-color: var(--brand-600);
    --bs-btn-hover-bg: var(--brand-700);
    --bs-btn-hover-border-color: var(--brand-700);
    --bs-btn-active-bg: var(--brand-800);
    box-shadow: 0 8px 16px -10px rgba(24, 85, 62, 0.9);
}

.btn-primary:hover {
    box-shadow: 0 12px 22px -12px rgba(24, 85, 62, 0.95);
}

.btn-outline-primary {
    --bs-btn-color: var(--brand-600);
    --bs-btn-border-color: var(--brand-300);
    --bs-btn-hover-bg: var(--brand-600);
    --bs-btn-hover-border-color: var(--brand-600);
}

.btn-light {
    --bs-btn-bg: var(--surface-2);
    --bs-btn-border-color: var(--border);
    --bs-btn-color: var(--ink);
    --bs-btn-hover-bg: var(--brand-50);
    --bs-btn-hover-border-color: var(--brand-200);
    --bs-btn-hover-color: var(--brand-700);
}

.btn-outline-secondary {
    --bs-btn-color: var(--muted);
    --bs-btn-border-color: var(--border-strong);
    --bs-btn-hover-bg: var(--brand-50);
    --bs-btn-hover-border-color: var(--brand-300);
    --bs-btn-hover-color: var(--brand-700);
}

.btn-outline-danger {
    --bs-btn-color: #b4453a;
    --bs-btn-border-color: #e8c4bf;
    --bs-btn-hover-bg: #b4453a;
    --bs-btn-hover-border-color: #b4453a;
}

.btn-sm {
    --bs-btn-padding-y: 6px;
    --bs-btn-padding-x: 11px;
    --bs-btn-font-size: 11.5px;
}

/* ============================================================
   Dashboard
   ============================================================ */
.welcome-banner {
    position: relative;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    min-height: 186px;
    margin-bottom: 22px;
    padding: 32px 34px;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(520px 260px at 88% 8%, rgba(126, 207, 163, 0.38), transparent 62%),
        linear-gradient(135deg, var(--brand-800), var(--brand-900) 62%, #0a2119);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.welcome-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: radial-gradient(600px 300px at 82% 10%, #000 0%, transparent 75%);
    pointer-events: none;
}

.welcome-banner > div {
    position: relative;
    z-index: 1;
}

.welcome-banner h2 {
    margin: 14px 0 8px;
    font-size: 27px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #fff;
}

.welcome-banner p {
    margin: 0;
    font-size: 13px;
    color: rgba(232, 247, 238, 0.82);
}

.tag-light {
    display: inline-block;
    padding: 5px 11px;
    font-size: 8.5px;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: #cfe9d9;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius-pill);
}

.banner-art {
    position: relative;
    width: 200px;
    flex: 0 0 auto;
}

.banner-art > span {
    position: absolute;
    top: -48px;
    right: 34px;
    font-size: 186px;
    font-weight: 200;
    line-height: 1.1;
    color: rgba(255, 255, 255, 0.14);
}

.art-grid {
    position: absolute;
    inset: -40px -60px -60px -30px;
    background: radial-gradient(120px 120px at 60% 40%, rgba(126, 207, 163, 0.35), transparent 70%);
    transform: rotate(-16deg);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.stat-card {
    position: relative;
    padding: 20px 20px 18px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: transform var(--ease), box-shadow var(--ease), border-color var(--ease);
}

.stat-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand-400), var(--brand-200));
    opacity: 0.85;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--brand-200);
    box-shadow: var(--shadow-md);
}

.stat-label {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    color: var(--muted);
}

.stat-label span {
    color: var(--brand-400);
}

.stat-number {
    margin: 14px 0 6px;
    font-size: 25px;
    font-weight: 700;
    letter-spacing: -0.03em;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.stat-number.smaller {
    font-size: 21px;
}

.stat-card small {
    font-size: 10.5px;
    color: var(--muted);
}

.secondary .stat-card {
    padding: 16px 20px;
    background: var(--surface-2);
}

.secondary .stat-number {
    margin: 10px 0 0;
}

.dashboard-columns {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 20px;
    margin-top: 22px;
}

.card {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
    padding: 20px 22px 14px;
}

.card-title h2 {
    margin: 0 0 6px;
    font-size: 15.5px;
    font-weight: 650;
}

.card-title p {
    margin: 0;
    font-size: 11px;
}

.card-title > a {
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.inventory-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 4px 22px 22px;
}

.inventory-strip > div {
    padding: 10px 20px;
    border-right: 1px solid var(--border);
}

.inventory-strip > div:first-child {
    padding-left: 0;
}

.inventory-strip > div:last-child {
    border-right: 0;
}

.inventory-strip strong {
    display: block;
    margin-top: 10px;
    font-size: 25px;
    font-weight: 700;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

.inventory-strip small {
    font-size: 11px;
}

.due-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 22px;
    font-size: 11.5px;
    border-top: 1px solid var(--border);
    transition: background var(--ease);
}

.due-row:hover {
    background: var(--surface-2);
}

.due-row strong {
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
}

.date-box {
    min-width: 44px;
    padding: 6px;
    font-size: 17px;
    font-weight: 650;
    text-align: center;
    color: var(--brand-700);
    background: linear-gradient(160deg, var(--brand-50), var(--brand-100));
    border: 1px solid var(--brand-200);
    border-radius: var(--radius-sm);
}

.date-box small {
    display: block;
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--brand-500);
    text-transform: uppercase;
}

.subtle-icon {
    font-size: 22px;
    color: var(--border-strong);
}

.empty-state {
    padding: 42px 20px !important;
    font-size: 12.5px;
    color: var(--muted);
    text-align: center;
}

/* Status pills ------------------------------------------------- */
.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 8px;
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: capitalize;
    border-radius: var(--radius-pill);
    white-space: nowrap;
}

.status::before {
    content: "";
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 50%;
    opacity: 0.75;
}

.status.posted {
    color: #2f7d52;
    background: #e7f5ec;
}

.status.draft {
    color: #9a7326;
    background: #fdf3dd;
}

.status.reversed {
    color: #a8564a;
    background: #fbeae6;
}

/* ============================================================
   Tables
   ============================================================ */
.table {
    margin: 0;
    font-size: 12.5px;
    --bs-table-color: var(--ink);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--border);
}

.table thead th {
    padding: 12px 20px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.09em;
    color: var(--muted);
    text-transform: uppercase;
    white-space: nowrap;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 15px 20px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
}

.table tbody tr {
    transition: background var(--ease);
}

.table tbody tr:hover {
    background: var(--brand-50);
}

.table tbody tr:last-child td {
    border-bottom: 0;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.pagination-wrap {
    margin-top: 22px;
}

.pagination-wrap .pagination,
.pagination {
    display: flex;
    gap: 6px;
    margin: 0;
}

.pagination .page-link {
    padding: 8px 13px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all var(--ease);
}

.pagination .page-link:hover {
    color: var(--brand-700);
    background: var(--brand-50);
    border-color: var(--brand-200);
}

.pagination .active .page-link,
.pagination .page-item.active .page-link {
    color: #fff;
    background: var(--brand-600);
    border-color: var(--brand-600);
}

/* ============================================================
   Forms
   ============================================================ */
.form-card {
    max-width: 860px;
    padding: 28px;
}

.form-card.wide {
    max-width: 100%;
}

.form-control,
.form-select {
    min-height: 42px;
    padding: 9px 13px;
    font-size: 13px;
    color: var(--ink);
    background-color: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    transition: border-color var(--ease), box-shadow var(--ease), background var(--ease);
}

.form-control::placeholder {
    color: var(--muted);
    opacity: 0.75;
}

.form-control:focus,
.form-select:focus {
    color: var(--ink);
    background-color: var(--surface);
    border-color: var(--brand-400);
    box-shadow: 0 0 0 3px var(--ring);
    outline: 0;
}

.form-label {
    margin-bottom: 6px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--muted);
    text-transform: uppercase;
}

.form-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
}

.form-actions form {
    margin: 0;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 0 0 20px;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
}

.filter-bar > * {
    max-width: 250px;
}

.filter-bar button {
    white-space: nowrap;
}

.entry-table {
    min-width: 650px;
}

.entry-table .form-select {
    min-width: 200px;
}

.entry-table .form-control {
    min-width: 100px;
}

.entry-table td {
    padding: 9px 5px;
}

.entry-table th {
    padding: 9px 5px !important;
}

.entry-table input[type="date"] {
    min-width: 140px;
}

.check-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-top: 4px;
}

.check-grid label,
.check-row label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
}

.check-grid label[hidden] {
    display: none;
}

.check-grid input,
.check-row input,
.permission-grid input {
    width: 15px;
    height: 15px;
    accent-color: var(--brand-600);
}

.check-row {
    display: flex;
    gap: 22px;
    margin: 22px 0;
}

.check-row label {
    padding: 9px 13px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.permission-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.permission-grid fieldset {
    padding: 10px 12px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
}

.permission-grid legend {
    float: none;
    width: auto;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--brand-600);
    text-transform: uppercase;
}

.permission-grid label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 6px 0;
    font-size: 12px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.detail-grid small {
    display: block;
    margin-bottom: 6px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--muted);
    text-transform: uppercase;
}

.detail-grid strong {
    font-size: 14px;
    overflow-wrap: anywhere;
}

.balance-callout {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 18px;
    padding: 18px 20px;
    font-size: 13px;
    background: linear-gradient(120deg, var(--brand-50), var(--brand-100));
    border: 1px solid var(--brand-200);
    border-radius: var(--radius);
}

/* Alerts ------------------------------------------------------- */
.alert {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    font-size: 12.5px;
    line-height: 1.65;
    border: 1px solid var(--border);
    border-left-width: 4px;
    border-radius: var(--radius);
}

.alert ul {
    padding-left: 18px;
    margin: 0;
}

.alert-info {
    color: var(--brand-700);
    background: var(--brand-50);
    border-color: var(--brand-200);
    border-left-color: var(--brand-500);
}

.alert-success {
    color: #2f7d52;
    background: #e9f7ef;
    border-color: #c8e8d6;
    border-left-color: #3fa06b;
}

.alert-danger {
    color: #a5443a;
    background: #fdeeeb;
    border-color: #f2cfc9;
    border-left-color: #c4564a;
}

.alert-warning {
    color: #8b6a1f;
    background: #fdf5e2;
    border-color: #f0e1ba;
    border-left-color: #d3a33c;
}

details summary {
    display: inline-block;
    padding: 4px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--brand-600);
    cursor: pointer;
    list-style: none;
}

details summary::marker,
details summary::-webkit-details-marker {
    display: none;
}

details summary::before {
    content: "▸ ";
    display: inline-block;
    transition: transform var(--ease);
}

details[open] summary::before {
    content: "▾ ";
}

details summary:hover {
    color: var(--brand-700);
}

/* ============================================================
   Sign in
   ============================================================ */
.login-page {
    display: flex;
    min-height: 100vh;
    background: var(--paper);
}

.login-story {
    position: relative;
    width: 48%;
    padding: 6vw 5.5vw;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(520px 340px at 84% 6%, rgba(126, 207, 163, 0.34), transparent 62%),
        linear-gradient(150deg, var(--brand-800), #0a2119 70%);
}

.login-story .brand {
    margin: 0;
    color: #fff;
}

.login-story .brand:hover {
    color: #fff;
    text-decoration: none;
}

.login-story .brand > span {
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-story h1 {
    margin-top: 84px;
    font-size: clamp(34px, 4vw, 62px);
    font-weight: 600;
    line-height: 1.14;
    letter-spacing: -0.04em;
    color: #fff;
}

.login-story em {
    font-style: normal;
    color: #b9e0c8;
}

.login-story p {
    max-width: 34ch;
    margin-top: 22px;
    font-size: 14px;
    line-height: 1.9;
    color: rgba(226, 243, 233, 0.78);
}

.login-landscape {
    position: absolute;
    inset: auto 0 -40px;
    height: 220px;
    overflow: hidden;
    opacity: 0.75;
}

.hill {
    position: absolute;
    top: 60px;
    left: -30%;
    width: 120%;
    height: 190px;
    background: rgba(90, 168, 128, 0.22);
    border-radius: 50% 50% 0 0;
    transform: rotate(9deg);
}

.hill.two {
    top: 104px;
    left: 18%;
    background: rgba(126, 207, 163, 0.16);
    transform: rotate(-13deg);
}

.sun {
    position: absolute;
    top: 6px;
    right: 86px;
    width: 56px;
    height: 56px;
    background: radial-gradient(circle at 40% 35%, #f4e6bd, #d8bd7d);
    border-radius: 50%;
    box-shadow: 0 0 60px rgba(219, 201, 142, 0.55);
}

.login-form {
    display: grid;
    place-items: center;
    width: 52%;
    padding: 34px;
}

.login-form > div {
    width: 392px;
    max-width: 100%;
    padding: 34px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.login-form h2 {
    margin: 12px 0 10px;
    font-size: 23px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.login-form p {
    margin-bottom: 28px;
}

.login-form .form-control {
    min-height: 46px;
}

/* Language switcher + theme toggle in the top-right corner of the sign-in page */
.login-preferences {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1200px) {
    :root {
        --sidebar-w: 224px;
    }

    main {
        padding: 24px;
    }

    .topbar {
        padding: 0 24px;
    }

    .stats-grid {
        gap: 12px;
    }

    .stat-card {
        padding: 18px 16px;
    }

    .stat-number {
        font-size: 21px;
    }

    .dashboard-columns {
        grid-template-columns: 1fr;
    }

    .permission-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .filter-bar {
        flex-wrap: wrap;
    }

    .filter-bar > * {
        flex: 1 1 150px;
        max-width: none;
        min-width: 130px;
    }

    .welcome-banner {
        padding: 26px;
    }

    /* Keep the switcher compact once the sidebar starts crowding the topbar. */
    .lang-option span {
        display: none;
    }
}

@media (max-width: 800px) {
    .sidebar {
        width: 262px;
        transform: translateX(-105%);
        transition: transform 220ms cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: var(--shadow-lg);
    }

    .menu-open .sidebar {
        transform: translateX(0);
    }

    .side-footer {
        display: none;
    }

    .workspace {
        margin: 0;
    }

    .menu-button {
        display: grid;
        place-items: center;
        width: 36px;
        height: 36px;
        font-size: 18px;
        color: var(--ink);
        background: var(--surface-2);
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        cursor: pointer;
    }

    .topbar {
        height: 64px;
        padding: 0 14px;
    }

    .topbar-business,
    .topbar-sep,
    .date-pill {
        display: none;
    }

    .topbar-right {
        gap: 8px;
    }

    main {
        padding: 22px 14px;
    }

    .page-heading {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-heading h1 {
        font-size: 22px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .welcome-banner {
        padding: 24px;
    }

    .banner-art {
        width: 90px;
        opacity: 0.5;
    }

    .inventory-strip {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }

    .inventory-strip > div:nth-child(2) {
        border-right: 0;
    }

    .permission-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .detail-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-card {
        padding: 20px;
    }

    .check-row {
        flex-direction: column;
        gap: 10px;
    }

    .table td {
        padding: 12px 14px;
    }

    .card-title {
        padding: 18px;
    }

    .balance-callout {
        flex-wrap: wrap;
    }

    .login-story {
        display: none;
    }

    .login-form {
        width: 100%;
        min-height: 100vh;
        padding: 20px;
    }

    .login-form > div {
        padding: 26px;
    }

    .page-footer {
        gap: 6px 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* ============================================================
   Staff list & permission modals
   ============================================================ */
.staff-table {
    min-width: 1040px;
}

.staff-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 170px;
}

.staff-identity .avatar.mini {
    width: 32px;
    height: 32px;
    font-size: 12px;
}

.staff-identity-copy {
    min-width: 0;
}

.staff-identity-copy strong,
.staff-identity-copy small {
    display: block;
}

.staff-identity-copy strong {
    font-size: 13px;
    line-height: 1.35;
}

.staff-identity-copy small {
    margin-top: 1px;
    font-size: 11px;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.staff-edit-link {
    display: inline-block;
    min-width: 150px;
    font-size: 12px;
    font-weight: 600;
}

.permission-pill {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    padding: 7px 12px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--brand-700);
    background: var(--brand-50);
    border: 1px solid var(--brand-200);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all var(--ease);
}

.permission-pill strong {
    font-size: 15px;
    line-height: 1;
}

.permission-pill span {
    color: var(--muted);
    font-weight: 500;
}

.permission-pill b {
    margin-left: 2px;
    font-size: 10px;
    font-weight: 700;
    color: var(--brand-500);
}

.permission-pill:hover {
    color: var(--brand-800);
    background: var(--brand-100);
    border-color: var(--brand-300);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.permission-pill.is-empty {
    color: var(--muted);
    background: var(--surface-2);
    border-color: var(--border);
}

.permission-pill.is-empty b {
    color: var(--muted);
}

body:has(dialog.app-modal[open]) {
    overflow: hidden;
}

.app-modal {
    width: min(940px, calc(100vw - 32px));
    max-width: none;
    max-height: calc(100vh - 40px);
    padding: 0;
    color: var(--ink);
    background: transparent;
    border: 0;
    overflow: visible;
}

.app-modal::backdrop {
    background: rgba(7, 24, 17, 0.5);
    backdrop-filter: blur(4px);
}

.app-modal-panel {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 40px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.app-modal[open] .app-modal-panel {
    animation: modal-in 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.99);
    }
}

.app-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 26px 18px;
    border-bottom: 1px solid var(--border);
}

.app-modal-head h2 {
    margin: 2px 0 4px;
    font-size: 20px;
    line-height: 1.2;
}

.app-modal-head > div {
    min-width: 0;
}

.app-modal-head p {
    margin: 0;
    font-size: 12.5px;
}

.app-modal-body {
    padding: 20px 26px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.app-modal-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 15px 26px;
    background: var(--surface-2);
    border-top: 1px solid var(--border);
}

.modal-close {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    padding: 0;
    font-size: 20px;
    line-height: 1;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--ease);
}

.modal-close:hover {
    color: var(--brand-700);
    background: var(--brand-50);
    border-color: var(--brand-300);
}

.modal-person {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.modal-person .avatar {
    width: 44px;
    height: 44px;
    font-size: 17px;
}

.modal-person > div {
    min-width: 0;
}

.modal-person p {
    overflow-wrap: anywhere;
}

.modal-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.permission-modal-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
    padding: 12px 14px;
    background: var(--brand-50);
    border: 1px solid var(--brand-200);
    border-radius: var(--radius);
}

.permission-modal-summary p {
    margin: 0;
    font-size: 12px;
}

.permission-total-badge {
    padding: 4px 11px;
    font-size: 13px;
    font-weight: 700;
    color: var(--brand-700);
    background: var(--surface);
    border: 1px solid var(--brand-200);
    border-radius: var(--radius-pill);
    white-space: nowrap;
}

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

.permission-group {
    padding: 13px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.permission-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 9px;
}

.permission-group-head h3 {
    margin: 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--brand-600);
    text-transform: uppercase;
}

.permission-group-head span {
    display: grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 10px;
    font-weight: 700;
    color: var(--brand-700);
    background: var(--brand-100);
    border-radius: var(--radius-pill);
}

.permission-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.permission-token {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 550;
    color: var(--brand-700);
    background: var(--surface);
    border: 1px solid var(--brand-200);
    border-radius: var(--radius-pill);
}

.permission-empty {
    padding: 34px 20px;
    font-size: 12.5px;
    color: var(--muted);
    text-align: center;
    background: var(--surface-2);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
}

/* Permission picker (Staff form) ----------------------------------- */
.permission-picker {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    margin-top: 26px;
    padding: 19px 20px;
    background: linear-gradient(135deg, var(--brand-50), var(--surface-2) 70%);
    border: 1px solid var(--brand-200);
    border-radius: var(--radius-lg);
}

.permission-picker-copy h3 {
    margin: 2px 0 4px;
    font-size: 16px;
}

.permission-picker-copy p {
    max-width: 690px;
    margin: 0;
    font-size: 12.5px;
}

.permission-picker-side {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 0 0 auto;
}

.permission-counter {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-size: 11.5px;
    color: var(--muted);
    white-space: nowrap;
}

.permission-counter strong {
    font-size: 23px;
    line-height: 1;
    color: var(--brand-700);
}

.permission-picker-modal {
    width: min(1080px, calc(100vw - 32px));
}

.permission-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 26px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}

.permission-search {
    flex: 1;
    min-width: 190px;
    margin: 0;
}

.permission-search input {
    width: 100%;
    height: 38px;
    padding: 8px 12px;
    font: inherit;
    font-size: 12.5px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    transition: border-color var(--ease), box-shadow var(--ease);
}

.permission-search input:focus {
    border-color: var(--brand-400);
    outline: 0;
    box-shadow: 0 0 0 3px var(--ring);
}

.permission-toolbar-actions {
    display: flex;
    gap: 2px;
}

.permission-total {
    font-size: 11.5px;
    color: var(--muted);
    white-space: nowrap;
}

.permission-total strong {
    color: var(--brand-700);
}

.permission-picker-modal .permission-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.permission-picker-modal .permission-grid fieldset {
    position: relative;
    padding: 12px 13px 14px;
}

.permission-picker-modal .permission-grid legend {
    max-width: calc(100% - 46px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.permission-module-toggle {
    position: absolute;
    top: 8px;
    right: 9px;
    padding: 2px 7px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--muted);
    text-transform: uppercase;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all var(--ease);
}

.permission-module-toggle:hover,
.permission-module-toggle.is-active {
    color: var(--brand-700);
    background: var(--brand-50);
    border-color: var(--brand-300);
}

.permission-options {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-top: 6px;
}

.permission-picker-modal .permission-grid label {
    margin: 0;
    padding: 4px 5px;
    border-radius: 6px;
    cursor: pointer;
    transition: background var(--ease), color var(--ease);
}

.permission-picker-modal .permission-grid label:hover {
    color: var(--brand-700);
    background: var(--brand-50);
}

.permission-picker-modal .permission-grid label[hidden],
.permission-picker-modal .permission-grid fieldset[hidden] {
    display: none;
}

.permission-no-results {
    margin: 12px 0 0;
    padding: 24px;
    font-size: 12.5px;
    color: var(--muted);
    text-align: center;
    background: var(--surface-2);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
}

@media (max-width: 1000px) {
    .permission-modal-grid,
    .permission-picker-modal .permission-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .app-modal {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
    }

    .app-modal-panel {
        max-height: calc(100vh - 20px);
    }

    .app-modal-head,
    .app-modal-foot {
        padding-right: 16px;
        padding-left: 16px;
    }

    .app-modal-body {
        padding: 16px;
    }

    .app-modal-foot {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .app-modal-foot .btn,
    .app-modal-foot .modal-actions {
        width: 100%;
    }

    .app-modal-foot .modal-actions .btn {
        flex: 1;
    }

    .permission-modal-summary {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .permission-modal-grid,
    .permission-picker-modal .permission-grid {
        grid-template-columns: 1fr;
    }

    .permission-picker {
        flex-direction: column;
        align-items: flex-start;
    }

    .permission-picker-side {
        justify-content: space-between;
        width: 100%;
    }

    .permission-toolbar {
        flex-wrap: wrap;
        padding: 12px 16px;
    }

    .permission-search {
        flex-basis: 100%;
    }

    .permission-total {
        margin-left: auto;
    }
}

@media print {
    .app-modal {
        display: none !important;
    }
}

/* ============================================================
   Change history
   ============================================================ */
.activity-time {
    font-weight: 600;
    white-space: nowrap;
}

.detail-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 460px;
}

.detail-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    max-width: 100%;
    padding: 4px 10px;
    font-size: 11.5px;
    color: var(--ink);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    overflow-wrap: anywhere;
}

.detail-chip b {
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--muted);
    text-transform: uppercase;
    white-space: nowrap;
}


/* ============================================================
   Print
   ============================================================ */
@media print {
    .sidebar,
    .topbar,
    .no-print,
    .page-footer,
    .btn,
    .form-actions {
        display: none !important;
    }

    .workspace {
        margin: 0;
    }

    main {
        max-width: none;
        padding: 0;
    }

    body {
        font-size: 12px;
        background: #fff;
        background-image: none;
    }

    .card,
    .stat-card {
        border: 1px solid #ddd;
        box-shadow: none;
        break-inside: avoid;
    }

    .table-responsive {
        overflow: visible;
    }

    .page-heading h1 {
        font-size: 20px;
    }

    .detail-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .welcome-banner {
        color: #111;
        background: #f3f7f4;
        box-shadow: none;
    }

    .welcome-banner h2,
    .welcome-banner p {
        color: #111;
    }
}

