/* ============================================================
   Clubinho Bookstore — Production CSS
   New design system: warm cream, amber accent, DM Mono
   Drop-in replacement for style.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700&family=DM+Mono:wght@400;500;600&display=swap');

/* ── TOKENS ─────────────────────────────────────────────── */
:root {
    --bg:           #faf8f4;
    --bg2:          #f3f0ea;
    --ink:          #1a1714;
    --ink2:         #4a4540;
    --ink3:         #8a8580;
    --border:       #e0dbd3;

    --amber:        oklch(72% 0.14 65);
    --amber-light:  oklch(94% 0.05 65);
    --amber-dark:   oklch(50% 0.14 65);
    --green:        oklch(68% 0.14 145);
    --green-light:  oklch(94% 0.05 145);
    --blue:         oklch(65% 0.14 240);
    --blue-light:   oklch(94% 0.05 240);
    --red:          oklch(62% 0.18 20);
    --red-light:    oklch(94% 0.06 20);

    /* Legacy aliases — keeps existing template references working */
    --primary-color:   var(--amber);
    --primary-gradient: var(--amber);
    --success-color:   var(--green);
    --info-color:      var(--blue);
    --warning-color:   var(--amber);
    --danger-color:    var(--red);
    --card-shadow:     0 4px 16px rgba(0,0,0,0.06);
    --border-radius:   12px;
}

/* ── RESET & BASE ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    background-color: var(--bg);
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--ink);
    padding-bottom: 80px;
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ── TYPOGRAPHY UTILITY ──────────────────────────────────── */
.fin {
    font-family: 'DM Mono', 'Courier New', monospace;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* ── HEADER ──────────────────────────────────────────────── */
.header {
    background: white;
    color: var(--ink);
    padding: 0 16px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.header p { display: none; }

/* Logo mark left of header */
.header::before {
    content: '';
    display: block;
    width: 28px;
    height: 28px;
    background: var(--amber);
    border-radius: 7px;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19.5A2.5 2.5 0 0 1 6.5 17H20'/%3E%3Cpath d='M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19.5A2.5 2.5 0 0 1 6.5 17H20'/%3E%3Cpath d='M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z'/%3E%3C/svg%3E");
    mask-size: contain;
    -webkit-mask-size: contain;
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
}

/* ── BOTTOM NAVIGATION ───────────────────────────────────── */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--border);
    padding: 6px 0 10px;
    z-index: 100;
}

.nav-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    max-width: 500px;
    margin: 0 auto;
    padding: 0 8px;
    gap: 4px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 8px;
    text-decoration: none;
    color: var(--ink3);
    border-radius: 16px;
    transition: background 0.15s, color 0.15s;
}

.nav-item.active {
    background: var(--amber-light);
    color: var(--amber-dark);
}

.nav-item:hover:not(.active) {
    color: var(--ink2);
    text-decoration: none;
}

.nav-icon { font-size: 1.25rem; display: block; }
.nav-label { font-size: 0.6875rem; font-weight: 600; }

/* ── CARDS ───────────────────────────────────────────────── */
.stat-card,
.action-card,
.item-card,
.order-card,
.activity-card,
.search-card,
.report-card,
.filter-section {
    background: white;
    border-radius: var(--border-radius);
    border: 1px solid var(--border);
    box-shadow: none;
    transition: box-shadow 0.15s, transform 0.15s;
}

.stat-card:hover,
.item-card:hover,
.order-card:hover {
    box-shadow: var(--card-shadow);
    transform: translateY(-1px);
}

/* ── STATS ───────────────────────────────────────────────── */
.stats-container { padding: 1rem; }

.stat-card {
    padding: 1.25rem 1rem;
    text-align: center;
    height: 100%;
}

