.flash-messages {
    margin-bottom: 1rem;
}

.flash {
    border-radius: .75rem;
    padding: .6rem .9rem;
    margin-bottom: .5rem;
    font-size: .85rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    border: 1px solid var(--border-subtle);
    background: rgba(15,23,42,0.85);
}

.flash span.tag {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: .1rem .4rem;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
}

.flash-danger span.tag { border-color: var(--danger); color: var(--danger); }
.flash-success span.tag { border-color: var(--success); color: var(--success); }
.flash-warning span.tag { border-color: #eab308; color: #eab308; }
.flash-info span.tag { border-color: var(--accent); color: var(--accent); }

.btn,
button.btn,
a.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    font-size: .8rem;
    padding: .45rem .9rem;
    border-radius: .7rem;
    border: 1px solid var(--border-subtle);
    background: rgba(15,23,42,0.85);
    color: var(--text-main);
    cursor: pointer;
    text-decoration: none;
    min-height: 44px;
}

.btn:hover,
a.btn:hover {
    text-decoration: none;
}

.btn-primary {
    border-color: var(--accent);
    background: linear-gradient(to right, var(--accent), #ea580c);
    color: #0b1120;
    font-weight: 700;
}

.btn-sm {
    padding: .3rem .7rem;
    font-size: .78rem;
}

.btn-ndh,
.btn-ndh-outline,
.btn-ndh-outline-white,
.btn-ndh-glass {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    text-align: center;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    min-height: 44px;
}

.btn-ndh-outline {
    padding: .55rem 1rem;
    border-radius: 999px;
    background: transparent;
    color: #ffffff;
    border: 1px solid rgba(249,115,22,.75);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.06),
        0 10px 30px rgba(0,0,0,.35);
    font-weight: 650;
    font-size: .92rem;
    letter-spacing: .1px;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.btn-ndh-outline:hover {
    text-decoration: none;
    border-color: rgba(249,115,22,.95);
    background: rgba(249,115,22,.08);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.08),
        0 14px 38px rgba(0,0,0,.45),
        0 0 0 6px rgba(249,115,22,.10);
    transform: translateY(-1px);
}

.btn-ndh-outline-white {
    padding: .55rem 1rem;
    border-radius: 999px;
    background: transparent;
    color: #ffffff;
    border: 2px solid floralwhite;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.06),
        0 10px 30px rgba(0,0,0,.35);
    font-weight: 500;
    font-size: .85rem;
    letter-spacing: .1px;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.btn-ndh-outline-white:hover {
    text-decoration: none;
    border-color: rgba(255,255,255,.92);
    background: rgba(255,255,255,.05);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.08),
        0 14px 38px rgba(0,0,0,.45),
        0 0 0 6px rgba(255,255,255,.08);
    transform: translateY(-1px);
}

.btn-ndh-glass {
    padding: .55rem 1rem;
    border-radius: 999px;
    background: rgba(255,255,255,.06);
    color: #ffffff;
    border: 1px solid rgba(249,115,22,.75);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.06),
        0 10px 30px rgba(0,0,0,.35);
    font-weight: 400;
    font-size: .78rem;
    letter-spacing: .1px;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.btn-ndh-glass:hover {
    text-decoration: none;
    background: rgba(255,255,255,.09);
    border-color: rgba(255,255,255,.18);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.08),
        0 14px 38px rgba(0,0,0,.45),
        0 0 0 6px rgba(249,115,22,.10);
    transform: translateY(-1px);
}

.card {
    border-radius: 1rem;
    border: 1px solid var(--border-subtle);
    background: radial-gradient(circle at top left, #020617 0, #020617 35%, #000 100%);
    padding: 1rem 1.1rem;
    box-shadow: 0 10px 34px rgba(0,0,0,.22);
}

.card + .card {
    margin-top: 1rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .6rem;
}

.card-header h2 {
    margin: 0;
    font-size: 1rem;
}

.card-header small {
    color: var(--text-muted);
    font-size: .78rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .9rem;
    margin-top: 1rem;
}

.card-grid > .card {
    height: 100%;
    display: flex;
    flex-direction: column;
    margin-top: 0;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .18rem .55rem;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
}

.pill-retail {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: .75rem;
}

.stat {
    border-radius: .85rem;
    padding: .7rem .8rem;
    background: rgba(15,23,42,0.8);
    border: 1px solid var(--border-subtle);
    min-width: 0;
}

.stat-label {
    font-size: .75rem;
    color: var(--text-muted);
    margin-bottom: .25rem;
}

.stat-value {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-foot {
    font-size: .7rem;
    color: var(--text-muted);
    margin-top: .25rem;
}

.business-title-row {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-width: 0;
}

.business-logo-sm {
    width: 38px;
    height: 38px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background: rgba(255,255,255,0.02);
    flex: 0 0 auto;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-wrap table {
    min-width: 640px;
    white-space: nowrap;
}

table.simple-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .82rem;
}

table.simple-table th,
table.simple-table td {
    padding: .45rem .4rem;
    border-bottom: 1px solid var(--border-subtle);
}

table.simple-table th {
    text-align: left;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
}

table.simple-table tr:hover td {
    background: rgba(15,23,42,0.7);
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
    margin-bottom: 1rem;
}

.filter-bar select,
.filter-bar input[type="text"] {
    padding: .3rem .4rem;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    font-size: .9rem;
    background: rgba(255,255,255,0.02);
    color: var(--text-main);
}

.customer-filters input[type="date"] {
    background-color: #020617;
    color: #e5e7eb;
    border: 1px solid var(--border-subtle);
    border-radius: .65rem;
    padding: .25rem .45rem;
    font-size: .8rem;
}

.customer-filters input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
}

.notif-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .35rem .8rem;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    background: rgba(15,23,42,0.85);
    font-size: .8rem;
    color: var(--text-main);
}

