/* public/assets/css/app.css */

/* ====== Theme Foundations ====== */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Manrope:wght@400;500;600;700&display=swap');

:root {
    --bg-body: #f3f5f9;
    --bg-panel: #ffffff;
    --bg-soft: #f5f7fb;
    --accent: #2563eb;
    --accent-strong: #1d4ed8;
    --accent-soft: rgba(37, 99, 235, 0.16);
    --accent-amber: #0ea5e9;
    --text-main: #0f172a;
    --text-muted: #4b5563;
    --border: #e2e8f0;
    --danger: #dc2626;
    --radius-lg: 20px;
    --shadow-soft: 0 22px 54px rgba(15, 23, 42, 0.08);
    --sidebar-width: 240px;
    --panel-glow: 0 20px 52px rgba(37, 99, 235, 0.18);
}

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

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Manrope', 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-main);
    background:
        radial-gradient(circle at 6% 0%, rgba(37, 99, 235, 0.18), transparent 42%),
        radial-gradient(circle at 90% 10%, rgba(14, 165, 233, 0.16), transparent 40%),
        #eef3fb;
}

h1,
h2,
h3,
h4 {
    font-family: 'Space Grotesk', 'Manrope', 'Segoe UI', sans-serif;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0;
}

p {
    margin: 0;
}

a {
    color: var(--accent-strong);
    text-decoration: none;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

/* ========= Global page loader ========= */
.page-loader {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #0f172a, #1f2937);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity .3s ease;
}

.page-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.subscription-alert {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 120;
    margin: 0 auto;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid #f59e0b;
    background: linear-gradient(135deg, #fff7ed, #fff3e0);
    color: #9a3412;
    font-size: 13px;
    display: none;
    max-width: 1180px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

body.has-subscription-alert .subscription-alert {
    display: block;
}

.page-loader .spinner {
    width: 56px;
    height: 56px;
    border-radius: 999px;
    border: 4px solid rgba(255, 255, 255, 0.16);
    border-top-color: var(--accent);
    animation: spin .8s linear infinite;
}

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

/* ========= AUTH / LOGIN ========= */
.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.16), rgba(15, 23, 42, 0.25)),
        radial-gradient(circle at 80% 0%, rgba(37, 99, 235, 0.18), transparent 35%),
        #0f172a;
}

.auth-panel {
    width: min(460px, 100%);
    background: rgba(255, 255, 255, 0.97);
    border-radius: 28px;
    box-shadow: 0 26px 56px rgba(15, 23, 42, 0.22);
    padding: 30px 26px 24px;
    border: 1px solid rgba(226, 232, 240, 0.75);
    backdrop-filter: blur(18px);
}

.auth-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.auth-logo-circle {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #f8fafc;
    font-size: 20px;
    box-shadow: var(--panel-glow);
}

.auth-title {
    font-size: 22px;
    font-weight: 700;
}

.auth-sub {
    font-size: 14px;
    color: var(--text-muted);
}

.auth-form {
    margin-top: 14px;
}

.auth-form .field {
    margin-bottom: 16px;
}

.auth-form label {
    display: block;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.auth-form input[type="text"],
.auth-form input[type="password"],
.auth-form input[type="email"] {
    width: 100%;
    padding: 12px 13px;
    border-radius: 14px;
    border: 1px solid var(--border);
    font-size: 15px;
    outline: none;
    background: var(--bg-soft);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.auth-form input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent-soft);
    background: #ffffff;
}

.auth-form .error-box {
    background: #fef2f2;
    color: #b91c1c;
    border-radius: 12px;
    border: 1px solid #fecaca;
    padding: 9px 11px;
    font-size: 13px;
    margin-bottom: 10px;
}