.stat-number {
    font-family: 'DM Mono', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--ink3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.stat-icon { font-size: 1.1rem; margin-bottom: 0.5rem; }

/* Color overrides */
.text-primary-custom { color: var(--amber-dark) !important; }
.text-success-custom { color: var(--green) !important; }
.text-info-custom    { color: var(--blue) !important; }
.text-warning-custom { color: var(--amber-dark) !important; }
.text-danger         { color: var(--red) !important; }
.text-success        { color: var(--green) !important; }

.bg-primary-light  { background-color: var(--amber-light) !important; }
.bg-success-light  { background-color: var(--green-light) !important; }
.bg-info-light     { background-color: var(--blue-light) !important; }
.bg-warning-light  { background-color: var(--amber-light) !important; }
.bg-danger-light   { background-color: var(--red-light) !important; }

/* ── QUICK ACTIONS ───────────────────────────────────────── */
.quick-actions { padding: 0 1rem 1rem; }

.action-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.action-card {
    padding: 1.25rem 1rem;
    text-decoration: none;
    color: inherit;
    text-align: center;
    display: block;
}

.action-card:hover { color: inherit; text-decoration: none; }
.action-icon { font-size: 1.4rem; margin-bottom: 0.5rem; display: block; }
.action-title { font-size: 0.875rem; font-weight: 600; margin: 0; }

/* ── ACTIVITY FEED ───────────────────────────────────────── */
.recent-section { padding: 0 1rem 1rem; }

.section-title {
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--ink2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.activity-card { padding: 0; border: 1px solid var(--border); }

.activity-item {
    padding: 0.75rem;
    border-bottom: 1px solid var(--bg2);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

.activity-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    flex-shrink: 0;
}

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

.activity-title {
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--ink);
}

.activity-subtitle { font-size: 0.75rem; color: var(--ink3); }

.activity-value {
    font-family: 'DM Mono', monospace;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.registry-count {
    font-size: 0.75rem;
    color: var(--ink3);
    font-weight: 500;
    background: var(--bg2);
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

/* ── SEARCH ──────────────────────────────────────────────── */
.search-section { padding: 0 1rem 1rem; }
.search-card { padding: 0.875rem; }

.search-input {
    border: 1px solid var(--border) !important;
    border-radius: 10px !important;
    padding: 0.625rem 0.75rem !important;
    font-size: 0.875rem;
    background: white;
    color: var(--ink);
    transition: border-color 0.15s;
}

.search-input:focus {
    border-color: var(--amber) !important;
    box-shadow: 0 0 0 3px var(--amber-light) !important;
    outline: none;
}

/* ── PAGE HEADER ─────────────────────────────────────────── */
.page-container { padding: 1rem; }

.page-header {
    background: white;
    border-radius: var(--border-radius);
    border: 1px solid var(--border);
    padding: 0.875rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.page-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--ink);
}

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn-add {
    background: var(--amber);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    padding: 0.625rem 1rem;
    transition: opacity 0.15s, transform 0.15s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.875rem;
}

.btn-add:hover { opacity: 0.9; transform: translateY(-1px); color: white; text-decoration: none; }

.btn-primary {
    background: var(--amber) !important;
    border: none !important;
    border-radius: 8px !important;
    font-weight: 600;
    transition: opacity 0.15s;
    color: white !important;
}

.btn-primary:hover { opacity: 0.9; background: var(--amber) !important; }

.btn-success { background-color: var(--green) !important; border: none !important; border-radius: 8px !important; }
.btn-warning { background-color: var(--amber) !important;  border: none !important; border-radius: 8px !important; }
.btn-danger  { background-color: var(--red) !important;   border: none !important; border-radius: 8px !important; }
.btn-info    { background-color: var(--blue) !important;  border: none !important; border-radius: 8px !important; }

.btn-action {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    transition: all 0.15s;
    cursor: pointer;
}

.btn-edit  { color: var(--blue); }
.btn-edit:hover  { background: var(--blue); color: white; border-color: var(--blue); }

.btn-delete { color: var(--red); }
.btn-delete:hover { background: var(--red); color: white; border-color: var(--red); }

.btn-print  { color: var(--ink3); }
.btn-print:hover { background: var(--ink3); color: white; }

.btn-filter {
    background: var(--amber);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    padding: 0.75rem 1rem;
    transition: opacity 0.15s;
    font-family: inherit;
    cursor: pointer;
}

.btn-filter:hover { opacity: 0.9; color: white; }

/* ── ITEM CARDS ──────────────────────────────────────────── */
.item-card {
    margin-bottom: 0.875rem;
    padding: 1rem;
    border: 1px solid var(--border);
}

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

.item-info { flex: 1; }
.item-name { font-size: 1rem; font-weight: 700; color: var(--ink); margin: 0 0 0.25rem 0; }

.item-details {
    font-size: 0.8125rem;
    color: var(--ink3);
    line-height: 1.5;
}

.item-details i { width: 16px; margin-right: 0.375rem; color: var(--amber); }
.item-actions { display: flex; gap: 0.375rem; flex-shrink: 0; }

.item-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.75rem;
    background-color: var(--bg);
    border-radius: 8px;
    border: 1px solid var(--border);
}

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

.stat-value {
    font-family: 'DM Mono', monospace;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

/* ── ORDERS ──────────────────────────────────────────────── */
.orders-container { padding: 0 1rem; }

.order-card {
    margin-bottom: 0.875rem;
    padding: 1rem;
    border: 1px solid var(--border);
}

.order-id {
    font-family: 'DM Mono', monospace;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--ink3);
}

.customer-name { font-size: 0.9375rem; font-weight: 700; color: var(--ink); }
.asset-name    { font-size: 0.875rem; color: var(--ink3); }

.order-details {
    font-size: 0.8125rem;
    color: var(--ink3);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.order-details i { width: 16px; margin-right: 0.375rem; color: var(--amber); }

.order-financial {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding: 0.625rem 0.75rem;
    background-color: var(--bg);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.financial-item { text-align: center; flex: 1; min-width: 70px; }

.financial-value {
    font-family: 'DM Mono', monospace;
    font-size: 0.875rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.financial-label {
    font-size: 0.6875rem;
    color: var(--ink3);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 500;
}

/* Total value — no gradient, clean mono display */
.total-value {
    background: var(--ink);
    color: white;
    padding: 0.625rem 0.75rem;
    border-radius: 8px;
    text-align: right;
    font-family: 'DM Mono', monospace;
    font-size: 1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* ── STATUS BADGES ───────────────────────────────────────── */
.status-badge {
    font-size: 0.6875rem;
    padding: 3px 9px;
    border-radius: 20px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    display: inline-block;
}

.status-pending    { background: var(--amber-light);  color: var(--amber-dark); }
.status-processing { background: var(--blue-light);   color: var(--blue); }
.status-delivered  { background: var(--green-light);  color: var(--green); }

/* ── MODALS ──────────────────────────────────────────────── */
.modal-content {
    border-radius: var(--border-radius);
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

/* Remove gradient, use clean white */
.modal-header {
    background: white !important;
    color: var(--ink) !important;
    border-bottom: 1px solid var(--border);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    padding: 1rem 1.25rem;
}

.modal-title { font-weight: 700; color: var(--ink); font-size: 1rem; }
.btn-close { filter: none !important; opacity: 0.5; }
.btn-close:hover { opacity: 1; }

/* ── FORMS ───────────────────────────────────────────────── */
.form-control,
.form-select {
    border-radius: 8px !important;
    border: 1px solid var(--border) !important;
    padding: 0.625rem 0.75rem !important;
    font-size: 0.875rem;
    color: var(--ink);
    background: white;
    font-family: inherit;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--amber) !important;
    box-shadow: 0 0 0 3px var(--amber-light) !important;
    outline: none;
}

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

.form-group { margin-bottom: 1.25rem; }

/* ── TAB NAVIGATION ──────────────────────────────────────── */
.tab-navigation {
    background: white;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
}

.nav-tabs { border-bottom: none; padding: 0 1rem; }

.nav-tabs .nav-link {
    border: none;
    color: var(--ink3);
    font-weight: 600;
    padding: 0.875rem 1.25rem;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
    background: none;
    font-size: 0.875rem;
    border-radius: 0;
}

.nav-tabs .nav-link:hover { color: var(--amber-dark); background: var(--amber-light); border-bottom-color: transparent; }
.nav-tabs .nav-link.active { color: var(--amber-dark); background: white; border-bottom-color: var(--amber); }

/* ── ACTION SECTION ──────────────────────────────────────── */
.action-section {
    padding: 0.875rem 1rem;
    background: white;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
}

/* ── PAGINATION ──────────────────────────────────────────── */
.pagination-section { padding: 1rem; text-align: center; }
.pagination { justify-content: center; margin: 0; }

.page-link {
    border-radius: 8px !important;
    margin: 0 0.2rem;
    border: 1px solid var(--border) !important;
    color: var(--amber-dark);
}

.page-link:hover { background: var(--amber); border-color: var(--amber) !important; color: white; }
.page-item.active .page-link { background: var(--amber); border-color: var(--amber) !important; }

/* ── CALCULATOR ──────────────────────────────────────────── */
.calculator-container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: var(--border-radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

.calculator-header {
    background: var(--amber);
    color: white;
    padding: 1.25rem 1.5rem;
    text-align: center;
}

.calculator-header h3 { margin: 0; font-weight: 700; font-size: 1.1rem; }
.calculator-header p  { margin: 4px 0 0; opacity: 0.8; font-size: 0.875rem; }

.calculator-form { padding: 1.25rem 1.5rem; }

.label-with-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.375rem;
}

.btn-edit-profit {
    background: var(--amber-light);
    color: var(--amber-dark);
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.currency-note { font-size: 0.75rem; color: var(--ink3); margin-top: 0.25rem; }

.button-container { display: flex; gap: 0.75rem; margin-bottom: 0.75rem; }

.btn-calculate {
    flex: 2;
    background: var(--amber);
    border: none;
    color: white;
    padding: 0.875rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.15s;
}

.btn-calculate:hover:not(:disabled) { opacity: 0.9; color: white; }
.btn-calculate:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-clear {
    flex: 1;
    background: var(--bg2);
    border: 1px solid var(--border);
    color: var(--ink2);
    padding: 0.875rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.btn-clear:hover { background: var(--border); color: var(--ink); }

.results {
    background: var(--bg);
    border-radius: 8px;
    padding: 1.25rem;
    margin-top: 1rem;
    border: 1px solid var(--border);
    display: none;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border);
}

.result-item:last-child {
    border-bottom: none;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--amber-dark);
}

.result-label { color: var(--ink3); font-size: 0.875rem; }

.result-value {
    font-family: 'DM Mono', monospace;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
}

.btn-copy {
    background: var(--green);
    color: white;
    border: none;
    padding: 0.375rem 0.875rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
    font-family: inherit;
}

.btn-copy:hover { opacity: 0.9; }
.btn-copy.copied { background: var(--ink3); }

.btn-approve {
    background: var(--blue);
    color: white;
    border: none;
    padding: 0.375rem 0.875rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.exchange-info { font-size: 0.75rem; color: var(--ink3); text-align: center; margin-top: 0.75rem; }

/* ── COMBOBOX ────────────────────────────────────────────── */
.combobox-container { position: relative; }
.combobox-input { width: 100%; }

.combobox-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    display: none;
}

.combobox-option {
    padding: 0.625rem 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--bg2);
}

.combobox-option:hover, .combobox-option.highlighted { background: var(--amber-light); color: var(--amber-dark); }
.combobox-option.add-new { background: var(--blue-light); color: var(--blue); font-weight: 600; }
.combobox-option.add-new:hover { background: var(--blue); color: white; }

/* ── REPORTS ─────────────────────────────────────────────── */
.reports-container { padding: 1rem; }
.report-section { margin-bottom: 1.5rem; }

.stat-box {
    background: white;
    border-radius: var(--border-radius);
    border: 1px solid var(--border);
    padding: 1.25rem;
    text-align: center;
    transition: box-shadow 0.15s;
}

.stat-box:hover { box-shadow: var(--card-shadow); }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.875rem;
    margin-bottom: 1.5rem;
}

.rank-number {
    background: var(--amber-light);
    color: var(--amber-dark);
    border-radius: 50%;
    width: 24px; height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    margin-right: 0.5rem;
    font-family: 'DM Mono', monospace;
}

.rank-gold   { background: oklch(88% 0.12 65);  color: var(--amber-dark); }
.rank-silver { background: oklch(90% 0.02 60);  color: var(--ink3); }
.rank-bronze { background: oklch(85% 0.08 50);  color: oklch(45% 0.10 50); }

.report-table { width: 100%; margin-bottom: 0; }

.report-table th {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--ink3);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.625rem 0.5rem;
}

.report-table td {
    vertical-align: middle;
    font-size: 0.875rem;
    padding: 0.625rem 0.5rem;
    border-bottom: 1px solid var(--bg2);
    color: var(--ink2);
}

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

/* ── CUSTOMER ACCOUNT ────────────────────────────────────── */
.customer-header { padding: 1rem; margin-bottom: 0; }

.customer-info-card {
    background: white;
    border-radius: var(--border-radius);
    border: 1px solid var(--border);
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
}

.customer-title { margin: 0 0 0.5rem 0; color: var(--ink); font-size: 1.375rem; font-weight: 700; }

.customer-details { color: var(--ink3); font-size: 0.875rem; line-height: 1.5; }
.customer-details i { width: 16px; margin-right: 0.375rem; color: var(--amber); }

.btn-back {
    padding: 0.625rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    background: var(--bg2);
    color: var(--ink2);
    border: 1px solid var(--border);
    transition: background 0.15s;
}

.btn-back:hover { background: var(--border); color: var(--ink); text-decoration: none; }

.btn-orders {
    padding: 0.625rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    background: var(--amber);
    color: white;
    border: none;
    transition: opacity 0.15s;
}

.btn-orders:hover { opacity: 0.9; color: white; text-decoration: none; }

.account-summary { padding: 0 1rem 1rem; }

/* Balance hero */
.balance-hero {
    background: var(--ink);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1rem;
}

.balance-hero.owing { background: oklch(24% 0.08 20); }
.balance-hero.credit { background: oklch(24% 0.06 145); }

.balance-hero-label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    opacity: 0.5;
    color: white;
    margin-bottom: 0.5rem;
}

.balance-hero-value {
    font-family: 'DM Mono', monospace;
    font-size: 2rem;
    font-weight: 700;
    color: white;
    font-variant-numeric: tabular-nums;
}

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

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

.summary-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: white;
    flex-shrink: 0;
}

