/* FloriPro Theme - Florist Operating System */
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600;700&family=Playfair+Display:wght@400;500;600;700&display=swap');

:root {
    /* FloriPro palette - Official brand colors */
    --bg-cream: #f9f9f9;
    --bg-white: #ffffff;
    --bg-soft: #f8faf8;
    --bg-sage-light: #e8f5e9;

    /* Shop theme. The five --theme-* values are overridden inline by MainLayout
       from Store Settings; everything below is derived from them. */
    --theme-primary: #2e7d32;           /* Forest Green - "Flori" text */
    --theme-secondary: #66bb6a;          /* Lime Green - "pro" text */
    --theme-accent: #f5a89a;             /* Coral from the flower petals */
    --theme-background: #f9f9f9;
    --theme-text: #3d3d3d;
    --theme-primary-dark: color-mix(in srgb, var(--theme-primary) 72%, black);
    --theme-primary-light: color-mix(in srgb, var(--theme-secondary) 75%, white);
    --theme-accent-dark: color-mix(in srgb, var(--theme-accent) 80%, black);

    /* Legacy sage naming (maps to theme colors) */
    --sage-dark: var(--theme-primary-dark);
    --sage: var(--theme-primary);
    --sage-light: var(--theme-secondary);
    --sage-pale: var(--theme-primary-light);
    --sage-mist: color-mix(in srgb, var(--theme-secondary) 28%, white);

    /* Coral accent */
    --theme-coral: var(--theme-accent);
    --theme-coral-dark: var(--theme-accent-dark);
    --blush: var(--theme-accent);
    --blush-dark: var(--theme-accent-dark);
    --rose-soft: var(--theme-accent);

    /* Warm neutrals */
    --charcoal: #4a4a4a;
    --warm-grey: #6b6b6b;
    --text-primary: #3d3d3d;
    --text-secondary: #6b6b6b;
    --text-muted: #9a9a9a;

    /* Functional colors */
    --success: #7ab377;
    --warning: #d4a85c;
    --error: #c97070;
    --info: #7a9ec9;
    --error-strong: #b55a5a;      /* white text passes 4.5:1 on these */
    --warning-strong: #8a6420;
    --info-strong: #4f739e;

    --border: #c8d0c8;  /* Darker border for better visibility */
    --border-light: #e0e8e0;
    --shadow: rgba(107, 124, 107, 0.08);
    --shadow-hover: rgba(107, 124, 107, 0.18);

    /* Theme aliases - for components using --theme-* naming */
    --theme-border: var(--border);
    --theme-border-light: var(--border-light);
    --theme-text-muted: var(--text-muted);
    --theme-background-alt: var(--bg-soft);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: 'Quicksand', -apple-system, sans-serif;
    background: var(--bg-cream);
    color: var(--text-primary);
    min-height: 100vh;
    font-weight: 500;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    color: var(--theme-text);
    font-weight: 600;
}

h1 {
    font-size: 1.5rem;
}

h2 { font-size: 1.5rem; }

h3 { font-size: 1.25rem; }

a, .btn-link {
    color: var(--sage-dark);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--sage);
}

.btn {
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
}

.btn-primary {
    background: var(--theme-primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background: linear-gradient(135deg, var(--sage-dark) 0%, var(--sage-dark) 100%);
    border-color: var(--sage-light);
    box-shadow: 0 4px 15px var(--shadow-hover);
    color: white;
}

.btn-outline-primary {
    border: 1.5px solid var(--sage);
    color: var(--sage-dark);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--sage-mist);
    border-color: var(--sage);
    color: var(--sage-dark);
}

.btn-secondary {
    background: white;
    color: var(--theme-text);
    border: 1px solid var(--theme-border);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.btn-secondary:hover {
    background: var(--theme-background-alt);
}

/* Bootstrap's .btn-secondary turns the text white on hover, focus and press (its grey button). Ours is a light
   button, so every state keeps the dark text: set Bootstrap's own state variables, which all its .btn rules read. */
.btn-secondary {
    --bs-btn-hover-color: var(--theme-text);
    --bs-btn-hover-bg: var(--theme-background-alt);
    --bs-btn-hover-border-color: var(--theme-border);
    --bs-btn-active-color: var(--theme-text);
    --bs-btn-active-bg: var(--theme-background-alt);
    --bs-btn-active-border-color: var(--theme-border);
    --bs-btn-disabled-color: var(--theme-text);
    --bs-btn-disabled-bg: white;
    --bs-btn-disabled-border-color: var(--theme-border);
}

.btn-secondary:hover,
.btn-secondary:focus-visible,
.btn-secondary:active {
    color: var(--theme-text);
}

.btn-sm {
    min-height: 40px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn .btn-icon,
.btn > svg:not([width]) {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
    vertical-align: -0.15em;
    margin-right: 0.35rem;
}

.btn-icon-only > svg:not([width]) {
    margin-right: 0;
}

.btn-success, .btn-success:visited {
    background: var(--sage);
    border-color: var(--sage-light);
    color: white;
    box-shadow: 0 2px 8px var(--shadow);
}

.btn-success:hover, .btn-success:focus, .btn-success:active {
    background: var(--sage-dark);
    border-color: var(--sage-light);
    color: white;
    box-shadow: 0 4px 15px var(--shadow-hover);
}

.btn-danger, .btn-danger:visited {
    background: var(--error-strong);
    border-color: var(--error-strong);
    color: white;
}

.btn-danger:hover, .btn-danger:focus, .btn-danger:active {
    background: #9f4b4b;
    border-color: #9f4b4b;
    color: white;
}

.btn-warning, .btn-warning:visited {
    background: var(--warning);
    border-color: var(--warning);
    color: var(--text-primary);
}

.btn-warning:hover, .btn-warning:focus, .btn-warning:active {
    background: #c4954a;
    border-color: #c4954a;
    color: var(--text-primary);
}

.btn-info, .btn-info:visited {
    background: var(--info-strong);
    border-color: var(--info-strong);
    color: white;
}

.btn-info:hover, .btn-info:focus, .btn-info:active {
    background: #41628a;
    border-color: #41628a;
    color: white;
}

.btn-light, .btn-light:visited {
    background: var(--bg-white);
    border: 1.5px solid var(--border);
    color: var(--text-primary);
}

.btn-light:hover, .btn-light:focus, .btn-light:active {
    background: var(--bg-soft);
    color: var(--text-primary);
}

.btn-ghost {
    background: none;
    border: none;
    color: var(--theme-primary);
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
}

.btn-ghost:hover {
    text-decoration: underline;
}

.btn-dark, .btn-dark:visited {
    background: var(--charcoal);
    border-color: var(--charcoal);
    color: white;
}

.btn-dark:hover, .btn-dark:focus, .btn-dark:active {
    background: var(--text-primary);
    border-color: var(--text-primary);
    color: white;
}

.btn-outline-secondary, .btn-outline-secondary:visited {
    border: 1.5px solid var(--border);
    color: var(--text-secondary);
    background: transparent;
}

.btn-outline-secondary:hover, .btn-outline-secondary:focus, .btn-outline-secondary:active {
    background: var(--bg-soft);
    border-color: var(--sage-pale);
    color: var(--text-primary);
}

.btn-outline-success, .btn-outline-success:visited {
    border: 1.5px solid var(--sage);
    color: var(--sage-dark);
    background: transparent;
}

.btn-outline-success:hover, .btn-outline-success:focus, .btn-outline-success:active {
    background: var(--sage-mist);
    border-color: var(--sage);
    color: var(--sage-dark);
}

.btn-outline-danger, .btn-outline-danger:visited {
    border: 1.5px solid var(--error);
    color: #9f4b4b;
    background: transparent;
}

.btn-outline-danger:hover, .btn-outline-danger:focus, .btn-outline-danger:active {
    background: rgba(201, 112, 112, 0.12);
    border-color: #9f4b4b;
    color: #9f4b4b;
}

.btn-outline-warning, .btn-outline-warning:visited {
    border: 1.5px solid var(--warning);
    color: var(--warning-strong);
    background: transparent;
}

.btn-outline-warning:hover, .btn-outline-warning:focus, .btn-outline-warning:active {
    background: rgba(212, 168, 92, 0.15);
    border-color: var(--warning-strong);
    color: var(--warning-strong);
}

.btn-outline-info, .btn-outline-info:visited {
    border: 1.5px solid var(--info);
    color: var(--info-strong);
    background: transparent;
}

.btn-outline-info:hover, .btn-outline-info:focus, .btn-outline-info:active {
    background: rgba(122, 158, 201, 0.15);
    border-color: var(--info-strong);
    color: var(--info-strong);
}

.btn-link, .btn-link:visited {
    color: var(--sage-dark);
    text-decoration: none;
}

.btn-link:hover, .btn-link:focus {
    color: var(--sage);
    text-decoration: underline;
}

.btn:disabled, .btn.disabled {
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

/* Bootstrap turns off mouse events on disabled buttons, which also hides their tooltip. A disabled button that
   explains itself (title, e.g. "Set up AI in Settings...") gets them back; it still can't be clicked. */
.btn:disabled[title],
.mobile-fab:disabled[title] {
    pointer-events: auto;
    cursor: not-allowed;
}

.mobile-fab:disabled {
    opacity: 0.5;
    box-shadow: none;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
input[type="month"],
input[type="week"],
textarea,
select {
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 0.7rem 1rem;
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    background: var(--bg-white);
    transition: all 0.2s ease;
    color: var(--text-primary);
    width: 100%;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
input[type="time"]:focus,
input[type="month"]:focus,
input[type="week"]:focus,
textarea:focus,
select:focus {
    border-color: var(--sage);
    box-shadow: 0 0 0 3px rgba(138, 154, 135, 0.15);
    outline: none;
    background: var(--bg-white);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

.form-control, .form-select {
    font-size: 16px !important; /* Prevents iOS zoom on focus */
    min-height: 48px;
    padding: 0.75rem 1rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--sage);
    box-shadow: 0 0 0 3px rgba(138, 154, 135, 0.15);
    outline: none;
    background: var(--bg-white);
}

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

.form-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.4rem;
}

.form-check-input:checked {
    background-color: var(--sage);
    border-color: var(--sage);
}

.card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card:hover {
    transform: none; /* Disable hover lift on mobile */
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--theme-border);
}

.card-body {
    padding: 1rem;
}

.card-footer {
    background: var(--bg-soft);
    border-top: 1px solid var(--border);
    padding: 0.75rem 1.25rem;
}

.card-title {
    font-family: 'Quicksand', sans-serif;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.card.text-white {
    border: none;
    position: relative;
    overflow: hidden;
    color: white !important;
}

.card.text-white * {
    color: white !important;
}

.supplier-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

.supplier-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.95) 0%, rgba(248,250,248,0.9) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(138, 148, 120, 0.15);
    border-radius: 20px;
    overflow: hidden;
    box-shadow:
        0 4px 24px rgba(90, 95, 74, 0.08),
        0 1px 3px rgba(90, 95, 74, 0.05),
        inset 0 1px 0 rgba(255,255,255,0.8);
    transition: all 0.3s ease;
    /* Column layout so the footer sits at the same height on every card in a row */
    display: flex;
    flex-direction: column;
}

.supplier-card:hover {
    box-shadow:
        0 6px 20px rgba(90, 95, 74, 0.12),
        0 2px 8px rgba(90, 95, 74, 0.06),
        inset 0 1px 0 rgba(255,255,255,0.9);
    border-color: var(--sage-light);
}

.supplier-card.inactive {
    opacity: 0.7;
}

.supplier-card-header {
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.supplier-logo {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: white;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.supplier-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.supplier-logo svg {
    color: var(--theme-primary);
}

.supplier-title {
    flex: 1;
    min-width: 0;
}

.supplier-title h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.supplier-title .contact-name {
    display: block;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.85);
    margin-top: 0.15rem;
}

.inactive-badge {
    font-size: 0.625rem;
    font-weight: 600;
    background: var(--theme-border);
    color: var(--theme-text-muted);
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    text-transform: uppercase;
}

.supplier-card-body {
    flex: 1;
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.supplier-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.detail-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--theme-border);
}

.detail-row svg {
    flex-shrink: 0;
    color: var(--sage);
}

.detail-row.muted {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.stem-count {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-sage-light) 0%, var(--sage-mist) 100%);
    border-radius: 14px;
    padding: 0.75rem 1rem;
    min-width: 70px;
}

.stem-count .count {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--theme-primary);
    line-height: 1;
}

.stem-count .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.supplier-card-footer {
    padding: 0 1.25rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.supplier-quick-links {
    display: flex;
    gap: 0.4rem;
    padding: 1rem 1.25rem;
    background: rgba(248,250,248,0.5);
    border-top: 1px solid rgba(138, 148, 120, 0.1);
}

.supplier-quick-links a {
    font-family: 'Quicksand', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--sage-dark);
    background: white;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.supplier-quick-links a:hover {
    background: var(--theme-primary);
    border-color: var(--theme-primary);
    color: white;
}

a.card.dash-link,
a.card.dash-link:hover,
a.card.dash-link:focus {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

a.card.dash-link:focus-visible {
    outline: 2px solid var(--sage);
    outline-offset: 2px;
}

a.card.text-white.dash-link:hover {
    filter: brightness(1.06);
}

.card.text-white.stat-card-1 { background-color: var(--theme-primary); }

.card.text-white.stat-card-2 { background-color: var(--theme-secondary); }

.card.text-white.stat-card-3 { background-color: var(--theme-accent); }

.card.text-white.stat-card-4 { background-color: var(--theme-accent-dark); }

.card.text-white::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    transform: translate(30%, -30%);
    transition: opacity 0.3s ease;
}

.card.text-white:hover::before {
    opacity: 0.25;
}

.card.text-white h5,
.card.text-white .card-title {
    font-family: 'Quicksand', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 1;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.card.text-white h2 {
    font-family: 'Quicksand', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.table {
    background: var(--bg-white);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 0;
}

.table-responsive {
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
}

.table thead {
    background: var(--bg-soft);
}

.table th {
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border) !important;
    padding: 1rem;
    white-space: nowrap;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-light) !important;
    vertical-align: middle;
    color: var(--text-primary);
}

.table-hover tbody tr {
    transition: all 0.2s ease;
}

.table-hover tbody tr:hover {
    background: var(--sage-mist);
}

.badge {
    font-size: 0.65rem;
    padding: 0.35rem 0.6rem;
}

.badge.bg-secondary {
    background: var(--sage-pale) !important;
    color: var(--sage-dark);
}

.badge.bg-success, .price-tag {
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 100%) !important;
    color: white;
}

.badge.bg-warning {
    background: var(--warning) !important;
    color: var(--text-primary);
}

.badge.bg-danger {
    background: var(--error) !important;
}

.badge.bg-info {
    background: var(--info-strong) !important;
}

.badge.bg-primary {
    background: var(--sage) !important;
}

/* Customer card business badge */
.customer-name .badge {
    font-size: 0.65rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-weight: 600;
    letter-spacing: 0.3px;
    background: linear-gradient(135deg, var(--sage) 0%, var(--sage-dark) 100%) !important;
    box-shadow: 0 2px 4px rgba(90, 95, 74, 0.2);
}

.modal-content {
    border-radius: 0;
    min-height: 100vh;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--theme-border);
}

.modal-title {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--theme-border);
}

.modal-header-warning {
    background: var(--warning);
    border-bottom: 1px solid #c69042;
}

.modal-header-warning .modal-title {
    color: #3d2a0a;
}

.modal-header-warning .modal-close {
    color: #3d2a0a;
}

.btn-close {
    opacity: 0.5;
}

.btn-close:hover {
    opacity: 1;
}

.sidebar {
    background: var(--bg-white) !important;
    border-right: 1px solid var(--border);
    box-shadow: 2px 0 20px var(--shadow);
}

.top-row {
    background: linear-gradient(135deg, var(--sage) 0%, var(--sage-dark) 100%) !important;
    padding: 0.75rem 1rem !important;
    min-height: 4rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: contain;
}

.navbar-brand {
    font-family: 'Playfair Display', serif !important;
    font-weight: 600 !important;
    font-size: 1.2rem !important;
    letter-spacing: 0.02em;
}

.nav-section-title {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 0.5rem 0.75rem;
    margin-top: 0.5rem;
}

.nav-icon {
    font-size: 1.1rem;
    margin-right: 0.75rem;
    opacity: 0.8;
}

.nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500 !important;
    padding: 0.75rem 1rem !important;
    border-radius: 10px !important;
    margin: 0.125rem 0.5rem !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
}

.nav-link:hover {
    background: var(--sage-mist) !important;
    color: var(--sage-dark) !important;
}

.nav-link.active {
    background: linear-gradient(135deg, var(--sage-pale) 0%, var(--sage-mist) 100%) !important;
    color: var(--sage-dark) !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 8px rgba(138, 154, 135, 0.15);
}

.content {
    padding: 1.5rem 2rem;
}

main {
    background: var(--bg-cream);
}

article {
    padding: 1.5rem 2rem !important;
}

.container-fluid {
    padding: 0;
}

.text-success { color: var(--success) !important; }

.text-warning { color: var(--warning) !important; }

.text-danger { color: var(--error) !important; }

.text-muted { color: var(--text-muted) !important; }

h1:focus, h2:focus, h3:focus, h4:focus, h5:focus, h6:focus,
p:focus, span:focus, label:focus, small:focus, strong:focus,
div:not([tabindex]):focus, article:focus, section:focus, main:focus,
ul:focus, ol:focus, li:focus, table:focus, tr:focus, td:focus, th:focus,
.card:focus, .card-body:focus, .card-header:focus, .modal-content:focus {
    outline: none !important;
    box-shadow: none !important;
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible,
.btn:focus-visible,
.nav-link:focus-visible {
    outline: 2px solid var(--sage);
    outline-offset: 2px;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: var(--sage);
    box-shadow: 0 0 0 3px rgba(138, 154, 135, 0.35);
    outline: none;
}

.btn:focus,
.btn:active:focus,
.btn-check:focus + .btn {
    box-shadow: none;
    transform: none;
}

.btn:focus:not(:focus-visible) {
    outline: none;
}

.btn-close:focus-visible {
    outline: 2px solid var(--sage);
    outline-offset: 2px;
    box-shadow: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 2px solid var(--success);
}

.invalid {
    outline: 2px solid var(--error);
}

.validation-message {
    color: var(--error);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.blazor-error-boundary {
    background: var(--error);
    padding: 1rem;
    color: white;
    border-radius: 10px;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

/* Input groups with addons */
.input-group {
    display: flex;
}

.input-group-text {
    background: var(--bg-soft);
    border: 1.5px solid var(--border);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
}

.input-group > :first-child {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.input-group > :last-child {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

.input-group > :not(:first-child):not(:last-child) {
    border-radius: 0 !important;
}

.input-group > :not(:first-child) {
    margin-left: -1px;
}

.input-group .form-control {
    flex: 1;
}

/* Ensure input-group-text has correct radius */
.input-group .input-group-text:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.input-group .input-group-text:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* Settings page card headers */
.settings-page .card-header {
    background: linear-gradient(135deg, var(--sage-mist) 0%, var(--sage-pale) 100%);
    border-bottom: 1px solid var(--sage-light);
    padding: 1rem 1.25rem;
    border-radius: 12px 12px 0 0;
}

.settings-page .card-header h2,
.settings-page .card-header h3,
.settings-page .card-header h4,
.settings-page .card-header h5,
.settings-page .card-header h6 {
    color: var(--sage-dark);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.quick-action {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-action:hover {
    background: var(--sage-mist);
    box-shadow: 0 4px 12px var(--shadow-hover);
    border-color: var(--sage-light);
}

.row {
    --bs-gutter-x: 1.5rem;
}

.mb-3 { margin-bottom: 1rem !important; }

.mb-4 { margin-bottom: 1.5rem !important; }

.mt-4 { margin-top: 1.5rem !important; }

.content, article {
    padding: 1rem !important;
}

.btn, button, .nav-link, a.clickable, [role="button"] {
    min-height: 44px;
    min-width: 44px;
}

.row > [class*="col-lg-"],
.row > [class*="col-md-"] {
    flex: 0 0 100%;
    max-width: 100%;
    margin-bottom: 0.75rem;
}

.row > [class*="col-md-"]:last-child {
    margin-bottom: 0;
}

.row > [class*="col-6"] {
    flex: 0 0 50%;
    max-width: 50%;
}

.row.mb-3 > [class*="col-"],
.row.mb-4 > [class*="col-"] {
    margin-bottom: 0.75rem;
}

.row.mb-3 > [class*="col-"]:last-child,
.row.mb-4 > [class*="col-"]:last-child {
    margin-bottom: 0;
}

.row .form-control,
.row .form-select,
.row .form-check {
    margin-bottom: 0;
}

.row > .col-md-2,
.row > .col-md-3,
.row > .col-md-4 {
    margin-bottom: 0.75rem;
}

.table th, .table td {
    padding: 0.75rem 0.5rem;
    font-size: 0.85rem;
}

.table th:first-child, .table td:first-child {
    padding-left: 1rem;
}

.table th:last-child, .table td:last-child {
    padding-right: 1rem;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1rem;
}

.modal {
    background: white;
    border-radius: 0.75rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal.show, .modal.d-block {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.modal-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-height: 90vh;
    max-width: 90vw;
    width: 500px;
    display: flex;
    flex-direction: column;
    z-index: 1050;
    overflow: hidden;
}

.modal-container.modal-sm { width: 300px; }

.modal-container.modal-lg { width: 800px; }

.modal-container.modal-xl { width: 1140px; }

.modal-container .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
    border-radius: 16px 16px 0 0;
    flex-shrink: 0;
}

.modal-container .modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
}

.modal-container .modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
    line-height: 1;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: background 0.15s;
}

.modal-container .modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal-container .modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-container .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg-soft);
    flex-shrink: 0;
}

.modal-body .form-row,
.modal-body .form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.modal-body .form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

@media (max-width: 600px) {
    .modal-body .form-row,
    .modal-body .form-row-2,
    .modal-body .form-row-3 {
        grid-template-columns: 1fr;
    }
}

.dropdown-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    background: transparent;
}

.category-dropdown {
    position: relative;
    display: inline-block;
}

.category-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    min-height: 48px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    min-width: 160px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.category-dropdown-trigger:hover:not(.disabled) {
    border-color: var(--theme-primary);
}

.category-dropdown-trigger:focus {
    outline: none;
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 3px rgba(90, 95, 74, 0.1);
}

.category-dropdown-trigger.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.category-dropdown.open .category-dropdown-trigger {
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 3px rgba(90, 95, 74, 0.1);
}

.category-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.category-name {
    color: var(--theme-text);
}

.category-placeholder {
    flex: 1;
    text-align: left;
    color: var(--text-muted);
}

.dropdown-arrow {
    flex-shrink: 0;
    transition: transform 0.15s;
    color: var(--text-muted);
}

.category-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

/* Inside a grid column, form group or table cell the shared dropdowns fill the space they're given and never
   push past it: their min-widths (160/180px) made them overlap the next filter in narrow columns (Stems filter
   bar). Long names and placeholders end in "..." instead of wrapping onto two lines. */
[class*="col-"] > .category-dropdown,
[class*="col-"] > .supplier-dropdown,
.form-group > .category-dropdown,
.form-group > .supplier-dropdown,
td > .category-dropdown,
td > .supplier-dropdown {
    display: block;
    width: 100%;
}

.category-dropdown,
.supplier-dropdown {
    max-width: 100%;
}

[class*="col-"] > .category-dropdown > .category-dropdown-trigger,
[class*="col-"] > .supplier-dropdown > .supplier-dropdown-trigger,
.form-group > .category-dropdown > .category-dropdown-trigger,
.form-group > .supplier-dropdown > .supplier-dropdown-trigger,
td > .category-dropdown > .category-dropdown-trigger,
td > .supplier-dropdown > .supplier-dropdown-trigger {
    width: 100%;
    min-width: 0;
}

.category-dropdown-trigger > .category-name,
.category-dropdown-trigger > .category-placeholder,
.supplier-dropdown-trigger > .supplier-name,
.supplier-dropdown-trigger > .supplier-placeholder {
    min-width: 0;
    flex: 1;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Filter bars: a row of several col-md-2 filters (Stems, Orders...) is six to a row from 768px, about 150px each
   on a laptop with the sidebar open: too narrow for a dropdown or date. Below 1400px they go three to a row
   (their col-md-3/4 neighbours too) and wrap, with a gap between the lines. */
@media (min-width: 768px) and (max-width: 1399.98px) {
    .row:has(> .col-md-2 ~ .col-md-2) > [class*="col-md-2"],
    .row:has(> .col-md-2 ~ .col-md-2) > [class*="col-md-3"],
    .row:has(> .col-md-2 ~ .col-md-2) > [class*="col-md-4"] {
        flex: 0 0 33.333%;
        max-width: 33.333%;
        margin-bottom: 0.75rem;
    }
}

/* Stems list: which markup priced the stem ("Rule: Roses", "Default markup"), under the $/stem price */
.markup-source {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 12rem;
    margin-left: auto;
}

.markup-source a { color: inherit; text-decoration: underline; text-decoration-color: var(--theme-border); }
.markup-source a:hover { color: var(--theme-primary); }

/* Shown in a category/supplier menu instead of an empty box: loading, or "none yet" with where to add them */
.dropdown-menu-note {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* A dropdown opened inside a scrolling table must not be clipped by the scroll box */
.table-responsive:has(.category-dropdown.open),
.table-responsive:has(.supplier-dropdown.open) {
    overflow: visible;
}

.category-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    min-width: 200px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 280px;
    overflow-y: auto;
}

.category-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    cursor: pointer;
    transition: background 0.1s;
}

.category-option:hover {
    background: var(--bg-soft);
}

.category-option.selected {
    background: rgba(90, 95, 74, 0.08);
    font-weight: 500;
}

.category-option:first-child {
    border-radius: 7px 7px 0 0;
}

.category-option:last-child {
    border-radius: 0 0 7px 7px;
}

.category-desc {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-left: auto;
}

.supplier-dropdown {
    position: relative;
    display: inline-block;
}

.supplier-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    min-height: 48px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    min-width: 180px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.supplier-dropdown-trigger:hover:not(.disabled) {
    border-color: var(--theme-primary);
}

.supplier-dropdown-trigger:focus {
    outline: none;
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 3px rgba(90, 95, 74, 0.1);
}

.supplier-dropdown-trigger.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.supplier-dropdown.open .supplier-dropdown-trigger {
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 3px rgba(90, 95, 74, 0.1);
}

.supplier-initials {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: var(--sage-mist);
    color: var(--theme-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    flex-shrink: 0;
}

.supplier-name {
    flex: 1;
    text-align: left;
}

.supplier-placeholder {
    flex: 1;
    text-align: left;
    color: var(--text-muted);
}

.supplier-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.supplier-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    min-width: 220px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 280px;
    overflow-y: auto;
}

.supplier-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    cursor: pointer;
    transition: background 0.1s;
}

.supplier-option:hover {
    background: var(--bg-soft);
}

.supplier-option.selected {
    background: rgba(90, 95, 74, 0.08);
    font-weight: 500;
}

.supplier-option:first-child {
    border-radius: 7px 7px 0 0;
}

.supplier-option:last-child {
    border-radius: 0 0 7px 7px;
}

.page-header-row,
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--sage-mist);
}

