/* ==========================================================================
   Invoice Maker — Modern SaaS Design System
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-body: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-subtle: #f8fafc;
    --bg-sidebar: #0f172a;
    --bg-sidebar-hover: #1e293b;
    --bg-sidebar-active: #2563eb;
    --text-main: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --border-strong: #cbd5e1;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-soft: #eff6ff;
    --accent-purple: #7c3aed;
    --accent-purple-soft: #faf5ff;
    --success: #16a34a;
    --success-soft: #dcfce7;
    --warning: #d97706;
    --warning-soft: #fef3c7;
    --danger: #dc2626;
    --danger-soft: #fee2e2;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.06);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    background-color: var(--bg-body) !important;
    color: var(--text-main) !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* App Shell Layout */
body.has-app-shell {
    padding-left: 250px !important;
    min-height: 100vh;
    transition: padding-left 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

body.has-app-shell.sidebar-collapsed {
    padding-left: 68px !important;
}

.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 250px;
    background: var(--bg-sidebar);
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    z-index: 900;
    border-right: 1px solid #1e293b;
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.08);
    transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

body.sidebar-collapsed .app-sidebar {
    width: 68px !important;
}

.app-brand-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-right: 0.65rem;
    transition: all 0.2s ease;
}

.app-brand-wrapper .app-brand {
    border-bottom: none;
    flex: 1;
    overflow: hidden;
}

.app-sidebar-toggle-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.app-sidebar-toggle-btn:hover {
    background: rgba(0, 229, 255, 0.15);
    border-color: rgba(0, 229, 255, 0.35);
    color: #00e5ff;
}

/* Collapsed Sidebar Rules */
body.sidebar-collapsed .app-brand-wrapper {
    justify-content: center;
    padding: 0.75rem 0.35rem;
    flex-direction: column;
    gap: 8px;
}
body.sidebar-collapsed .app-brand-text {
    display: none !important;
}
body.sidebar-collapsed .app-brand {
    padding: 0 !important;
    justify-content: center !important;
}
body.sidebar-collapsed .app-sidebar-toggle-btn {
    width: 28px;
    height: 28px;
}
body.sidebar-collapsed .app-nav-section {
    font-size: 0 !important;
    height: 1px !important;
    padding: 0 !important;
    margin: 0.6rem 0.4rem !important;
    background: rgba(255, 255, 255, 0.08) !important;
    overflow: hidden !important;
}
body.sidebar-collapsed .app-nav-row {
    justify-content: center !important;
}
body.sidebar-collapsed .app-nav-link {
    justify-content: center !important;
    padding: 0.75rem 0 !important;
    width: 100% !important;
    gap: 0 !important;
    position: relative !important;
    border-radius: 10px !important;
}
body.sidebar-collapsed .app-nav-link span:not(.nav-badge) {
    display: none !important;
}
body.sidebar-collapsed .app-nav-link svg {
    margin: 0 !important;
}
body.sidebar-collapsed .subnav-toggle-btn {
    display: none !important;
}
body.sidebar-collapsed .app-subnav {
    display: none !important;
}
body.sidebar-collapsed .app-sidebar-footer {
    padding: 0.75rem 0.35rem !important;
    justify-content: center !important;
}
body.sidebar-collapsed .app-user-info {
    display: none !important;
}
body.sidebar-collapsed .app-logout-btn {
    font-size: 0 !important;
    width: 38px !important;
    height: 38px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
}
body.sidebar-collapsed .app-logout-btn::before {
    content: "⏻";
    font-size: 1.15rem;
}

.app-brand {
    padding: 1.35rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #ffffff;
}

.app-brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
    flex-shrink: 0;
}

.app-brand-text {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-brand-title {
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-brand-sub {
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 500;
}

.app-nav-list {
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    overflow-y: auto;
}

.app-nav-section {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    font-weight: 600;
    padding: 0.75rem 0.75rem 0.35rem;
}

.app-nav-link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.62rem 0.65rem;
    border-radius: 8px;
    color: #cbd5e1 !important;
    text-decoration: none !important;
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.15s ease;
    margin: 0 !important;
}

.app-nav-badge {
    margin-left: auto;
    font-size: 0.62rem;
    line-height: 1;
    background: rgba(0, 229, 255, 0.14);
    color: #00e5ff;
    border: 1px solid rgba(0, 229, 255, 0.28);
    font-weight: 800;
    padding: 3px 6px;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.3px;
}

.app-nav-link svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
    opacity: 0.85;
    flex-shrink: 0;
}

.app-nav-link:hover {
    background: var(--bg-sidebar-hover);
    color: #ffffff !important;
}

.app-nav-link.active {
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(37, 99, 246, 0.3);
}

.app-nav-link.active svg {
    opacity: 1;
}

.app-subnav {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.2rem 0 0.35rem 2.1rem;
    margin-left: 0.85rem;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.app-subnav-link {
    display: flex;
    align-items: center;
    padding: 0.38rem 0.65rem;
    border-radius: 6px;
    color: #94a3b8 !important;
    text-decoration: none !important;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.15s ease;
    margin: 0 !important;
}

.app-subnav-link:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.06);
}

.app-subnav-link.active {
    color: #60a5fa !important;
    font-weight: 600;
    background: rgba(37, 99, 235, 0.15);
}

/* Quick Add Customer inline bar */
.customer-select-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-quick-customer {
    flex-shrink: 0;
    padding: 0.52rem 0.85rem !important;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}

.btn-quick-customer:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}

.app-sidebar-footer {
    padding: 0.9rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background: rgba(15, 23, 42, 0.5);
}

.app-user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-user-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-user-email {
    font-size: 0.72rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-logout-btn {
    padding: 0.4rem 0.65rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0 !important;
    font-size: 0.76rem;
    font-weight: 500;
    text-decoration: none !important;
    transition: all 0.15s;
    flex-shrink: 0;
}

.app-logout-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #fecaca !important;
}

/* Hide legacy inline nav inside container when sidebar is active */
body.has-app-shell nav:not(.app-sidebar-nav):not(.mobile-nav-drawer),
body.has-app-shell > nav,
body.has-app-shell .container > nav,
body.has-app-shell .card > nav {
    display: none !important;
}