.auth-form .actions {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-primary {
    border: none;
    border-radius: 14px;
    padding: 11px 20px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    color: #f8fafc;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 16px 34px rgba(37, 99, 235, 0.28);
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    filter: brightness(1.02);
    box-shadow: 0 18px 36px rgba(37, 99, 235, 0.32);
}

.btn-primary:active {
    transform: translateY(0);
}

.auth-footer-note {
    margin-top: 18px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

/* Small neutral button style */
.btn-sm {
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    font-size: 12px;
    padding: 5px 10px;
    cursor: pointer;
}

.btn-sm-danger {
    border-color: #fecaca;
    background: #fee2e2;
    color: #b91c1c;
}

/* ========= FORM OVERRIDES ========= */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="date"],
select,
textarea {
    border: 1px solid var(--border);
    background: var(--bg-soft);
    color: var(--text-main);
    border-radius: 12px;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 1px var(--accent-soft) !important;
    background: #ffffff;
    outline: none;
}

/* ========= APP SHELL (SIDEBAR + MAIN) ========= */
.app-shell {
    min-height: 100vh;
    display: flex;
    background: radial-gradient(circle at 20% 0%, rgba(37, 99, 235, 0.12), transparent 32%), var(--bg-body);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: #ffffff;
    color: #0f172a;
    display: flex;
    flex-direction: column;
    padding: 18px 14px 16px;
    position: relative;
    z-index: 30;
    flex-shrink: 0;
    border-right: 1px solid #e5e7eb;
    box-shadow: 10px 0 20px rgba(15, 23, 42, 0.05);
    overflow-y: auto;
    background: linear-gradient(180deg, #ffffff 0%, #f7f9fb 100%);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.sidebar-logo-circle {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    color: #f8fafc;
    box-shadow: var(--panel-glow);
}

.sidebar-company {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sidebar-company-name {
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
}

.sidebar-company-sub {
    font-size: 11px;
    color: #4b5563;
}

.sidebar-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    margin-bottom: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f6f8fb;
}

.sidebar-profile-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #2563eb;
    color: #f8fafc;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.sidebar-profile-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-profile-name {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

.sidebar-profile-role {
    font-size: 11px;
    color: #6b7280;
}

.sidebar-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 9px 12px;
    margin-bottom: 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    color: #ffffff;
    font-weight: 800;
    border: 1px solid rgba(37, 99, 235, 0.28);
    text-decoration: none;
    box-shadow: 0 12px 20px rgba(37, 99, 235, 0.22);
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}

.sidebar-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 24px rgba(37, 99, 235, 0.32);
    filter: brightness(1.02);
}

.sidebar-nav-heading {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7280;
    padding: 8px 6px 6px 6px;
}

.sidebar-nav {
    margin-top: 6px;
    flex: 1;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 7px 10px 7px 11px;
    border-radius: 11px;
    font-size: 14px;
    text-decoration: none;
    color: #111827;
    margin-bottom: 6px;
    transition: background-color .15s ease, color .15s ease, box-shadow .15s ease, transform .12s ease;
    border: 1px solid transparent;
    position: relative;
}

.sidebar-nav a span.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 6px;
    width: 26px;
    height: 26px;
    border-radius: 9px;
    background: rgba(37, 99, 235, 0.08);
    color: #1f2937;
    font-weight: 800;
    letter-spacing: 0.01em;
    font-size: 12px;
}

.sidebar-nav a .chevron {
    margin-left: auto;
    font-size: 11px;
    color: #9ca3af;
}

.sidebar-nav a:hover {
    background: #f5f7fb;
    color: #0f172a;
    transform: translateX(1px);
    border-color: #e5e7eb;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.sidebar-nav a.active {
    background: linear-gradient(120deg, rgba(37, 99, 235, 0.1), rgba(14, 165, 233, 0.14));
    color: #0f172a;
    border-color: rgba(37, 99, 235, 0.3);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 22px rgba(37, 99, 235, 0.18);
}

.sidebar-nav a.active .icon {
    background: #2563eb;
    color: #ffffff;
}

.sidebar-nav a::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 8px;
    background: transparent;
    transition: background .15s ease;
}

.sidebar-nav a:hover::before,
.sidebar-nav a.active::before {
    background: rgba(37, 99, 235, 0.9);
}

.sidebar-section {
    margin-top: 14px;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
}

.sidebar-section-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    padding: 6px 4px 6px 12px;
}

.sidebar-subnav {
    margin-top: 4px;
    margin-bottom: 6px;
    padding-left: 8px;
}

.sidebar-subnav a {
    font-size: 13px;
    padding-left: 34px;
    background: transparent;
    border: 1px solid transparent;
}

.sidebar-subnav a .icon {
    width: 26px;
    height: 26px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
    font-weight: 700;
    font-size: 11px;
}

/* Highlight box for Accounts / Receipts / Notes / Summary */
.sidebar-highlight-box {
    margin: 12px 0 16px;
    padding: 12px 0 14px;
    border-radius: 18px;
    background: #f5f7fb;
    border: 1px solid #e5e7eb;
}

.sidebar-highlight-box > a {
    display: block;
    margin-left: 0;
}

/* Sidebar footer */
.sidebar-footer {
    margin-top: 12px;
    border-top: 1px solid #e5e7eb;
    padding-top: 12px;
    font-size: 13px;
    color: #4b5563;
}

.sidebar-logout-form {
    margin-top: 10px;
}

.sidebar-logout-form button {
    width: 100%;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 9px 0;
    font-size: 13px;
    background: #f5f7fb;
    color: #0f172a;
    cursor: pointer;
    transition: background-color .15s ease, box-shadow .15s ease;
}

.sidebar-logout-form button:hover {
    background: #f3f4f6;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

/* Backdrop for mobile overlay */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity .24s ease;
    z-index: 20;
}