.page-header h1,
.page-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.page-header p,
.page-subtitle {
    margin: 0.25rem 0 0;
    color: var(--text-muted);
}

.stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--theme-text);
}

.stat-label {
    display: block;
    font-size: 0.6875rem;
    color: var(--theme-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.375rem;
}

.summary-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.page-header-content {
    flex: 1;
}

.page-header-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

@media (max-width: 576px) {
    .page-header,
    .page-header-row {
        flex-direction: column;
        align-items: stretch;
    }

    .page-header-actions {
        margin-top: 1rem;
        justify-content: flex-start;
    }

    .page-header-actions .btn {
        flex: 1;
    }
}

.header-content h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--theme-text);
    margin: 0 0 0.25rem;
}

.header-content p {
    color: var(--theme-text-muted);
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--theme-text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.back-link:hover {
    color: var(--theme-primary);
}

.back-link svg {
    width: 1rem;
    height: 1rem;
}

.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--sage);
    margin-left: 0.5rem;
    vertical-align: middle;
    cursor: pointer;
    transition: all 0.15s ease;
}

.help-icon:hover {
    color: var(--sage-dark);
    transform: scale(1.1);
}

.help-icon svg {
    width: 22px;
    height: 22px;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 4rem;
    color: var(--theme-text-muted);
}

.spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-large {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid var(--theme-border);
    border-top-color: var(--theme-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.toggle-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.toggle-tab {
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.15s;
}

.toggle-tab:hover {
    background: var(--bg-soft);
}

.toggle-tab.active {
    background: var(--theme-primary);
    color: white;
    border-color: var(--theme-primary);
}

/* Toggle tabs in a row with other controls (search box, buttons): no bottom margin (it pushed them above the row's
   centre line) and the same height as an input, so everything lines up. The row keeps its own spacing below. */
:is(.d-flex, [class$="-toolbar"], [class*="-toolbar "], :has(> .search-box)) > .toggle-tabs {
    margin-bottom: 0;
    align-items: stretch;
}

:is(.d-flex, [class$="-toolbar"], [class*="-toolbar "], :has(> .search-box)) > .toggle-tabs .toggle-tab {
    padding-top: 0;
    padding-bottom: 0;
    min-height: 48px;   /* same as .form-control */
    display: inline-flex;
    align-items: center;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.summary-card .label {
    display: block;
    font-size: 0.75rem;
    color: var(--theme-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.summary-card .value {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--theme-text);
}

.summary-card .sub {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.summary-card.primary {
    background: var(--theme-primary);
    color: white;
}

.summary-card.primary .label,
.summary-card.primary .value,
.summary-card.primary .sub {
    color: white;
}

.summary-card.warning {
    background: #fffbeb;
    border-color: var(--warning);
}

.summary-card.success {
    background: #f0fdf4;
    border-color: var(--success);
}

.summary-card.danger {
    background: #fef2f2;
    border-color: var(--error);
}

.status-badge {
    display: inline-flex;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.draft { background: #f3f4f6; color: #6b7280; }

.status-badge.sent { background: #dbeafe; color: #1d4ed8; }

.status-badge.paid {
    background: #dcfce7;
    color: #166534;
}

.status-badge.overdue { background: #fee2e2; color: #dc2626; }

.status-badge.cancelled {
    background: #f3f4f6;
    color: #6b7280;
}

.status-badge.new { background: #fef3c7; color: #d97706; }

.status-badge.accepted { background: #dbeafe; color: #2563eb; }

.status-badge.inproduction { background: #e0e7ff; color: #4f46e5; }

.status-badge.ready { background: #d1fae5; color: #059669; }

.status-badge.outfordelivery { background: #cffafe; color: #0891b2; }

.status-badge.completed { background: #dcfce7; color: #16a34a; }

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

.status-badge.inactive {
    background: #f3f4f6;
    color: #9ca3af;
}

.status-badge.pending {
    background: #fef3c7;
    color: #b45309;
}

.status-badge.received { background: #dbeafe; color: #2563eb; }

.empty-state,
.empty-state-card {
    text-align: center;
    padding: 3rem 2rem;
    background: white;
    border-radius: 12px;
    border: 1px dashed var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.empty-state-card .empty-icon,
.empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    color: var(--text-muted);
    opacity: 0.5;
}

.empty-state-card h3 {
    margin: 0 0 0.5rem;
    color: var(--text-primary);
}

.empty-state p,
.empty-state-card p {
    margin: 0;
    color: var(--text-muted);
}

.empty-state .btn,
.empty-state-card .btn {
    margin-top: 0.5rem;
}

.empty-state-icon {
    margin-bottom: 1rem;
    color: var(--text-muted);
    opacity: 0.6;
}

.empty-state-icon svg {
    width: 48px;
    height: 48px;
}

.empty-state-title {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.empty-state-description {
    margin: 0 0 1.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.empty-state-action {
    margin-top: 1rem;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box .search-icon {
    position: absolute;
    left: 0.75rem;
    color: var(--text-muted);
    pointer-events: none;
}

.search-box .search-input {
    padding-left: 2.25rem;
    padding-right: 2rem;
}

.search-box .clear-btn {
    position: absolute;
    right: 0.5rem;
    background: none;
    border: none;
    padding: 0.25rem;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-box .clear-btn:hover {
    background: var(--bg-soft);
    color: var(--text-primary);
}

.help-page {
    max-width: 1200px;
    padding: 1rem;
}

.back-to-app {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    transition: all 0.15s;
}

.back-to-app:hover {
    background: var(--bg-soft);
    color: var(--theme-primary);
    border-color: var(--theme-primary);
}

.help-header {
    margin-bottom: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, var(--bg-sage-light) 0%, var(--bg-soft) 100%);
    border-radius: 16px;
}

.help-header h1 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--theme-primary);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.help-header h1 svg {
    color: var(--theme-primary);
}

.help-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin: 0;
}

.help-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .help-layout {
        grid-template-columns: 1fr;
    }
}

.help-nav {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid var(--border);
    position: sticky;
    top: 1rem;
    height: fit-content;
}

.help-nav h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.help-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.help-nav li {
    margin-bottom: 0.25rem;
}

.help-nav a {
    display: block;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.15s;
}

.help-nav a:hover {
    background: var(--bg-soft);
    color: var(--theme-primary);
}

.help-nav li.active a {
    background: var(--theme-primary);
    color: white;
    font-weight: 500;
}

.help-content {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid var(--border);
}

.help-content h2 {
    color: var(--theme-primary);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--bg-sage-light);
}

.help-content h3 {
    color: var(--text-primary);
    font-size: 1.15rem;
    margin: 1.5rem 0 0.75rem;
}

.help-content p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.help-content ol, .help-content ul {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.help-content li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.help-content code {
    background: var(--bg-soft);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
    color: var(--theme-primary-dark);
}

.help-content a {
    color: var(--theme-primary);
    text-decoration: none;
}

.help-content a:hover {
    text-decoration: underline;
}

.help-card {
    background: var(--bg-soft);
    border-radius: 12px;
    padding: 1.25rem;
    margin: 1rem 0;
    border-left: 4px solid var(--theme-primary);
}

.help-card.highlight {
    background: var(--bg-sage-light);
    border-left-color: var(--theme-secondary);
}

.help-card h3 {
    margin-top: 0;
    color: var(--theme-primary);
}

.checklist {
    list-style: none;
    padding-left: 0;
}

.checklist li {
    position: relative;
    padding-left: 1.75rem;
    margin-bottom: 0.75rem;
}

.checklist li::before {
    content: "☐";
    position: absolute;
    left: 0;
    color: var(--theme-primary);
}

.modal-dialog {
    margin: 0;
    max-width: 100%;
    min-height: 100vh;
}

.modal-footer .btn {
    flex: 1;
    min-width: 120px;
}

.mobile-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-nav-overlay.active {
    display: block;
    opacity: 1;
}

.mobile-header {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-primary-dark) 100%);
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    z-index: 1001;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.mobile-header .logo {
    height: 36px;
    object-fit: contain;
}

.mobile-header .hamburger {
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.mobile-header .hamburger:hover {
    background: rgba(255, 255, 255, 0.2);
}

.mobile-header .hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-header .hamburger.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-header .hamburger.open span:nth-child(2) {
    opacity: 0;
}

.mobile-header .hamburger.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-content-offset {
    padding-top: 60px;
}

.page-title-mobile {
    font-size: 1.25rem;
    color: white;
    font-family: 'Quicksand', sans-serif;
    font-weight: 600;
}

.btn-group-mobile {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.btn-group-mobile .btn {
    width: 100%;
}

.mobile-fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-primary-dark) 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(46, 125, 50, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: all 0.2s ease;
}

.mobile-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(46, 125, 50, 0.5);
}

.mobile-fab svg {
    width: 24px;
    height: 24px;
}

.mobile-search {
    position: relative;
    width: 100%;
}

.mobile-search .form-control {
    padding-left: 2.75rem;
    padding-right: 2.75rem;
    background: var(--bg-white);
    border: 2px solid var(--border);
    border-radius: 25px;
}

.mobile-search .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.mobile-search .clear-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem;
    cursor: pointer;
}

.mobile-list-item {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.mobile-list-item:active {
    background: var(--bg-sage-light);
    transform: scale(0.98);
}

.mobile-list-item .item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.mobile-list-item .item-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.mobile-list-item .item-subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.mobile-list-item .item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.mobile-list-item .item-meta svg {
    width: 14px;
    height: 14px;
    margin-right: 0.25rem;
    vertical-align: middle;
}

.mobile-tabs {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.5rem;
    padding: 0.5rem 0;
    margin: 0 -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
}

.mobile-tabs::-webkit-scrollbar {
    display: none;
}

.mobile-tab {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-tab.active {
    background: var(--theme-primary);
    border-color: var(--theme-primary);
    color: white;
}

.swipe-hint {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0.5rem;
}

.pull-to-refresh {
    text-align: center;
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.7rem;
    transition: color 0.2s ease;
}

.mobile-bottom-nav .nav-item.active {
    color: var(--theme-primary);
}

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

.hide-mobile {
    display: none !important;
}

.show-mobile {
    display: block !important;
}

.show-mobile-flex {
    display: flex !important;
}

@media (min-width: 768px) {
    /* Show/hide utilities */
    .hide-mobile {
        display: block !important;
    }

    .show-mobile, .show-mobile-flex {
        display: none !important;
    }

    /* Reset mobile column spacing */
    .row > [class*="col-lg-"],
    .row > [class*="col-md-"],
    .row > .col-md-2,
    .row > .col-md-3,
    .row > .col-md-4,
    .row.mb-3 > [class*="col-"],
    .row.mb-4 > [class*="col-"] {
        margin-bottom: 0;
    }

    /* Tablet stat cards - 2 columns */
    .row > [class*="col-md-6"] {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .row > [class*="col-md-4"] {
        flex: 0 0 33.333%;
        max-width: 33.333%;
    }

    .row > [class*="col-md-3"] {
        flex: 0 0 25%;
        max-width: 25%;
    }

    .row > [class*="col-md-2"] {
        flex: 0 0 16.666%;
        max-width: 16.666%;
    }

    /* The wide partners of the columns above. Without these a col-md-8 or col-md-9
       stays at 100% and wraps under its col-md-4 or col-md-3 sibling. */
    .row > .col-md-5 { flex: 0 0 41.666%; max-width: 41.666%; }
    .row > .col-md-7 { flex: 0 0 58.333%; max-width: 58.333%; }
    .row > .col-md-8 { flex: 0 0 66.666%; max-width: 66.666%; }
    .row > .col-md-9 { flex: 0 0 75%; max-width: 75%; }
    .row > .col-md-10 { flex: 0 0 83.333%; max-width: 83.333%; }

    /* Tablet modals - centered, not full screen */
    .modal-dialog {
        margin: 1.75rem auto;
        max-width: 500px;
        min-height: auto;
    }

    .modal-content {
        border-radius: 16px;
        min-height: auto;
    }

    .modal-footer .btn {
        flex: 0 0 auto;
        min-width: auto;
    }

    /* Tablet tables */
    .table th, .table td {
        padding: 1rem;
        font-size: 0.875rem;
    }

    /* Tablet buttons */
    .btn-group-mobile {
        flex-direction: row;
        width: auto;
    }

    .btn-group-mobile .btn {
        width: auto;
    }
}

@media (min-width: 992px) {
    .content, article {
        padding: 1.5rem 2rem !important;
    }

    h1 {
        font-size: 1.75rem;
    }

    /* Desktop stat cards - 4 columns */
    .row > [class*="col-lg-3"] {
        flex: 0 0 25%;
        max-width: 25%;
    }

    .row > [class*="col-lg-4"] {
        flex: 0 0 33.333%;
        max-width: 33.333%;
    }

    .row > [class*="col-lg-6"] {
        flex: 0 0 50%;
        max-width: 50%;
    }

    /* Desktop cards - hover effects */
    .card:hover {
        border-color: var(--theme-primary);
        box-shadow: 0 4px 20px var(--shadow-hover);
    }

    /* Desktop modal - larger */
    .modal-dialog {
        max-width: 600px;
    }

    .modal-lg .modal-dialog {
        max-width: 800px;
    }

    .modal-xl .modal-dialog {
        max-width: 1140px;
    }

    /* Hide mobile FAB on desktop */
    .mobile-fab {
        display: none;
    }
}

@media (min-width: 1200px) {
    .content, article {
        padding: 2rem 2.5rem !important;
    }
}

/* One content width for every page, left aligned (UI rules: never centre page content).
   Matches the Invoices page; pages no longer need their own max-width. */
article.content {
    max-width: 1400px;
    animation: pageEnter 0.18s ease-out;
}

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    article.content {
        animation: none;
    }
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-soft);
}

::-webkit-scrollbar-thumb {
    background: var(--sage-pale);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--sage);
}

.d-flex { display: flex !important; }

.align-items-center { align-items: center !important; }

.justify-content-between { justify-content: space-between !important; }

.gap-2 { gap: 0.5rem !important; }

.gap-3 { gap: 1rem !important; }

.me-2 { margin-right: 0.5rem !important; }

.h-100 { height: 100% !important; }

.w-100 { width: 100% !important; }

.text-center { text-align: center !important; }

.text-end { text-align: right !important; }

.py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }

.py-5 { padding-top: 3rem !important; padding-bottom: 3rem !important; }

.loading-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.spinner-container {
    position: relative;
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
}

.petal-spinner {
    position: absolute;
    width: 100%;
    height: 100%;
    animation: petalSpin 2s linear infinite;
}

@keyframes petalSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.petal {
    position: absolute;
    width: 12px;
    height: 20px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    opacity: 0.9;
}

.petal:nth-child(1) { background: var(--theme-primary-dark); top: 0; left: 50%; transform: translateX(-50%) rotate(0deg); transform-origin: center 30px; }

.petal:nth-child(2) { background: var(--theme-primary); top: 0; left: 50%; transform: translateX(-50%) rotate(45deg); transform-origin: center 30px; }

.petal:nth-child(3) { background: var(--theme-coral-dark); top: 0; left: 50%; transform: translateX(-50%) rotate(90deg); transform-origin: center 30px; }

.petal:nth-child(4) { background: var(--theme-coral); top: 0; left: 50%; transform: translateX(-50%) rotate(135deg); transform-origin: center 30px; }

.petal:nth-child(5) { background: var(--theme-secondary); top: 0; left: 50%; transform: translateX(-50%) rotate(180deg); transform-origin: center 30px; }

.petal:nth-child(6) { background: var(--theme-primary); top: 0; left: 50%; transform: translateX(-50%) rotate(225deg); transform-origin: center 30px; }

.petal:nth-child(7) { background: var(--theme-coral-dark); top: 0; left: 50%; transform: translateX(-50%) rotate(270deg); transform-origin: center 30px; }

.petal:nth-child(8) { background: var(--theme-coral); top: 0; left: 50%; transform: translateX(-50%) rotate(315deg); transform-origin: center 30px; }

.spinner-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, var(--theme-primary-dark) 0%, var(--theme-primary) 100%);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.loading-text {
    font-family: 'Quicksand', sans-serif;
    font-size: 0.9rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    animation: textPulse 2s ease-in-out infinite;
}

@keyframes textPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.spinner-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.spinner-inline .spinner-container {
    width: 24px;
    height: 24px;
    margin-bottom: 0;
}

.spinner-inline .petal {
    width: 5px;
    height: 9px;
}

.spinner-inline .petal:nth-child(1),
.spinner-inline .petal:nth-child(2),
.spinner-inline .petal:nth-child(3),
.spinner-inline .petal:nth-child(4),
.spinner-inline .petal:nth-child(5),
.spinner-inline .petal:nth-child(6),
.spinner-inline .petal:nth-child(7),
.spinner-inline .petal:nth-child(8) {
    transform-origin: center 12px;
}

.spinner-inline .spinner-center {
    width: 6px;
    height: 6px;
}

.stem-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--theme-border);
    margin-right: 0.6rem;
    vertical-align: middle;
    flex-shrink: 0;
}

.image-review-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
}

.image-review-card {
    border: 1px solid var(--theme-border);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: opacity 0.15s ease, border-color 0.15s ease;
}

.image-review-card.kept {
    border-color: var(--theme-secondary);
}

.image-review-card.rejected .image-review-main {
    filter: grayscale(0.85);
    opacity: 0.55;
}

.image-review-photo {
    position: relative;
}

.image-review-pick {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.7rem 0.3rem 0.5rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--theme-text);
    cursor: pointer;
    margin: 0;
}

.image-review-pick input {
    width: 1.15rem;
    height: 1.15rem;
    margin: 0;
    accent-color: var(--theme-primary);
    cursor: pointer;
}

.image-review-card.rejected .image-review-pick {
    color: var(--theme-text-muted);
}

.image-review-main {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: var(--theme-background-alt);
    display: block;
}

.image-review-empty {
    width: 100%;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.75rem;
    font-size: 0.8rem;
    color: var(--theme-text-muted);
    background: var(--theme-background-alt);
}

.image-review-body {
    padding: 0.5rem 0.6rem 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex: 1;
}

.image-review-body .name {
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1.2;
}

.image-review-body .reason {
    font-size: 0.75rem;
    color: var(--theme-text-muted);
    line-height: 1.25;
}

.image-review-alts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-top: auto;
    padding-top: 0.4rem;
}

.image-review-alts-label {
    flex-basis: 100%;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--theme-text);
}

.image-review-alt {
    position: relative;
    width: calc(25% - 0.3rem);
    aspect-ratio: 1;
    padding: 0;
    border: 2px solid var(--theme-border);
    border-radius: 8px;
    background: none;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
}

.image-review-alt img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-review-alt:hover,
.image-review-alt:focus-visible {
    border-color: var(--theme-secondary);
    outline: none;
}

.image-review-alt.current {
    border-color: var(--theme-primary);
}

.image-review-alt.current::after {
    content: "";
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--theme-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 12px no-repeat;
    box-shadow: 0 0 0 1.5px #fff;
}

.image-review-licence {
    font-size: 0.7rem;
    color: var(--theme-text-muted);
}

.image-finding {
    gap: 0.5rem;
    padding: 1.5rem 1rem;
}

.image-finding .spinner-container {
    margin-bottom: 0.25rem;
}

.image-finding-current {
    font-size: 0.9rem;
    color: var(--theme-text);
    min-height: 1.4em;
}

.image-finding-bar {
    width: min(420px, 100%);
    height: 6px;
    margin: 0.25rem 0 0.5rem;
}

.image-finding-bar .progress-bar {
    background: var(--theme-primary);
    transition: width 0.3s ease;
}

.home-page .search-card {
    background: linear-gradient(135deg, #f8f6f3 0%, #f0ede8 100%);
    border: 2px solid var(--sage-pale);
    position: relative;
    z-index: 100;
}

.home-page .search-container {
    position: relative;
    z-index: 100;
}

.home-page .search-input {
    font-size: 1.1rem;
    padding: 1rem 1.5rem;
    border: 2px solid var(--sage-pale);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.home-page .search-input:focus {
    border-color: var(--sage);
    box-shadow: 0 0 0 4px rgba(138, 154, 135, 0.2);
}

.home-page .search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    z-index: 9999;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 0.5rem;
}

.home-page .search-result-item {
    width: 100%;
    padding: 1rem 1.25rem;
    border: none;
    border-bottom: 1px solid var(--border-light);
    background: white;
    cursor: pointer;
    transition: background 0.2s ease;
    text-align: left;
    font: inherit;
    color: inherit;
}

.home-page .search-result-item:hover {
    background: var(--sage-mist);
}

.home-page .search-result-item:focus-visible {
    outline: 2px solid var(--sage);
    outline-offset: -2px;
    background: var(--sage-mist);
}

.home-page .search-result-item:last-child {
    border-bottom: none;
}

.home-page .price-tag {
    background: linear-gradient(135deg, var(--sage) 0%, var(--sage-dark) 100%);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
}

.home-page .price-missing {
    background: var(--warning);
    color: var(--text-primary);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}

.home-page .quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 1.5rem;
    background: var(--bg-soft);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    min-width: 140px;
    transition: all 0.2s ease;
}

.home-page .quick-action-btn:hover {
    background: var(--sage-mist);
    border-color: var(--sage);
    color: var(--sage-dark);
    box-shadow: 0 4px 12px var(--shadow-hover);
}

.home-page .action-icon {
    width: 28px;
    height: 28px;
    margin-bottom: 0.5rem;
    stroke: currentColor;
}

.home-page .quick-action-btn span {
    font-weight: 600;
    font-size: 0.9rem;
}

.home-page .getting-started-list li {
    padding: 0.4rem 0;
    color: var(--text-secondary);
}

@media (max-width: 767.98px) {
    .home-page .search-card .row.justify-content-center > div {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .home-page .search-input {
        font-size: 16px;
        padding: 0.875rem 1rem;
    }

    .home-page .search-results {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 60vh;
        border-radius: 16px 16px 0 0;
        margin-top: 0;
    }

    .home-page .search-result-item {
        min-height: 60px;
        padding: 1rem;
        display: flex;
        align-items: center;
    }

    .home-page .search-result-item:active {
        background: var(--sage-mist);
    }

    .home-page .price-tag {
        font-size: 1rem;
        padding: 0.35rem 0.65rem;
    }

    .home-page .row > .col-md-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .home-page .card.text-white .card-body {
        padding: 1rem;
    }

    .home-page .card.text-white h5 {
        font-size: 0.7rem;
    }

    .home-page .card.text-white h2 {
        font-size: 1.75rem;
    }

    .home-page .card-body.d-flex.flex-wrap.gap-3 {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem !important;
    }

    .home-page .quick-action-btn {
        min-width: auto;
        padding: 1rem;
        min-height: 80px;
    }

    .home-page .quick-action-btn:hover {
        transform: none;
    }

    .home-page .quick-action-btn:active {
        background: var(--sage-mist);
        transform: scale(0.98);
    }

    .home-page .action-icon {
        width: 24px;
        height: 24px;
    }

    .home-page .quick-action-btn span {
        font-size: 0.8rem;
        text-align: center;
    }

    .home-page .row.mt-4 > div[class*="col-md-6"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .home-page .d-flex.flex-wrap.gap-2 {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.5rem;
        margin: 0 -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .home-page .d-flex.flex-wrap.gap-2::-webkit-scrollbar {
        display: none;
    }

    .home-page .d-flex.flex-wrap.gap-2 .badge {
        flex-shrink: 0;
    }

    .home-page .getting-started-list {
        padding-left: 1.25rem;
    }

    .home-page .getting-started-list li {
        font-size: 0.9rem;
    }
}

@media (max-width: 375px) {
    .home-page .row > .col-md-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

.inventory-page .summary-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.inventory-page .summary-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inventory-page .summary-icon.fresh { background: #e8f5e9; color: #2e7d32; }

.inventory-page .summary-icon.warning { background: #fff3e0; color: #f57c00; }

.inventory-page .summary-icon.danger { background: #ffebee; color: #c62828; }

.inventory-page .summary-icon.low { background: #e3f2fd; color: #1976d2; }

.inventory-page .summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.inventory-page .summary-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.inventory-table th {
    background: var(--sage-mist);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border: none;
}

.inventory-table td {
    vertical-align: middle;
    border-color: var(--border);
}

.inventory-table tr.expired {
    background: #fff5f5;
}

.inventory-table tr.low-stock {
    background: #fffde7;
}

.inventory-page .category-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.inventory-page .category-badge.flower { background: #fce4ec; color: #c2185b; }

.inventory-page .category-badge.foliage { background: #e8f5e9; color: #2e7d32; }

.inventory-page .category-badge.filler { background: #fff3e0; color: #ef6c00; }

.inventory-page .qty-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--sage-mist);
    border-radius: 20px;
    font-weight: 600;
}

.inventory-page .qty-badge.low {
    background: #ffebee;
    color: #c62828;
}

.freshness-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.freshness-badge.fresh { background: #e8f5e9; color: #2e7d32; }

.freshness-badge.good { background: #e8f5e9; color: #388e3c; }

.freshness-badge.fair { background: #fff3e0; color: #f57c00; }

.freshness-badge.poor { background: #ffebee; color: #d32f2f; }

.freshness-badge.expired { background: #d32f2f; color: white; }

.supplies-page { padding: 1.5rem; }

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

.supplies-page .checkbox-label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }

.supplies-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }

.supply-card { background: white; border: 1px solid var(--border); border-radius: 12px; padding: 1rem; transition: box-shadow 0.2s; }

.supply-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }

.supply-card.inactive { opacity: 0.6; }

.supply-card.low-stock { border-color: var(--theme-coral); }

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

.supplies-page .category-badge { font-size: 0.7rem; padding: 0.2rem 0.5rem; border-radius: 4px; background: var(--theme-primary-light); color: var(--theme-primary-dark); text-transform: uppercase; font-weight: 600; }

.supplies-page .category-badge.containers { background: #e3f2fd; color: #1565c0; }

.supplies-page .category-badge.packaging { background: #fce4ec; color: #c2185b; }

.supplies-page .category-badge.foam { background: #e8f5e9; color: #2e7d32; }

.supplies-page .category-badge.wire { background: #fff3e0; color: #e65100; }

.supplies-page .category-badge.tools { background: #f3e5f5; color: #7b1fa2; }

.supplies-page .category-badge.cards { background: #fff8e1; color: #f9a825; }

.low-stock-badge { font-size: 0.7rem; padding: 0.2rem 0.5rem; border-radius: 4px; background: var(--theme-coral); color: white; }

.supply-card h3 { margin: 0 0 0.5rem; font-size: 1rem; }

.supply-card .description { margin: 0 0 0.75rem; font-size: 0.85rem; color: var(--text-muted); }

.supply-stats { display: flex; gap: 1.5rem; margin-bottom: 0.75rem; }

.supply-stats .stat { display: flex; flex-direction: column; }

.supply-stats .label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; }

.supply-stats .value { font-weight: 600; }

.supply-card .supplier { font-size: 0.8rem; color: var(--text-muted); margin: 0 0 0.75rem; }

.supply-card .card-actions { display: flex; gap: 0.5rem; border-top: 1px solid var(--border); padding-top: 0.75rem; margin-top: 0.5rem; }

.wastage-page { padding: 1.5rem; }

.wastage-page .page-header { margin-bottom: 1.5rem; }

.wastage-page .back-link { display: inline-flex; align-items: center; gap: 0.25rem; color: var(--text-muted); text-decoration: none; font-size: 0.9rem; margin-bottom: 0.5rem; }

.wastage-page .back-link:hover { color: var(--theme-primary); }

.wastage-page .header-content h1 { margin: 0; color: var(--text-primary); }

.wastage-page .header-content p { margin: 0.25rem 0 0; color: var(--text-muted); }

.wastage-page .form-layout { display: grid; grid-template-columns: 1fr 280px; gap: 1.5rem; margin-bottom: 1.5rem; }

.wastage-page .card { background: white; border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem; margin-bottom: 1rem; }

.wastage-page .card h3 { margin: 0 0 1rem; font-size: 1rem; color: var(--text-primary); }

.wastage-page .item-type-tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; justify-content: flex-start; }

.wastage-page .tab { padding: 0.75rem 1.5rem; border: 1px solid var(--border); background: white; border-radius: 8px; cursor: pointer; font-weight: 500; color: var(--text-muted); transition: all 0.15s; }

.wastage-page .tab:hover { background: var(--bg-soft); }

.wastage-page .tab.active { background: var(--theme-primary); color: white; border-color: var(--theme-primary); }

.wastage-page .selected-item-info { background: var(--bg-soft); border-radius: 8px; padding: 1rem; margin-bottom: 1rem; }

.wastage-page .selected-item-info h4 { margin: 0 0 0.5rem; color: var(--text-primary); }

.wastage-page .selected-item-info p { margin: 0.25rem 0; font-size: 0.9rem; color: var(--text-muted); }

.wastage-page .cost-impact { display: flex; justify-content: space-between; padding: 0.75rem 1rem; background: #fee2e2; border-radius: 8px; margin-top: 1rem; }

.wastage-page .cost-impact .label { font-weight: 500; color: #991b1b; }

.wastage-page .cost-impact .value { font-weight: 600; color: #dc2626; }

.wastage-page .summary-list { margin: 0; }

.wastage-page .summary-list dt { float: left; clear: left; color: var(--text-muted); font-size: 0.85rem; }

.wastage-page .summary-list dd { text-align: right; margin: 0 0 0.5rem; font-size: 0.85rem; }

.wastage-page .summary-list dd.loss { color: #dc2626; font-weight: 600; }

.wastage-page .empty-summary { font-size: 0.85rem; color: var(--text-muted); text-align: center; padding: 1rem 0; }

.wastage-page .success-message { background: #d1fae5; color: #059669; padding: 0.75rem 1rem; border-radius: 8px; margin-top: 0.75rem; text-align: center; font-weight: 500; }

.wastage-page .recent-wastage table { width: 100%; border-collapse: collapse; }

.wastage-page .recent-wastage th { text-align: left; padding: 0.5rem; font-weight: 600; font-size: 0.75rem; text-transform: uppercase; color: var(--text-muted); border-bottom: 1px solid var(--border); }

.wastage-page .recent-wastage th.number { text-align: right; }

.wastage-page .recent-wastage td { padding: 0.5rem; border-bottom: 1px solid var(--border); font-size: 0.9rem; }

.wastage-page .recent-wastage td.number { text-align: right; }

.wastage-page .recent-wastage td.loss { color: #dc2626; }

.wastage-page .btn-full { width: 100%; justify-content: center; display: flex; }

.templates-page { padding: 1.5rem; max-width: 1400px; }

.templates-page .page-header { margin-bottom: 1.5rem; }

.templates-page .back-link { display: inline-flex; align-items: center; gap: 0.25rem; color: var(--text-muted); text-decoration: none; font-size: 0.9rem; margin-bottom: 0.5rem; }

.templates-page .back-link:hover { color: var(--theme-primary); }

.templates-page .header-content h1 { margin: 0; color: var(--text-primary); }

.templates-page .header-content p { margin: 0.25rem 0 0; color: var(--text-muted); }

.templates-page .section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }

.templates-page .section-header h2 { margin: 0; font-size: 1.25rem; }

.templates-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }

.template-card { background: white; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; cursor: pointer; transition: all 0.2s; }

.template-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

.template-card.is-default { border-color: var(--theme-primary); }

.template-preview { padding: 1rem; background: var(--bg-soft); }

.mini-preview { background: white; border-radius: 4px; padding: 0.5rem; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

.mini-header { height: 8px; background: var(--theme-primary); border-radius: 2px; margin-bottom: 0.5rem; }

.mini-body { display: flex; flex-direction: column; gap: 4px; }

.mini-line { height: 4px; background: #e0e0e0; border-radius: 2px; }

.mini-line.w60 { width: 60%; }

.mini-line.w80 { width: 80%; }

.mini-line.w40 { width: 40%; }

.template-info { padding: 1rem; }

.template-info h4 { margin: 0 0 0.25rem; }

.default-badge { font-size: 0.7rem; padding: 0.15rem 0.4rem; background: var(--theme-primary); color: white; border-radius: 4px; margin-left: 0.5rem; }

.template-meta { margin: 0; font-size: 0.85rem; color: var(--text-muted); }

.template-actions { display: flex; gap: 0.5rem; padding: 0.75rem 1rem; border-top: 1px solid var(--border); }

.template-actions .danger { color: #dc2626; }

.templates-page .empty-state { text-align: center; padding: 3rem; background: white; border-radius: 12px; border: 1px dashed var(--border); }

.templates-page .empty-state svg { color: var(--text-muted); margin-bottom: 1rem; }

.templates-page .empty-state h3 { margin: 0 0 0.5rem; }

.templates-page .empty-state p { margin: 0 0 1.5rem; color: var(--text-muted); }

.templates-page .empty-actions { display: flex; gap: 1rem; justify-content: center; }

.editor-layout { display: grid; grid-template-columns: 380px 1fr; gap: 1.5rem; }

@media (max-width: 1000px) { .editor-layout { grid-template-columns: 1fr; } }

.editor-sidebar { display: flex; flex-direction: column; gap: 1rem; }

.templates-page .card { background: white; border: 1px solid var(--border); border-radius: 12px; padding: 1rem; }

.templates-page .card h3 { margin: 0 0 1rem; font-size: 0.9rem; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.5px; }

.color-inputs { display: flex; flex-direction: column; gap: 0.75rem; }

.color-input { display: flex; align-items: center; gap: 0.75rem; }

.color-input label { width: 60px; font-size: 0.85rem; }

.templates-page .color-picker { display: flex; gap: 0.5rem; flex: 1; }

.templates-page .color-picker input[type="color"] { width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; padding: 2px; }

.color-hex { width: 80px; padding: 0.4rem; border: 1px solid var(--border); border-radius: 6px; font-family: monospace; font-size: 0.85rem; }

.templates-page .form-group { margin-bottom: 0.75rem; }

.templates-page .form-group:last-child { margin-bottom: 0; }

.templates-page .form-group label { display: block; margin-bottom: 0.25rem; font-size: 0.85rem; font-weight: 500; }

.templates-page .form-group input, .templates-page .form-group select, .templates-page .form-group textarea { width: 100%; padding: 0.5rem; border: 1px solid var(--border); border-radius: 6px; font-size: 0.9rem; }

.templates-page .form-group textarea { resize: vertical; }

.templates-page .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.templates-page .checkbox-label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; font-size: 0.9rem; }

.editor-actions { display: flex; gap: 0.75rem; padding-top: 1rem; }

.editor-actions .btn-primary { flex: 1; }

.editor-preview { position: sticky; top: 1rem; }

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

.preview-header h3 { margin: 0; }

.preview-frame { background: white; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,0.08); }

.upload-zone { border: 2px dashed var(--border); border-radius: 12px; padding: 3rem 2rem; text-align: center; cursor: pointer; transition: all 0.2s; position: relative; }

.upload-zone:hover, .upload-zone.dragging { border-color: var(--theme-primary); background: rgba(46, 125, 50, 0.05); }

.upload-zone svg { color: var(--text-muted); margin-bottom: 1rem; }

.upload-zone h3 { margin: 0 0 0.5rem; }

.upload-zone p { margin: 0; color: var(--text-muted); }

.file-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.upload-hint { font-size: 0.85rem; color: var(--text-muted); text-align: center; margin-top: 1rem; }

.import-progress { text-align: center; padding: 2rem; }

.extraction-result { padding: 1rem 0; }

.result-success, .result-error { text-align: center; margin-bottom: 1.5rem; }

.result-success svg { color: var(--theme-primary); margin-bottom: 0.75rem; }

.result-error svg { color: #dc2626; margin-bottom: 0.75rem; }

.result-success h3 { color: var(--theme-primary); margin: 0 0 0.5rem; }

.result-error h3 { color: #dc2626; margin: 0 0 0.5rem; }

.extracted-summary { background: var(--bg-soft); border-radius: 8px; padding: 1rem; }

.summary-item {
    text-align: center;
}

.summary-item:last-child { border-bottom: none; }

.summary-item .label { font-weight: 500; min-width: 70px; }

.summary-item .value { color: var(--text-muted); }

.color-swatches { display: flex; gap: 0.5rem; }

.swatch { width: 24px; height: 24px; border-radius: 4px; border: 1px solid rgba(0,0,0,0.1); }

.pipeline-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 1rem;
}

.pipeline-column {
    flex: 1;
    min-width: 220px;
    max-width: 300px;
    background: var(--bg-soft);
    border-radius: 12px;
    padding: 0.75rem;
}

.pipeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.75rem;
}

.pipeline-title {
    font-weight: 600;
    font-size: 0.9rem;
}

.pipeline-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 200px;
}

.lead-card {
    background: white;
    border-radius: 8px;
    padding: 0.75rem;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: box-shadow 0.15s;
}

.lead-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.lead-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.lead-event {
    font-size: 0.85rem;
    color: var(--theme-primary);
}

.lead-budget {
    font-weight: 600;
    color: var(--theme-primary);
    margin-top: 0.25rem;
}

.calendar-grid {
    background: white;
    border-radius: 12px;
    border: 1px solid #d0d7d0;
    overflow: hidden;
}

.calendar-header-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--theme-background-alt);
    border-bottom: 2px solid #d0d7d0;
}

.calendar-header-cell {
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
    color: var(--theme-text-muted);
    font-size: 0.85rem;
    border-right: 1px solid #e0e8e0;
}

.calendar-header-cell:last-child {
    border-right: none;
}

.calendar-week-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 1px solid #d0d7d0;
}

.calendar-week-row:last-child {
    border-bottom: none;
}

.calendar-day {
    min-height: 100px;
    padding: 0.5rem;
    border-right: 1px solid #d0d7d0;
    cursor: pointer;
    transition: background-color 0.15s;
}

.calendar-day:last-child {
    border-right: none;
}

.calendar-day:hover {
    background-color: var(--theme-background-alt);
}

.calendar-day.other-month {
    background-color: #fafafa;
}

.calendar-day.other-month .day-number {
    color: var(--theme-text-muted);
    opacity: 0.5;
}

.calendar-day.weekend,
.week-day-column.weekend,
.week-header-cell.weekend {
    background-color: color-mix(in srgb, var(--theme-accent) 7%, white);
}

.calendar-header-cell.weekend,
.week-header-cell.weekend .week-day-name {
    color: var(--theme-accent-dark);
}

.calendar-day.past,
.week-day-column.past,
.week-header-cell.past {
    background-color: #f3f3f3;
}

.calendar-day.past.weekend,
.week-day-column.past.weekend,
.week-header-cell.past.weekend {
    background-color: color-mix(in srgb, var(--theme-accent) 5%, #f3f3f3);
}

.calendar-day.past:hover,
.week-day-column.past:hover {
    background-color: var(--theme-background-alt);
}

.calendar-day.past .day-number,
.week-header-cell.past .week-day-name,
.week-header-cell.past .week-day-number {
    color: var(--theme-text-muted);
    opacity: 0.65;
}

.calendar-day.past .day-event,
.week-day-column.past .week-event {
    opacity: 0.6;
}

.calendar-day.today {
    background-color: rgba(46, 125, 50, 0.05);
}

.day-number {
    display: inline-block;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.day-number.today-badge {
    background: var(--theme-primary);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.day-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.day-event {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    padding: 2px 4px;
    border-radius: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.day-event.order {
    background: rgba(33, 150, 243, 0.1);
    color: #1976d2;
}

.day-event.event {
    background: rgba(156, 39, 176, 0.1);
    color: #7b1fa2;
}

.day-event.occasion {
    background: rgba(245, 168, 154, 0.2);
    color: var(--theme-coral-dark);
}

.day-event.reminder {
    background: rgba(255, 152, 0, 0.1);
    color: #f57c00;
}

.day-event.more {
    color: var(--theme-text-muted);
    font-style: italic;
}

.event-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.day-event.order .event-dot { background: #1976d2; }

.day-event.event .event-dot { background: #7b1fa2; }

.day-event.occasion .event-dot { background: var(--theme-coral-dark); }

.day-event.reminder .event-dot { background: #f57c00; }

.event-title {
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-controls {
    background: white;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--theme-border);
}

.calendar-month-title {
    font-size: 1.25rem;
    font-weight: 600;
    min-width: 180px;
    text-align: center;
}

.btn-icon-only {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--theme-border);
    background: white;
    border-radius: 8px;
    cursor: pointer;
}

.btn-icon-only:hover {
    background: var(--theme-background-alt);
}

.btn-icon-only svg {
    width: 20px;
    height: 20px;
}

.view-toggle .btn {
    padding: 0.5rem 1rem;
}

.week-view {
    background: white;
    border-radius: 12px;
    border: 1px solid #d0d7d0;
    overflow: hidden;
}

.week-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f8faf8;
    border-bottom: 2px solid #d0d7d0;
}

.week-header-cell {
    padding: 0.75rem;
    text-align: center;
    border-right: 1px solid #e0e8e0;
}

.week-header-cell:last-child {
    border-right: none;
}

.week-header-cell.today {
    background: rgba(46, 125, 50, 0.1);
}

.week-day-name {
    display: block;
    font-size: 0.75rem;
    color: #6b7c6b;
    text-transform: uppercase;
}

.week-day-number {
    display: inline-block;
    font-weight: 600;
    font-size: 1.25rem;
    margin-top: 0.25rem;
}

.week-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    min-height: 400px;
}

.week-day-column {
    border-right: 1px solid #d0d7d0;
    padding: 0.5rem;
    cursor: pointer;
}

.week-day-column:last-child {
    border-right: none;
}

.week-day-column:hover {
    background: #f8faf8;
}

.week-event {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

.week-event.order {
    background: rgba(33, 150, 243, 0.1);
    border-left: 3px solid #1976d2;
}

.week-event.event {
    background: rgba(156, 39, 176, 0.1);
    border-left: 3px solid #7b1fa2;
}

.week-event.occasion {
    background: rgba(245, 168, 154, 0.2);
    border-left: 3px solid var(--theme-coral-dark);
}

.week-event .event-time {
    display: block;
    font-size: 0.7rem;
    color: var(--theme-text-muted);
}

.list-view {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--theme-border);
    overflow: hidden;
}

.list-date-group {
    border-bottom: 1px solid var(--theme-border);
}

.list-date-group:last-child {
    border-bottom: none;
}

.list-date-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--theme-background-alt);
    font-weight: 600;
}

.list-event {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--theme-border);
    cursor: pointer;
    transition: background-color 0.15s;
}

.list-event:last-child {
    border-bottom: none;
}

.list-event:hover {
    background: var(--theme-background-alt);
}

.event-type-indicator {
    width: 4px;
    height: 100%;
    min-height: 40px;
    border-radius: 2px;
    flex-shrink: 0;
}

.list-event.order .event-type-indicator { background: #1976d2; }

.list-event.event .event-type-indicator { background: #7b1fa2; }

.list-event.occasion .event-type-indicator { background: var(--theme-coral-dark); }

.list-event.reminder .event-type-indicator { background: #f57c00; }

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

.event-content .event-title {
    font-weight: 500;
}

.event-description {
    color: var(--theme-text-muted);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.event-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    flex-shrink: 0;
}

.event-meta .event-time {
    font-size: 0.875rem;
    color: var(--theme-text-muted);
}

.event-type-badge {
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    background: var(--theme-background-alt);
}

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--theme-border);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--theme-text-muted);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend-item.order .legend-dot { background: #1976d2; }

.legend-item.event .legend-dot { background: #7b1fa2; }

.legend-item.occasion .legend-dot { background: var(--theme-coral-dark); }

.legend-item.reminder .legend-dot { background: #f57c00; }

.calendar-page .empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--theme-text-muted);
}

.calendar-page .empty-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.calendar-page .empty-state h3 {
    margin-bottom: 0.5rem;
    color: var(--theme-text);
}

.detail-event {
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.15s;
}

.detail-event:hover {
    background: var(--theme-background-alt);
}

.detail-event.order { border-left: 4px solid #1976d2; }

.detail-event.event { border-left: 4px solid #7b1fa2; }

.detail-event.occasion { border-left: 4px solid #e8786a; }

.detail-event.reminder { border-left: 4px solid #f57c00; }

.reminder-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.reminder-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.group-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--theme-border);
}

.group-label {
    font-weight: 600;
    color: var(--theme-text);
}

.group-badge {
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
}

.reminder-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border: 1px solid var(--theme-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.reminder-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.reminder-card.urgent {
    border-left: 4px solid #f57c00;
    background: rgba(255, 152, 0, 0.03);
}

.reminder-card.today {
    border-left: 4px solid #d32f2f;
    background: rgba(211, 47, 47, 0.03);
}

.reminder-card.this-week {
    border-left: 4px solid var(--theme-coral-dark);
}

.reminder-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--theme-background-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.reminder-icon svg {
    width: 20px;
    height: 20px;
    color: var(--theme-primary);
}

.reminder-card.occasion .reminder-icon {
    background: rgba(245, 168, 154, 0.2);
}

.reminder-card.occasion .reminder-icon svg {
    color: var(--theme-coral-dark);
}

.reminder-card.event .reminder-icon {
    background: rgba(156, 39, 176, 0.1);
}

.reminder-card.event .reminder-icon svg {
    color: #7b1fa2;
}

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

.reminder-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.reminder-title .recipient {
    font-weight: 400;
    color: var(--theme-text-muted);
}

.reminder-customer {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.customer-phone {
    color: var(--theme-text-muted);
    margin-left: 0.5rem;
}

.reminder-date {
    font-size: 0.875rem;
    color: var(--theme-text-muted);
}

.days-away {
    color: var(--theme-primary);
    font-weight: 500;
}

.reminder-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--theme-text-muted);
    margin-bottom: 0.25rem;
}

.reminder-alert {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 152, 0, 0.1);
    border-radius: 6px;
    font-size: 0.875rem;
    color: #f57c00;
}

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

.chevron {
    width: 20px;
    height: 20px;
    color: var(--theme-text-muted);
}

.detail-section {
    margin-bottom: 1.5rem;
}

.detail-section h6 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    color: var(--theme-text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-section.highlight {
    background: rgba(46, 125, 50, 0.05);
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--theme-primary);
}

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

.detail-label {
    width: 100px;
    flex-shrink: 0;
    color: var(--theme-text-muted);
}

.customer-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    gap: 1.25rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.customer-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--sage), var(--blush), var(--sage-light));
    opacity: 0;
    transition: opacity 0.3s;
}

.customer-card:hover::before {
    opacity: 1;
}

.customer-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(90, 95, 74, 0.15);
    border-color: var(--sage-light);
}

.customer-card:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(138, 148, 120, 0.2), 0 8px 24px rgba(90, 95, 74, 0.12);
}

.customer-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.customer-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--theme-primary);
    text-decoration: none;
    margin-top: 0.25rem;
}

.customer-link:hover {
    text-decoration: underline;
}

.last-order-card {
    background: white;
    border: 1px solid var(--theme-border);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.order-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.order-description {
    font-style: italic;
    color: var(--ink-muted, #9a9a9a);
}

.order-total {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.suggestion-box {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(33, 150, 243, 0.1);
    border-radius: 8px;
    color: #1976d2;
}

.mini-order {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    border-bottom: 1px solid var(--theme-border);
    font-size: 0.875rem;
}

.mini-order:last-child {
    border-bottom: none;
}

.mini-order .order-desc {
    flex: 1;
    color: var(--theme-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.budget-info {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--theme-border);
}

.bg-purple {
    background-color: rgba(156, 39, 176, 0.1);
    color: #7b1fa2;
}

.contracts-page .filter-bar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: white;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s;
}

.filter-chip:hover {
    border-color: var(--theme-primary);
}

.filter-chip.active {
    background: var(--theme-primary);
    border-color: var(--theme-primary);
    color: white;
}

.contracts-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.contract-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: box-shadow 0.15s;
}

.contract-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

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

.contract-number {
    font-weight: 600;
    color: var(--theme-primary);
}

.contract-client {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.contract-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

.contract-total {
    font-weight: 600;
    font-size: 1.1rem;
}

.contracts-page .empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.stem-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
}

.stem-result-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background 0.2s;
}

.stem-result-item:hover {
    background: var(--sage-mist);
}

.stem-result-item:last-child {
    border-bottom: none;
}

.costing-summary {
    background: linear-gradient(135deg, #f8f6f3 0%, #f0ede8 100%);
    border: 2px solid var(--sage-pale);
}

.total-cost {
    color: var(--sage-dark);
}

.bg-success-subtle {
    background-color: rgba(138, 154, 135, 0.15);
}

.bg-danger-subtle {
    background-color: rgba(207, 142, 130, 0.15);
}

.order-status-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    border-bottom: 2px solid var(--border-color, #e5e2dd);
    padding-bottom: 0.5rem;
}

.status-tab {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    color: var(--ink-soft, #6a6f60);
    transition: all 0.2s;
}

.status-tab:hover {
    background: var(--sage-mist, #dfe5db);
}

.status-tab.active {
    background: var(--sage, #8a9478);
    color: white;
}

.status-tab .badge {
    background: rgba(0,0,0,0.1);
    font-size: 0.7rem;
    padding: 0.2em 0.5em;
    border-radius: 10px;
    margin-left: 0.25rem;
}

.order-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.order-card {
    background: white;
    border: 1px solid var(--border-color, #e5e2dd);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.order-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.order-card.urgent {
    border-left: 4px solid #dc3545;
}

.order-card.flagged {
    background: #fff8e1;
}

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

.order-number {
    font-weight: 500;
    color: var(--theme-primary);
}

.order-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    color: var(--ink-soft, #6a6f60);
    font-size: 0.9rem;
}

.order-customer, .order-delivery, .order-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.recipient-name {
    color: var(--ink-muted, #9a9a9a);
    font-style: italic;
}

.time-slot {
    background: var(--sage-mist, #dfe5db);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.order-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color, #e5e2dd);
}

.source-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.source-badge.source-manual { background: #f5f5f5; color: #666; }

.source-badge.source-shopify { background: #95bf47; color: white; }

.source-badge.source-phone { background: #2196f3; color: white; }

.source-badge.source-walk-in { background: #9c27b0; color: white; }

.source-badge.source-interflora { background: #e91e63; color: white; }

.payment-status {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.payment-status.paid { background: #e8f5e9; color: #2e7d32; }

.payment-status.unpaid { background: #ffebee; color: #c62828; }

.status-timeline {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem;
    background: var(--sage-mist, #dfe5db);
    border-radius: 12px;
    position: relative;
}

.status-timeline::before {
    content: '';
    position: absolute;
    top: 2rem;
    left: 10%;
    right: 10%;
    height: 2px;
    background: #ccc;
    z-index: 0;
}

.timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    flex: 1;
    text-align: center;
}

.timeline-step .step-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    border: 2px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    color: #999;
}

.timeline-step.completed .step-icon {
    background: var(--sage, #2e7d32);
    border-color: var(--sage, #2e7d32);
    color: white;
}

.timeline-step .step-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #999;
}

.timeline-step.completed .step-label {
    color: var(--ink, #3f4438);
}

.timeline-step .step-time {
    font-size: 0.65rem;
    color: #999;
    margin-top: 0.25rem;
}

.timeline-step.completed .step-time {
    color: var(--sage, #2e7d32);
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .status-timeline::before {
        left: 5%;
        right: 5%;
    }
}

.categories-page { padding: 1.5rem; }

.categories-page .page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem; }

.categories-page .header-content h1 { margin: 0; }

.categories-page .header-content p { margin: 0.25rem 0 0; color: var(--text-muted); }

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.category-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.95) 0%, rgba(248,250,248,0.9) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid var(--theme-border);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(90, 95, 74, 0.06);
}

.category-card:hover {
    box-shadow: 0 6px 20px rgba(90, 95, 74, 0.1);
    border-color: var(--sage);
}

/* Coloured bar: icon and name side by side */
.category-card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    height: 52px;
    padding: 0 1rem;
}

.category-card-icon {
    font-size: 1.6rem;
    line-height: 1;
}

.category-card-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.category-card-body {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    font-size: 0.8125rem;
}

.category-card-body p {
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.category-info {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    font-size: 0.8125rem;
}

.category-info h3 {
    margin: 0 0 0.25rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.category-info p {
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.category-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    padding: 0.75rem 1rem;
    background: rgba(248,250,248,0.5);
    border-top: 1px solid rgba(138, 148, 120, 0.1);
}

/* Small icon button */
.btn-icon-sm {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--border);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.2s;
}

.btn-icon-sm:hover {
    background: var(--bg-soft);
    border-color: var(--sage-light);
    color: var(--text-primary);
}

.btn-icon-sm.danger:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

.btn-icon-sm svg {
    width: 16px;
    height: 16px;
}

.color-picker { display: flex; gap: 0.5rem; }

.color-picker input[type="color"] { width: 40px; height: 38px; padding: 2px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }

.color-picker input[type="text"] { flex: 1; }

.quotes-page .filter-bar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.quotes-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.quote-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: box-shadow 0.15s;
}

.quote-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

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

.quote-number {
    font-weight: 600;
    color: var(--theme-primary);
}

.quote-client {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.quote-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

.quote-total {
    font-weight: 600;
    font-size: 1.1rem;
}

.recipe-card {
    transition: box-shadow 0.2s;
}

.recipe-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.income-report .chart-container {
    overflow-x: auto;
}

.income-report .progress {
    background-color: var(--theme-background-alt);
}

.wizard-step {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.wizard-step.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.wizard-step.completed {
    background: #10b981;
    color: white;
}

.wizard-line {
    width: 40px;
    height: 2px;
    background: #e2e8f0;
}

.wizard-line.completed {
    background: #10b981;
}

.wizard-option.selected {
    border-color: var(--theme-primary);
    background: var(--bg-sage-light);
}

.image-analysis-upload-area {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-soft);
}

.image-analysis-upload-area:hover,
.image-analysis-upload-area:focus-visible {
    border-color: var(--sage);
    background: var(--sage-mist);
    outline: 2px solid var(--sage);
    outline-offset: 2px;
}

.image-analysis-upload-area svg {
    color: var(--sage);
}

.image-analysis-result-stat {
    background: var(--bg-soft);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}

.image-analysis-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.image-analysis-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.arrangement-card {
    transition: all 0.2s ease;
}

.arrangement-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.retail-price {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--sage-dark);
}

.cost-breakdown {
    background: var(--sage-mist);
    padding: 0.75rem;
    border-radius: 8px;
}

.customer-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
}

.customer-select-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.customer-select-item:hover {
    border-color: var(--sage);
    background: var(--sage-mist);
}

.customer-avatar.small {
    width: 36px;
    height: 36px;
    font-size: 0.8rem;
}

.customer-select-name {
    font-weight: 600;
    color: var(--text-primary);
}

.suggested-message {
    background: var(--bg-soft);
    border-radius: 8px;
    padding: 0.75rem;
}

.customer-summary-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.customer-summary-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.customer-summary-icon.total { background: var(--sage-mist); color: var(--sage-dark); }

.customer-summary-icon.recent { background: #e8f5e9; color: #2e7d32; }

.customer-summary-icon.occasions { background: #fff3e0; color: #f57c00; }

.customer-summary-icon.business { background: #e3f2fd; color: #1976d2; }

.customer-summary-value { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); }

.customer-summary-label { font-size: 0.85rem; color: var(--text-muted); }

.occasions-alert {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 12px;
    padding: 1rem;
}

.occasions-alert-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    color: #f57c00;
}

.occasion-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.occasion-item {
    background: white;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.occasion-date {
    font-weight: 600;
    color: #f57c00;
}

.occasion-customer {
    color: var(--text-muted);
}

.customer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.customer-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sage) 0%, var(--sage-dark) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.2rem;
    flex-shrink: 0;
    position: relative;
    box-shadow: 0 4px 12px rgba(90, 95, 74, 0.25);
}

.customer-avatar::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid var(--sage-light);
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
}

.customer-card:hover .customer-avatar::after {
    opacity: 1;
}

.customer-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.customer-contact {
    font-size: 0.875rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0.125rem;
}

.customer-contact svg {
    flex-shrink: 0;
    opacity: 0.6;
}

.customer-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-self: center;
}

.customer-stats .stat {
    background: linear-gradient(135deg, var(--sage-mist) 0%, var(--sage-pale) 100%);
    border-radius: 10px;
    padding: 0.625rem 1rem;
    text-align: center;
    min-width: 72px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.customer-card:hover .customer-stats .stat {
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(90, 95, 74, 0.1);
}

.customer-stats .stat-value {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--sage-dark);
    display: block;
    line-height: 1.2;
}

.customer-stats .stat-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.purchases-page { padding: 1.5rem; }

.filter-bar { display: flex; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }

.purchases-table-container { background: white; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }

.payment-badge { font-size: 0.75rem; padding: 0.2rem 0.5rem; border-radius: 4px; font-weight: 500; }

.payment-badge.unpaid { background: #fef3c7; color: #d97706; }

.payment-badge.partiallypaid { background: #e0e7ff; color: #4f46e5; }

.payment-badge.paid { background: #d1fae5; color: #059669; }

.payment-badge.overdue { background: #fee2e2; color: #dc2626; }

.row-actions { display: flex; gap: 0.5rem; justify-content: flex-end; }

.create-purchase-page { padding: 1.5rem; }

.create-purchase-page .card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.create-purchase-page .card h3,
.create-purchase-page .card h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

.create-purchase-status-badges { display: flex; gap: 0.5rem; margin-top: 0.5rem; }

.create-purchase-form-layout { display: grid; grid-template-columns: 1fr 300px; gap: 1.5rem; }

@media (max-width: 900px) { .create-purchase-form-layout { grid-template-columns: 1fr; } }

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

.create-purchase-card-header-row h3 { margin: 0; border-bottom: none; padding-bottom: 0; }

.create-purchase-add-item-buttons { display: flex; gap: 0.5rem; }

.purchase-items-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }

.purchase-items-table th { text-align: left; padding: 0.5rem; font-weight: 600; font-size: 0.75rem; text-transform: uppercase; color: var(--text-muted); border-bottom: 1px solid var(--border); }

.purchase-items-table th.number { text-align: right; }

.purchase-items-table td { padding: 0.5rem; border-bottom: 1px solid var(--border); }

.purchase-items-table td.number { text-align: right; }

.purchase-items-table td.received { color: var(--theme-primary); font-weight: 500; }

.purchase-items-table tfoot td { border-bottom: none; padding-top: 0.75rem; }

.purchase-items-table .total-label { text-align: right; color: var(--text-muted); }

.purchase-items-table .total-row td { padding-top: 0.5rem; }

.purchase-item-type { font-size: 0.65rem; padding: 0.15rem 0.4rem; border-radius: 3px; text-transform: uppercase; font-weight: 600; margin-right: 0.5rem; }

.purchase-item-type.stem { background: #e8f5e9; color: #2e7d32; }

.purchase-item-type.supply { background: #e3f2fd; color: #1565c0; }

.purchase-empty-items { color: var(--text-muted); text-align: center; padding: 1.5rem; }

.purchase-summary-list { margin: 0; }

.purchase-summary-list dt { float: left; clear: left; color: var(--text-muted); font-size: 0.9rem; }

.purchase-summary-list dd { text-align: right; margin: 0 0 0.5rem; font-size: 0.9rem; }

.btn-full {
    width: 100%;
}

.poc-container { padding: 1.5rem; max-width: 1200px; }

.poc-header { margin-bottom: 1.5rem; }

.poc-header h1 { margin: 0 0 0.25rem; }

.poc-header > p { color: var(--text-muted); margin: 0 0 1rem; }

.poc-tabs { display: flex; gap: 0.5rem; border-bottom: 2px solid var(--border); padding-bottom: 0; }

.poc-tabs button { display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1rem; border: none; background: none; cursor: pointer; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.15s; }

.poc-tabs button:hover { color: var(--theme-primary); }

.poc-tabs button.active { color: var(--theme-primary); border-bottom-color: var(--theme-primary); }

.poc-section { background: white; border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; margin-top: 1rem; }

.poc-section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }

.poc-section-header h2 { margin: 0; font-size: 1.25rem; }

.poc-timeline-list { display: flex; flex-direction: column; gap: 0.5rem; }

.poc-timeline-item { display: flex; align-items: center; gap: 1rem; padding: 0.75rem; background: var(--bg-soft); border-radius: 8px; }

.poc-timeline-time { display: flex; align-items: center; gap: 0.5rem; }

.poc-timeline-time input { width: 100px; padding: 0.4rem; border: 1px solid var(--border); border-radius: 6px; }

.poc-timeline-time span { color: var(--text-muted); font-size: 0.9rem; }

.poc-timeline-content { flex: 1; display: flex; gap: 0.75rem; }

.poc-timeline-desc { flex: 1; padding: 0.4rem 0.75rem; border: 1px solid var(--border); border-radius: 6px; }

.poc-timeline-vendor { width: 150px; padding: 0.4rem; border: 1px solid var(--border); border-radius: 6px; }

.poc-vendor-select { padding: 0.5rem; border: 1px solid var(--border); border-radius: 8px; min-width: 200px; }

.poc-runsheet-card { background: var(--bg-soft); border-radius: 8px; padding: 1rem; margin-bottom: 1rem; }

.poc-runsheet-header { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 0.75rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }

.poc-runsheet-header h3 { margin: 0; }

.poc-vendor-role { color: var(--text-muted); font-size: 0.9rem; }

.poc-vendor-phone { color: var(--theme-primary); font-size: 0.9rem; margin-left: auto; }

.poc-runsheet-items { display: flex; flex-direction: column; gap: 0.5rem; }

.poc-runsheet-item { display: flex; gap: 1rem; padding: 0.5rem 0; }

.poc-runsheet-item .time { font-weight: 600; min-width: 60px; color: var(--theme-primary); }

.poc-runsheet-item .desc { flex: 1; }

.poc-layout-tools { display: flex; gap: 0.25rem; }

.poc-layout-tools button { padding: 0.5rem; border: 1px solid var(--border); background: white; border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; }

.poc-layout-tools button:hover { background: var(--bg-soft); }

.poc-layout-tools button.active { background: var(--theme-primary); color: white; border-color: var(--theme-primary); }

.poc-layout-tools button:disabled { opacity: 0.4; cursor: not-allowed; }

.poc-layout-tools .divider { width: 1px; background: var(--border); margin: 0 0.5rem; }

.poc-layout-canvas-container { border: 2px solid var(--border); border-radius: 8px; overflow: hidden; margin-top: 1rem; background: white; }

.poc-layout-canvas { width: 100%; height: 500px; cursor: crosshair; }

.poc-layout-canvas .layout-object { cursor: move; }

.poc-layout-canvas .layout-object.selected circle,
.poc-layout-canvas .layout-object.selected rect { stroke-width: 3; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2)); }

.poc-layout-stats { display: flex; gap: 2rem; margin-top: 1rem; font-size: 0.9rem; color: var(--text-muted); }

.poc-layout-stats .hint { margin-left: auto; font-style: italic; }

.poc-resize-handle { transition: all 0.1s; }

.poc-resize-handle:hover { stroke-width: 3; filter: drop-shadow(0 0 3px rgba(0,0,0,0.3)); }

.poc-header-actions { display: flex; align-items: center; gap: 1rem; }

.poc-guest-stats { font-size: 0.9rem; color: var(--text-muted); }

.poc-seating-layout { display: grid; grid-template-columns: 320px 1fr; gap: 1rem; margin-top: 1rem; }

.poc-guest-list-panel { background: var(--bg-soft); border-radius: 8px; padding: 1rem; max-height: 500px; overflow-y: auto; }

.poc-guest-list-panel h3 { margin: 0 0 0.75rem; font-size: 1rem; }

.poc-panel-tabs { display: flex; gap: 0.25rem; margin-bottom: 0.75rem; }

.poc-panel-tabs button { flex: 1; padding: 0.5rem; border: 1px solid var(--border); background: white; border-radius: 6px; cursor: pointer; font-size: 0.8rem; }

.poc-panel-tabs button.active { background: var(--theme-primary); color: white; border-color: var(--theme-primary); }

.poc-table-detail-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }

.poc-table-detail-header h3 { margin: 0; flex: 1; }

.poc-capacity-badge { font-size: 0.75rem; padding: 0.25rem 0.5rem; background: #e8f5e9; border-radius: 4px; }

.poc-capacity-badge.full { background: #ffcdd2; color: #c62828; }

.poc-table-guest-list { display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: 1rem; }

.poc-empty-table-msg { padding: 1rem; text-align: center; color: var(--text-muted); font-size: 0.85rem; }

.poc-quick-seat { margin-top: 1rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }

.poc-quick-seat h4 { margin: 0 0 0.5rem; font-size: 0.85rem; color: var(--text-muted); }

.poc-quick-seat-btn { display: block; width: 100%; padding: 0.4rem 0.75rem; margin-bottom: 0.25rem; background: white; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; text-align: left; font-size: 0.85rem; }

.poc-quick-seat-btn:hover { background: #e8f5e9; border-color: var(--theme-primary); }

.poc-guest-list { display: flex; flex-direction: column; gap: 0.25rem; max-height: 280px; overflow-y: auto; }

.poc-guest-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem; background: white; border-radius: 6px; cursor: pointer; font-size: 0.9rem; transition: all 0.1s; }

.poc-guest-item:hover { box-shadow: 0 1px 4px rgba(0,0,0,0.1); }

.poc-guest-item.seated { background: #e8f5e9; }

.poc-guest-item.unseated { background: #fff3e0; }

.poc-guest-name { flex: 1; }

.poc-guest-table { font-size: 0.75rem; background: var(--theme-primary); color: white; padding: 0.15rem 0.4rem; border-radius: 4px; }

.poc-guest-meal { font-size: 0.7rem; color: var(--text-muted); }

.poc-guest-dietary { font-size: 0.7rem; color: #f57c00; }

.poc-meal-summary { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }

.poc-meal-summary h4 { margin: 0 0 0.5rem; font-size: 0.9rem; }

.poc-meal-row { display: flex; justify-content: space-between; font-size: 0.85rem; padding: 0.25rem 0; }

.poc-seating-canvas-panel h3 { margin: 0 0 0.5rem; font-size: 0.9rem; color: var(--text-muted); font-weight: normal; }

.poc-seating-canvas { width: 100%; height: 400px; border: 2px solid var(--border); border-radius: 8px; background: white; }

.poc-seating-table { cursor: pointer; transition: transform 0.1s; }

.poc-seating-table:hover { transform: scale(1.05); }

.poc-seating-table.selected circle, .poc-seating-table.selected rect { filter: drop-shadow(0 2px 6px rgba(21, 101, 192, 0.4)); }

.month-nav {
    background: white;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--theme-border);
}

.month-nav .btn {
    min-width: 50px;
    padding: 0.375rem 0.75rem;
}

.filters-row {
    background: white;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--theme-border);
}

.category-section {
    margin-bottom: 2rem;
}

.category-title {
    color: var(--theme-text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--theme-border);
}

.stems-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
}

.stem-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid var(--theme-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.stem-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.stem-card.peak {
    border-color: #ffc107;
    background: rgba(255, 193, 7, 0.05);
}

.stem-card.in-season {
    border-color: var(--theme-primary);
    background: rgba(46, 125, 50, 0.05);
}

.stem-card.out-season {
    border-color: #e0e0e0;
    background: #fafafa;
    opacity: 0.7;
}

.stem-availability-indicator {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stem-availability-indicator svg {
    width: 18px;
    height: 18px;
}

.stem-card.peak .stem-availability-indicator {
    background: rgba(255, 193, 7, 0.2);
    color: #f57c00;
}

.stem-card.in-season .stem-availability-indicator {
    background: rgba(46, 125, 50, 0.2);
    color: var(--theme-primary);
}

.stem-card.out-season .stem-availability-indicator {
    background: rgba(0, 0, 0, 0.05);
    color: #9e9e9e;
}

.stem-info {
    flex: 1;
    min-width: 0;
}

.stem-name {
    display: block;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stem-variety {
    display: block;
    font-size: 0.8rem;
    color: var(--theme-text-muted);
}

.stem-season-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    flex-shrink: 0;
}

.stem-season-badge.peak {
    background: rgba(255, 193, 7, 0.2);
    color: #f57c00;
}

.stem-season-badge.in-season {
    background: rgba(46, 125, 50, 0.2);
    color: var(--theme-primary);
}

.stem-season-badge.out-season {
    background: rgba(0, 0, 0, 0.05);
    color: #9e9e9e;
}

.stem-card-v2 {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.stem-card-v2:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.stem-card-v2.peak {
    border-color: #ffc107;
    border-width: 2px;
}

.stem-card-v2.in-season {
    border-color: var(--sage);
    border-width: 2px;
}

.stem-card-v2.out-season {
    opacity: 0.6;
    filter: grayscale(30%);
}

.stem-image { position: relative; height: 140px; background: #f5f5f5; }

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

.stem-image-placeholder { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--theme-text-muted); }

.stem-availability-badge { position: absolute; top: 8px; right: 8px; padding: 4px 8px; border-radius: 4px; font-size: 0.7rem; font-weight: 500; display: flex; align-items: center; gap: 4px; }

.stem-availability-badge.peak { background: rgba(255, 193, 7, 0.9); color: #5d4037; }

.stem-availability-badge.in-season { background: rgba(46, 125, 50, 0.9); color: white; }

.stem-availability-badge.out-season { background: rgba(0, 0, 0, 0.6); color: white; }

.stem-details { padding: 0.75rem; }

.stem-details h4.stem-name { margin: 0 0 0.25rem; font-size: 0.95rem; font-weight: 600; }

.stem-details .stem-variety { font-size: 0.8rem; color: var(--theme-text-muted); display: block; }

.stem-details .stem-common { font-size: 0.75rem; color: var(--theme-text-muted); font-style: italic; display: block; margin-top: 2px; }

.stem-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; font-size: 0.75rem; color: var(--theme-text-muted); }

.meta-item { display: flex; align-items: center; gap: 4px; }

.meta-item.price { font-weight: 500; color: var(--theme-primary); }

.color-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

.stem-seasons { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 0.5rem; }

.season-tag { font-size: 0.65rem; padding: 2px 6px; background: var(--theme-background-alt); border-radius: 4px; color: var(--theme-text-muted); }

.season-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--theme-border);
}

.season-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.legend-item.peak svg { color: #f57c00; }

.legend-item.in-season svg { color: var(--theme-primary); }

.legend-item.out-season svg { color: #9e9e9e; }

.season-calendar {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
}

.season-month {
    text-align: center;
    padding: 0.5rem;
    border-radius: 8px;
    border: 1px solid var(--theme-border);
}

.season-month.peak {
    background: rgba(255, 193, 7, 0.2);
    border-color: #ffc107;
}

.season-month.in-season {
    background: rgba(46, 125, 50, 0.1);
    border-color: var(--theme-primary);
}

.season-month.out-season {
    background: #fafafa;
    opacity: 0.6;
}

.month-abbr {
    display: block;
    font-size: 0.75rem;
    color: var(--theme-text-muted);
}

.month-status {
    display: block;
    font-size: 0.7rem;
    font-weight: 500;
}

.season-month.peak .month-status { color: #f57c00; }

.season-month.in-season .month-status { color: var(--theme-primary); }

.season-month.out-season .month-status { color: #9e9e9e; }

.season-record {
    padding: 0.75rem;
    background: var(--theme-background-alt);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

/* "This feature needs AI" notice with a link to Settings > AI Assistant (AiSetupNotice component) */
.ai-setup-notice {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    border-radius: 10px;
    color: #4c1d95;
    font-size: 0.9rem;
}

.ai-setup-notice-icon {
    flex-shrink: 0;
    color: #7c3aed;
}

.ai-setup-notice-text {
    flex: 1;
    min-width: 0;
}

.ai-setup-notice-link {
    flex-shrink: 0;
    white-space: nowrap;
}

@media (max-width: 576px) {
    .ai-setup-notice {
        flex-wrap: wrap;
    }
}

/* AI is set up but there's nothing for the feature to work on yet ("add a customer first") */
.ai-setup-notice-waiting {
    background: var(--cream-2, #f2ece4);
    border-color: var(--sage-soft, #9fa88f);
    color: var(--ink, #3f4438);
}

.ai-setup-notice-waiting .ai-setup-notice-icon {
    color: var(--sage, #8a9478);
}

/* Emoji box + 20 plant emoji to click (EmojiPicker component) */
.emoji-picker {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.emoji-picker-input {
    width: 60px !important;
    text-align: center;
    font-size: 1.5rem;
}

.emoji-picker-grid {
    display: grid;
    grid-template-columns: repeat(10, 2.25rem);
    gap: 0.25rem;
}

.emoji-picker-option {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.emoji-picker-option:hover {
    background: var(--sage-mist, #eef1ea);
}

.emoji-picker-option:focus-visible {
    outline: 2px solid var(--sage, #8a9478);
    outline-offset: 1px;
}

.emoji-picker-option.is-selected {
    background: var(--sage-mist, #eef1ea);
    border-color: var(--sage, #8a9478);
}

@media (max-width: 576px) {
    .emoji-picker-grid {
        grid-template-columns: repeat(5, 2.25rem);
    }
}

/* Settings > AI Assistant: FloriPro AI or your own key */
.ai-choice-option {
    padding: 1rem;
    border: 1px solid var(--sage-soft, #9fa88f);
    border-radius: 10px;
    background: var(--cream, #f9f6f2);
}

.ai-choice-option h6 {
    margin-bottom: 0.35rem;
}

/* "FloriPro key" inside an AI button: the shop has no key of its own, so the cost is passed on (AiKeyLabel) */
.ai-key-label {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.45);
    font-size: 0.68rem;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0.01em;
    vertical-align: middle;
    white-space: nowrap;
}

/* Settings: leave room above the AI card when a link scrolls to it (#ai-setup) */
#ai-setup {
    scroll-margin-top: 1rem;
}

#ai-setup:focus {
    outline: none;   /* focused only to scroll it into view; it isn't a control */
}

/* Unified AI Button Style */
.btn-ai {
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 50%, #7c3aed 100%);
    color: white;
    border: none;
    font-weight: 500;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}

.btn-ai::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-ai:hover::before {
    left: 100%;
}

.btn-ai:hover {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 50%, #6d28d9 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.35);
}

.btn-ai:focus {
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.4);
    outline: none;
}

.btn-ai svg {
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
}

/* AI button icon pulse animation on hover */
.btn-ai:hover svg {
    animation: ai-pulse 0.6s ease-in-out;
}

@keyframes ai-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Legacy ai-research-btn extends btn-ai */
.ai-research-btn {
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 50%, #7c3aed 100%);
    color: white;
    border: none;
    font-weight: 500;
    border-radius: 8px;
}

.ai-research-btn:hover {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 50%, #6d28d9 100%);
    color: white;
}

.ai-research-btn:focus {
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.4);
}

/* Split button - ensure no gap */
.btn-group .ai-research-btn {
    position: relative;
}

.btn-group .ai-research-btn:not(.dropdown-toggle-split) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: 1px solid rgba(255,255,255,0.3);
}

.btn-group .ai-research-btn.dropdown-toggle-split {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    margin-left: -1px;
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 50%, #7c3aed 100%);
    color: white;
    border: none;
}

.btn-group .ai-research-btn.dropdown-toggle-split:hover {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 50%, #6d28d9 100%);
}

.btn-group .ai-research-btn.dropdown-toggle-split:hover {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 50%, #6d28d9 100%);
}

.ai-research-modal {
    border: 2px solid rgba(102, 126, 234, 0.3);
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

@keyframes indeterminate {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(200%);
    }
}

.progress {
    overflow: hidden;
    background: #e2e8f0;
    border-radius: 4px;
}

.progress-bar {
    width: 30%;
}

.shopping-list-card {
    background: white;
    border: 1px solid var(--theme-border);
    border-radius: 12px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.shopping-list-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.list-name {
    margin: 0;
    font-size: 1.1rem;
}

.list-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    color: var(--theme-text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.event-link {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.event-link svg {
    width: 14px;
    height: 14px;
}

.list-summary {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
}

.summary-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--theme-primary);
}

.summary-label {
    font-size: 0.75rem;
    color: var(--theme-text-muted);
}

.progress-bar-container {
    height: 4px;
    background: var(--theme-border);
    border-radius: 2px;
    overflow: hidden;
}

.shopping-lists-page .progress-bar {
    height: 100%;
    background: var(--theme-primary);
    transition: width 0.3s;
}

.preview-orders {
    background: var(--theme-background-alt);
    border-radius: 8px;
    padding: 0.75rem;
}

.preview-order {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--theme-border);
}

.preview-order:last-child {
    border-bottom: none;
}

.order-customer {
    flex: 1;
    margin: 0 1rem;
}

.order-date {
    color: var(--theme-text-muted);
    font-size: 0.875rem;
}

.shopping-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.shopping-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--theme-background-alt);
    border-radius: 8px;
    transition: opacity 0.2s;
}

.shopping-item.purchased {
    opacity: 0.6;
    background: rgba(46, 125, 50, 0.05);
}

.item-check input {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.item-details {
    flex: 1;
    min-width: 0;
}

.item-name {
    display: block;
    font-weight: 500;
}

.item-qty {
    font-size: 0.875rem;
    color: var(--theme-text-muted);
}

.item-cost {
    text-align: right;
}

.item-cost .estimated {
    display: block;
    color: var(--theme-text-muted);
    font-size: 0.875rem;
}

.item-cost .actual {
    display: block;
    font-weight: 600;
    color: var(--theme-primary);
}

.list-totals {
    background: var(--theme-background-alt);
    padding: 1rem;
    border-radius: 8px;
}

.system-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    background: var(--bg-soft);
    color: var(--text-muted);
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cost-line {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
}

.cost-line:last-child {
    border-bottom: none;
}

.margin-display {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.image-upload-zone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

/* Upload / Find / Remove buttons in an image zone: stacked, full width, with a gap */
.image-upload-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.image-upload-actions .btn {
    width: 100%;
    margin: 0;
}

.image-upload-zone:hover {
    border-color: var(--sage);
    background: var(--bg-soft);
}

.upload-area {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-area:hover {
    border-color: var(--sage);
    background: var(--bg-soft);
}

.result-stat {
    text-align: center;
    padding: 1rem;
}

.items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.items-table th,
.items-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.item-type {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.item-type.stem { background: var(--bg-sage-light); color: var(--sage-dark); }

.item-type.supply { background: #fef3c7; color: #92400e; }

.empty-items {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.add-item-buttons {
    display: flex;
    gap: 0.5rem;
}

.status-badges {
    display: flex;
    gap: 0.5rem;
}

.contract-event,
.contract-deposit,
.contract-signed {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.quote-date,
.quote-event {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.lead-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.order-source,
.order-status {
    font-size: 0.8rem;
}

.delivery,
.production {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    height: 200px;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--theme-border);
}

.chart-bar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.chart-bar {
    width: 100%;
    max-width: 40px;
    background: var(--theme-primary);
    border-radius: 4px 4px 0 0;
    transition: height 0.3s ease;
}

.chart-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    text-align: center;
}

.chart-value {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.source-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wizard-steps,
.wizard-steps-list {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-soft);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
}

.step-number.active {
    background: var(--theme-primary);
    color: white;
}

.step-number.complete {
    background: var(--success);
    color: white;
}

.wizard-instruction {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.wizard-option {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.wizard-option:hover {
    border-color: var(--sage);
    background: var(--bg-soft);
}

.ai-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}

.season-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.research-results,
.bulk-results {
    margin-top: 1rem;
}

.bulk-flower-item {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

.bulk-flower-item:last-child {
    border-bottom: none;
}

.ai-intro {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.ai-success {
    color: var(--success);
}

.ai-error {
    color: var(--error);
}

.ai-pulse {
    animation: pulse 2s infinite;
}

.event-type,
.event-venue {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.customer-select-info {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.occasion-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.templates-section {
    margin-bottom: 2rem;
}

.account-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--theme-text);
    margin: 0;
}

.profile-content {
    display: flex;
    gap: 1rem;
}

.profile-logo img {
    width: 64px;
    height: 64px;
    border-radius: 0.5rem;
    object-fit: cover;
}

.logo-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 0.5rem;
    background: var(--theme-primary-light);
    color: var(--theme-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.25rem;
}

.profile-details h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
    color: var(--theme-text);
}

.profile-details p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--theme-text-muted);
}

.profile-details .owner {
    color: var(--theme-text);
}

.subscription-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.plan-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: fit-content;
}

.plan-badge.trial {
    background: #dbeafe;
    color: #1d4ed8;
}

.plan-badge.active {
    background: #dcfce7;
    color: #166534;
}

.plan-badge.pastdue {
    background: #fef3c7;
    color: #b45309;
}

.plan-badge.cancelled, .plan-badge.suspended {
    background: #fee2e2;
    color: #dc2626;
}

.plan-details .price {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.plan-details .amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--theme-text);
}

.plan-details .period {
    font-size: 0.875rem;
    color: var(--theme-text-muted);
}

.trial-note {
    font-size: 0.875rem;
    color: #1d4ed8;
    margin: 0.25rem 0 0;
}

.addons-summary p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--theme-text);
}

.addons-summary p.muted {
    color: var(--theme-text-muted);
}

.addons-summary .link {
    display: inline-block;
    margin-top: 0.5rem;
    color: var(--theme-primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.addons-summary .link:hover {
    text-decoration: underline;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat {
    display: flex;
    flex-direction: column;
    padding: 0.75rem;
    background: var(--theme-background-alt);
    border-radius: 0.5rem;
}

.team-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.team-count {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.team-count .count {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--theme-text);
}

.team-count .limit {
    font-size: 0.875rem;
    color: var(--theme-text-muted);
}

.team-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.team-member {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--theme-primary-light);
    color: var(--theme-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
}

.member-info {
    display: flex;
    flex-direction: column;
}

.member-info .name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--theme-text);
}

.member-info .role {
    font-size: 0.75rem;
    color: var(--theme-text-muted);
    text-transform: capitalize;
}

.more-users {
    font-size: 0.875rem;
    color: var(--theme-text-muted);
    margin: 0;
}

.quick-actions {
    margin-top: 2rem;
}

.quick-actions h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--theme-text);
    margin: 0 0 1rem;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: var(--theme-text);
    transition: box-shadow 0.2s, transform 0.2s;
}

.action-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.action-card svg {
    width: 2rem;
    height: 2rem;
    color: var(--theme-primary);
}

.action-card span {
    font-size: 0.875rem;
    font-weight: 500;
}

@media (max-width: 480px) {
    .account-page {
        padding: 1rem;
    }

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

    .profile-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

.alert {
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

/* Bootstrap pins the close button to the top with padding sized for its taller alerts: centre it on ours */
.alert-dismissible {
    padding-right: 3rem;
}

.alert-dismissible .btn-close {
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    padding: 0.5rem;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #86efac;
}

.alert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.billing-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.plan-details {
    padding: 1.5rem;
}

.plan-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    color: var(--theme-text);
}

.plan-row.addon {
    color: var(--theme-text-muted);
}

.plan-row.addon small {
    color: var(--theme-text-muted);
}

.plan-row.total {
    border-top: 1px solid var(--theme-border);
    margin-top: 0.5rem;
    padding-top: 1rem;
    font-weight: 600;
    font-size: 1rem;
}

.annual-note {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f0fdf4;
    color: #166534;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
    font-size: 0.875rem;
}

.annual-note svg {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.btn-save-annual {
    width: 100%;
    background: #dbeafe;
    color: #1d4ed8;
    border: none;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    margin-top: 1rem;
    transition: background 0.2s;
}

.btn-save-annual:hover {
    background: #bfdbfe;
}

.payment-content {
    padding: 1.5rem;
}

.trial-notice {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: #fef3c7;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.trial-notice svg {
    width: 1.5rem;
    height: 1.5rem;
    color: #b45309;
    flex-shrink: 0;
}

.trial-notice strong {
    display: block;
    color: #b45309;
}

.trial-notice p {
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
    color: #92400e;
}

.card-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--theme-background-alt);
    border-radius: 0.5rem;
}

.card-icon {
    width: 48px;
    height: 32px;
    background: white;
    border: 1px solid var(--theme-border);
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-icon svg {
    width: 24px;
    height: 24px;
    color: var(--theme-text-muted);
}

.card-details {
    display: flex;
    flex-direction: column;
}

.card-name {
    font-weight: 500;
    color: var(--theme-text);
}

.card-expiry {
    font-size: 0.875rem;
    color: var(--theme-text-muted);
}

.payment-actions {
    margin-top: 1rem;
}

.invoices-card {
    margin-bottom: 1.5rem;
}

.empty-state svg {
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    margin: 0;
}

.invoices-table {
    width: 100%;
    border-collapse: collapse;
}

.invoices-table th,
.invoices-table td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--theme-border);
}

.invoices-table th {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--theme-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.invoices-table td {
    font-size: 0.875rem;
    color: var(--theme-text);
}

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

.status-badge.failed {
    background: #fee2e2;
    color: #dc2626;
}

.download-link {
    color: var(--theme-primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.download-link:hover {
    text-decoration: underline;
}

.danger-card {
    border: 1px solid #fecaca;
}

.danger-card .card-header {
    background: #fef2f2;
}

.danger-card .card-header h2 {
    color: #dc2626;
}

.danger-content {
    padding: 1.5rem;
}

.danger-content p {
    margin: 0 0 0.5rem;
    color: var(--theme-text);
}

.danger-content ul {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
    color: var(--theme-text-muted);
    font-size: 0.875rem;
}

.danger-content li {
    margin-bottom: 0.25rem;
}

@media (max-width: 700px) {
    .billing-page {
        padding: 1rem;
    }

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

    .invoices-table th:last-child,
    .invoices-table td:last-child {
        display: none;
    }
}

.profile-form {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
}

.form-section {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--theme-text);
    margin: 0 0 0.25rem;
}

.logo-upload {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.current-logo {
    width: 80px;
    height: 80px;
    border-radius: 0.5rem;
    object-fit: contain; /* show the whole logo; cover cropped wide logos */
}

.logo-size-hint {
    display: block;
    margin-top: 0.75rem;
    color: var(--theme-text-muted);
}

/* Toast: fixed to the bottom-right, so a message shows wherever the page is scrolled */
.page-toast {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 1080;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: min(420px, calc(100vw - 2rem));
    padding: 0.85rem 1rem 0.85rem 1.25rem;
    border-radius: 0.75rem;
    background: var(--theme-background);
    color: var(--theme-text);
    border: 1px solid var(--theme-border);
    border-left: 4px solid var(--theme-primary);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    font-weight: 500;
    animation: page-toast-in 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-toast-error { border-left-color: var(--theme-coral-dark); }

.page-toast-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    line-height: 1;
    color: var(--theme-text-muted);
    cursor: pointer;
    padding: 0 0.25rem;
}

.page-toast-close:hover { color: var(--theme-text); }

@keyframes page-toast-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 767px) {
    .page-toast { right: 1rem; left: 1rem; bottom: 1rem; max-width: none; }
}

.logo-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--theme-text);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-text {
    background: none;
    border: none;
    color: var(--theme-text-muted);
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0.5rem;
}

.btn-text:hover {
    color: #dc2626;
}

.plan-summary {
    background: var(--theme-primary);
    color: white;
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}

.summary-left .label {
    display: block;
    font-size: 0.75rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.summary-left .amount {
    font-size: 2rem;
    font-weight: 700;
}

.summary-left .period {
    font-size: 1rem;
    font-weight: 400;
    opacity: 0.8;
}

.summary-right {
    text-align: right;
    font-size: 0.875rem;
    opacity: 0.9;
}

.summary-right span {
    display: block;
}

.addons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.addon-card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.2s;
}

.addon-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.addon-card.enabled {
    border: 2px solid var(--theme-primary);
}

.addon-card.coming-soon {
    opacity: 0.7;
}

.addon-icon {
    width: 48px;
    height: 48px;
    background: var(--theme-primary-light);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.addon-icon svg {
    width: 24px;
    height: 24px;
    color: var(--theme-primary);
}

.addon-card.enabled .addon-icon {
    background: var(--theme-primary);
}

.addon-card.enabled .addon-icon svg {
    color: white;
}

.addon-content {
    flex: 1;
}

.addon-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--theme-text);
    margin: 0 0 0.5rem;
}

.addon-content .description {
    font-size: 0.875rem;
    color: var(--theme-text-muted);
    margin: 0 0 0.75rem;
    line-height: 1.5;
}

.addon-content .price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--theme-text);
    margin: 0 0 1rem;
}

.addon-content .price span {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--theme-text-muted);
}

.features {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
}

.features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--theme-text);
    margin-bottom: 0.5rem;
}

.features li svg {
    width: 1rem;
    height: 1rem;
    color: var(--theme-primary);
    flex-shrink: 0;
}

.addon-actions {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--theme-border);
}

.btn-add {
    width: 100%;
    background: var(--theme-primary);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-add:hover {
    background: var(--theme-primary-dark);
}

.btn-enabled {
    width: 100%;
    background: #dcfce7;
    color: #166534;
    border: none;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.btn-enabled:hover {
    background: #bbf7d0;
}

.btn-enabled svg {
    width: 1rem;
    height: 1rem;
}

.btn-notify {
    width: 100%;
    background: var(--theme-background-alt);
    color: var(--theme-text-muted);
    border: 1px solid var(--theme-border);
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: not-allowed;
}

.quantity-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.qty-btn {
    width: 36px;
    height: 36px;
    background: var(--theme-background-alt);
    border: 1px solid var(--theme-border);
    border-radius: 0.5rem;
    font-size: 1.25rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.qty-btn:hover {
    background: var(--theme-border);
}

.qty-value {
    font-size: 1.25rem;
    font-weight: 600;
    width: 40px;
    text-align: center;
}

.free-integrations {
    margin-top: 3rem;
}

.free-integrations h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--theme-text);
    margin: 0 0 0.5rem;
}

.free-integrations > p {
    color: var(--theme-text-muted);
    margin: 0 0 1.5rem;
}

.integrations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.integration-card {
    background: white;
    border: 1px solid var(--theme-border);
    border-radius: 0.5rem;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.integration-card svg {
    width: 24px;
    height: 24px;
    color: var(--theme-primary);
}

.integration-card span {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--theme-text);
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.btn-primary svg {
    width: 1rem;
    height: 1rem;
}

.user-limit {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.limit-bar {
    flex: 1;
    max-width: 200px;
    height: 8px;
    background: var(--theme-border);
    border-radius: 4px;
    overflow: hidden;
}

.limit-fill {
    height: 100%;
    background: var(--theme-primary);
    border-radius: 4px;
    transition: width 0.3s;
}

.limit-text {
    font-size: 0.875rem;
    color: var(--theme-text-muted);
}

.upgrade-link {
    font-size: 0.875rem;
    color: var(--theme-primary);
    text-decoration: none;
}

.upgrade-link:hover {
    text-decoration: underline;
}

.users-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.user-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: white;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.user-card.inactive {
    opacity: 0.6;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    color: var(--theme-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.you-badge {
    font-size: 0.625rem;
    font-weight: 600;
    background: var(--theme-primary);
    color: white;
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    text-transform: uppercase;
}

.user-email {
    font-size: 0.875rem;
    color: var(--theme-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.25rem;
}

.role {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    text-transform: capitalize;
}

.role.owner {
    background: #dbeafe;
    color: #1d4ed8;
}

.role.manager {
    background: #fef3c7;
    color: #b45309;
}

.role.staff {
    background: var(--theme-background-alt);
    color: var(--theme-text-muted);
}

.last-login {
    font-size: 0.75rem;
    color: var(--theme-text-muted);
}

.user-actions {
    position: relative;
}

.dropdown-toggle {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--theme-text-muted);
    border-radius: 0.25rem;
    transition: background 0.2s;
}

.dropdown-toggle:hover {
    background: var(--theme-background-alt);
    color: var(--theme-text);
}

.dropdown-toggle svg {
    width: 1.25rem;
    height: 1.25rem;
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    z-index: 10;
    overflow: hidden;
}

.dropdown-menu button {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: var(--theme-text);
    cursor: pointer;
    transition: background 0.2s;
}

.dropdown-menu button:hover {
    background: var(--theme-background-alt);
}

.dropdown-menu button.danger {
    color: #dc2626;
}

.dropdown-menu button.danger:hover {
    background: #fef2f2;
}

.roles-info {
    margin-top: 2rem;
}

.roles-info h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--theme-text);
    margin: 0 0 1rem;
}

.roles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.role-card {
    background: white;
    padding: 1.25rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.role-card h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--theme-text);
    margin: 0 0 0.75rem;
}

.role-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.role-card li {
    font-size: 0.75rem;
    color: var(--theme-text-muted);
    padding: 0.25rem 0;
    padding-left: 1.25rem;
    position: relative;
}

.role-card li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.625rem;
    width: 6px;
    height: 6px;
    background: var(--theme-primary-light);
    border-radius: 50%;
}

.modal-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: var(--theme-text-muted);
}

.close-btn:hover {
    color: var(--theme-text);
}

.close-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--theme-primary-light) 0%, #f8faf8 50%, var(--theme-coral-light, #fde7e4) 100%);
    padding: 1rem;
}

.auth-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 420px;
    padding: 1.75rem 2.25rem;
}

.auth-header {
    text-align: center;
    margin-bottom: 1.25rem;
}

.auth-logo {
    height: 40px;
    margin-bottom: 0.75rem;
}

.auth-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--theme-text);
    margin: 0 0 0.25rem;
}

.auth-header p {
    color: var(--theme-text-muted);
    margin: 0;
}

.auth-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.auth-error .icon-sm {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.success-state {
    text-align: center;
}

.success-state .icon-lg {
    width: 4rem;
    height: 4rem;
    color: var(--theme-primary);
    margin-bottom: 1rem;
}

.success-state h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--theme-text);
    margin: 0 0 1rem;
}

.success-state p {
    color: var(--theme-text);
    margin: 0 0 0.5rem;
    font-size: 0.875rem;
}

.success-state .hint {
    color: var(--theme-text-muted);
    margin-bottom: 1.5rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.link {
    color: var(--theme-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.link:hover {
    color: var(--theme-primary-dark);
    text-decoration: underline;
}

.auth-footer {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--theme-border);
}

.auth-footer p {
    margin: 0;
    color: var(--theme-text-muted);
    font-size: 0.875rem;
}

.password-input {
    position: relative;
}

.password-input input {
    width: 100%;
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: var(--theme-text-muted);
    transition: color 0.2s;
}

.password-toggle:hover {
    color: var(--theme-primary);
}

.password-toggle svg {
    width: 1.25rem;
    height: 1.25rem;
}

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

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 400;
}

.checkbox-label input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    accent-color: var(--theme-primary);
}

.btn-primary:active:not(:disabled) {
    transform: scale(0.98);
}

.auth-card-wide {
    max-width: 520px;
}

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

.password-requirements {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}

.password-requirements .req {
    font-size: 0.75rem;
    color: var(--theme-text-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.password-requirements .req::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--theme-border);
}

.password-requirements .req.met {
    color: var(--theme-primary);
}

.password-requirements .req.met::before {
    background: var(--theme-primary);
}

.password-requirements.strong .req.met::before {
    background: var(--theme-primary);
}

.password-requirements.medium .req.met::before {
    background: #f59e0b;
}

.password-requirements.weak .req.met::before {
    background: #ef4444;
}

.checkbox-label.terms {
    line-height: 1.4;
}

.pricing-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: var(--theme-primary-dark);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
    font-size: 0.875rem;
}

.pricing-note .icon-sm {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--theme-primary);
}

@media (max-width: 540px) {
    .auth-card {
        padding: 1.5rem;
    }

    .form-row-2col {
        grid-template-columns: 1fr;
    }

    .auth-header h1 {
        font-size: 1.25rem;
    }

    .password-requirements {
        flex-direction: column;
        gap: 0.25rem;
    }
}

.costs-page {
    padding: 1.5rem;
    max-width: 1400px;
    
}

.summary-card.primary .label {
    color: rgba(255, 255, 255, 0.8);
}

.summary-card.primary .value {
    color: white;
}

.category-breakdown {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.category-breakdown h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--theme-text);
    margin: 0 0 1rem;
}

.category-bars {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.category-bar-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.category-amount {
    font-weight: 500;
    color: var(--theme-text);
}

.bar-bg {
    height: 8px;
    background: var(--theme-background-alt);
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--theme-primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.costs-table {
    overflow-x: auto;
}

.costs-table table {
    width: 100%;
    border-collapse: collapse;
}

.costs-table th {
    text-align: left;
    padding: 1rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--theme-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--theme-background-alt);
    border-bottom: 1px solid var(--theme-border);
}

.costs-table th.amount {
    text-align: right;
}

.costs-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--theme-border);
    font-size: 0.875rem;
}

.costs-table td.amount {
    text-align: right;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.costs-table td.monthly {
    color: var(--theme-primary);
}

.costs-table tr:hover {
    background: var(--theme-background-alt);
}

.costs-table tr.inactive {
    opacity: 0.6;
}

.cost-name {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.cost-name .name {
    font-weight: 500;
    color: var(--theme-text);
}

.cost-name .vendor {
    font-size: 0.75rem;
    color: var(--theme-text-muted);
}

.category-badge {
    display: inline-flex;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    background: #f3f4f6;
    color: #6b7280;
}

.category-badge.rent { background: #dbeafe; color: #1d4ed8; }

.category-badge.utilities { background: #fef3c7; color: #d97706; }

.category-badge.internet { background: #e0e7ff; color: #4f46e5; }

.category-badge.insurance { background: #dcfce7; color: #166534; }

.category-badge.software { background: #f3e8ff; color: #7c3aed; }

.category-badge.marketing { background: #fce7f3; color: #be185d; }

.category-badge.vehicle { background: #cffafe; color: #0891b2; }

.category-badge.staff { background: #fed7aa; color: #c2410c; }

.actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.btn-link.danger {
    color: #dc2626;
}

.empty-state h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--theme-text);
    margin: 0 0 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem 1rem;
    border: 1px solid var(--theme-border);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.input-prefix {
    display: flex;
    align-items: center;
}

.input-prefix span {
    padding: 0.75rem 0.75rem;
    background: var(--theme-background-alt);
    border: 1px solid var(--theme-border);
    border-right: none;
    border-radius: 0.5rem 0 0 0.5rem;
    color: var(--theme-text-muted);
}

.input-prefix input {
    border-radius: 0 0.5rem 0.5rem 0;
    flex: 1;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-check input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--theme-primary);
}

/* Switches keep Bootstrap's track shape; the 1rem checkbox size above squashed them into a dot.
   .form-check is flex here, so drop Bootstrap's negative-margin offset too. */
.form-check.form-switch {
    padding-left: 0;
}

.form-check.form-switch input[type="checkbox"] {
    width: 2.25rem;
    height: 1.25rem;
    margin-left: 0;
    cursor: pointer;
}

.form-check.form-switch input[type="checkbox"]:checked {
    background-color: var(--theme-primary);
    border-color: var(--theme-primary);
}

@media (max-width: 1024px) {
    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

.create-invoice-page {
    padding: 1.5rem;
    max-width: 900px;
    
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 500;
}

.form-sections {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.section-header h2 {
    margin: 0;
}

.items-header {
    display: grid;
    grid-template-columns: 1fr 80px 120px 100px 40px;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--theme-background-alt);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--theme-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.item-row {
    display: grid;
    grid-template-columns: 1fr 80px 120px 100px 40px;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--theme-border);
    align-items: center;
}

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

.item-row input {
    padding: 0.5rem;
    border: 1px solid var(--theme-border);
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.item-row input:focus {
    outline: none;
    border-color: var(--theme-primary);
}

.item-row .col-total {
    font-weight: 500;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.item-row .col-qty,
.item-row .col-price {
    text-align: right;
}

/* Standalone icon button (different from SVG .btn-icon inside buttons) */
button.btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 0.375rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--theme-text-muted);
}

button.btn-icon:hover:not(:disabled) {
    background: var(--theme-background-alt);
    color: var(--theme-text);
}

button.btn-icon:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button.btn-icon.danger:hover:not(:disabled) {
    background: #fee2e2;
    color: #dc2626;
}

button.btn-icon svg {
    width: 1rem;
    height: 1rem;
}

.no-items {
    padding: 2rem;
    text-align: center;
    color: var(--theme-text-muted);
}

.no-items p {
    margin: 0;
}

.totals {
    margin-top: 1.5rem;
    border-top: 1px solid var(--theme-border);
    padding-top: 1rem;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.875rem;
}

.total-row .label {
    color: var(--theme-text-muted);
}

.total-row .value {
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.total-row.grand-total {
    border-top: 2px solid var(--theme-border);
    padding-top: 0.75rem;
    margin-top: 0.5rem;
}

.total-row.grand-total .label {
    font-weight: 600;
    color: var(--theme-text);
}

.total-row.grand-total .value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--theme-primary);
}

.btn-secondary.btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
}

.btn-secondary svg {
    width: 1rem;
    height: 1rem;
}

.invoices-page {
    padding: 1.5rem;
    max-width: 1400px;
    
}

.summary-card .count {
    display: block;
    font-size: 0.75rem;
    color: var(--theme-text-muted);
    margin-top: 0.25rem;
}

.summary-card.overdue .value {
    color: #dc2626;
}

.integration-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1px solid #86efac;
    border-radius: 0.75rem;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.banner-icon {
    width: 40px;
    height: 40px;
    background: var(--theme-primary);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.banner-icon svg {
    width: 20px;
    height: 20px;
    color: white;
}

.banner-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.banner-content strong {
    font-size: 0.875rem;
    color: var(--theme-text);
}

.banner-content span {
    font-size: 0.8125rem;
    color: var(--theme-text-muted);
}

.coming-soon-badge {
    background: var(--theme-text-muted);
    color: white;
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.summary-card .mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 1.125rem;
}

.invoice-table {
    overflow-x: auto;
}

.invoice-table table {
    width: 100%;
    border-collapse: collapse;
}

.invoice-table th {
    text-align: left;
    padding: 1rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--theme-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--theme-background-alt);
    border-bottom: 1px solid var(--theme-border);
}

.invoice-table th.amount {
    text-align: right;
}

.invoice-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--theme-border);
    font-size: 0.875rem;
}

.invoice-table td.amount {
    text-align: right;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.invoice-table td.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 500;
}

.invoice-table tr:hover {
    background: var(--theme-background-alt);
}

.invoice-table tr.overdue {
    background: #fef2f2;
}

.invoice-table tr.overdue:hover {
    background: #fee2e2;
}

.client-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.client-info .name {
    font-weight: 500;
    color: var(--theme-text);
}

.client-info .email {
    font-size: 0.75rem;
    color: var(--theme-text-muted);
}

.overdue-date {
    color: #dc2626;
    font-weight: 500;
}

.invoice-settings-page {
    padding: 1.5rem;
    max-width: 800px;
    
}

.section-desc {
    color: var(--theme-text-muted);
    font-size: 0.875rem;
    margin: 0 0 1.5rem;
}

.number-preview {
    background: var(--theme-background-alt);
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.number-preview .label {
    color: var(--theme-text-muted);
    font-size: 0.875rem;
}

.number-preview .preview {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--theme-primary);
}

.hint {
    font-size: 0.75rem;
    color: var(--theme-text-muted);
}

.starting-number {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--theme-border);
}

.input-with-button {
    display: flex;
    gap: 0.5rem;
}

.input-with-button input {
    flex: 1;
}

.gst-toggle {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--theme-border);
}

.gst-toggle .checkbox-label {
    margin-bottom: 0.5rem;
}

.integration-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.integration-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--theme-background-alt);
    border-radius: 0.5rem;
    border: 1px solid var(--theme-border);
}

.integration-logo {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    color: white;
    flex-shrink: 0;
}

.integration-logo.xero {
    background: #13B5EA;
}

.integration-logo.myob {
    background: #6B2C91;
}

.integration-logo.quickbooks {
    background: #2CA01C;
}

.integration-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.integration-info strong {
    font-size: 0.875rem;
    color: var(--theme-text);
}

.integration-info span {
    font-size: 0.8125rem;
    color: var(--theme-text-muted);
}

.view-invoice-page {
    padding: 1.5rem;
    max-width: 900px;
    
}

.header-row h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--theme-text);
    margin: 0;
}

.invoice-preview {
    padding: 2rem;
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--theme-primary);
}

.business-info {
    display: flex;
    gap: 1rem;
}

.business-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.business-info h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--theme-primary);
    margin: 0 0 0.5rem;
}

.business-info p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--theme-text-muted);
    line-height: 1.5;
}

.invoice-info {
    text-align: right;
}

.invoice-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--theme-text);
    margin: 0 0 0.75rem;
}

.invoice-info p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--theme-text);
    line-height: 1.6;
}

.bill-to {
    margin-bottom: 2rem;
}

.bill-to h4 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--theme-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.5rem;
}

.bill-to .client-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--theme-text);
    margin: 0 0 0.25rem;
}

.bill-to p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--theme-text-muted);
    line-height: 1.5;
}

.items-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--theme-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--theme-background-alt);
    border-bottom: 1px solid var(--theme-border);
}

.items-table th.qty,
.items-table th.price,
.items-table th.total {
    text-align: right;
}

.items-table td.qty,
.items-table td.price,
.items-table td.total {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.items-table td.total {
    font-weight: 500;
}

.invoice-totals {
    max-width: 300px;
    margin-left: auto;
    margin-bottom: 2rem;
}

.total-row.grand {
    border-top: 2px solid var(--theme-border);
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    font-size: 1.125rem;
    font-weight: 700;
}

.total-row.grand span:last-child {
    color: var(--theme-primary);
}

.payment-details {
    background: var(--theme-background-alt);
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.payment-details h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--theme-text);
    margin: 0 0 0.75rem;
}

.payment-details p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--theme-text);
    line-height: 1.6;
}

.invoice-notes {
    border-top: 1px solid var(--theme-border);
    padding-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--theme-text-muted);
}

.invoice-notes p {
    margin: 0;
    white-space: pre-wrap;
}

.form-group:last-child {
    margin-bottom: 0;
}

@media print {
    .page-header,
    .header-actions,
    .alert {
        display: none !important;
    }

    .invoice-preview {
        box-shadow: none;
        padding: 0;
    }
}

.reports-page {
    padding: 1.5rem;
    max-width: 1200px;
    
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.metric-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.metric-card.revenue {
    border-left: 4px solid var(--theme-primary);
}

.metric-card.profit {
    border-left: 4px solid #22c55e;
}

.metric-card.profit.negative {
    border-left-color: #ef4444;
}

.metric-card.costs {
    border-left: 4px solid #f59e0b;
}

.metric-card.ytd {
    border-left: 4px solid #6366f1;
}

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

.metric-label {
    font-size: 0.75rem;
    color: var(--theme-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.trend {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
}

.trend.up {
    background: #dcfce7;
    color: #166534;
}

.trend.down {
    background: #fee2e2;
    color: #dc2626;
}

.metric-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--theme-text);
    margin-bottom: 0.25rem;
}

.metric-compare {
    font-size: 0.75rem;
    color: var(--theme-text-muted);
}

.report-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.report-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: white;
    border-radius: 0.75rem;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.report-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.report-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.report-icon svg {
    width: 24px;
    height: 24px;
}

.report-icon.green {
    background: #dcfce7;
    color: #166534;
}

.report-icon.blue {
    background: #dbeafe;
    color: #1d4ed8;
}

.report-icon.purple {
    background: #f3e8ff;
    color: #7c3aed;
}

.report-icon.orange {
    background: #ffedd5;
    color: #c2410c;
}

.report-info {
    flex: 1;
}

.report-info h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--theme-text);
    margin: 0 0 0.25rem;
}

.report-info p {
    font-size: 0.8125rem;
    color: var(--theme-text-muted);
    margin: 0;
}

.report-card .arrow {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--theme-text-muted);
    flex-shrink: 0;
}

.quick-stats {
    padding: 1.5rem;
}

.quick-stats h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--theme-text);
    margin: 0 0 1rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-value.positive { color: #16a34a; }

.stat-value.negative { color: #dc2626; }

.orders-report-page {
    padding: 1.5rem;
    max-width: 1200px;
    
}

.date-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.date-filter input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--theme-border);
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

.date-filter span {
    color: var(--theme-text-muted);
}

.stat-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-card.warning {
    border-left: 3px solid #f59e0b;
}

.margin-distribution {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.margin-distribution h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--theme-text);
    margin: 0 0 1rem;
}

.distribution-bars {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.distribution-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.distribution-info {
    width: 140px;
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
}

.bracket {
    color: var(--theme-text);
    font-weight: 500;
}

.count {
    color: var(--theme-text-muted);
}

.bar-container {
    flex: 1;
    height: 20px;
    background: var(--theme-background-alt);
    border-radius: 4px;
    overflow: hidden;
}

.bar-container .bar {
    height: 100%;
    background: var(--theme-primary);
    border-radius: 4px;
    transition: width 0.3s;
}

.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.top-orders, .bottom-orders {
    padding: 1.5rem;
}

.top-orders h3, .bottom-orders h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--theme-text);
    margin: 0 0 1rem;
}

.top-orders h3 svg, .bottom-orders h3 svg {
    width: 1rem;
    height: 1rem;
}

.top-orders h3 svg { color: #16a34a; }

.bottom-orders h3 svg { color: #dc2626; }

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--theme-background-alt);
    border-radius: 0.5rem;
}

.order-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.order-info .order-number {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--theme-text);
}

.order-info .customer {
    font-size: 0.75rem;
    color: var(--theme-text-muted);
}

.order-metrics {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.125rem;
}

.order-metrics .profit {
    font-weight: 600;
    font-size: 0.875rem;
}

.order-metrics .profit.positive { color: #16a34a; }

.order-metrics .profit.negative { color: #dc2626; }

.order-metrics .margin {
    font-size: 0.75rem;
    color: var(--theme-text-muted);
}

.order-metrics .margin.low { color: #dc2626; }

.orders-table {
    padding: 1.5rem;
}

.orders-table h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--theme-text);
    margin: 0 0 1rem;
}

.orders-table table {
    width: 100%;
    border-collapse: collapse;
}

.orders-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--theme-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--theme-background-alt);
    border-bottom: 1px solid var(--theme-border);
}

.orders-table th.number {
    text-align: right;
}

.orders-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--theme-border);
    font-size: 0.875rem;
}