/* Main Content Container Overrides */
body.has-app-shell .container {
    max-width: 1240px !important;
    margin: 0 auto !important;
    padding: 2rem 2.5rem !important;
}

/* Special case when .container itself is styled like a card (e.g., business.php) */
body.has-app-shell > .container {
    background: transparent;
    box-shadow: none;
}

/* Headings & Page Headers */
h1 {
    font-size: 1.65rem !important;
    font-weight: 700 !important;
    color: var(--text-main) !important;
    letter-spacing: -0.02em;
    margin-top: 0;
}

h2 {
    font-size: 1.12rem !important;
    font-weight: 600 !important;
    color: var(--text-main) !important;
    letter-spacing: -0.01em;
}

.greeting {
    color: var(--text-muted) !important;
    font-size: 0.95rem;
    margin-top: -0.4rem;
    margin-bottom: 1.75rem !important;
}

a.back {
    display: inline-flex !important;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary) !important;
    font-size: 0.84rem;
    font-weight: 500;
    text-decoration: none !important;
    margin-bottom: 1.25rem !important;
    box-shadow: var(--shadow-sm);
    transition: all 0.15s;
}

a.back:hover {
    border-color: var(--border-strong);
    color: var(--text-main) !important;
    background: var(--bg-subtle);
}

/* Cards & Panels */
.card, .stat-card, .quick-stat {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-sm) !important;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card {
    padding: 1.6rem !important;
    margin-bottom: 1.5rem !important;
}

.stat-card {
    padding: 1.35rem !important;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), #6366f1);
    opacity: 0.85;
}

.stat-label {
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    color: var(--text-muted) !important;
    text-transform: uppercase;
    letter-spacing: 0.05em !important;
}

.stat-value {
    font-size: 1.65rem !important;
    font-weight: 700 !important;
    color: var(--text-main) !important;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

/* Tables */
table {
    width: 100%;
    border-collapse: separate !important;
    border-spacing: 0;
}

th {
    background: var(--bg-subtle);
    color: var(--text-secondary) !important;
    font-size: 0.76rem !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.75rem 0.85rem !important;
    border-bottom: 1px solid var(--border-color) !important;
}

th:first-child {
    border-top-left-radius: var(--radius-sm);
}

th:last-child {
    border-top-right-radius: var(--radius-sm);
}

td {
    padding: 0.8rem 0.85rem !important;
    border-bottom: 1px solid #f1f5f9 !important;
    color: var(--text-main);
    font-size: 0.88rem !important;
    vertical-align: middle;
}

tbody tr {
    transition: background-color 0.12s ease;
}

tbody tr:hover:not(.matrix-group-header) {
    background-color: #f8fafc;
}

a.row-link {
    color: var(--primary) !important;
    font-weight: 600 !important;
    text-decoration: none;
    padding: 0.2rem 0.45rem;
    border-radius: 5px;
    background: var(--primary-soft);
    transition: all 0.15s;
}

a.row-link:hover {
    background: #dbeafe;
    color: var(--primary-hover) !important;
}

/* Modern Inputs & Selects */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
    border: 1px solid var(--border-strong) !important;
    border-radius: var(--radius-sm) !important;
    padding: 0.52rem 0.7rem !important;
    font-size: 0.88rem !important;
    color: var(--text-main);
    background-color: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14) !important;
}

label {
    font-weight: 500;
    color: var(--text-secondary) !important;
}

fieldset {
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    background: var(--bg-subtle);
    padding: 1.25rem !important;
}

legend {
    font-weight: 600 !important;
    color: var(--text-main) !important;
    background: white;
    padding: 0.2rem 0.65rem !important;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    font-size: 0.82rem !important;
}

/* Buttons */
.btn,
button.submit,
.btn-submit,
.btn-download,
.action-btn,
.pay-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-weight: 600 !important;
    border-radius: var(--radius-sm) !important;
    padding: 0.55rem 1.1rem !important;
    font-size: 0.86rem !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
    transition: all 0.15s ease !important;
    cursor: pointer;
    text-decoration: none;
    background: var(--primary);
    color: #ffffff;
    border: none;
}

.btn:not([style*="color"]),
a.btn:not([style*="color"]),
.btn:not([style*="color"]):visited,
a.btn:not([style*="color"]):visited,
.btn-download:not([style*="color"]):visited,
.action-btn:not([style*="color"]):visited {
    color: #ffffff !important;
}

.btn-light-outline,
a.btn-light-outline,
a.btn-light-outline:visited {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
}

.btn-light-outline:hover,
a.btn-light-outline:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}

.btn-secondary,
a.btn-secondary {
    background: #475569 !important;
    color: #ffffff !important;
    border: 1px solid #334155 !important;
}

.btn-secondary:visited,
a.btn-secondary:visited {
    color: #ffffff !important;
}

.btn:hover,
button.submit:hover,
.btn-submit:hover,
.btn-download:hover,
.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.18);
}

.btn:not([style*="color"]):hover,
a.btn:not([style*="color"]):hover,
.btn-download:not([style*="color"]):hover,
.action-btn:not([style*="color"]):hover {
    color: #ffffff !important;
}

.btn-secondary:hover,
a.btn-secondary:hover {
    background: #334155 !important;
    color: #ffffff !important;
}

/* Status Badges */
.badge {
    display: inline-flex !important;
    align-items: center;
    gap: 0.3rem;
    padding: 0.22rem 0.65rem !important;
    border-radius: 999px !important;
    font-size: 0.73rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

/* Table Filter Bar (Global Search + Status Pills) */
.list-filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-color);
}

