@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --radius: 0.75rem;
    --background: oklch(12% .005 260);
    --foreground: oklch(96% .002 260);
    --card: oklch(15.5% .006 260);
    --primary: oklch(60% .13 250);
    --primary-foreground: oklch(98% .002 260);
    --secondary: oklch(19.5% .006 260);
    --muted-foreground: oklch(62% .008 260);
    --border: oklch(22% .006 260);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: #050607;
    color: var(--foreground);
    min-height: 100vh;
    padding-bottom: 90px;
    -webkit-font-smoothing: antialiased;
}

/* ── Header ── */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    margin: 16px 16px 12px;
    position: relative;
}

.balance-section { display: flex; align-items: center; gap: 10px; }

.balance-icon {
    width: 34px; height: 34px;
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
}

.balance-label {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.8px;
    color: var(--muted-foreground);
    text-transform: uppercase;
}

.balance-amount { font-size: 15px; font-weight: 700; }

.brand {
    position: absolute; left: 50%; transform: translateX(-50%);
    font-size: 13px; font-weight: 600; color: var(--foreground);
}

.header-actions { display: flex; align-items: center; }

.cart-button {
    position: relative; background: none; border: none;
    cursor: pointer; padding: 8px; color: #fff;
    display: flex; align-items: center; justify-content: center;
}

.cart-badge {
    position: absolute; top: 0; right: 0;
    background: var(--primary); color: #fff;
    font-size: 9px; font-weight: 700;
    padding: 2px 5px; border-radius: 10px; min-width: 16px; text-align: center;
}

/* ── Main ── */
.main-content { padding: 0 16px; display: flex; flex-direction: column; gap: 14px; }

/* ── Hero ── */
.hero-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    padding: 20px;
}

.hero-title { font-size: 26px; font-weight: 700; margin-bottom: 6px; }
.hero-subtitle { font-size: 12px; color: var(--muted-foreground); line-height: 1.6; margin-bottom: 18px; }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.stat-card {
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius));
    padding: 14px;
}

.stat-label {
    display: flex; align-items: center; gap: 6px;
    font-size: 10px; font-weight: 600;
    color: var(--muted-foreground); text-transform: uppercase;
    letter-spacing: 0.6px; margin-bottom: 6px;
}

.stat-value { font-size: 26px; font-weight: 700; }

/* ── List section ── */
.list-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    overflow: hidden;
}

/* ── Tabs bar ── */
.tabs-bar {
    display: flex;
    background: var(--secondary);
    border-bottom: 1px solid var(--border);
    padding: 6px;
    gap: 4px;
}

.tab-btn {
    flex: 1;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 0;
    background: none; border: none;
    color: var(--muted-foreground);
    font-size: 13px; font-weight: 500;
    border-radius: calc(var(--radius) - 2px);
    cursor: pointer; transition: all 0.2s;
}

.tab-btn.active {
    background: var(--card);
    color: var(--foreground);
    font-weight: 600;
}

/* ── Entry count ── */
.entry-count {
    padding: 10px 16px 8px;
    font-size: 11px;
    color: var(--muted-foreground);
    font-weight: 500;
}

/* ── Depot row ── */
.depot-row {
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}

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

.depot-summary {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.depot-amount {
    font-size: 18px;
    font-weight: 700;
    min-width: 72px;
}

.depot-crypto-badge {
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted-foreground);
    flex-shrink: 0;
}

.depot-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}
.status-completed { background: rgba(0,200,80,0.15); color: #00c850; }
.status-cancelled { background: rgba(220,50,50,0.15); color: #ff5555; }
.status-pending   { background: rgba(255,180,0,0.15); color: #ffb800; }

.depot-date {
    font-size: 11px;
    color: var(--muted-foreground);
    flex-shrink: 0;
    margin-left: auto;
}

.depot-chevron {
    color: var(--muted-foreground);
    transition: transform 0.25s;
    flex-shrink: 0;
    margin-left: 4px;
}
.depot-row.open .depot-chevron { transform: rotate(180deg); }

/* ── Compte row ── */
.compte-row {
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}
.compte-row:last-child { border-bottom: none; }

.compte-summary {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.compte-id {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted-foreground);
    min-width: 54px;
}

.compte-amount {
    font-size: 18px;
    font-weight: 700;
}

.compte-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

.compte-date {
    font-size: 11px;
    color: var(--muted-foreground);
    flex-shrink: 0;
    margin-left: auto;
}

.compte-chevron {
    color: var(--muted-foreground);
    transition: transform 0.25s;
    flex-shrink: 0;
    margin-left: 4px;
}
.compte-row.open .compte-chevron { transform: rotate(180deg); }

/* ── Expanded panels ── */
.expanded-panel {
    display: none;
    padding: 0 16px 16px;
    border-top: 1px solid var(--border);
    background: var(--background);
}

.depot-row.open .expanded-panel,
.compte-row.open .expanded-panel { display: block; }

/* ── Compte detail card ── */
.compte-detail-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius));
    padding: 14px;
    margin-top: 12px;
}

.compte-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.compte-detail-name { font-size: 14px; font-weight: 700; }
.compte-detail-sub { font-size: 11px; color: var(--muted-foreground); margin-top: 2px; text-transform: uppercase; }

.compte-detail-right { text-align: right; }
.compte-pts { font-size: 11px; color: var(--muted-foreground); }
.compte-price { font-size: 14px; font-weight: 700; }

/* ── Contenu livré ── */
.contenu-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 12px 0 6px;
}

.contenu-box {
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 600;
    font-family: monospace;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.copy-btn {
    background: none; border: none;
    color: var(--muted-foreground);
    cursor: pointer; padding: 4px;
    display: flex; align-items: center; justify-content: center;
    transition: color 0.2s;
}
.copy-btn:hover { color: var(--foreground); }

/* ── Barcode ── */
.barcode-label {
    font-size: 10px; font-weight: 600;
    color: var(--muted-foreground); text-transform: uppercase;
    letter-spacing: 0.5px; margin-bottom: 8px;
}

.barcode-container {
    background: #fff;
    border-radius: calc(var(--radius) - 2px);
    padding: 14px;
    text-align: center;
    margin-bottom: 10px;
}

.barcode-container img {
    width: 100%; max-width: 300px;
    image-rendering: pixelated;
}

.barcode-text {
    margin-top: 6px;
    font-size: 12px;
    color: #111;
    font-family: monospace;
}

.download-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
    color: var(--foreground);
    font-size: 12px; font-weight: 600;
    padding: 8px 14px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
    margin-bottom: 12px;
}
.download-btn:hover { background: var(--card); }

/* ── Description ── */
.desc-label {
    font-size: 11px; font-weight: 600;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.desc-text {
    font-size: 12px;
    color: var(--muted-foreground);
    line-height: 1.7;
}

/* ── Empty state ── */
.empty-state {
    text-align: center; padding: 40px 20px;
    color: var(--muted-foreground);
    display: flex; flex-direction: column; align-items: center; gap: 12px;
}

/* ── Bottom nav ── */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: rgba(5,6,7,0.97);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    padding: 10px 20px 18px;
    display: flex; justify-content: space-around;
    z-index: 100;
}

.nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    color: var(--muted-foreground);
    text-decoration: none;
    font-size: 11px; font-weight: 500;
    padding: 6px 14px;
    border-radius: calc(var(--radius));
    transition: all 0.2s;
}
.nav-item:hover { background: rgba(255,255,255,0.05); }
.nav-item.active { background: rgba(96,156,255,0.12); color: var(--primary); }
.nav-item svg { stroke: currentColor; }