.orders-table td.number {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.orders-table td.order-number {
    font-weight: 500;
}

.orders-table td.positive { color: #16a34a; }

.orders-table td.negative { color: #dc2626; }

.orders-table td.low { color: #dc2626; }

.orders-table td.good { color: #16a34a; }

.orders-table tr:hover td {
    background: rgba(0, 0, 0, 0.02);
}

.status-badge.completed, .status-badge.delivered {
    background: #dcfce7;
    color: #166534;
}

.status-badge.pending, .status-badge.processing {
    background: #fef3c7;
    color: #d97706;
}

.empty {
    text-align: center;
    color: var(--theme-text-muted);
    padding: 2rem;
}

.pl-report-page {
    padding: 1.5rem;
    max-width: 1200px;
}

.year-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    padding: 0.25rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.year-selector .year {
    font-size: 1.125rem;
    font-weight: 600;
    padding: 0 0.75rem;
    min-width: 4rem;
    text-align: center;
}

.year-summary {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-card.highlight {
    background: var(--theme-primary);
    color: white;
}

.summary-card.highlight.positive {
    background: #16a34a;
}

.summary-card.highlight.negative {
    background: #dc2626;
}

.summary-card.highlight .label {
    color: rgba(255, 255, 255, 0.8);
}

.summary-card.highlight .value {
    color: white;
}

.summary-card .value.negative {
    color: #dc2626;
}

.monthly-table {
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.monthly-table table {
    width: 100%;
    border-collapse: collapse;
}

.monthly-table th {
    text-align: left;
    padding: 1rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--theme-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--theme-background-alt);
    border-bottom: 1px solid var(--theme-border);
}

.monthly-table th.number {
    text-align: right;
}

.monthly-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--theme-border);
    font-size: 0.875rem;
}

.monthly-table td.number {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.monthly-table td.month-name {
    font-weight: 500;
}

.monthly-table td.positive {
    color: #16a34a;
}

.monthly-table td.negative {
    color: #6b7280;
}

.monthly-table td.loss {
    color: #dc2626;
}

.monthly-table tfoot td {
    background: var(--theme-background-alt);
    font-weight: 600;
}

.monthly-table tr:hover td {
    background: rgba(0, 0, 0, 0.02);
}

.chart-section {
    padding: 1.5rem;
}

.chart-section h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--theme-text);
    margin: 0 0 1.5rem;
}

.chart-bar-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.chart-bar-group .bars {
    flex: 1;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    width: 100%;
}

.chart-bar-group .bar {
    flex: 1;
    min-height: 2px;
    border-radius: 2px 2px 0 0;
    transition: height 0.3s ease;
}

.bar.revenue {
    background: var(--theme-primary);
    opacity: 0.3;
}

.bar.profit {
    background: #16a34a;
}

.bar.loss {
    background: #dc2626;
}

.bar-label {
    font-size: 0.6875rem;
    color: var(--theme-text-muted);
    margin-top: 0.5rem;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
}

.legend-item .dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.dot.revenue {
    background: var(--theme-primary);
    opacity: 0.3;
}

.dot.profit {
    background: #16a34a;
}

.dot.loss {
    background: #dc2626;
}

.account-page,
.addons-page,
.billing-page,
.profile-page,
.users-page {
    padding: 1.5rem;
    max-width: 1200px;
}

.billing-page,
.profile-page,
.users-page {
    max-width: 900px;
}

.avatar,
.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--theme-primary-light);
    color: var(--theme-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    flex-shrink: 0;
}

/* Help Chat */
.help-chat {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
}

.help-chat-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--theme-primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

.help-chat-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

.help-chat.open .help-chat-toggle {
    background: var(--theme-text);
}

.help-chat-window {
    position: absolute;
    bottom: 72px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 48px);
    height: 500px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.2s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.help-chat-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 100%); /* same as modal headers */
    color: white;
    font-weight: 600;
}