.status-pills {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.status-pill {
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-subtle);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.status-pill:hover {
    border-color: var(--border-strong);
    color: var(--text-main);
}

.status-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.list-search-input {
    max-width: 260px;
    padding: 0.42rem 0.75rem !important;
    font-size: 0.84rem !important;
}

/* Variant Matrix Advanced Filter Bar */
.matrix-adv-filters {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.6rem;
}

.matrix-adv-filters select,
.matrix-adv-filters input {
    width: auto !important;
    padding: 0.35rem 0.55rem !important;
    font-size: 0.79rem !important;
}

.matrix-filter-badge {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    margin-left: auto;
}

/* Settings Tabs */
.settings-tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
    overflow-x: auto;
    background: var(--bg-subtle);
    padding: 0.4rem 0.4rem 0 0.4rem;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.settings-tab-btn {
    background: transparent;
    border: none;
    padding: 0.65rem 1rem;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}
.settings-tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.7);
}
.settings-tab-btn.active {
    color: var(--primary);
    font-weight: 600;
    background: var(--bg-surface);
    border-bottom: 2px solid var(--primary);
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.04);
}
.settings-tab-pane {
    display: none;
}
.settings-tab-pane.active {
    display: block;
    animation: tabFadeIn 0.15s ease-in-out;
}
@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(3px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Modern Settings & Logo Branding Component
   ========================================================================== */
.logo-branding-widget {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.35rem 1.5rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.25rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.logo-preview-dropzone {
    width: 170px;
    height: 96px;
    flex-shrink: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafbfc;
    background-image: linear-gradient(45deg, #f1f5f9 25%, transparent 25%),
                      linear-gradient(-45deg, #f1f5f9 25%, transparent 25%),
                      linear-gradient(45deg, transparent 75%, #f1f5f9 75%),
                      linear-gradient(-45deg, transparent 75%, #f1f5f9 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}

.logo-preview-dropzone:hover,
.logo-preview-dropzone.drag-active {
    border-color: var(--primary);
    background-color: #eff6ff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.logo-preview-dropzone.has-logo {
    border-style: solid;
    border-color: #e2e8f0;
    background-color: #ffffff;
}

.logo-preview-image {
    max-width: 150px;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    transition: transform 0.2s ease;
}

.logo-preview-dropzone:hover .logo-preview-image {
    transform: scale(1.03);
}

.logo-preview-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.18s ease;
    backdrop-filter: blur(2px);
}

.logo-preview-dropzone:hover .logo-preview-overlay {
    opacity: 1;
}

.logo-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    color: #94a3b8;
    text-align: center;
}

.logo-empty-state svg {
    color: #94a3b8;
}

.logo-empty-label {
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
}

.logo-widget-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.logo-widget-header {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.logo-widget-title {
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.logo-widget-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

.logo-actions-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.2rem;
}

.btn-logo-upload {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.52rem 1rem;
    background: var(--primary);
    color: #ffffff !important;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
    transition: all 0.15s ease;
}

.btn-logo-upload:hover {
    background: var(--primary-hover);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.btn-logo-delete {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.52rem 0.85rem;
    background: #ffffff;
    color: var(--danger) !important;
    border: 1px solid #fecaca;
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-logo-delete:hover {
    background: var(--danger-soft);
    border-color: #fca5a5;
    color: #b91c1c !important;
}

.logo-guidelines {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

.badge-spec {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.logo-upload-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--primary);
}

.spinner-dot {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(37, 99, 235, 0.25);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: logoSpin 0.7s linear infinite;
}

@keyframes logoSpin {
    to { transform: rotate(360deg); }
}

/* Modern Form Section Cards */
.form-section {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.4rem;
    margin-top: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.form-section:first-child {
    margin-top: 0;
}

.form-section-header {
    padding-bottom: 0.7rem;
    margin-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-color);
}

.form-section-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.form-section-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 0.2rem 0 0 0;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 650px) {
    .logo-branding-widget {
        flex-direction: column;
        align-items: flex-start;
    }
    .logo-preview-dropzone {
        width: 100%;
        max-width: 240px;
    }
    .form-grid-2 {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}

/* ==========================================================================
   Native Mobile App Shell & APK Optimization (Android / PWA / Responsive)
   ========================================================================== */

/* Touch Ergonomics & Base Safe Areas */
html, body {
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
}

/* Mobile Topbar */
.app-mobile-topbar {
    display: none;
}

/* Mobile Bottom Navigation Bar */
.app-mobile-bottombar {
    display: none;
}

/* Bottom Sheet Modals */
.mobile-bottom-sheet-overlay {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(15, 23, 42, 0.7) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    z-index: 10005 !important; /* Above bottom bar */
    display: none;
    align-items: flex-end !important;
    justify-content: center !important;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.mobile-bottom-sheet-overlay.active {
    display: flex !important;
    opacity: 1 !important;
}

.mobile-bottom-sheet-content {
    background: #ffffff !important;
    width: 100% !important;
    max-width: 600px !important;
    border-radius: 20px 20px 0 0 !important;
    padding: 1.15rem 1.15rem calc(2rem + env(safe-area-inset-bottom)) 1.15rem !important;
    box-shadow: 0 -10px 35px rgba(0, 0, 0, 0.35) !important;
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
    max-height: 85vh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: contain !important;
    touch-action: pan-y !important;
    box-sizing: border-box !important;
}

.mobile-bottom-sheet-overlay.active .mobile-bottom-sheet-content {
    transform: translateY(0) !important;
}

.mobile-sheet-drag-handle {
    width: 42px;
    height: 4.5px;
    background: #cbd5e1;
    border-radius: 3px;
    margin: 0 auto 1rem auto;
}

.mobile-sheet-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 0.85rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-sheet-close {
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
}

/* Quick Action Cards in Sheet */
.mobile-action-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
    padding-bottom: 0.5rem;
}

.mobile-action-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.8rem 1rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-main);
    transition: background 0.15s, transform 0.12s;
    min-height: 48px;
}

.mobile-action-card:active {
    background: var(--primary-soft);
    transform: scale(0.98);
}

.mobile-action-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mobile-action-icon svg {
    width: 20px;
    height: 20px;
}

.mobile-action-info {
    display: flex;
    flex-direction: column;
}

.mobile-action-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
}

.mobile-action-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

/* Mobile More Menu List */
.mobile-more-profile {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-radius: 12px;
    padding: 1rem 1.15rem;
    color: white;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.mobile-avatar-big {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: white;
    font-weight: 700;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mobile-menu-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.95rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
}

.mobile-menu-item svg {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
}

.mobile-menu-item.logout {
    color: #dc2626;
    background: #fef2f2;
    border-color: #fecaca;
    margin-top: 0.5rem;
}

.mobile-menu-item.logout svg {
    color: #dc2626;
}

/* Breakpoint for Mobile & Tablets (820px and below) */
/* Navigation Drawer (Android Style) */
.mobile-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.mobile-drawer-backdrop.active {
    display: block;
    opacity: 1;
}

.mobile-nav-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 290px;
    max-width: 82vw;
    background: #0f172a;
    color: #f8fafc;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    box-shadow: 10px 0 35px rgba(0, 0, 0, 0.4);
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-nav-drawer.active {
    transform: translateX(0);
}

.mobile-drawer-header {
    padding: calc(1.2rem + env(safe-area-inset-top)) 1.25rem 1.1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-drawer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mobile-drawer-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #cbd5e1;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.mobile-drawer-user {
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mobile-drawer-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mobile-drawer-menu {
    padding: 0.75rem 0.85rem 2rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mobile-drawer-section {
    font-size: 0.7rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.85rem 0.65rem 0.4rem 0.65rem;
}

.mobile-drawer-link-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
}

.mobile-drawer-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 0.85rem;
    border-radius: 8px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.94rem;
    font-weight: 500;
    flex: 1;
    transition: background 0.15s, color 0.15s;
}

.mobile-drawer-link:active,
.mobile-drawer-link.active {
    background: rgba(37, 99, 235, 0.18);
    color: #60a5fa;
    font-weight: 600;
}

.mobile-drawer-link svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    flex-shrink: 0;
}

.mobile-drawer-shortcut-btn {
    padding: 0.35rem 0.65rem;
    background: rgba(37, 99, 235, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-radius: 6px;
    color: #93c5fd;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    flex-shrink: 0;
}

/* Business Option A: Mobile Section Selector */
.mobile-section-picker-wrap {
    display: none;
    margin-bottom: 1.25rem;
}

.mobile-section-picker-sub {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.mobile-section-picker-btn {
    width: 100%;
    min-height: 50px;
    background: #ffffff;
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    box-sizing: border-box;
}

.mobile-section-picker-arrow {
    font-size: 0.8rem;
    color: var(--primary);
    background: var(--primary-soft);
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    font-weight: 600;
}

.active-sheet-tab {
    background: var(--primary-soft) !important;
    border-color: #bfdbfe !important;
}

/* Breakpoint for Mobile & Tablets (820px and below) */
@media (max-width: 820px) {
    /* Hide desktop sidebar */
    .app-sidebar {
        display: none !important;
    }

    body.has-app-shell {
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-top: calc(56px + env(safe-area-inset-top) + 0.6rem) !important;
        padding-bottom: calc(75px + env(safe-area-inset-bottom) + 1.2rem) !important;
    }

    /* Show Topbar */
    .app-mobile-topbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: calc(56px + env(safe-area-inset-top));
        padding-top: env(safe-area-inset-top);
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        background: #0f172a;
        color: #f8fafc;
        display: flex;
        align-items: center;
        justify-content: space-between;
        z-index: 990;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    }

    .app-mobile-topbar-left {
        display: flex;
        align-items: center;
        gap: 0.65rem;
        overflow: hidden;
    }

    .app-mobile-hamburger-btn {
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.15);
        border-radius: 8px;
        width: 38px;
        height: 38px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #ffffff !important;
        cursor: pointer;
        flex-shrink: 0;
    }

    .app-mobile-hamburger-btn svg {
        width: 22px !important;
        height: 22px !important;
        stroke: #ffffff !important;
        stroke-width: 2.5px !important;
        fill: none !important;
        display: block !important;
    }

    .app-mobile-hamburger-btn svg line {
        stroke: #ffffff !important;
        stroke-width: 2.5px !important;
    }

    .app-mobile-back-btn {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.15);
        color: #ffffff;
        text-decoration: none;
        padding: 0.35rem 0.7rem;
        border-radius: 8px;
        font-size: 0.85rem;
        font-weight: 600;
        flex-shrink: 0;
    }

    .app-mobile-back-btn svg {
        width: 18px;
        height: 18px;
    }

    .app-mobile-brand-link {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        text-decoration: none;
        color: #ffffff;
        overflow: hidden;
    }

    .app-mobile-topbar-title {
        font-weight: 700;
        font-size: 1rem;
        letter-spacing: -0.01em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .app-mobile-topbar-actions {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex-shrink: 0;
    }

    .app-mobile-avatar-btn {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: linear-gradient(135deg, #3b82f6, #6366f1);
        color: white;
        font-weight: 700;
        font-size: 0.9rem;
        border: 2px solid rgba(255, 255, 255, 0.2);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Show Bottom Navigation Bar - ALWAYS VISIBLE, PINNED, HIGH Z-INDEX */
    .app-mobile-bottombar {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        height: calc(60px + env(safe-area-inset-bottom)) !important;
        padding-bottom: env(safe-area-inset-bottom) !important;
        background: #ffffff !important;
        border-top: 1px solid var(--border-color) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-around !important;
        z-index: 9999 !important;
        box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.12) !important;
    }

    .mobile-nav-link {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: var(--text-muted);
        font-size: 0.72rem;
        font-weight: 500;
        gap: 3px;
        flex: 1;
        height: 100%;
        background: transparent;
        border: none;
        cursor: pointer;
        transition: color 0.15s;
    }

    .mobile-nav-link svg {
        width: 22px;
        height: 22px;
    }

    .mobile-nav-link.active {
        color: var(--primary);
        font-weight: 700;
    }

    .mobile-nav-link.active svg {
        stroke: var(--primary);
        stroke-width: 2.2px;
    }

    /* Floating Action Center Button (FAB) */
    .mobile-nav-fab {
        width: 48px;
        height: 48px;
        border-radius: 50%;
        background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 3px solid #ffffff;
        box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
        transform: translateY(-12px);
        cursor: pointer;
        flex-shrink: 0;
        transition: transform 0.15s ease;
    }

    .mobile-nav-fab:active {
        transform: translateY(-10px) scale(0.95);
    }

    .mobile-nav-fab svg {
        width: 24px !important;
        height: 24px !important;
        stroke: #ffffff !important;
        stroke-width: 2.8px !important;
        fill: none !important;
        display: block !important;
    }

    .mobile-nav-fab svg line {
        stroke: #ffffff !important;
        stroke-width: 2.8px !important;
    }

    /* Container adjustments on Mobile */
    .container, body.has-app-shell .container {
        padding: 0 1rem !important;
        margin-top: 0.5rem !important;
        margin-bottom: 1.5rem !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Top greeting and Header rows */
    .header-row {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.8rem;
    }

    .header-row .btn, .header-row a.btn {
        width: 100%;
        text-align: center;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Stats Grid on Mobile */
    .stats-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.75rem !important;
    }

    .quick-stats {
        grid-template-columns: 1fr !important;
        gap: 0.6rem !important;
    }

    .two-col {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    /* Card-Based Mobile Responsive Tables (Invoices, Quotations, Customers, Products) */
    .card table:not(:has(#lineItemsBody)) {
        display: block !important;
        width: 100% !important;
        border-collapse: separate !important;
    }

    .card table:not(:has(#lineItemsBody)) thead {
        display: none !important;
    }

    .card table:not(:has(#lineItemsBody)) tbody {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.75rem !important;
    }

    .card table:not(:has(#lineItemsBody)) tbody tr {
        display: block !important;
        background: #ffffff !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 12px !important;
        padding: 0.95rem 1rem !important;
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
        position: relative !important;
    }

    /* Clean empty-state table cards */
    .card table tbody tr:has(td[colspan]),
    .card table tbody tr.table-empty-row {
        display: block !important;
        text-align: center !important;
        padding: 1.6rem 1rem !important;
        background: #f8fafc !important;
        border: 1px dashed var(--border-color) !important;
        border-radius: 12px !important;
        color: var(--text-muted) !important;
        margin-bottom: 0.5rem !important;
    }

    .card table tbody tr:has(td[colspan]) td,
    .card table tbody tr.table-empty-row td {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.6rem !important;
        border: none !important;
        text-align: center !important;
        font-size: 0.95rem !important;
        padding: 0 !important;
    }

    .card table tbody tr:has(td[colspan]) td::before,
    .card table tbody tr.table-empty-row td::before {
        display: none !important;
    }

    .card table tbody tr:has(td[colspan]) td a,
    .card table tbody tr.table-empty-row td a {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0.5rem 1.2rem !important;
        background: var(--primary) !important;
        color: #ffffff !important;
        border-radius: 8px !important;
        font-size: 0.88rem !important;
        font-weight: 600 !important;
        text-decoration: none !important;
        margin-top: 0.25rem !important;
        box-shadow: 0 1px 3px rgba(37, 99, 235, 0.2) !important;
    }

    .card table:not(:has(#lineItemsBody)) tbody td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 0.35rem 0 !important;
        border-bottom: 1px dashed #f1f5f9 !important;
        font-size: 0.9rem !important;
    }

    .card table:not(:has(#lineItemsBody)) tbody td:last-child {
        border-bottom: none !important;
        padding-top: 0.5rem !important;
        margin-top: 0.2rem !important;
        font-weight: 700 !important;
        font-size: 1.05rem !important;
        color: var(--text-main) !important;
    }

    .card table:not(:has(#lineItemsBody)) tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        margin-right: 0.5rem;
    }

    /* Primary link on card */
    .card table:not(:has(#lineItemsBody)) tbody td:first-child a.row-link {
        font-size: 1.02rem;
        font-weight: 700;
    }

    /* Forms & Touch Ergonomics */
    input, select, textarea, button {
        min-height: 48px;
        font-size: 16px !important; /* Prevents auto-zoom in mobile browsers & WebViews */
        border-radius: 8px !important;
    }

    .row {
        flex-direction: column !important;
        gap: 0.6rem !important;
    }

    /* Unsquished Customer Selector Row on Mobile */
    .customer-select-row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.55rem !important;
        width: 100% !important;
    }

    .customer-select-row select {
        width: 100% !important;
        min-height: 48px !important;
    }

    .customer-select-row .btn-quick-customer {
        width: 100% !important;
        min-height: 44px !important;
        text-align: center !important;
        justify-content: center !important;
    }

    /* Unsquished Deposit Request Row */
    .deposit-row-wrap {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.5rem !important;
    }

    .deposit-row-wrap select,
    .deposit-row-wrap input {
        width: 100% !important;
    }

    /* Unsquished Phone Field Row */
    .phone-wrap {
        display: flex !important;
        align-items: stretch !important;
        width: 100% !important;
        box-sizing: border-box !important;
        border-radius: 6px !important;
    }

    .phone-wrap select {
        max-width: 45% !important;
        min-width: 110px !important;
        flex: 0 0 auto !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        overflow: hidden !important;
    }

    .phone-wrap input[type=tel] {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        width: 100% !important;
    }

    /* ==========================================================
       MOBILE UNSQUISHED LINE-ITEMS EDITOR (Invoices & Quotations)
       ========================================================== */
    table:has(#lineItemsBody),
    #lineItemsBody {
        display: block !important;
        width: 100% !important;
    }

    table:has(#lineItemsBody) thead {
        display: none !important;
    }

    #lineItemsBody tr.line-item {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.75rem !important;
        background: #ffffff !important;
        border: 1.5px solid #cbd5e1 !important;
        border-radius: 14px !important;
        padding: 1rem !important;
        margin-bottom: 1rem !important;
        box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05) !important;
        position: relative !important;
        box-sizing: border-box !important;
    }

    #lineItemsBody tr.line-item td {
        display: block !important;
        width: 100% !important;
        padding: 0 !important;
        border: none !important;
        box-sizing: border-box !important;
    }

    #lineItemsBody tr.line-item td::before {
        display: none !important;
    }

    /* Description spans full width */
    #lineItemsBody tr.line-item td.col-desc {
        grid-column: 1 / -1 !important;
        padding-right: 2.8rem !important; /* clear delete button */
    }

    /* Delete Button in Top Right */
    #lineItemsBody tr.line-item td.col-remove {
        position: absolute !important;
        top: 0.8rem !important;
        right: 0.8rem !important;
        width: auto !important;
        padding: 0 !important;
    }

    #lineItemsBody tr.line-item .remove-btn {
        width: 36px !important;
        height: 36px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: #fee2e2 !important;
        color: #dc2626 !important;
        border-radius: 8px !important;
        font-size: 1.3rem !important;
        font-weight: bold !important;
        border: none !important;
        cursor: pointer !important;
    }

    /* Quantity & Price side-by-side in equal 50% grid columns */
    #lineItemsBody tr.line-item td.col-qty {
        grid-column: 1 / 2 !important;
    }

    #lineItemsBody tr.line-item td.col-price {
        grid-column: 2 / 3 !important;
    }

    #lineItemsBody tr.line-item td.col-qty::before {
        content: "Quantity" !important;
        display: block !important;
        font-size: 0.75rem !important;
        font-weight: 600 !important;
        color: var(--text-muted) !important;
        margin-bottom: 0.25rem !important;
    }

    #lineItemsBody tr.line-item td.col-price::before {
        content: "Unit Price (R)" !important;
        display: block !important;
        font-size: 0.75rem !important;
        font-weight: 600 !important;
        color: var(--text-muted) !important;
        margin-bottom: 0.25rem !important;
    }

    /* Discount & VAT side-by-side in equal 50% grid columns */
    #lineItemsBody tr.line-item td.col-disc {
        grid-column: 1 / 2 !important;
    }

    #lineItemsBody tr.line-item td.col-disc::before {
        content: "Discount" !important;
        display: block !important;
        font-size: 0.75rem !important;
        font-weight: 600 !important;
        color: var(--text-muted) !important;
        margin-bottom: 0.25rem !important;
    }

    #lineItemsBody tr.line-item td.col-vat {
        grid-column: 2 / 3 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-end !important;
        text-align: left !important;
    }

    #lineItemsBody tr.line-item td.col-vat::before {
        content: "VAT (15%)" !important;
        display: block !important;
        font-size: 0.75rem !important;
        font-weight: 600 !important;
        color: var(--text-muted) !important;
        margin-bottom: 0.25rem !important;
    }

    #lineItemsBody tr.line-item td.col-vat input[type="checkbox"] {
        width: 26px !important;
        height: 26px !important;
        cursor: pointer !important;
        min-height: auto !important;
        margin: 0.25rem 0 !important;
    }

    /* Line Total row at bottom spans full width */
    #lineItemsBody tr.line-item td.col-total {
        grid-column: 1 / -1 !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        border-top: 1px dashed #cbd5e1 !important;
        padding-top: 0.65rem !important;
        margin-top: 0.2rem !important;
        font-size: 1.1rem !important;
        font-weight: 700 !important;
        color: var(--text-main) !important;
    }

    #lineItemsBody tr.line-item td.col-total::before {
        content: "Line Total" !important;
        display: block !important;
        font-size: 0.85rem !important;
        font-weight: 600 !important;
        color: var(--text-muted) !important;
    }

    /* Sticky submit button on creation forms */
    button.submit,
    .btn-create-submit {
        position: sticky !important;
        bottom: calc(65px + env(safe-area-inset-bottom)) !important;
        width: 100% !important;
        min-height: 52px !important;
        font-size: 1.05rem !important;
        font-weight: 700 !important;
        border-radius: 12px !important;
        background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
        color: white !important;
        box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4) !important;
        z-index: 100 !important;
        margin-top: 1rem !important;
        margin-bottom: 1rem !important;
    }

    /* Ample bottom scroll padding so all items scroll past sticky button */
    body.has-app-shell:has(button.submit, .btn-create-submit) .container,
    body.has-app-shell:has(#invoiceForm) .container,
    body.has-app-shell:has(#invoiceForm) {
        padding-bottom: calc(140px + env(safe-area-inset-bottom)) !important;
    }

    /* Unsquished View Screens (Invoices & Quotations) */
    .bank-grid {
        grid-template-columns: 1fr !important;
        gap: 0.45rem !important;
    }

    .actions {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.55rem !important;
    }

    .actions .action-btn,
    .actions .btn-download,
    .actions a.btn,
    .actions form {
        width: 100% !important;
        text-align: center !important;
        min-height: 46px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Modals convert to Native Bottom Sheets on Mobile */
    .modal-overlay {
        align-items: flex-end !important;
        padding: 0 !important;
        z-index: 10005 !important;
    }

    .modal-card {
        max-width: 100% !important;
        border-radius: 20px 20px 0 0 !important;
        max-height: 85vh !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior-y: contain !important;
        touch-action: pan-y !important;
        animation: slideUpModal 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
        padding-bottom: calc(1.5rem + env(safe-area-inset-bottom)) !important;
    }

    @keyframes slideUpModal {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    /* Mobile Option A Section Selector */
    .mobile-section-picker-wrap {
        display: block !important;
    }

    .settings-tabs {
        display: none !important;
    }

    /* List filter bar on mobile */
    .list-filter-bar {
        flex-direction: column !important;
        gap: 0.6rem !important;
    }

    .status-pills {
        overflow-x: auto !important;
        white-space: nowrap !important;
        padding-bottom: 0.3rem !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .status-pill {
        flex-shrink: 0 !important;
    }

    .list-search-input {
        width: 100% !important;
    }

    .vat-mode-selector {
        width: 100% !important;
        flex-direction: column !important;
    }

    .vat-mode-btn {
        min-height: 48px !important;
        justify-content: flex-start !important;
        padding: 0.6rem 0.9rem !important;
    }

    body.is-not-vat-registered #lineItemsBody tr.line-item td.col-disc {
        grid-column: 1 / 3 !important;
    }
}

/* Suppress VAT elements when business is not VAT registered */
body.is-not-vat-registered .col-vat,
body.is-not-vat-registered #vatTotalRow,
body.is-not-vat-registered .th-vat,
body.is-not-vat-registered .td-vat {
    display: none !important;
}

/* Product VAT Pricing Mode Toggle */
.vat-mode-selector {
    display: inline-flex;
    background: #e2e8f0;
    padding: 3px;
    border-radius: 8px;
    gap: 3px;
    max-width: 460px;
}
.vat-mode-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
    text-align: center;
    min-height: 42px;
}
.vat-mode-btn input[type="radio"] {
    accent-color: #2563eb;
    margin: 0;
    width: 16px;
    height: 16px;
}
.vat-mode-btn.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.vat-breakdown-box {
    margin-top: 0.45rem;
    padding: 0.65rem 0.85rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.83rem;
    line-height: 1.45;
    color: #334155;
}



/* ==========================================================================
   Collapsible Sidebar Navigation (PC Standard)
   ========================================================================== */
.app-nav-group {
    display: flex;
    flex-direction: column;
}

.app-nav-row {
    display: flex;
    align-items: center;
    position: relative;
}

.app-nav-row .app-nav-link {
    flex: 1;
    min-width: 0;
}

.subnav-toggle-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 6px 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    margin-right: 4px;
    transition: background 0.15s ease, color 0.15s ease;
}