.summary-value {
    font-family: 'DM Mono', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
}

.summary-label { font-size: 0.75rem; color: var(--ink3); text-transform: uppercase; letter-spacing: 0.4px; }

/* Transaction timeline */
.transactions-section { padding: 0 1rem 1rem; }

.transaction-timeline {
    position: relative;
    padding-left: 44px;
}

.transaction-timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.transaction-card {
    position: relative;
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.875rem;
    margin-bottom: 0.75rem;
    transition: box-shadow 0.15s;
}

.transaction-card::before {
    content: '';
    position: absolute;
    left: -36px;
    top: 12px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: white;
}

.transaction-card.transaction-payment::before { background: var(--green); border-color: var(--green); }
.transaction-card.transaction-debit::before   { background: var(--red);   border-color: var(--red); }
.transaction-card.transaction-credit::before  { background: var(--blue);  border-color: var(--blue); }

.transaction-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.375rem;
}

.type-label { font-weight: 600; color: var(--ink); font-size: 0.875rem; }
.transaction-date { font-size: 0.75rem; color: var(--ink3); margin-top: 2px; }

.transaction-amount {
    font-family: 'DM Mono', monospace;
    font-size: 1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.transaction-amount-payment { color: var(--green); }
.transaction-amount-debit   { color: var(--red); }
.transaction-amount-credit  { color: var(--blue); }

.transaction-description {
    font-size: 0.8125rem;
    color: var(--ink3);
    padding-top: 0.5rem;
    border-top: 1px solid var(--bg2);
    margin-top: 0.375rem;
}

.btn-delete-transaction {
    width: 30px; height: 30px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: white;
    color: var(--red);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.8125rem;
}

.btn-delete-transaction:hover { background: var(--red); color: white; border-color: var(--red); }

/* Quick actions for customer account */
.quick-actions-section { padding: 0 1rem 1rem; }

.action-buttons { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.btn-action-primary, .btn-action-secondary, .btn-action-tertiary {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-family: inherit;
    transition: opacity 0.15s;
}

.btn-action-primary   { background: var(--green); color: white; }
.btn-action-secondary { background: var(--red);   color: white; }
.btn-action-tertiary  { background: var(--blue);  color: white; }

.btn-action-primary:hover,
.btn-action-secondary:hover,
.btn-action-tertiary:hover { opacity: 0.9; color: white; }

/* ── ALERTS ──────────────────────────────────────────────── */
.alert { border-radius: 8px; font-size: 0.875rem; border: none; }
.alert-danger  { background: var(--red-light);   color: var(--red); }
.alert-warning { background: var(--amber-light); color: var(--amber-dark); }
.alert-success { background: var(--green-light); color: var(--green); }
.alert-info    { background: var(--blue-light);  color: var(--blue); }

/* ── EMPTY STATE ─────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--ink3);
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--border);
    display: block;
}

/* ── ADMIN LOGIN ─────────────────────────────────────────── */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ink);
    padding: 1.5rem;
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--border);
}