.help-chat-header svg {
    flex-shrink: 0;
}

.help-chat-header span {
    flex: 1;
}

/* Close and clear buttons match the modal close button (.modal-container .modal-close) */
.help-chat-close,
.help-chat-clear {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    cursor: pointer;
    line-height: 1;
    border-radius: 8px;
    transition: background 0.15s;
}

.help-chat-close {
    font-size: 1.5rem;
    padding: 0.5rem 0.75rem;
}

.help-chat-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 0.7rem;
    margin-left: auto;
}

.help-chat-close:hover,
.help-chat-clear:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Opens at the top (greeting first); HelpChat scrolls each new question to the top via js/help-chat.js */
.help-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.help-chat-thread {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.help-chat-message {
    display: flex;
    max-width: 85%;
}

.help-chat-message.user {
    margin-left: auto;
}

.help-chat-message.bot {
    margin-right: auto;
}

.help-chat-message .message-content {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.help-chat-message.user .message-content {
    background: var(--theme-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.help-chat-message.bot .message-content {
    background: var(--bg-soft);
    color: var(--theme-text);
    border-bottom-left-radius: 4px;
}

.help-chat-message.bot .bot-text {
    margin-bottom: 0.5rem;
}

.help-chat-message .help-link,
.help-chat-message .action-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--theme-primary);
    text-decoration: none;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: white;
    border-radius: 8px;
    transition: background 0.15s;
}

.help-chat-message .help-link:hover,
.help-chat-message .action-link:hover {
    background: var(--sage-mist);
}

.help-chat-message .suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.help-chat-message .suggestion-chip {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.help-chat-message .suggestion-chip:hover {
    border-color: var(--theme-primary);
    background: var(--sage-mist);
}

.help-chat-input {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid var(--border);
    background: white;
}

.help-chat-input input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 24px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.15s;
}

.help-chat-input input:focus {
    border-color: var(--theme-primary);
}

.help-chat-input button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--theme-primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s;
}

.help-chat-input button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.help-chat-input button:not(:disabled):hover {
    opacity: 0.9;
}

@media (max-width: 480px) {
    .help-chat {
        bottom: 16px;
        right: 16px;
    }

    .help-chat-window {
        width: calc(100vw - 32px);
        height: calc(100vh - 100px);
        bottom: 68px;
    }
}
/* Empty state shown inside a form in place of a dropdown that has nothing to offer */
.form-empty-state {
    padding: 1.25rem 1rem;
    border: 1px dashed var(--theme-border);
    border-radius: 10px;
    background: var(--theme-background-alt);
}

/* Header bars (modal headers + help chat header): a small shadow lifts the bar off the content below */
.modal-container .modal-header,
.help-chat-header {
    box-shadow: 0 2px 6px rgba(20, 50, 20, 0.18);
    position: relative;
    z-index: 1;
}

/* Dashboard heading: store logo beside the store name, kept to heading height whatever its shape */
.dashboard-store-heading {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.dashboard-store-logo {
    max-height: 40px;
    max-width: 120px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    flex-shrink: 0;
}

/* =====================================================
   Supplier Emails (/supplier-emails) and the Supplier Emails card in Settings
   ===================================================== */

.supplier-emails-page .summary-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 767px) {
    .supplier-emails-page .summary-cards {
        grid-template-columns: 1fr;
    }
}

/* Mailbox status line */
.se-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.6rem;
    padding: 0.65rem 1rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--theme-border);
    border-radius: 10px;
    background: var(--theme-background-alt);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.se-status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 25%, transparent);
}