.subnav-toggle-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.subnav-toggle-btn svg {
    width: 14px;
    height: 14px;
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-nav-group.collapsed .app-subnav {
    display: none !important;
}

.app-nav-group.collapsed .subnav-toggle-btn svg {
    transform: rotate(-90deg);
}

.app-nav-group.expanded .subnav-toggle-btn svg {
    transform: rotate(0deg);
}

/* ==========================================================================
   Top-Right Notification System (Desktop & Mobile)
   ========================================================================== */
.app-desktop-top-right {
    position: fixed;
    top: 14px;
    right: 24px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-top-notification-btn {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #0f172a;
    border: 1px solid #334155;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    transition: all 0.15s ease;
}

.app-top-notification-btn:hover {
    background: #1e293b;
    border-color: #00e5ff;
    color: #00e5ff;
    transform: translateY(-1px);
}

.app-mobile-notif-btn {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.app-top-notif-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 17px;
    height: 17px;
    border-radius: 999px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

.app-notif-popover {
    position: fixed;
    top: 66px;
    right: 24px;
    width: 360px;
    max-width: 92vw;
    background: #0f172a !important;
    border: 1px solid #334155;
    border-radius: 14px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.85);
    z-index: 1001;
    overflow: hidden;
    opacity: 1 !important;
}

.app-notif-header {
    padding: 0.85rem 1.1rem;
    background: #0d1527;
    border-bottom: 1px solid #334155;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-notif-counter {
    background: rgba(0, 229, 255, 0.15);
    color: #00e5ff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
}

.btn-notif-refresh {
    background: none;
    border: none;
    color: #00e5ff;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.btn-notif-refresh:hover {
    text-decoration: underline;
}

.app-notif-list {
    max-height: 380px;
    overflow-y: auto;
}

.app-notif-item {
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease;
}

.app-notif-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.app-notif-item.unread {
    background: rgba(0, 229, 255, 0.05);
}

.app-notif-icon-wrap {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.app-notif-content {
    flex: 1;
    min-width: 0;
}

.app-notif-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.app-notif-desc {
    font-size: 0.78rem;
    color: #94a3b8;
    line-height: 1.4;
    word-break: break-word;
}

.app-notif-time {
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 4px;
}

@media (max-width: 820px) {
    .app-desktop-top-right {
        display: none !important;
    }
    .app-notif-popover {
        top: 60px;
        right: 12px;
        left: 12px;
        width: auto;
        max-width: 100%;
    }
}

/* ==========================================================================
   Floating Support Desk Widget (Global Bottom-Right)
   ========================================================================== */
.support-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #0f172a;
    border: 2px solid #00e5ff;
    color: #00e5ff;
    box-shadow: 0 6px 20px rgba(0, 229, 255, 0.35);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9990;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.support-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 26px rgba(0, 229, 255, 0.55);
}

.support-fab svg {
    width: 26px;
    height: 26px;
}

.support-fab-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.7);
}