.login-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-logo-mark {
    width: 52px;
    height: 52px;
    background: var(--amber);
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.login-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 0.25rem;
}

.login-subtitle { font-size: 0.875rem; color: var(--ink3); }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .page-header { flex-direction: column; align-items: stretch; text-align: center; }
    .item-actions { width: 100%; justify-content: flex-end; }
    .order-financial { grid-template-columns: 1fr 1fr; }
    .customer-info-card { flex-direction: column; }
    .action-buttons { flex-direction: column; }
    .summary-grid { grid-template-columns: 1fr 1fr; }
    .transaction-timeline { padding-left: 36px; }
}

@media (max-width: 430px) {
    .stat-number { font-size: 1.25rem; }
    .stats-grid  { grid-template-columns: 1fr; }
    .button-container { flex-direction: column; }
    .item-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ── PRINT ───────────────────────────────────────────────── */
@media print {
    .header, .bottom-nav, .filter-section, .btn-add, .btn-action { display: none; }
    body { background: white; padding-bottom: 0; }
    .item-card, .order-card, .report-card { box-shadow: none; border: 1px solid #ddd; page-break-inside: avoid; }
}

/* ── PAGE SUBTITLE ───────────────────────────────────────── */
.page-subtitle { color: var(--ink3); font-size: 0.875rem; margin: 0.25rem 0 0; }

/* ── QUOTES ──────────────────────────────────────────────── */
.quote-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: box-shadow 0.15s;
}
.quote-card:hover { box-shadow: var(--card-shadow); }

.quote-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.quote-info h5 { font-weight: 700; font-size: 1rem; color: var(--ink); margin: 0 0 0.2rem; }
.quote-info p  { color: var(--ink3); font-size: 0.8125rem; margin: 0 0 0.15rem; }

.quote-actions { display: flex; flex-direction: column; gap: 0.375rem; flex-shrink: 0; }

.btn-approve-quote {
    background: var(--green); color: white; border: none;
    padding: 0.375rem 0.75rem; border-radius: 6px;
    font-size: 0.75rem; font-weight: 600; cursor: pointer; font-family: inherit;
    display: flex; align-items: center; gap: 0.3rem; white-space: nowrap;
    transition: opacity 0.15s;
}
.btn-approve-quote:hover { opacity: 0.85; }

.btn-reject-quote {
    background: var(--red-light); color: var(--red);
    border: 1px solid var(--red); padding: 0.375rem 0.75rem; border-radius: 6px;
    font-size: 0.75rem; font-weight: 600; cursor: pointer; font-family: inherit;
    display: flex; align-items: center; gap: 0.3rem; white-space: nowrap;
    transition: all 0.15s;
}
.btn-reject-quote:hover { background: var(--red); color: white; }

.quote-details { background: var(--bg2); border-radius: 8px; padding: 0.75rem; }

.quote-detail-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.3rem 0; border-bottom: 1px solid var(--border); font-size: 0.8125rem;
}
.quote-detail-row:last-child { border-bottom: none; }
.quote-detail-label { color: var(--ink3); }
.quote-detail-value { font-family: 'DM Mono', monospace; font-weight: 600; color: var(--ink); }

