/* Infynidex Inc. Expense Tracker Application - Mobile-First Design */

:root {
    --primary-color: #097AE4;
    --primary-dark: #1e40af;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius: 0.75rem;
    --radius-sm: 0.5rem;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* Header */
.header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.header-date {
    flex: 1;
    text-align: center;
    line-height: 1.25;
    padding: 0 0.5rem;
}

.header-date-weekday {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.header-date-full {
    display: block;
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-menu {
    flex-shrink: 0;
}

.logo {
    flex-shrink: 0;
}

/* Constrain header on mobile to prevent logo from expanding */
@media (max-width: 767px) {
    .header-content {
        padding: 0 0.5rem;
        flex-wrap: wrap;
    }

    .header-date {
        order: 3;
        flex: 1 1 100%;
        padding: 0.35rem 0 0;
    }

    .header-date-weekday {
        display: inline;
        margin-right: 0.35rem;
    }

    .header-date-full {
        display: inline;
        font-size: 0.9375rem;
    }
}

.logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.logo-image {
    max-height: 50px;
    width: auto;
    height: auto;
    display: block;
    max-width: 100%;
}

/* Responsive logo sizing for mobile */
@media (max-width: 767px) {
    .logo-image {
        max-width: 200px;
        max-height: 40px;
        width: auto;
        height: auto;
    }
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Navigation */
.nav {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-list {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    min-width: max-content;
}

.nav-item {
    flex-shrink: 0;
}

.nav-link {
    display: block;
    padding: 0.75rem 1.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
    background: var(--bg-tertiary);
    color: var(--primary-color);
}

/* Buttons - Thumb-friendly sizing */
.btn {
    display: inline-block;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    min-height: 48px;
    min-width: 48px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #059669;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

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

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-block {
    width: 100%;
    display: block;
}

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

.btn-lg {
    padding: 1.25rem 2rem;
    font-size: 1.125rem;
    min-height: 56px;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.2s;
    min-height: 48px;
    -webkit-appearance: none;
    appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-error {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-help {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Cards */
.card {
    background: var(--bg-primary);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.card-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

/* Tables */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

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

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    position: sticky;
    top: 0;
}

.table tr:hover {
    background: var(--bg-secondary);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-primary);
    padding: 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.dashboard-stats-row {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
}

.dashboard-stats-row--primary,
.dashboard-stats-row--secondary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-stats-row--secondary {
    max-width: none;
}

.dashboard-recent-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
}

.delivery-summary-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.delivery-summary-filter .form-group {
    margin-bottom: 0;
    min-width: 180px;
}

.delivery-detail-grid {
    display: grid;
    grid-template-columns: minmax(140px, 180px) 1fr;
    gap: 0.35rem 1rem;
    margin: 0 0 1rem;
}

.delivery-detail-grid dt {
    margin: 0;
    font-weight: 600;
    color: var(--text-secondary);
}

.delivery-detail-grid dd {
    margin: 0 0 0.5rem;
}

.delivery-pay-extra {
    margin-bottom: 0.75rem;
}

.delivery-pay-extra-amount {
    margin-top: 0.5rem;
    margin-bottom: 0;
}

/* Deliveries page — wider layout, no horizontal scroll on order tables */
.container--deliveries {
    max-width: min(96vw, 1680px);
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.delivery-list-pickup,
.delivery-list-notes,
.delivery-list-dropoff {
    min-width: 0;
    max-width: none;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    font-size: 0.875rem;
    vertical-align: top;
}

.delivery-list-notes {
    color: var(--text-secondary, #64748b);
}

.delivery-list-dropoff {
    font-size: 0.8125rem;
}

.table-container--deliveries-orders {
    overflow-x: visible;
}

.table--deliveries-orders {
    width: 100%;
    table-layout: fixed;
    min-width: 0;
}

.table--deliveries-orders th,
.table--deliveries-orders td {
    padding: 0.625rem 0.4rem;
    overflow-wrap: anywhere;
}

.table--deliveries-orders-month .delivery-col-date { width: 7.5%; }
.table--deliveries-orders-month .delivery-col-time { width: 6%; }
.table--deliveries-orders-month .delivery-col-customer { width: 8.5%; }
.table--deliveries-orders-month .delivery-col-num { width: 6.5%; }
.table--deliveries-orders-month .delivery-col-money { width: 7%; }
.table--deliveries-orders-month .delivery-col-pickup { width: 12%; }
.table--deliveries-orders-month .delivery-col-notes { width: 26%; }
.table--deliveries-orders-month .delivery-col-actions { width: 12.5%; }

.table--deliveries-orders-report .delivery-col-date { width: 6.5%; }
.table--deliveries-orders-report .delivery-col-time { width: 5%; }
.table--deliveries-orders-report .delivery-col-customer { width: 7%; }
.table--deliveries-orders-report .delivery-col-num { width: 5.5%; }
.table--deliveries-orders-report .delivery-col-money { width: 6%; }
.table--deliveries-orders-report .delivery-col-dropoff { width: 16%; }
.table--deliveries-orders-report .delivery-col-pickup { width: 9%; }
.table--deliveries-orders-report .delivery-col-notes { width: 18%; }
.table--deliveries-orders-report .delivery-col-actions { width: 8%; }

.delivery-orders-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.delivery-orders-actions .btn-sm {
    padding: 0.35rem 0.55rem;
    font-size: 0.75rem;
    min-height: 30px;
}

.delivery-orders-actions form {
    display: inline;
}

@media (max-width: 767px) {
    .dashboard-stats-row--primary,
    .dashboard-stats-row--secondary {
        grid-template-columns: 1fr;
    }

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

/* Deliveries page tabs - reuse nav-list / nav-item / nav-link for same button style */
.delivery-tabs {
    margin-bottom: 1.25rem;
}

.delivery-report-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.delivery-report-search-wrap {
    grid-column: span 2;
}

@media (max-width: 640px) {
    .delivery-report-search-wrap {
        grid-column: span 1;
    }
}

.delivery-report-filter-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.modal-dialog {
    position: relative;
    z-index: 1;
    background: var(--card-bg, #fff);
    color: var(--text-primary, inherit);
    padding: 1.5rem;
    border-radius: 8px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    margin: auto;
}

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    padding: 1rem;
    overflow-y: auto;
    align-items: flex-start;
    justify-content: center;
}

.modal-overlay.is-open {
    display: flex;
}

.modal-overlay--persistent .modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 0;
}

body.modal-open {
    overflow: hidden;
}

.modal-dialog--sm {
    max-width: 400px;
}

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

.modal-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.table-sort-link {
    color: inherit;
    text-decoration: none;
    font-weight: 600;
}

.table-sort-link:hover {
    color: var(--primary-color, #2563eb);
    text-decoration: underline;
}

/* Time Tracker */
.time-tracker {
    text-align: center;
    padding: 2rem 1rem;
}

.current-time {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 1rem 0;
    font-variant-numeric: tabular-nums;
}

.time-status {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.punch-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Image Preview */
.image-preview {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius-sm);
    margin-top: 1rem;
    border: 2px solid var(--border-color);
}

.image-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-sm);
    padding: 2rem;
    text-align: center;
    background: var(--bg-tertiary);
    cursor: pointer;
    transition: all 0.2s;
}

.image-upload-area:hover {
    border-color: var(--primary-color);
    background: var(--bg-secondary);
}

.image-upload-area input[type="file"] {
    display: none;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--text-secondary); }
.text-danger { color: var(--danger-color); }
.text-success { color: var(--secondary-color); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

.hidden { display: none; }

.place-autocomplete-host {
    width: 100%;
    min-height: 2.5rem;
}

.place-autocomplete-host gmp-place-autocomplete {
    width: 100%;
    display: block;
}

.gps-map-overlay {
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 5;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 6px;
    padding: 0.4rem 0.55rem;
    font-size: 0.75rem;
    line-height: 1.3;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    pointer-events: none;
    min-width: 5.5rem;
}

.gps-map-overlay.hidden {
    display: none;
}

.gps-map-overlay-speed {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
}

.gps-map-overlay-row {
    display: flex;
    gap: 0.65rem;
    color: var(--text-secondary, #666);
    margin-top: 0.15rem;
}

.gps-telemetry-stats {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.35rem 1rem;
    margin: 0 0 1.25rem;
}

.gps-telemetry-stats dt {
    margin: 0;
    color: var(--text-secondary, #666);
    font-weight: normal;
}

.gps-telemetry-stats dd {
    margin: 0;
    font-weight: 600;
    text-align: right;
}

.gps-map-viewport {
    position: relative;
    margin-bottom: 1rem;
}

.gps-map-canvas {
    width: 100%;
    height: 280px;
    border-radius: 8px;
    background: #e8e8e8;
}

.gps-map-locate-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    background: #fff;
}

/* Hamburger Menu Toggle Button */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101;
}

.nav-toggle span {
    width: 100%;
    height: 3px;
    background: var(--text-primary);
    border-radius: 3px;
    transition: all 0.3s;
}

.nav-toggle-active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.nav-toggle-active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle-active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Mobile Menu - Hamburger for all mobile */
@media (max-width: 767px) {
    /* Hamburger menu */
    .nav-toggle {
        display: flex;
    }
    
    /* Hide nav by default, show when toggled */
    .nav {
        display: none;
        background: var(--bg-primary);
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-md);
    }
    
    .nav-open {
        display: block;
    }
    
    .nav-list {
        flex-direction: column;
        gap: 0;
        padding: 0.5rem 0;
    }
    
    .nav-item {
        width: 100%;
    }
    
    .nav-link {
        padding: 1rem 1.5rem;
        border-radius: 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-link:last-child {
        border-bottom: none;
    }
}

/* Portrait Mode Specific Adjustments */
@media (max-width: 767px) and (orientation: portrait) {
    /* Header adjustments */
    .header-content {
        padding: 0.75rem 0.5rem;
    }
    
    .user-menu {
        gap: 0.5rem;
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    
    .user-name {
        display: none;
    }
    
    .btn-sm {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
        min-height: 36px;
        min-width: auto;
    }
    
    /* Table adjustments for portrait */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -1rem;
        padding: 0 1rem;
    }
    
    .table {
        font-size: 0.875rem;
        min-width: 600px;
    }

    .table--deliveries-orders {
        min-width: 0;
    }

    .table-container--deliveries-orders {
        overflow-x: visible;
        margin: 0;
        padding: 0;
    }

    .container--deliveries {
        max-width: 100%;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
    }
    
    /* Card padding adjustment for tables */
    .card {
        padding: 1rem;
        overflow: hidden;
    }
    
    /* Container padding */
    .container {
        padding: 1rem 0.75rem;
    }
}

/* Responsive */
@media (min-width: 768px) {
    .container {
        padding: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .nav-list {
        justify-content: center;
    }
}

/* Print Styles */
@media print {
    .header,
    .nav,
    .btn,
    .no-print {
        display: none !important;
    }
}

/* Entry macros */
.macro-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.macro-builder-dialog {
    width: min(720px, 100%);
    max-height: 90vh;
    overflow-y: auto;
}

.macro-actions-ol {
    margin: 0;
    padding-left: 1.25rem;
}

.macro-action-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.macro-summary-list {
    margin: 0;
    padding-left: 1.1rem;
}

.macro-action-fields {
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 0.75rem;
}

.macro-run-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.macro-run-item {
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    padding: 0.875rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.macro-run-item.is-disabled {
    opacity: 0.65;
}

.macro-run-meta {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.dashboard-actions {
    margin-bottom: 1.5rem;
}

/* Profile section menu */
.profile-layout {
    display: grid;
    grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.profile-nav {
    position: sticky;
    top: 1rem;
    padding: 0.75rem;
}

.profile-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.profile-nav-link {
    display: block;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

.profile-nav-link:hover {
    background: var(--bg-tertiary);
    color: var(--primary-color);
}

.profile-nav-link.active {
    background: var(--bg-tertiary);
    color: var(--primary-color);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--primary-color);
}

.profile-panels {
    min-width: 0;
}

.profile-panel {
    display: none;
}

.profile-panel.is-active {
    display: block;
}

.profile-panel .card + .card,
.profile-panel .card + .profile-modal-host {
    margin-top: 1.5rem;
}

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

    .profile-nav {
        position: static;
        padding: 0.5rem;
    }

    .profile-nav-list {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 0.5rem;
        padding-bottom: 0.25rem;
        -webkit-overflow-scrolling: touch;
    }

    .profile-nav-item {
        flex: 0 0 auto;
    }

    .profile-nav-link {
        white-space: nowrap;
        padding: 0.5rem 0.85rem;
        border: 1px solid var(--border-color, #ddd);
    }

    .profile-nav-link.active {
        border-color: var(--primary-color);
        background: rgba(9, 122, 228, 0.1);
        color: var(--primary-color);
        box-shadow: none;
    }
}

.invoice-template-field-with-var {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.invoice-template-field-with-var .form-input,
.invoice-template-field-with-var .form-textarea {
    flex: 1 1 220px;
    min-width: 0;
}

.invoice-template-field-with-var .invoice-template-var-select {
    flex: 0 0 auto;
    min-width: 11rem;
    max-width: 100%;
}

.invoice-template-field-with-var--stack {
    flex-direction: column;
    align-items: stretch;
}

.invoice-email-template-editor {
    background: var(--surface-muted, #f9f9f9);
}