.se-status.has-error .se-status-dot {
    background: var(--error);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--error) 25%, transparent);
}

.se-status-sep {
    color: var(--text-muted);
}

.se-status-error {
    flex-basis: 100%;
    color: var(--error-strong);
}

/* Not connected */
.se-connect-banner {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--theme-border);
    border-radius: 14px;
    background: linear-gradient(135deg, var(--theme-background-alt) 0%, var(--bg-white) 100%);
}

.se-connect-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
}

.se-connect-text {
    flex: 1;
}

.se-connect-text h3 {
    margin: 0 0 0.25rem;
    font-size: 1.15rem;
}

.se-connect-text p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

@media (max-width: 767px) {
    .se-connect-banner {
        flex-direction: column;
        align-items: flex-start;
    }
}

.se-toolbar {
    margin-bottom: 1rem;
}

/* Email cards */
.se-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.se-card {
    position: relative;
    padding: 1.1rem 1.25rem 0.25rem;
    border: 1px solid var(--theme-border);
    border-radius: 14px;
    background: var(--bg-white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.se-card:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.07);
}

/* Waiting for review: a coloured edge down the left */
.se-card.is-open {
    border-left: 4px solid var(--theme-accent);
}

.se-card-head {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.se-avatar {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-weight: 700;
    font-size: 0.95rem;
    color: hsl(var(--avatar-hue, 140), 45%, 30%);
    background: hsl(var(--avatar-hue, 140), 45%, 90%);
}

.se-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--bg-white);
}