.support-widget-panel {
    position: fixed;
    bottom: 92px;
    right: 24px;
    width: 420px;
    height: 580px;
    max-height: calc(100vh - 120px);
    max-width: 95vw;
    background: #0f172a !important;
    border: 1px solid #334155;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85);
    z-index: 9991;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 1 !important;
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.support-widget-header {
    padding: 1rem 1.25rem;
    background: #0d1527;
    border-bottom: 1px solid #334155;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.support-widget-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #ffffff;
}

.support-widget-sub {
    font-size: 0.74rem;
    color: #94a3b8;
}

.support-widget-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-widget-action {
    background: rgba(0, 229, 255, 0.12);
    border: 1px solid rgba(0, 229, 255, 0.35);
    color: #00e5ff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-widget-action:hover {
    background: rgba(0, 229, 255, 0.25);
}

.btn-widget-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

.btn-widget-close:hover {
    color: #ffffff;
}

.support-widget-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: #0f172a;
    color: #f8fafc;
}

.widget-ticket-item {
    padding: 0.9rem 1.15rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: background 0.15s ease;
}

.widget-ticket-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.widget-ticket-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.widget-ticket-num {
    font-size: 0.8rem;
    font-weight: 700;
    color: #00e5ff;
}

.widget-ticket-badge {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 999px;
    text-transform: uppercase;
}