.empty-quotes { text-align: center; padding: 3rem 1rem; color: var(--ink3); }
.empty-quotes i { font-size: 2.5rem; margin-bottom: 0.75rem; display: block; color: var(--border); }
.empty-quotes h4 { color: var(--ink2); margin-bottom: 0.5rem; }

/* ── REPORTS FILTER ──────────────────────────────────────── */
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.75rem; align-items: end; }
.date-presets { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.75rem; }

.preset-btn {
    padding: 5px 12px; border-radius: 20px; border: 1px solid var(--border);
    background: white; color: var(--ink3); font-size: 0.75rem; font-weight: 600;
    cursor: pointer; font-family: inherit; transition: all 0.15s;
}
.preset-btn.active, .preset-btn:hover { background: var(--amber-light); color: var(--amber-dark); border-color: var(--amber); }

.nav-pills .nav-link { color: var(--ink3); background: var(--bg2); border-radius: 8px; margin-right: 8px; font-size: 0.875rem; }
.nav-pills .nav-link.active { background: var(--amber); color: white; }

.status-order-item { border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-bottom: 8px; background: white; transition: background 0.15s; }
.status-order-item:hover { background: var(--bg); }

/* ── DASHBOARD CHECKBOXES ────────────────────────────────── */
.dashboard-order-checkbox { margin-right: 8px; display: flex; align-items: center; }
.dashboard-order-select-checkbox { width: 16px; height: 16px; cursor: pointer; accent-color: var(--amber); }
.batch-controls-dashboard { margin-bottom: 12px; }