/* ========= MAIN AREA ========= */
.main {
    flex: 1;
    padding: 24px 24px 28px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background:
        radial-gradient(circle at 80% 0%, rgba(37, 99, 235, 0.12), transparent 35%),
        radial-gradient(circle at 10% 30%, rgba(14, 165, 233, 0.08), transparent 34%),
        var(--bg-body);
}

.main-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 18px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(7px);
}

.main-title-block h1 {
    margin: 0;
    font-size: 24px;
}

.main-title-block p {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--text-muted);
}

/* Right side: search + user badge */
.main-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.user-badge {
    padding: 9px 13px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.16), rgba(14, 165, 233, 0.18));
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #0f172a;
    border: 1px solid rgba(37, 99, 235, 0.26);
    font-weight: 700;
}

.user-badge-role {
    padding: 4px 9px;
    border-radius: 10px;
    background: #0f172a;
    color: #f8fafc;
    font-size: 12px;
    letter-spacing: 0.04em;
}

/* Mobile sidebar toggle banner button */
.mobile-sidebar-toggle {
    display: none;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: linear-gradient(135deg, #ffffff, #f4f6fb);
    padding: 9px 12px;
    font-size: 14px;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    color: var(--text-main);
    box-shadow: 0 14px 28px rgba(148, 163, 184, 0.35);
}

.mobile-sidebar-toggle .icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    position: relative;
}

.mobile-sidebar-toggle .icon::before,
.mobile-sidebar-toggle .icon::after {
    content: '';
    position: absolute;
    left: 2px;
    right: 2px;
    height: 2px;
    border-radius: 2px;
    background: var(--text-main);
}

.mobile-sidebar-toggle .icon::before {
    top: 5px;
    box-shadow: 0 5px 0 var(--text-main);
}

.mobile-sidebar-toggle .icon::after {
    top: 11px;
}

/* ========= TOP BAR SEARCH ========= */
.header-search,
.global-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 13px;
    border-radius: 14px;
    background: linear-gradient(145deg, #ffffff, #f6f7fb);
    border: 1px solid var(--border);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
    max-width: 380px;
    width: 100%;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease, transform .06s ease;
    font-size: 14px;
}

.header-search-icon,
.global-search-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 10px;
    background: rgba(37, 99, 235, 0.16);
    color: #1d4ed8;
    font-size: 0;
    position: relative;
}

.header-search-icon::before,
.global-search-icon::before {
    content: '';
    width: 12px;
    height: 12px;
    background: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='11' cy='11' r='7' stroke='%231d4ed8' stroke-width='2'/%3E%3Cpath d='M15.5 15.5L21 21' stroke='%231d4ed8' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
}

.header-search-input,
.global-search-input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    color: var(--text-main);
    width: 100%;
    min-width: 160px;
}

.header-search-input::placeholder,
.global-search-input::placeholder {
    color: var(--text-muted);
    opacity: 0.85;
}

.header-search:focus-within,
.global-search:focus-within {
    border-color: var(--accent);
    background: #ffffff;
    box-shadow:
        0 0 0 1px var(--accent-soft),
        0 18px 38px rgba(37, 99, 235, 0.22);
    transform: translateY(-1px);
}

/* ===== Global search results panel (dashboard) ===== */
.global-search-results {
    margin-bottom: 14px;
}

.global-search-results-card {
    background: var(--bg-panel);
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    padding: 12px 12px 10px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

.global-search-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.global-search-results-header .q {
    font-weight: 700;
    color: var(--text-main);
}

.global-search-results-groups {
    display: grid;
    gap: 10px;
}

.global-search-group-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.global-search-item {
    padding: 5px 0;
    border-top: 1px dashed rgba(148, 163, 184, 0.5);
}

.global-search-item:first-of-type {
    border-top: none;
}

.global-search-item-main {
    font-size: 13px;
    font-weight: 600;
}

.global-search-item-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.global-search-results-empty {
    font-size: 13px;
    color: var(--text-muted);
}

/* ========= CARDS / GRID ========= */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 18px;
}

.card {
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.92));
    border-radius: var(--radius-lg);
    padding: 18px 18px 16px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(226, 232, 240, 0.95);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    inset: -20% auto auto -20%;
    width: 170px;
    height: 170px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.08), transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.card > * {
    position: relative;
    z-index: 1;
}

.card-title {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
    letter-spacing: 0.01em;
}

.card-value {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 4px;
}

.card-sub {
    font-size: 13px;
    color: var(--text-muted);
}

/* ========= TABLE / BADGES ========= */
.users-toolbar {
    margin-top: 8px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.users-count {
    font-size: 13px;
    color: var(--text-muted);
}

.users-table-wrap {
    width: 100%;
    overflow-x: auto;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: #f7f9fb;
    box-shadow: var(--shadow-soft);
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
}

.users-table thead {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(14, 165, 233, 0.22));
    color: #0f172a;
}