.widget-ticket-subj {
    font-size: 0.88rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
    line-height: 1.35;
}

.widget-ticket-cat {
    font-size: 0.72rem;
    color: #94a3b8;
}

/* Conversation View */
.widget-convo-header {
    padding: 0.85rem 1.1rem;
    background: #0d1527;
    border-bottom: 1px solid #334155;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-convo-back {
    background: transparent;
    border: 1px solid #334155;
    color: #00e5ff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
}

.widget-convo-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.convo-bubble {
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    font-size: 0.84rem;
    line-height: 1.45;
    max-width: 85%;
}

.convo-bubble.client {
    align-self: flex-end;
    background: #2563eb;
    color: #ffffff;
    border-bottom-right-radius: 2px;
}

.convo-bubble.admin {
    align-self: flex-start;
    background: #1e293b;
    border: 1px solid #334155;
    color: #f1f5f9;
    border-bottom-left-radius: 2px;
}

.convo-bubble-meta {
    font-size: 0.68rem;
    opacity: 0.75;
    margin-top: 4px;
    display: flex;
    justify-content: space-between;
}

.widget-reply-box {
    padding: 0.75rem 1rem;
    background: #0d1527;
    border-top: 1px solid #334155;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.widget-reply-input {
    width: 100%;
    min-height: 60px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 0.6rem;
    color: #ffffff;
    font-size: 16px;
    font-family: inherit;
    resize: none;
    box-sizing: border-box;
}