.notif-btn:hover {
    border-color: var(--accent);
    text-decoration: none;
}

.notif-icon {
    font-size: .9rem;
}

.notif-text {
    font-size: .78rem;
}

.notif-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #FF5705;
    box-shadow: 0 0 0 2px #020617;
}

.ndh-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    justify-content: flex-end;
    align-items: center;
}

.ndh-actions .btn-ndh-outline {
    white-space: nowrap;
}

/* Profile switcher */
.profile-switcher {
    position: relative;
    min-width: 0;
}

.profile-switcher-inline .profile-switcher-btn {
    width: 100%;
    max-width: 420px;
}

.profile-switcher-btn {
    min-height: 54px;
    width: 100%;
    display: inline-flex;
    align-items: center;
    gap: .8rem;
    padding: .55rem .8rem;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.04);
    color: var(--text-main);
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
    text-align: left;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

.profile-switcher-btn:hover {
    border-color: rgba(249,115,22,.55);
    background: rgba(255,255,255,.06);
    box-shadow:
        0 12px 28px rgba(0,0,0,.25),
        0 0 0 4px rgba(249,115,22,.06);
}

.profile-switcher-avatar,
.profile-switcher-avatar-fallback,
.profile-switcher-item-avatar,
.profile-switcher-item-fallback {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    flex: 0 0 42px;
}

.profile-switcher-avatar,
.profile-switcher-item-avatar {
    object-fit: cover;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.05);
}

.profile-switcher-avatar-fallback,
.profile-switcher-item-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.05);
    color: var(--text-muted);
    font-weight: 800;
}

.profile-switcher-meta,
.profile-switcher-item-meta {
    min-width: 0;
    flex: 1 1 auto;
}

.profile-switcher-name,
.profile-switcher-item-name {
    font-size: .92rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-switcher-role,
.profile-switcher-item-sub {
    margin-top: .12rem;
    font-size: .76rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-switcher-chevron {
    flex: 0 0 auto;
    font-size: .95rem;
    color: var(--text-muted);
    transition: transform .18s ease;
}

.profile-switcher.open .profile-switcher-chevron {
    transform: rotate(180deg);
}

.profile-switcher-menu {
    position: absolute;
    top: calc(100% + .55rem);
    left: 0;
    width: 100%;
    min-width: 320px;
    max-width: 420px;
    max-height: 420px;
    overflow-y: auto;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,.08);
    background:
        radial-gradient(800px 240px at top left, rgba(255,255,255,.05), transparent 45%),
        rgba(17,24,39,.98);
    box-shadow:
        0 24px 70px rgba(0,0,0,.46),
        inset 0 1px 0 rgba(255,255,255,.04);
    padding: .55rem;
    display: none;
    z-index: 300;
    backdrop-filter: blur(14px);
}

.profile-switcher.open .profile-switcher-menu {
    display: block;
}

.profile-switcher-section {
    padding: .25rem;
}

.profile-switcher-section + .profile-switcher-section {
    border-top: 1px solid rgba(255,255,255,.06);
    margin-top: .2rem;
    padding-top: .6rem;
}

.profile-switcher-section-title {
    padding: .2rem .45rem .45rem;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.profile-switcher-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .72rem;
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-main);
    transition: background .16s ease, border-color .16s ease;
    border: 1px solid transparent;
}

.profile-switcher-item:hover {
    background: rgba(255,255,255,.05);
    border-color: rgba(249,115,22,.22);
    text-decoration: none;
}

.profile-switcher-item.is-active {
    background: rgba(249,115,22,.08);
    border-color: rgba(249,115,22,.35);
}

.profile-switcher-badge {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .22rem .55rem;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.04);
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .03em;
    color: var(--text-muted);
    text-transform: uppercase;
    white-space: nowrap;
}

.profile-switcher-badge.owner {
    color: #fdba74;
    border-color: rgba(249,115,22,.35);
    background: rgba(249,115,22,.10);
}

.profile-switcher-badge.employee {
    color: #93c5fd;
    border-color: rgba(147,197,253,.25);
    background: rgba(147,197,253,.08);
}

.profile-switcher-badge.customer {
    color: #c4b5fd;
    border-color: rgba(196,181,253,.25);
    background: rgba(196,181,253,.08);
}