/* ── CUSTOMERS STAT LINK ─────────────────────────────────── */
.stat-link { text-decoration: none; color: inherit; transition: transform 0.15s; display: block; }
.stat-link:hover { transform: translateY(-1px); color: inherit; }

/* ── COPY CONTAINER ──────────────────────────────────────── */
.copy-container { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem; }

/* ── CUSTOM DROPDOWN (shipping) ──────────────────────────── */
.custom-dropdown { position: relative; }

.custom-dropdown-selected {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.625rem 0.75rem; background: white;
    border: 1px solid var(--border); border-radius: 8px;
    cursor: pointer; font-size: 0.875rem; color: var(--ink); transition: border-color 0.15s;
}
.custom-dropdown-selected:hover, .custom-dropdown.open .custom-dropdown-selected {
    border-color: var(--amber);
}
.custom-dropdown.open .custom-dropdown-selected { border-radius: 8px 8px 0 0; }

.dropdown-arrow { transition: transform 0.2s; font-size: 0.75rem; color: var(--ink3); }
.custom-dropdown.open .dropdown-arrow { transform: rotate(180deg); }

.custom-dropdown-options {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: white; border: 1px solid var(--border); border-top: none;
    border-radius: 0 0 8px 8px; max-height: 200px; overflow-y: auto;
    z-index: 100; box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.custom-dropdown.open .custom-dropdown-options { display: block; }
.custom-dropdown-options div {
    padding: 0.625rem 0.75rem; cursor: pointer; font-size: 0.875rem;
    border-bottom: 1px solid var(--bg2); color: var(--ink); transition: background 0.1s;
}
.custom-dropdown-options div:hover { background: var(--amber-light); color: var(--amber-dark); }
.custom-dropdown-options div:last-child { border-bottom: none; }