.se-card-title {
    flex: 1;
    min-width: 0;
}

.se-supplier {
    font-weight: 700;
    color: var(--text-primary);
}

.se-from {
    font-size: 0.8rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.se-received {
    flex-shrink: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.se-subject {
    margin-top: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.se-preview {
    margin: 0.25rem 0 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Attachment rows */
.se-files {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.85rem;
}

.se-file {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--theme-border-light);
    border-radius: 10px;
    background: var(--theme-background-alt);
}

.se-file-icon {
    flex-shrink: 0;
    width: 42px;
    height: 48px;
    border-radius: 6px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 6px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    color: white;
    background: var(--warm-grey);
    clip-path: polygon(0 0, 72% 0, 100% 22%, 100% 100%, 0 100%);
}

.se-ext-pdf { background: var(--theme-coral-dark); }
.se-ext-xlsx,
.se-ext-xls { background: var(--theme-primary); }
.se-ext-csv { background: var(--sage-dark); }

.se-file-info {
    flex: 1 1 220px;
    min-width: 0;
}

.se-file-name {
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.se-file-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.2rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.se-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--bg-soft);
    color: var(--text-secondary);
}

.se-chip-open {
    background: color-mix(in srgb, var(--theme-accent) 22%, white);
    color: var(--theme-accent-dark);
}

.se-chip-imported {
    background: color-mix(in srgb, var(--success) 18%, white);
    color: var(--theme-primary-dark);
}

.se-chip-muted,
.se-chip-unchanged,
.se-chip-superseded {
    background: var(--bg-soft);
    color: var(--text-muted);
}

.se-chip-link {
    gap: 0.25rem;
    background: color-mix(in srgb, var(--theme-primary) 12%, white);
    color: var(--theme-primary-dark);
}

/* Buttons wrap as a group under the file name on narrow screens instead of squashing */
.se-file-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
}

.se-file-actions .btn {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

@media (max-width: 767px) {
    .se-file-actions {
        margin-left: 0;
        width: 100%;
    }

    .se-file-actions .btn-primary {
        flex: 1 1 100%;
        justify-content: center;
    }
}

/* Handled files fade back so the open ones stand out */
.se-file-imported,
.se-file-notpricelist,
.se-file-dismissed,
.se-file-unchanged,
.se-file-superseded {
    background: var(--bg-white);
}

.se-file-imported .se-file-icon,
.se-file-notpricelist .se-file-icon,
.se-file-dismissed .se-file-icon,
.se-file-unchanged .se-file-icon,
.se-file-superseded .se-file-icon {
    opacity: 0.55;
}

.se-card-foot {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.35rem;
}

.se-view-email {
    text-decoration: none;
    font-weight: 600;
}

/* View email modal */
.se-email-meta {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.4rem 1rem;
    margin-bottom: 1rem;
}

.se-email-meta dt {
    font-weight: 600;
    color: var(--text-muted);
}

.se-email-meta dd {
    margin: 0;
    word-break: break-word;
}

.se-email-body {
    padding: 1rem;
    border: 1px solid var(--theme-border);
    border-radius: 10px;
    background: var(--theme-background-alt);
    white-space: pre-wrap;
    word-break: break-word;
}

/* Settings > Supplier Emails card */
.se-settings-code {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px dashed var(--theme-primary);
    border-radius: 12px;
    background: var(--theme-background-alt);
}

.se-settings-code .se-code {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--theme-primary-dark);
}

/* Monitored addresses: one compact row each so the list fits the narrow Settings column */
.se-sender-list {
    list-style: none;
    margin: 0 0 0.75rem;
    padding: 0;
    border: 1px solid var(--theme-border);
    border-radius: 10px;
    /* About five rows, then the list scrolls inside its box (each supplier adds an address and a domain row).
       The half row peeking at the bottom shows there is more. */
    max-height: 21rem;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.se-sender {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.75rem;
}

.se-sender + .se-sender {
    border-top: 1px solid var(--theme-border-light);
}

.se-sender.is-off .se-sender-text {
    opacity: 0.5;
}

.se-sender-text {
    flex: 1;
    min-width: 0;
}

.se-sender-pattern {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.se-sender-supplier {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Same width whether or not the row has a remove button, so the switches line up */
.se-sender-remove {
    width: 44px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Add form: address on its own row, then supplier and the Add button */
.se-sender-add {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "pattern pattern"
        "supplier button";
    gap: 0.5rem;
    align-items: start;
    margin-top:0.5rem;
}

.se-sender-add-pattern { grid-area: pattern; }
.se-sender-add-supplier { grid-area: supplier; min-width: 0; }
.se-sender-add-supplier .supplier-dropdown,
.se-sender-add-supplier .supplier-dropdown-trigger { width: 100%; }
.se-sender-add-button { grid-area: button; }

/* Dashboard: Needs your attention (supplier price lists waiting) */
.attention-card {
    border: 1px solid var(--theme-border);
    border-left: 4px solid var(--theme-accent);
    border-radius: 14px;
    background: var(--bg-white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    padding: 1rem 1.25rem;
}

.attention-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.85rem;
}

.attention-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--theme-accent-dark);
    background: color-mix(in srgb, var(--theme-accent) 22%, white);
    flex-shrink: 0;
}

.attention-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.attention-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.attention-list {
    list-style: none;
    margin: 0.85rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.attention-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    background: var(--theme-background-alt);
    font-size: 0.9rem;
}

.attention-file {
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.attention-from {
    color: var(--text-muted);
}

.attention-action {
    margin-left: auto;
    font-weight: 600;
    text-decoration: none;
}

.se-file-note {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Some emails were skipped: amber, not red (checking still works) */
.se-status.has-warning .se-status-dot {
    background: var(--warning);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--warning) 25%, transparent);
}

.se-status-warning {
    flex-basis: 100%;
    color: var(--warning-strong);
}

.se-chip-warning {
    background: color-mix(in srgb, var(--warning) 22%, white);
    color: var(--warning-strong);
}

.se-chip-invoice {
    background: color-mix(in srgb, var(--info) 18%, white);
    color: var(--info-strong);
}

.se-chip-snoozed {
    background: var(--bg-soft);
    color: var(--text-secondary);
}

.se-file-snoozed {
    background: var(--bg-white);
}

/* What the background AI read found: purple AI accent, like the other AI-prepared content */
.se-prepared {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    margin-top: 0.35rem;
    font-size: 0.82rem;
    color: var(--text-primary);
}

.se-prepared-mark {
    flex-shrink: 0;
    padding: 0 0.35rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: white;
    background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
}

.se-prepared-highlights {
    color: var(--text-muted);
}

.se-prepared.is-pending,
.se-prepared.is-problem {
    color: var(--text-muted);
    font-style: italic;
}

.se-prepared.is-problem {
    color: var(--warning-strong);
}

/* Email from an address not linked to a supplier */
.se-link-supplier {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 0.25rem 0 0.75rem;
}

.se-link-supplier select {
    width: auto;
    min-width: 14rem;
}

.se-snooze-menu {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

/* Dashboard: mailbox problem row */
.attention-problem {
    color: var(--error-strong);
}

/* ---------- Import: what changed since the last list ---------- */
.price-diff {
    border: 1px solid var(--theme-border);
    border-radius: 12px;
    padding: 1rem 1.1rem;
    margin-bottom: 1.5rem;
    background: var(--bg-white);
}

.price-diff-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.price-diff-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--theme-primary-dark);
}

.price-diff-sub {
    margin: 0.15rem 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.price-diff-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.price-diff-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    background: var(--bg-soft);
    color: var(--text-secondary);
}

/* A rise costs the florist money (warm), a drop saves it (green) */
.price-diff-chip.is-up {
    background: color-mix(in srgb, var(--error) 16%, white);
    color: var(--error-strong);
}

.price-diff-chip.is-down {
    background: color-mix(in srgb, var(--success) 20%, white);
    color: var(--theme-primary-dark);
}

.price-diff-chip.is-new {
    background: color-mix(in srgb, var(--info) 18%, white);
    color: var(--info-strong);
}

.price-diff-none {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.price-diff-table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    font-weight: 600;
}

.price-diff-table td {
    vertical-align: middle;
}

.price-diff-check {
    width: 2rem;
}

.price-diff-table tr.is-excluded td {
    opacity: 0.45;
}

.price-diff-table tr.is-excluded .price-diff-check {
    opacity: 1;
}

.price-diff-delta {
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}

.price-diff-delta.is-up {
    color: var(--error-strong);
}

.price-diff-delta.is-down {
    color: var(--theme-primary-dark);
}

.price-diff-tag {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0 0.45rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    background: color-mix(in srgb, var(--info) 18%, white);
    color: var(--info-strong);
}

.price-diff-notlisted {
    margin-top: 0.75rem;
    font-size: 0.85rem;
}

.price-diff-notlisted summary {
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 600;
}

.price-diff-notlisted p {
    margin: 0.4rem 0 0;
}

/* Settings > Supplier Emails: look back through older mail */
.se-lookback {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--theme-border);
    border-radius: 10px;
    background: var(--theme-background-alt);
}

.se-lookback-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

/* Compact period picker: four choices fit the narrow Settings column without wrapping inside a button */
.se-lookback .toggle-tabs {
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0;
}

.se-lookback .toggle-tab {
    padding: 0.35rem 0.75rem;
    font-size: 0.82rem;
    white-space: nowrap;
}
/* ---------- Venues page ---------- */
.venues-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.venues-toolbar .search-box {
    flex: 1 1 18rem;
    max-width: 28rem;
}

.venues-table .venue-name {
    font-weight: 600;
    text-align: left;
    text-decoration: none;
}

/* Access notes: one line under the name, full text on hover and in Edit */
.venues-table .venue-access {
    max-width: 22rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.venues-table tr.is-off td {
    opacity: 0.6;
}


/* ---------- Sign-in pages: provider buttons, divider, messages ---------- */
.auth-layout {
    min-height: 100vh;
}

.auth-providers {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.auth-provider-form {
    margin: 0;
}

.btn-provider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.55rem 1rem;
    border: 1px solid #d6d3ce;
    border-radius: 0.5rem;
    background: #ffffff;
    color: #3d3d3d;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
}

.btn-provider:hover {
    background: #f7f6f3;
    border-color: #bdb9b2;
}

.btn-provider:focus-visible {
    outline: 2px solid var(--theme-primary);
    outline-offset: 2px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0;
    color: #8a8a8a;
    font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    border-top: 1px solid #e5e2dd;
}

.auth-success {
    background: #f0f7f0;
    border: 1px solid #c8e2c9;
    color: #2e6b31;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.auth-form .form-hint {
    margin-top: 0.1rem;
    font-size: 0.78rem;
    color: #8a8a8a;
}

/* Sign-in pages use tighter form fields than the rest of the app, so the trial form fits a laptop screen. */
.auth-container .form-row-2col {
    gap: 0.85rem;
}

.auth-container .form-group {
    gap: 0.3rem;
    margin-bottom: 0;
}

.auth-container .form-group input {
    padding: 0.55rem 0.85rem;
    font-size: 0.95rem;
}

/* On the wider sign-up card, the provider buttons sit side by side. */
.auth-card-wide .auth-providers {
    flex-direction: row;
}

.auth-card-wide .auth-provider-form {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
}

.auth-card-wide .btn-provider {
    height: 100%;
    white-space: nowrap;
    font-size: 0.9rem;
}

@media (max-width: 540px) {
    .auth-card-wide .auth-providers {
        flex-direction: column;
    }
}

/* ---------- Commercial readiness (Nov 2026) ---------- */

/* Hint under a form field, anywhere in the app */
.form-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--theme-text-muted);
}

/* Shown above every page while the shop is read-only (closed, unpaid, or trial over) */
.readonly-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    border: 1px solid var(--theme-coral);
    border-left: 4px solid var(--theme-coral-dark);
    border-radius: 0.5rem;
    background: var(--theme-background-alt);
    color: var(--theme-text);
    font-size: 0.9rem;
}

/* Account > Activity */
.activity-table td { vertical-align: top; font-size: 0.9rem; }
.activity-summary { color: var(--theme-text-muted); word-break: break-word; }
.activity-action { font-weight: 600; }
.activity-action.is-added { color: var(--theme-primary); }
.activity-action.is-deleted { color: var(--theme-coral-dark); }
.activity-action.is-changed { color: var(--theme-text); }

/* Billing (#98) */
.billing-small {
    font-size: 0.8125rem;
    color: var(--theme-text-muted);
    margin: 0.75rem 0 0;
}

.billing-cycle-choice {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.billing-cycle-choice label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--theme-border);
    border-radius: 8px;
    font-size: 0.875rem;
    cursor: pointer;
}

.billing-cycle-choice label.selected {
    border-color: var(--theme-primary);
    background: var(--theme-primary-light, rgba(46, 125, 50, 0.06));
}

.trial-notice.billing-overdue {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.billing-ai {
    margin-top: 1rem;
    border-top: 1px solid var(--theme-border);
    padding-top: 0.75rem;
}

/* Pager (Components/Shared/Pager.razor): Previous / Next under lists loaded a page at a time */
.pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.5rem;
    margin: 1rem 0;
    color: var(--theme-text-muted);
    font-size: 0.9rem;
}
.pager-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.pager-page { white-space: nowrap; }

/* Getting started checklist (#102) */
.getting-started-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.getting-started-bar {
    height: 6px;
    border-radius: 3px;
    background: var(--theme-border);
    margin: 0.75rem 0 0.5rem;
    overflow: hidden;
}

.getting-started-bar span {
    display: block;
    height: 100%;
    background: var(--theme-primary);
}

.getting-started-steps {
    list-style: none;
    margin: 0;
    padding: 0;
}

.getting-started-steps li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--theme-border);
    font-size: 0.875rem;
}

.getting-started-steps li:last-child {
    border-bottom: none;
}

.getting-started-steps li.done strong {
    color: var(--theme-text-muted);
    font-weight: 500;
}

.getting-started-tick {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--theme-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #fff;
}

.getting-started-steps li.done .getting-started-tick {
    background: var(--theme-primary);
    border-color: var(--theme-primary);
}

.getting-started-hint {
    color: var(--theme-text-muted);
    font-size: 0.8125rem;
}

.getting-started-sample {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
    font-size: 0.8125rem;
    color: var(--theme-text-muted);
}

/* Support console (#101) */
.admin-search {
    max-width: 360px;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.admin-dl {
    display: grid;
    grid-template-columns: 9rem 1fr;
    gap: 0.25rem 0.75rem;
    margin: 0;
}

.admin-dl dt {
    font-weight: 500;
    color: var(--theme-text-muted);
}

.admin-dl dd {
    margin: 0;
    word-break: break-word;
}

.admin-action + .admin-action {
    margin-top: 1rem;
}

.admin-amount {
    max-width: 7rem;
}

/* Support "view as shop" banner (#101) */
.support-view-banner {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #3730a3;
}

/* Roster (#111) */
.roster-tabs {
    margin-bottom: 1rem;
}

.roster-weekbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    margin-bottom: 1rem;
}

.roster-weeknav,
.roster-weekactions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.roster-weekactions {
    margin-left: auto;
}

.roster-weektitle {
    font-size: 1.15rem;
    margin: 0;
}

.roster-grid th,
.roster-grid td {
    vertical-align: top;
    min-width: 7.5rem;
    font-size: 0.875rem;
}

.roster-grid thead th {
    background: var(--sage-mist);
    color: var(--sage-dark);
    font-weight: 600;
    white-space: nowrap;
}

.roster-grid .roster-date {
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.roster-grid .is-today {
    background: color-mix(in srgb, var(--theme-accent) 12%, white);
}

.roster-grid .roster-namecol {
    min-width: 9rem;
    white-space: nowrap;
    font-weight: 500;
}

/* Staff initials in their roster colour (StaffAvatar.razor) */
.staff-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    margin-right: 0.6rem;
    font-family: Inter, sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1;
    vertical-align: middle;
}

.staff-avatar.is-small {
    width: 1.6rem;
    height: 1.6rem;
    margin-right: 0.45rem;
    font-size: 0.68rem;
}