.widget-reply-input:focus {
    outline: none;
    border-color: #00e5ff;
}

.btn-widget-reply-send {
    align-self: flex-end;
    background: #00e5ff;
    color: #0b1120;
    border: none;
    border-radius: 6px;
    padding: 0.45rem 1rem;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
}

/* Mobile Support Widget (Bottom Sheet) */
@media (max-width: 820px) {
    .support-fab {
        bottom: calc(75px + env(safe-area-inset-bottom));
        right: 16px;
        width: 52px;
        height: 52px;
    }
    .support-widget-panel {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 85vh;
        max-height: 85vh;
        border-radius: 20px 20px 0 0;
        z-index: 9999;
    }
}

.redacted-chip {
    display: inline-block;
    background: #0f172a;
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.45);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.85em;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 5px;
}

/* Clean Print / PDF Mode */
@media print {
    .app-sidebar,
    .app-mobile-topbar,
    .app-mobile-bottombar,
    .mobile-nav-drawer,
    .mobile-nav-backdrop,
    .support-fab,
    .support-widget-panel,
    .app-notif-popover {
        display: none !important;
    }

    body.has-app-shell {
        padding-left: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        background: #ffffff !important;
    }

    .darc-desktop-titlebar {
        display: none !important;
    }
}

/* ==========================================================================
   Native Desktop App — Custom Dark Blueprint Window Titlebar
   ========================================================================== */