.users-table th,
.users-table td {
    padding: 11px 12px;
    border-bottom: 1px solid #e2e8f0;
    text-align: center;
    white-space: nowrap;
}

.users-table tbody tr:nth-child(even) {
    background: rgba(37, 99, 235, 0.05);
}

/* Global table sizing/centering */
table {
    font-size: 13px !important;
}

table th,
table td {
    text-align: center !important;
    font-size: inherit !important;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge-role-admin {
    background: #e0f2fe;
    color: #1d4ed8;
}

.badge-role-user {
    background: #e2e8f0;
    color: #1f2937;
}

.badge-status-active {
    background: #dcfce7;
    color: #15803d;
}

.badge-status-inactive {
    background: #fee2e2;
    color: #b91c1c;
}

.users-error {
    margin-bottom: 8px;
    background: #fef2f2;
    color: #b91c1c;
    border-radius: 12px;
    border: 1px solid #fecaca;
    padding: 8px 10px;
    font-size: 13px;
}

/* ========= MODAL (User create/edit) ========= */
.user-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 40;
}

.user-modal-backdrop.show {
    display: flex;
}

.user-modal {
    width: min(480px, 100% - 32px);
    background: linear-gradient(160deg, #ffffff, #f9fafc);
    border-radius: 24px;
    box-shadow: 0 26px 62px rgba(15, 23, 42, 0.35);
    padding: 20px 20px 18px;
    border: 1px solid rgba(226, 232, 240, 0.95);
}

.user-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.user-modal-title {
    font-size: 18px;
    font-weight: 800;
}

.user-modal-close {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 20px;
}

.user-modal-form .field {
    margin-bottom: 12px;
}

.user-modal-form label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.user-modal-form input,
.user-modal-form select {
    width: 100%;
    padding: 10px 11px;
    border-radius: 12px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    outline: none;
    background: var(--bg-soft);
}

.user-modal-form input:focus,
.user-modal-form select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent-soft);
    background: #ffffff;
}

.user-modal-footer {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.user-modal-error {
    margin-top: 4px;
    font-size: 13px;
    color: #b91c1c;
}

/* ========= PRINT OVERRIDES ========= */
@media print {
    body {
        background: #ffffff;
        font-size: 14px;
    }
    .sidebar,
    .mobile-sidebar-toggle,
    .sidebar-backdrop {
        display: none !important;
    }
    .main {
        padding: 0;
        background: #ffffff;
    }
    .card {
        box-shadow: none;
        border-radius: 0;
        border: 1px solid #e2e8f0;
    }
}

/* ========= Responsive ========= */
@media (max-width: 900px) {
    .app-shell {
        position: relative;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        transform: translateX(-100%);
        transition: transform .24s ease;
        width: min(86vw, 280px);
        max-width: 100%;
        box-shadow: 16px 0 44px rgba(15, 23, 42, 0.18);
        padding: calc(16px + env(safe-area-inset-top, 0)) 12px 16px 12px;
    }

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

    body.sidebar-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .main-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .main-header-right {
        justify-content: space-between;
        width: 100%;
    }

    .header-search,
    .global-search {
        max-width: 100%;
    }

    .mobile-sidebar-toggle {
        display: inline-flex;
        justify-content: space-between;
        width: 100%;
        font-weight: 700;
    }
}

@media (min-width: 901px) {
    .sidebar-backdrop {
        display: none;
    }
}

@media (max-width: 540px) {
    .sidebar {
        width: 100vw;
        padding: calc(14px + env(safe-area-inset-top, 0)) 10px 14px 10px;
    }
    .sidebar-brand {
        margin-bottom: 12px;
        gap: 8px;
    }
    .sidebar-logo-circle {
        width: 34px;
        height: 34px;
    }
    .sidebar-company-name {
        font-size: 13px;
    }
    .sidebar-company-sub {
        font-size: 11px;
    }
    .sidebar-profile {
        padding: 8px 9px;
    }
    .sidebar-profile-avatar {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }
    .sidebar-cta {
        font-size: 13px;
        padding: 9px 10px;
    }
    .sidebar-nav a {
        font-size: 13px;
        padding: 7px 9px 7px 10px;
    }
    .sidebar-nav a span.icon {
        width: 24px;
        height: 24px;
        font-size: 11px;
        margin-right: 5px;
    }
}

/* Collapsible subnav (for Customers/Shipments/etc.) */
.sidebar-subnav.collapsed {
    display: none;
}

/* Optional: rotate chevron when open */
.sidebar-nav [data-sidebar-toggle] .chevron {
    transition: transform .18s ease;
}

.sidebar-nav [data-sidebar-toggle].sidebar-toggle-open .chevron {
    transform: rotate(90deg);
}

@media print {
  .subscription-alert, body.has-subscription-alert .subscription-alert { display: none !important; }
}