.roster-dot {
    display: inline-block;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    margin-right: 0.45rem;
    vertical-align: middle;
}

.roster-shift {
    display: block;
    width: 100%;
    text-align: left;
    background: white;
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--sage);
    border-radius: 0.35rem;
    padding: 0.25rem 0.4rem;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
    line-height: 1.25;
}

.roster-shift:not(:disabled):hover {
    border-color: var(--sage);
    box-shadow: 0 1px 4px var(--shadow-hover);
}

.roster-shift:disabled {
    opacity: 1;
    cursor: default;
}

.roster-shift-time {
    display: block;
    font-weight: 500;
    white-space: nowrap;
}

.roster-shift-note {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.roster-add {
    display: block;
    width: 100%;
    border: 1px dashed var(--border);
    border-radius: 0.35rem;
    background: transparent;
    color: var(--text-muted);
    line-height: 1.4;
    opacity: 0;
    transition: opacity 0.15s;
}

.roster-cell:hover .roster-add,
.roster-add:focus-visible,
.roster-cell:not(:has(.roster-shift)) .roster-add {
    opacity: 1;
}

.roster-add:hover {
    border-color: var(--sage);
    color: var(--sage-dark);
}

.roster-hours {
    font-weight: 600;
    white-space: nowrap;
}

.roster-sumrow th,
.roster-sumrow td {
    background: var(--theme-background);
}

.roster-joblist {
    list-style: none;
    padding: 0;
    margin: 0.15rem 0 0;
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.roster-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 1rem;
    font-weight: 600;
    font-size: 0.78rem;
    white-space: nowrap;
}

.roster-badge.is-ok {
    background: color-mix(in srgb, var(--success) 22%, white);
    color: #3f6b3c;
}

.roster-badge.is-short {
    background: var(--error-strong);
    color: white;
}

.roster-minutes {
    max-width: 7rem;
}

.roster-colours {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.roster-colour {
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 1px var(--border);
}

.roster-colour.is-selected {
    box-shadow: 0 0 0 3px var(--sage-dark);
}

.roster-days {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
}

.roster-day-check {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.roster-day-check .form-check-input {
    margin: 0;
}

.roster-page tr.is-off td {
    color: var(--text-muted);
}

/* Availability, opening hours and the week's tasks (#114) */
.roster-warnings {
    margin: 0.4rem 0 0;
    padding-left: 1.2rem;
    font-size: 0.875rem;
}

.roster-shift.is-outside {
    background: color-mix(in srgb, var(--rose, #cf8e82) 12%, white);
}

.roster-shift-warn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    margin-left: 0.2rem;
    border-radius: 50%;
    background: #b9756a;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    vertical-align: middle;
}

.roster-outside-note {
    color: #9a5a50;
}

.roster-usual {
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-muted);
}

.staff-avail,
.roster-opendays {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.staff-avail-row,
.roster-openday {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 38px;
}

.staff-avail-row input[type="time"],
.roster-openday input[type="time"] {
    width: 8.5rem;
}

.staff-avail-day {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    width: 4rem;
    font-weight: 500;
}

.staff-avail-day .form-check-input {
    margin: 0;
}

.staff-avail-row.is-off .staff-avail-day,
.roster-openday.is-off .staff-avail-day {
    color: var(--text-muted);
}

.roster-needed {
    width: 4.5rem;
}

.roster-taskdays {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: 1rem;
}

.roster-taskday {
    padding: 1rem;
}

.roster-taskday.is-today {
    box-shadow: 0 0 0 2px var(--sage, #8a9478);
}

.roster-taskday-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.roster-taskday-head h3 {
    margin: 0;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.1rem;
}

.roster-taskperson {
    border-left: 4px solid var(--sage, #8a9478);
    padding: 0.25rem 0 0.25rem 0.75rem;
    margin-bottom: 0.85rem;
}

.roster-taskperson.is-nobody {
    border-left-style: dashed;
    border-left-color: #b9756a;
}

.roster-taskperson-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}

.roster-taskperson-name {
    font-weight: 600;
}

.roster-tasklist {
    list-style: none;
    padding: 0;
    margin: 0;
}

.roster-tasklist li {
    padding: 0.1rem 0;
}

.roster-task-btn {
    display: inline-flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.4rem;
    border: none;
    background: none;
    padding: 0.15rem 0.3rem;
    margin-left: -0.3rem;
    border-radius: 6px;
    text-align: left;
    color: inherit;
    font-size: 0.9rem;
}

.roster-task-btn:not(:disabled):hover {
    background: var(--theme-background, #f9f6f2);
}

.roster-task-btn:disabled {
    cursor: default;
    opacity: 1;
}

.roster-task-when {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--sage-dark, #5a5f4a);
}

.roster-task-kept {
    font-size: 0.68rem;
    padding: 0 0.4rem;
    border-radius: 1rem;
    background: #f6ded9;
    color: #8a4f46;
}

.roster-task-orders {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding-left: 0.05rem !important;
}

@media print {
    .roster-taskdays {
        display: block;
    }

    .roster-taskday {
        break-inside: avoid;
        margin-bottom: 0.75rem;
    }

    .roster-task-kept {
        display: none;
    }
}

@media print {
    .no-print,
    .sidebar,
    .mobile-header {
        display: none !important;
    }

    .roster-page .card {
        box-shadow: none;
        border: 1px solid #999;
    }

    .roster-page .table-responsive {
        overflow: visible;
    }

    .roster-grid th,
    .roster-grid td {
        min-width: 0;
        font-size: 0.72rem;
        padding: 0.25rem;
    }

    .roster-shift {
        border: none;
        border-left: 3px solid #999;
        padding: 0 0.25rem;
    }
}

/* Staff picker (shared) and Staff page (#111) */
.staff-picker {
    position: relative;
}

.staff-picker.open {
    z-index: 1060;
}

.staff-picker-trigger {
    display: flex;
    align-items: center;
    min-height: 2.4rem;
}

.staff-picker-menu {
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 0;
    right: 0;
    max-height: 16rem;
    overflow-y: auto;
    background: white;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    box-shadow: 0 6px 18px var(--shadow-hover);
    padding: 0.25rem;
}

.staff-picker-option {
    display: flex;
    align-items: center;
    width: 100%;
    text-align: left;
    border: none;
    background: none;
    border-radius: 0.35rem;
    padding: 0.45rem 0.6rem;
    color: var(--text-primary);
}

.staff-picker-option:hover,
.staff-picker-option:focus-visible {
    background: var(--sage-mist);
}

.staff-picker-option.selected {
    background: var(--sage-pale);
    font-weight: 600;
}

.staff-picker-empty {
    padding: 0.5rem 0.6rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.staff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
    gap: 1rem;
}

.staff-card {
    border-top: 4px solid var(--sage);
}

.staff-card.is-off {
    opacity: 0.7;
}

.staff-card h3 {
    font-size: 1.05rem;
    margin: 0 0 0.25rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.staff-card-contact {
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.staff-card-contact a {
    display: block;
    word-break: break-word;
}

.staff-card-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.staff-card-stats div {
    background: var(--theme-background);
    border-radius: 0.4rem;
    padding: 0.4rem 0.55rem;
}

.staff-card-stats span {
    display: block;
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.staff-card-stats strong {
    font-size: 1.05rem;
}

.staff-card-line {
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
}

.staff-card-line .label {
    color: var(--text-secondary);
}

.staff-card-notes {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: pre-line;
}

.staff-card-actions {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.75rem;
}

/* Two-step sign-in setup: QR code on white (scans reliably in dark mode too) */
.twofactor-qr {
    display: inline-block;
    padding: 0.5rem;
    background: #ffffff;
    border: 1px solid var(--theme-border, #dee2e6);
    border-radius: 8px;
    line-height: 0;
}
.twofactor-qr svg {
    display: block;
}

/* Selects: the shared .form-control/.form-select padding above wiped Bootstrap's right padding, so text ran under the
   arrow (e.g. "For 24 hours" on Sign-in & security). Room for the arrow on every select; small ones stay small
   (16px text kept, so iPhones still don't zoom). */
.form-select {
    padding-right: 2.5rem;
    background-position: right 0.875rem center;
}
.form-control-sm,
.form-select-sm {
    min-height: 38px;
    padding-top: 0.375rem;
    padding-bottom: 0.375rem;
    padding-left: 0.75rem;
}
.form-select-sm {
    padding-right: 2.25rem;
    background-position: right 0.625rem center;
}

/* Shared LoadingSpinner (petal spinner): large size, and calmer for people who prefer reduced motion */
.loading-spinner.spinner-lg .spinner-container {
    transform: scale(1.35);
    margin: 0.75rem 0 1.5rem;
}
@media (prefers-reduced-motion: reduce) {
    .petal-spinner { animation-duration: 8s; }
    .loading-text { animation: none; }
}

/* Welcome video on someone's first time in the app (WelcomeIntro.razor) */
.welcome-intro {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: #2a2c24;
    overflow: hidden;
    animation: welcome-in 0.5s ease-out;
    transition: opacity 0.45s ease;
}

.welcome-intro.is-leaving {
    opacity: 0;
}

.welcome-intro-video,
.welcome-intro-still {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.welcome-intro-still {
    opacity: 0;
    transition: opacity 0.6s ease;
}

.welcome-intro.is-finale .welcome-intro-still {
    opacity: 1;
}

.welcome-intro-skip {
    position: absolute;
    top: 1rem;
    right: 1rem;
    min-height: 40px;
    padding: 0.4rem 1.1rem;
    border: none;
    border-radius: 2rem;
    background: rgba(249, 246, 242, 0.85);
    color: #3f4438;
    font-weight: 500;
    backdrop-filter: blur(4px);
}

.welcome-intro-skip:hover {
    background: #f9f6f2;
}

.welcome-intro-finale {
    position: absolute;
    left: 50%;
    bottom: 8%;
    width: min(92vw, 30rem);
    transform: translate(-50%, 1rem);
    opacity: 0;
    pointer-events: none;
    padding: 1.5rem 1.75rem;
    border-radius: 18px;
    background: rgba(249, 246, 242, 0.93);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    text-align: center;
    transition: opacity 0.6s ease 0.2s, transform 0.6s ease 0.2s;
}

.welcome-intro-finale.is-shown {
    opacity: 1;
    transform: translate(-50%, 0);
    pointer-events: auto;
}

.welcome-intro-finale h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.6rem;
    color: #3f4438;
    margin-bottom: 0.4rem;
}

.welcome-intro-finale p {
    color: #6a6f60;
    margin-bottom: 1rem;
}

@keyframes welcome-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Shown only if the browser blocks the video from starting by itself */
.welcome-intro-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 84px;
    height: 84px;
    border: none;
    border-radius: 50%;
    background: rgba(249, 246, 242, 0.9);
    color: #5a5f4a;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.welcome-intro-play:hover {
    background: #f9f6f2;
}

/* Reduce motion: the video still plays (one short video, once, with Skip), but nothing else animates around it */
@media (prefers-reduced-motion: reduce) {
    .welcome-intro,
    .welcome-intro-still,
    .welcome-intro-finale {
        animation: none;
        transition: none;
    }
}

/* ===== Gift Opportunities (#116): customers' birthdays, anniversaries and other gifting dates ===== */
.gift-tiles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.gift-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    padding: 1rem 1.25rem;
    background: var(--theme-background);
    border: 1px solid var(--theme-border);
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s, border-color 0.2s;
}

.gift-tile:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08); }
.gift-tile.active { border-color: var(--theme-primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--theme-primary) 20%, transparent); }
.gift-tile-value { font-size: 1.75rem; font-weight: 700; color: var(--theme-text); line-height: 1.1; }
.gift-tile-label { font-size: 0.85rem; color: var(--theme-text-muted); }
.gift-tile.to-contact .gift-tile-value { color: var(--theme-coral-dark); }

.gift-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.gift-filter-select { width: auto; min-width: 0; }
.gift-search { width: 240px; max-width: 100%; }

.gift-list { display: flex; flex-direction: column; gap: 0.75rem; }

.gift-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--theme-background);
    border: 1px solid var(--theme-border);
    border-left: 4px solid var(--theme-border);
    border-radius: 12px;
    transition: box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.gift-card:hover { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07); }
.gift-card.stage-tocontact { border-left-color: var(--theme-coral-dark); }
.gift-card.stage-contacted, .gift-card.stage-interested { border-left-color: var(--theme-secondary); }
.gift-card.stage-ordered { border-left-color: var(--theme-primary); }
.gift-card.stage-declined { opacity: 0.75; }

.gift-date {
    flex: 0 0 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.4rem 0;
    border-radius: 10px;
    background: var(--theme-background-alt);
}

.gift-date-day { font-size: 1.4rem; font-weight: 700; line-height: 1.1; color: var(--theme-text); }
.gift-date-month { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--theme-text-muted); }

.gift-thumb {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 10px;
}

.gift-body { flex: 1; min-width: 0; }

.gift-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.6rem;
}

.gift-title { font-weight: 600; color: var(--theme-text); overflow-wrap: anywhere; }
.gift-milestone { font-size: 0.85rem; color: var(--theme-text-muted); }
.gift-when { font-size: 0.85rem; color: var(--theme-text-muted); margin-left: auto; white-space: nowrap; }

.gift-chip {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    white-space: nowrap;
    background: var(--theme-background-alt);
    color: var(--theme-text-muted);
}

.gift-chip.stage-tocontact { background: color-mix(in srgb, var(--theme-coral) 30%, white); color: var(--theme-coral-dark); }
.gift-chip.stage-contacted, .gift-chip.stage-interested { background: color-mix(in srgb, var(--theme-secondary) 20%, white); color: var(--theme-primary-dark, var(--theme-primary)); }
.gift-chip.stage-ordered { background: var(--theme-primary); color: white; }

.gift-meta, .gift-last { font-size: 0.9rem; color: var(--theme-text-muted); margin-top: 0.25rem; overflow-wrap: anywhere; }
.gift-last { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; color: var(--theme-text); }
.gift-money { color: var(--theme-text-muted); white-space: nowrap; }
.gift-note { font-size: 0.85rem; color: var(--theme-text-muted); font-style: italic; margin-top: 0.25rem; }
.gift-card .row-actions { flex-wrap: wrap; }

/* Month view: the gift calendar, separate from the shop Calendar */
.gift-month-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.gift-month-title { font-size: 1.15rem; margin: 0 0.5rem; min-width: 10rem; }

.gift-month-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
}

.gift-month-dow { font-size: 0.75rem; font-weight: 600; color: var(--theme-text-muted); text-align: center; padding: 0.25rem 0; }

.gift-month-day {
    min-height: 92px;
    padding: 0.35rem;
    background: var(--theme-background);
    border: 1px solid var(--theme-border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.gift-month-day.empty { background: transparent; border-color: transparent; }
.gift-month-day.today { border-color: var(--theme-primary); box-shadow: inset 0 0 0 1px var(--theme-primary); }
.gift-month-num { font-size: 0.8rem; color: var(--theme-text-muted); }

.gift-month-item {
    border: none;
    background: color-mix(in srgb, var(--theme-coral) 30%, white);
    color: var(--theme-text);
    font-size: 0.75rem;
    text-align: left;
    padding: 0.15rem 0.35rem;
    border-radius: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.gift-month-item:hover { background: var(--theme-coral); }

/* Add / edit dialog */
.gift-picked { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem; }

.gift-customer-matches {
    margin-top: 0.25rem;
    border: 1px solid var(--theme-border);
    border-radius: 8px;
    overflow: hidden;
}

.gift-customer-match {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.75rem;
    border: none;
    border-bottom: 1px solid var(--theme-border);
    background: var(--theme-background);
    overflow-wrap: anywhere;
}

.gift-customer-match:last-child { border-bottom: none; }
.gift-customer-match:hover { background: var(--theme-background-alt); }

.gift-photo-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    min-height: 140px;
    border: 2px dashed var(--theme-border);
    border-radius: 10px;
}

.gift-photo-preview { max-width: 100%; max-height: 160px; border-radius: 8px; object-fit: contain; }
.gift-photo-empty { color: var(--theme-text-muted); font-size: 0.85rem; margin: auto 0; }
.gift-photo-zone .image-upload-actions { width: 100%; }

/* "Remember this date next year?" on the order form */
.remember-date {
    padding: 0.75rem 1rem;
    border: 1px dashed var(--theme-border);
    border-radius: 10px;
    background: var(--theme-background-alt);
}

@media (max-width: 991.98px) {
    .gift-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
    .gift-card { flex-wrap: wrap; padding: 0.85rem 1rem; gap: 0.75rem; }
    .gift-body { flex-basis: 100%; }
    .gift-when { margin-left: 0; }
    .gift-search { width: 100%; }
    .gift-filter-select { flex: 1; }
    /* A month grid of seven columns is unreadable on a phone: just the days that have something */
    .gift-month-grid { grid-template-columns: 1fr; }
    .gift-month-dow, .gift-month-day.empty { display: none; }
    .gift-month-day { min-height: 0; flex-direction: row; flex-wrap: wrap; align-items: center; }
    .gift-month-day:not(:has(.gift-month-item)):not(.today) { display: none; }
    .gift-month-num { min-width: 2rem; font-weight: 600; }
}

/* ===== Responsive fixes (9 Nov 2026, review of every page) =====
   Bootstrap's breakpoints go by the window, but the sidebar takes 280px from 768px up, so a "tablet" or small
   laptop has a much narrower content area than its column classes expect. These rules come last on purpose. */

/* Long emails, links and product names wrap instead of pushing the page wider */
body { overflow-wrap: break-word; }

/* Grids with a fixed number of columns: as many as fit, at least 150px each */
.stats-grid,
.metrics-grid,
.year-summary,
.season-calendar,
.roles-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

/* Calendar day columns never grow past an equal share (long event names used to widen the calendar) */
.calendar-header-row,
.calendar-week-row,
.week-header,
.week-body {
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

/* Tables whose page has no .table-responsive wrapper scroll inside their box */
.table-container,
.orders-table {
    overflow-x: auto;
}

/* Page header buttons wrap instead of running off the screen; button groups too */
.page-header-actions {
    flex-wrap: wrap;
    flex-shrink: 1;
    min-width: 0;
}

.page-header-actions > .btn-group {
    flex-wrap: wrap;
}

/* Tab rows (Roster, Staff, Venues) wrap on narrow screens */
.toggle-tabs { flex-wrap: wrap; }

/* Modal footers: three buttons no longer get cut off on a phone */
.modal-footer { flex-wrap: wrap; }

@media (min-width: 768px) {
    /* .hide-mobile forced display:block, which cancelled d-flex and its gap (Calendar, Seasons headers) */
    .hide-mobile.d-flex { display: flex !important; }

    /* col-md-1 (Stems "Clear") was never sized and sat alone on a full-width line */
    .row > .col-md-1 { flex: 0 0 auto; width: auto; max-width: none; }
}

@media (min-width: 992px) {
    /* Partners of col-lg-3/4/6 that were left at 100% and wrapped under their neighbour */
    .row > .col-lg-5 { flex: 0 0 41.666%; max-width: 41.666%; }
    .row > .col-lg-7 { flex: 0 0 58.333%; max-width: 58.333%; }
    .row > .col-lg-8 { flex: 0 0 66.666%; max-width: 66.666%; }
    .row > .col-lg-9 { flex: 0 0 75%; max-width: 75%; }
}

/* Tablet and small laptop with the sidebar open: rows made only of quarter/sixth columns (stat cards, filters,
   field rows) go two to a row. Rows that pair them with a wide column (3 + 9 image beside fields) are left alone. */
@media (min-width: 768px) and (max-width: 1099.98px) {
    .row:has(> [class*="col-md-3"] ~ [class*="col-md-3"]):not(:has(> [class*="col-md-6"], > [class*="col-md-8"], > [class*="col-md-9"], > [class*="col-md-10"])) > [class*="col-md-3"],
    .row:has(> [class*="col-md-2"] ~ [class*="col-md-2"]):not(:has(> [class*="col-md-6"], > [class*="col-md-8"], > [class*="col-md-9"], > [class*="col-md-10"])) > [class*="col-md-2"] {
        flex: 0 0 50%;
        max-width: 50%;
        margin-bottom: 0.75rem;
    }

    /* Side-by-side layouts that left the main part a few hundred pixels: stack them */
    .help-layout,
    .editor-layout { grid-template-columns: 1fr; }
}

@media (max-width: 1279.98px) {
    .editor-layout { grid-template-columns: 1fr; }
}

@media (max-width: 1199.98px) {
    .create-purchase-form-layout,
    .wastage-page .form-layout { grid-template-columns: 1fr; }
}

@media (max-width: 767.98px) {
    /* Two-column forms and panels are one column on a phone */
    .account-grid,
    .form-grid,
    .report-cards,
    .two-column,
    .form-row,
    .templates-page .form-row {
        grid-template-columns: 1fr;
    }

    .modal-footer .btn { min-width: 0; flex: 1 1 auto; }
}

@media (max-width: 575.98px) {
    /* Invoice line items: description on its own line, the numbers two by two below; no header row */
    .items-header { display: none; }
    .item-row { grid-template-columns: 1fr 1fr; }
    .item-row > :first-child { grid-column: 1 / -1; }

    .toggle-tab { padding: 0.5rem 0.9rem; }
}

/* Markup Rules: the default markup card */
.markup-default-card.needs-setup { border-color: var(--theme-coral-dark); }
.markup-default-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.markup-default-head > div { flex: 1 1 18rem; min-width: 0; }
.markup-default-title { font-size: 1.1rem; margin: 0 0 0.25rem; }
.markup-default-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; }
.markup-default-value { font-size: 1.6rem; font-weight: 700; color: var(--theme-primary); }
.markup-default-choice { display: flex; flex-direction: column; gap: 0.35rem; }

.markup-help {
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--theme-border);
    border-radius: 10px;
    background: var(--theme-background-alt);
    font-size: 0.9rem;
}

.markup-help summary { cursor: pointer; font-weight: 600; color: var(--theme-primary); }
.markup-help ul { margin-top: 0.5rem; padding-left: 1.1rem; }
.markup-help li { margin-bottom: 0.3rem; }

/* Import: Basic upload (free) or AI upload, chosen before the file */
:root { --ai-purple: #8b5cf6; }

.reader-choice {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.75rem;
}

.reader-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--theme-border);
    border-radius: 12px;
    background: var(--theme-background);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.reader-option:hover { border-color: var(--theme-primary-light); }
.reader-option.selected { border-color: var(--theme-primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--theme-primary) 18%, transparent); }
.reader-option .form-check-input { margin-top: 0.2rem; flex-shrink: 0; }
.reader-option-text { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.reader-option-text small { color: var(--theme-text-muted); }

.bg-ai-subtle {
    background: color-mix(in srgb, var(--ai-purple) 15%, white);
    color: var(--ai-purple);
}

/* Settings > Supplier Emails: one row per connected mailbox */
.se-mailbox-list { list-style: none; padding: 0; margin: 0 0 0.25rem; display: flex; flex-direction: column; gap: 0.5rem; }
.se-mailbox { padding: 0.6rem 0.75rem; border: 1px solid var(--theme-border); border-radius: 10px; background: var(--theme-background); }
.se-mailbox-address { overflow-wrap: anywhere; }