body.is-desktop-app {
    padding-top: 38px !important;
}

body.is-desktop-app .app-sidebar {
    top: 38px !important;
    height: calc(100vh - 38px) !important;
}

body.is-desktop-app #desktopNotifBtn {
    top: 52px !important;
}

.darc-desktop-titlebar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 38px;
    background: #0b1120;
    border-bottom: 1px solid #1e293b;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 0 12px;
    z-index: 12000;
    user-select: none;
    -webkit-app-region: drag;
    color: #e2e8f0;
    font-size: 0.78rem;
}

.dt-left,
.dt-right {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
}

.dt-logo {
    background: #00e5ff;
    color: #0b1120;
    font-weight: 900;
    font-size: 0.68rem;
    padding: 2px 5px;
    border-radius: 4px;
    letter-spacing: 0.4px;
}

.dt-app-name {
    font-weight: 700;
    color: #f8fafc;
    letter-spacing: 0.2px;
}

.dt-nav-btns {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: 6px;
    -webkit-app-region: no-drag;
}

.dt-icon-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    width: 28px;
    height: 26px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dt-icon-btn:hover {
    background: #1e293b;
    color: #ffffff;
}

.dt-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.14);
    color: #34d399;
    font-size: 0.68rem;
    font-weight: 700;
    margin-left: 4px;
}

.dt-status-pill.offline {
    background: rgba(245, 158, 11, 0.16);
    color: #fbbf24;
}

.dt-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.dt-prefs-btn,
.dt-win-btn {
    -webkit-app-region: no-drag;
    background: transparent;
    border: none;
    color: #cbd5e1;
    height: 100%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

.dt-prefs-btn {
    font-size: 0.74rem;
    font-weight: 700;
    padding: 0 10px;
    color: #00e5ff;
}

.dt-prefs-btn:hover {
    background: #1e293b;
}

.dt-win-btn {
    width: 44px;
    font-size: 0.85rem;
}

.dt-win-btn:hover {
    background: #1e293b;
    color: #ffffff;
}

.dt-win-close:hover {
    background: #dc2626 !important;
    color: #ffffff !important;
}

.dt-prefs-popover {
    -webkit-app-region: no-drag;
    position: absolute;
    top: 42px;
    right: 120px;
    width: 280px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 0.9rem 1rem;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55);
    z-index: 12005;
}

.dt-pref-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 0;
    border-bottom: 1px dashed #1e293b;
    font-size: 0.8rem;
    color: #e2e8f0;
    cursor: pointer;
}

.dt-pref-row:last-child {
    border-bottom: none;
}

.dt-pref-row input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: #00e5ff;
}

/* ==========================================================================
   Multi-Business Account Switcher & Link Modal (Mobile + Browser + Desktop)
   ========================================================================== */
.app-biz-switcher-wrap {
    padding: 0.55rem 0.75rem 0.2rem 0.75rem;
    position: relative;
}

.app-biz-switcher-btn {
    width: 100%;
    min-height: 46px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 10px;
    padding: 0.4rem 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    cursor: pointer;
    color: #f8fafc;
    text-align: left;
    transition: all 0.15s ease;
}

.app-biz-switcher-btn:hover {
    background: rgba(0, 229, 255, 0.08);
    border-color: rgba(0, 229, 255, 0.35);
}

.app-biz-avatar {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    background: linear-gradient(135deg, #0284c7, #2563eb);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.app-biz-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.app-biz-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-biz-sub {
    font-size: 0.68rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-biz-count-badge {
    background: #00e5ff;
    color: #0f172a;
    font-size: 0.65rem;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 999px;
    flex-shrink: 0;
}

.app-biz-chevron {
    color: #94a3b8;
    flex-shrink: 0;
}

.app-biz-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0.75rem;
    right: 0.75rem;
    background: #0b1120;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55);
    z-index: 10050;
}

.app-biz-menu-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.55rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.app-biz-menu-item:hover {
    background: #1e293b;
}

.app-biz-menu-item.active {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.app-biz-add-btn {
    margin-top: 0.25rem;
    min-height: 40px;
    width: 100%;
    background: rgba(0, 229, 255, 0.12);
    color: #00e5ff;
    border: 1px dashed rgba(0, 229, 255, 0.4);
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
}

.app-biz-add-btn:hover {
    background: #00e5ff;
    color: #0f172a;
}

body.sidebar-collapsed .app-biz-switcher-wrap {
    padding: 0.4rem 0.35rem;
}

body.sidebar-collapsed .app-biz-switcher-btn {
    justify-content: center;
    padding: 0.4rem;
}

body.sidebar-collapsed .app-biz-meta,
body.sidebar-collapsed .app-biz-count-badge,
body.sidebar-collapsed .app-biz-chevron {
    display: none !important;
}

body.sidebar-collapsed .app-biz-menu {
    left: 64px;
    width: 240px;
}

.darc-biz-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.75);
    z-index: 12500;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.darc-biz-modal-card {
    background: #0f172a;
    border: 1px solid rgba(0, 229, 255, 0.35);
    border-radius: 16px;
    width: 100%;
    max-width: 440px;
    padding: 1.5rem;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

@media (max-width: 820px) {
    .darc-biz-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }
    .darc-biz-modal-card {
        border-radius: 20px 20px 0 0;
        max-width: 100%;
    }
}
