/* ====================================================
   Swiss TVs Admin – Main Stylesheet
   Phase 2: Layout, Dashboard, Products, Detail
   ==================================================== */

:root {
    --ink: #0F1B2D;
    --ink-soft: #1E2A3D;
    --paper: #FAFAF7;
    --paper-warm: #F5F2EB;
    --line: #E6E1D5;
    --line-soft: #EFEBE0;
    --muted: #7A7468;
    --muted-soft: #ADA697;
    --copper: #A87644;
    --copper-soft: #C8985F;
    --swiss-red: #C8201F;
    --green: #2C7A50;
    --green-soft: #E8F3ED;
    --amber: #B8763C;
    --amber-soft: #FAF1DF;
    --red-soft: #FBE9E8;

    --shadow-sm: 0 1px 2px rgba(15, 27, 45, .04), 0 0 0 1px rgba(15, 27, 45, .04);
    --shadow-md: 0 4px 16px rgba(15, 27, 45, .06), 0 0 0 1px rgba(15, 27, 45, .04);
    --shadow-lg: 0 12px 40px rgba(15, 27, 45, .08), 0 0 0 1px rgba(15, 27, 45, .04);

    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'Geist Mono', 'SF Mono', Consolas, monospace;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --safe-area-top: env(safe-area-inset-top);
    --safe-area-bottom: env(safe-area-inset-bottom);
}

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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-body);
    background: var(--paper-warm);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-image:
        radial-gradient(at 0% 0%, #FAF1DF 0%, transparent 50%),
        radial-gradient(at 100% 100%, #E8F3ED 0%, transparent 50%);
}

#app {
    height: 100dvh;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--paper-warm);
    position: relative;
}

@media (min-width: 480px) {
    #app {
        box-shadow: var(--shadow-lg);
    }
}

button { font-family: inherit; cursor: pointer; border: 0; background: transparent; }
input, textarea, select { font-family: inherit; }

/* ====================================================
   LOADING
   ==================================================== */

.loading-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding: 40px;
}

.loading-brand {
    font-family: var(--font-display);
    font-size: 42px;
    font-weight: 500;
    letter-spacing: -0.02em;
}

.loading-brand em {
    font-style: italic;
    color: var(--copper);
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--line);
    border-top-color: var(--copper);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-spinner-sm {
    width: 16px;
    height: 16px;
    border: 2px solid var(--line);
    border-top-color: var(--copper);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

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

.loading-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px;
    color: var(--muted);
    font-size: 13px;
    justify-content: center;
}

/* ====================================================
   LOGIN
   ==================================================== */

.login-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 32px;
    background: linear-gradient(180deg, var(--paper) 0%, var(--paper-warm) 100%);
}

.login-brand {
    font-family: var(--font-display);
    font-size: 42px;
    font-weight: 500;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
    text-align: center;
}

.login-brand em { font-style: italic; color: var(--copper); }

.login-tagline {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 48px;
}

.login-form { width: 100%; max-width: 360px; }

.login-form .form-group { margin-bottom: 16px; }

.login-form label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 6px;
}

.login-form input {
    width: 100%;
    padding: 14px 16px;
    background: white;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    font-size: 15px;
    color: var(--ink);
    transition: border 0.2s, box-shadow 0.2s;
}

.login-form input:focus {
    outline: none;
    border-color: var(--ink);
    box-shadow: 0 0 0 3px rgba(15, 27, 45, 0.08);
}

.login-foot {
    margin-top: 40px;
    font-size: 11px;
    color: var(--muted);
    text-align: center;
    font-family: var(--font-mono);
    letter-spacing: 0.04em;
}

/* ====================================================
   APP HEADER
   ==================================================== */

.app-header {
    padding: calc(var(--safe-area-top) + 12px) 20px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line-soft);
    background: var(--paper);
    flex-shrink: 0;
}

.app-header .brand {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.app-header .brand-tag {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--copper);
}

.app-header .brand-name {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.app-header .header-icons { display: flex; gap: 8px; }

.app-header .icon-btn {
    width: 36px;
    height: 36px;
    background: var(--paper-warm);
    border: 1px solid var(--line);
    border-radius: 10px;
    display: grid;
    place-items: center;
    cursor: pointer;
    color: var(--ink);
}

.app-header .icon-btn svg { width: 18px; height: 18px; }

/* ====================================================
   SCROLL CONTENT
   ==================================================== */

.content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 16px 88px;
    -webkit-overflow-scrolling: touch;
}

.scroll-content {
    scrollbar-width: thin;
}

/* ====================================================
   BOTTOM NAV
   ==================================================== */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: calc(64px + var(--safe-area-bottom));
    border-top: 1px solid var(--line);
    background: rgba(250, 250, 247, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    padding-bottom: var(--safe-area-bottom);
    z-index: 50;
}

.bottom-nav .nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--muted);
    cursor: pointer;
    position: relative;
    font-size: 10px;
    font-weight: 500;
    padding: 0;
    transition: color 0.15s;
}

.bottom-nav .nav-item.active { color: var(--ink); }

.bottom-nav .nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    width: 28px;
    height: 2px;
    background: var(--copper);
    border-radius: 0 0 4px 4px;
}

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

/* ====================================================
   DASHBOARD
   ==================================================== */

.greeting { margin-bottom: 20px; }

.greeting .day {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 4px;
}

.greeting h2 {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.greeting h2 em { font-style: italic; color: var(--copper); }

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

.stat-card {
    padding: 16px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 14px;
    min-height: 100px;
}

.stat-card.dark {
    background: var(--ink);
    color: white;
    border-color: var(--ink);
}

.stat-card .stat-label {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}

.stat-card.dark .stat-label { color: var(--muted-soft); }

.stat-card .stat-num {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.02em;
}

.stat-card .stat-delta {
    font-size: 11px;
    color: var(--green);
    margin-top: 6px;
    font-weight: 500;
}

.stat-card .stat-delta.down { color: var(--swiss-red); }

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 12px 0 12px;
}

.section-head h3 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.section-head .see-all {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--copper);
    cursor: pointer;
    text-decoration: none;
}

.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 24px;
}

.qa-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 14px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.qa-btn:hover {
    border-color: var(--copper);
    transform: translateY(-1px);
}

.qa-btn .qa-icon {
    width: 32px;
    height: 32px;
    background: var(--paper-warm);
    border-radius: 8px;
    display: grid;
    place-items: center;
}

.qa-btn .qa-icon svg { width: 18px; height: 18px; color: var(--copper); }

.qa-btn .qa-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
}

.qa-btn .qa-sub {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
}

.activity-list {
    background: white;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
}

.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line-soft);
}

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

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
    background: var(--muted-soft);
}

.activity-dot.success { background: var(--green); }
.activity-dot.error { background: var(--swiss-red); }
.activity-dot.pending { background: var(--amber); }

.activity-text {
    flex: 1;
    font-size: 13px;
    line-height: 1.4;
}

.activity-meta {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--muted);
    margin-top: 2px;
}

.activity-empty {
    padding: 24px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

/* ====================================================
   PRODUCTS LIST
   ==================================================== */

.search-row {
    margin-bottom: 12px;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    background: white;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: border 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--ink);
}

.filter-chips {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar { display: none; }

.chip {
    padding: 6px 12px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 100px;
    font-size: 12px;
    white-space: nowrap;
    cursor: pointer;
    color: var(--muted);
    font-family: inherit;
    transition: all 0.15s;
}

.chip.active {
    background: var(--ink);
    color: white;
    border-color: var(--ink);
}

.product-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.15s;
    align-items: center;
}

.product-card:hover { border-color: var(--copper); }

.product-card:active { transform: scale(0.99); }

.product-img {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1E2A3D 0%, #0F1B2D 100%);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.product-img.led { background: linear-gradient(135deg, #3D2A1E 0%, #2D1F15 100%); }
.product-img.qled { background: linear-gradient(135deg, #1E3D2A 0%, #15301F 100%); }
.product-img.oled { background: linear-gradient(135deg, #2A1E3D 0%, #1F152D 100%); }
.product-img.nanocell { background: linear-gradient(135deg, #1E2A3D 0%, #0F1B2D 100%); }

.product-img .tv-icon {
    width: 36px;
    height: 28px;
    border: 1.5px solid #C8985F;
    border-radius: 2px;
    position: relative;
}

.product-img .tv-icon::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 8px;
    right: 8px;
    height: 1.5px;
    background: #C8985F;
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-width: 0;
}

.product-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-meta {
    display: flex;
    gap: 8px;
    font-size: 11px;
    color: var(--muted);
    font-family: var(--font-mono);
}

.product-price {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--ink);
    align-self: center;
    white-space: nowrap;
}

.empty-state {
    padding: 60px 24px;
    text-align: center;
    color: var(--muted);
}

.empty-state .empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.empty-state .empty-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 500;
    color: var(--ink);
    margin-bottom: 4px;
}

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

/* ====================================================
   PRODUCT DETAIL
   ==================================================== */

.detail-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 16px;
    cursor: pointer;
    padding: 4px 0;
}

.detail-hero {
    width: 100%;
    aspect-ratio: 16/10;
    background: linear-gradient(135deg, #1E2A3D 0%, #0F1B2D 100%);
    border-radius: 16px;
    display: grid;
    place-items: center;
    margin-bottom: 12px;
    position: relative;
}

.detail-hero.led { background: linear-gradient(135deg, #3D2A1E 0%, #2D1F15 100%); }
.detail-hero.qled { background: linear-gradient(135deg, #1E3D2A 0%, #15301F 100%); }
.detail-hero.oled { background: linear-gradient(135deg, #2A1E3D 0%, #1F152D 100%); }

.detail-hero .tv-icon-large {
    width: 120px;
    height: 80px;
    border: 2px solid #C8985F;
    border-radius: 4px;
    position: relative;
}

.detail-hero .tv-icon-large::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 30px;
    right: 30px;
    height: 2px;
    background: #C8985F;
}

.detail-hero .img-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(15, 27, 45, 0.6);
    color: white;
    font-family: var(--font-mono);
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 100px;
}

.detail-thumbs {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
}

.thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    background: linear-gradient(135deg, #1E2A3D 0%, #0F1B2D 100%);
    cursor: pointer;
    flex-shrink: 0;
}

.thumb.qled { background: linear-gradient(135deg, #1E3D2A 0%, #15301F 100%); }
.thumb.oled { background: linear-gradient(135deg, #2A1E3D 0%, #1F152D 100%); }
.thumb.led { background: linear-gradient(135deg, #3D2A1E 0%, #2D1F15 100%); }

.thumb.add {
    background: white;
    border: 1px dashed var(--line);
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 12px;
}

.detail-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1.2;
    margin-bottom: 6px;
}

.detail-brand {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--copper);
    margin-bottom: 16px;
}

.detail-price-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 14px 16px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 16px;
}

.detail-price-row .currency {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted);
}

.detail-price-row .price {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 600;
    color: var(--ink);
}

.detail-price-row .negotiable {
    font-size: 11px;
    color: var(--muted);
    margin-left: auto;
    font-family: var(--font-mono);
}

.field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

.field-card {
    padding: 10px 12px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.field-card .field-label {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 2px;
}

.field-card .field-val {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
}

.status-badge-row {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-mono);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.status-badge.status-active { background: var(--green-soft); color: var(--green); }
.status-badge.status-draft { background: var(--amber-soft); color: var(--amber); }
.status-badge.status-sold { background: var(--paper-warm); color: var(--muted); }
.status-badge.status-archived { background: var(--paper-warm); color: var(--muted); }
.status-badge.status-info { background: var(--paper-warm); color: var(--ink); border: 1px solid var(--line); }

.detail-desc {
    background: white;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}

.detail-desc .field-label {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 6px;
}

.detail-desc .desc-text {
    font-size: 13px;
    line-height: 1.5;
    color: var(--ink-soft);
}

.keywords-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.keyword-pill {
    padding: 3px 8px;
    background: var(--paper-warm);
    border-radius: 100px;
    font-size: 11px;
    color: var(--ink-soft);
    font-family: var(--font-mono);
}

.detail-actions {
    display: flex;
    gap: 8px;
    margin: 24px 0 16px;
}

.phase-note {
    background: var(--amber-soft);
    border: 1px solid #E8D199;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 12px;
    color: var(--ink-soft);
    line-height: 1.5;
    margin-top: 16px;
}

.phase-note strong { color: var(--copper); }

/* ====================================================
   SETTINGS
   ==================================================== */

.settings-group {
    background: white;
    border: 1px solid var(--line);
    border-radius: 14px;
    margin-bottom: 12px;
    overflow: hidden;
}

.settings-group .group-title {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 12px 14px 8px;
    border-bottom: 1px solid var(--line-soft);
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line-soft);
}

.settings-row:last-child { border-bottom: 0; }
.settings-row .s-label { font-size: 13px; font-weight: 500; }
.settings-row .s-val { font-size: 12px; color: var(--muted); font-family: var(--font-mono); }

/* ====================================================
   BUTTONS
   ==================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: transform 0.1s, opacity 0.2s, background 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary {
    background: var(--ink);
    color: white;
    width: 100%;
}

.btn-primary:hover:not(:disabled) { background: var(--ink-soft); }

.btn-secondary {
    background: white;
    color: var(--ink);
    border: 1px solid var(--line);
    flex: 1;
}

.btn-secondary:hover:not(:disabled) { border-color: var(--copper); }

/* ====================================================
   TOAST
   ==================================================== */

.toast-container {
    position: fixed;
    bottom: calc(80px + var(--safe-area-bottom));
    left: 16px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: var(--ink);
    color: white;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    animation: toast-in 0.3s ease;
    pointer-events: auto;
    max-width: 448px;
    margin: 0 auto;
    width: 100%;
}

.toast.toast-success { background: var(--green); }
.toast.toast-error { background: var(--swiss-red); }
.toast.toast-warning { background: var(--amber); }

.toast.toast-out { animation: toast-out 0.3s ease forwards; }

@keyframes toast-in {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes toast-out {
    to { transform: translateY(20px); opacity: 0; }
}

.hidden { display: none !important; }
.text-center { text-align: center; }
.text-muted { color: var(--muted); }

/* ====================================================
   APP SHELL (Header + Content + Bottom-Nav)
   ==================================================== */

.app-header {
    padding: max(12px, var(--safe-area-top)) 20px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line-soft);
    background: var(--paper);
    flex-shrink: 0;
}

.app-header .brand { display: flex; flex-direction: column; gap: 2px; }
.app-header .brand-tag {
    font-family: var(--font-mono);
    font-size: 9px; letter-spacing: 0.15em;
    text-transform: uppercase; color: var(--copper);
}
.app-header .brand-name {
    font-family: var(--font-display);
    font-size: 18px; font-weight: 600; letter-spacing: -0.01em;
}
.app-header .header-icons { display: flex; gap: 12px; }
.icon-btn {
    width: 36px; height: 36px;
    background: var(--paper-warm);
    border: 1px solid var(--line);
    border-radius: 10px;
    display: grid; place-items: center;
}
.icon-btn svg { width: 18px; height: 18px; color: var(--ink); }

.app-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.screen-pad { padding: 16px 16px 24px; }

.bottom-nav {
    height: calc(64px + var(--safe-area-bottom));
    padding-bottom: var(--safe-area-bottom);
    border-top: 1px solid var(--line);
    background: rgba(250, 250, 247, .96);
    backdrop-filter: blur(12px);
    display: flex;
    flex-shrink: 0;
}
.bottom-nav .nav-item {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 3px; color: var(--muted);
    position: relative; font-size: 10px; font-weight: 500;
    -webkit-tap-highlight-color: transparent;
}
.bottom-nav .nav-item.active { color: var(--ink); }
.bottom-nav .nav-item.active::before {
    content: ''; position: absolute; top: 0;
    width: 28px; height: 2px;
    background: var(--copper); border-radius: 0 0 4px 4px;
}
.bottom-nav .nav-item svg { width: 20px; height: 20px; }

/* ====================================================
   LOADING / EMPTY / ERROR STATES
   ==================================================== */

.loading-inline {
    display: flex; justify-content: center;
    padding: 60px 20px;
}
.empty-hint {
    padding: 24px 16px; text-align: center;
    color: var(--muted); font-size: 13px; line-height: 1.5;
}
.error-box {
    margin: 16px; padding: 16px;
    background: var(--red-soft); border: 1px solid #F0C0BF;
    border-radius: var(--radius-md);
    color: var(--swiss-red); font-size: 13px;
}

/* ====================================================
   DASHBOARD
   ==================================================== */

.greeting { margin-bottom: 20px; }
.greeting .day {
    font-family: var(--font-mono);
    font-size: 10px; letter-spacing: 0.12em;
    text-transform: uppercase; color: var(--muted); margin-bottom: 4px;
}
.greeting h2 {
    font-family: var(--font-display);
    font-size: 28px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.1;
}
.greeting h2 em { font-style: italic; color: var(--copper); }

.stats-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 10px; margin-bottom: 24px;
}
.stat-card {
    padding: 16px; background: white;
    border: 1px solid var(--line); border-radius: 14px;
}
.stat-card.dark { background: var(--ink); color: white; border-color: var(--ink); }
.stat-card .stat-label {
    font-family: var(--font-mono);
    font-size: 9px; letter-spacing: 0.12em;
    text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
}
.stat-card.dark .stat-label { color: var(--muted-soft); }
.stat-card .stat-num {
    font-family: var(--font-display);
    font-size: 32px; font-weight: 500; line-height: 1; letter-spacing: -0.02em;
}
.stat-card .stat-delta { font-size: 11px; color: var(--green); margin-top: 6px; font-weight: 500; }
.stat-card .stat-delta.down { color: var(--swiss-red); }

.section-head {
    display: flex; align-items: center; justify-content: space-between;
    margin: 20px 0 12px;
}
.section-head h3 {
    font-family: var(--font-display);
    font-size: 18px; font-weight: 500; letter-spacing: -0.01em;
}
.section-head .see-all {
    font-family: var(--font-mono);
    font-size: 10px; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--copper); cursor: pointer;
}

/* Location bar */
.location-bar { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.loc-bar-track {
    display: flex; height: 12px; border-radius: 100px;
    overflow: hidden; margin-bottom: 12px; background: var(--line);
}
.loc-bar-seg { height: 100%; }
.loc-bar-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); }
.loc-bar-legend span { display: flex; align-items: center; gap: 6px; }
.loc-bar-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

/* Quick actions */
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qa-btn {
    display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
    padding: 14px; background: white;
    border: 1px solid var(--line); border-radius: 12px;
    text-align: left; transition: all 0.2s;
}
.qa-btn:active { transform: scale(0.98); }
.qa-icon {
    width: 32px; height: 32px; background: var(--paper-warm);
    border-radius: 8px; display: grid; place-items: center;
}
.qa-icon svg { width: 18px; height: 18px; color: var(--copper); }
.qa-label { font-size: 13px; font-weight: 600; color: var(--ink); }
.qa-sub { font-size: 11px; color: var(--muted); }

/* Activity list */
.activity-list { background: white; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.activity-item { display: flex; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.activity-item:last-child { border-bottom: 0; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.activity-dot.success { background: var(--green); }
.activity-dot.error { background: var(--swiss-red); }
.activity-dot.pending { background: var(--amber); }
.activity-text { flex: 1; font-size: 13px; line-height: 1.4; }
.activity-meta { font-family: var(--font-mono); font-size: 10px; color: var(--muted); margin-top: 2px; }

/* ====================================================
   PRODUCTS LIST
   ==================================================== */

.search-row { display: flex; gap: 8px; margin-bottom: 16px; }
.search-input {
    flex: 1; padding: 12px 16px; background: white;
    border: 1px solid var(--line); border-radius: 12px; font-size: 14px;
}
.search-input:focus { outline: none; border-color: var(--ink); }

.filter-chips {
    display: flex; gap: 6px; margin-bottom: 16px;
    overflow-x: auto; padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}
.filter-chips::-webkit-scrollbar { display: none; }
.chip {
    padding: 6px 12px; background: white; border: 1px solid var(--line);
    border-radius: 100px; font-size: 12px; white-space: nowrap; color: var(--muted);
}
.chip.active { background: var(--ink); color: white; border-color: var(--ink); }

.product-list { display: flex; flex-direction: column; gap: 8px; }
.product-card {
    display: flex; gap: 12px; padding: 12px;
    background: white; border: 1px solid var(--line); border-radius: 14px;
    transition: all 0.15s;
}
.product-card:active { transform: scale(0.99); border-color: var(--copper); }
.product-img {
    width: 64px; height: 64px; border-radius: 10px;
    background: linear-gradient(135deg, #1E2A3D 0%, #0F1B2D 100%);
    display: grid; place-items: center; flex-shrink: 0;
}
.product-img.led { background: linear-gradient(135deg, #3D2A1E 0%, #2D1F15 100%); }
.product-img.qled { background: linear-gradient(135deg, #1E3D2A 0%, #15301F 100%); }
.product-img.oled { background: linear-gradient(135deg, #2A1E3D 0%, #1F152D 100%); }
.product-img.nanocell { background: linear-gradient(135deg, #1E3A3D 0%, #15292D 100%); }
.product-img.miniled { background: linear-gradient(135deg, #3D1E2A 0%, #2D151F 100%); }
.tv-icon {
    width: 36px; height: 28px; border: 1.5px solid #C8985F;
    border-radius: 2px; position: relative;
}
.tv-icon::after {
    content: ''; position: absolute; bottom: -4px; left: 8px; right: 8px;
    height: 1.5px; background: #C8985F;
}
.product-info { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 3px; min-width: 0; }
.product-title {
    font-size: 14px; font-weight: 600; color: var(--ink);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.product-meta { font-size: 11px; color: var(--muted); font-family: var(--font-mono); }
.product-meta .sep { color: var(--line); }
.product-loc { font-size: 11px; color: var(--copper); }
.product-price {
    font-family: var(--font-display);
    font-size: 18px; font-weight: 600; color: var(--ink); align-self: center; flex-shrink: 0;
}

/* ====================================================
   PRODUCT DETAIL
   ==================================================== */

.detail-back {
    display: flex; align-items: center; gap: 8px;
    font-family: var(--font-mono); font-size: 11px;
    letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--muted); margin-bottom: 16px;
}
.detail-hero {
    width: 100%; aspect-ratio: 16/10; border-radius: 16px;
    display: grid; place-items: center; margin-bottom: 20px; position: relative;
    background: linear-gradient(135deg, #1E3D2A 0%, #15301F 100%);
}
.detail-hero.led { background: linear-gradient(135deg, #3D2A1E 0%, #2D1F15 100%); }
.detail-hero.qled { background: linear-gradient(135deg, #1E3D2A 0%, #15301F 100%); }
.detail-hero.oled { background: linear-gradient(135deg, #2A1E3D 0%, #1F152D 100%); }
.tv-icon-large {
    width: 120px; height: 80px; border: 2px solid #C8985F;
    border-radius: 4px; position: relative;
}
.tv-icon-large::after {
    content: ''; position: absolute; bottom: -10px; left: 30px; right: 30px;
    height: 2px; background: #C8985F;
}
.img-badge {
    position: absolute; bottom: 12px; right: 12px;
    background: rgba(15,27,45,.6); color: white;
    font-family: var(--font-mono); font-size: 10px;
    padding: 4px 8px; border-radius: 100px;
}
.detail-title {
    font-family: var(--font-display);
    font-size: 22px; font-weight: 500; letter-spacing: -0.01em;
    line-height: 1.2; margin-bottom: 6px;
}
.detail-brand {
    font-family: var(--font-mono); font-size: 11px;
    letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--copper); margin-bottom: 16px;
}
.detail-price-row {
    display: flex; align-items: baseline; gap: 12px;
    padding: 14px 16px; background: white;
    border: 1px solid var(--line); border-radius: 12px; margin-bottom: 16px;
}
.detail-price-row .currency { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.detail-price-row .price { font-family: var(--font-display); font-size: 28px; font-weight: 600; }
.detail-price-row .negotiable { font-size: 11px; color: var(--muted); margin-left: auto; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.field-card { padding: 10px 12px; background: white; border: 1px solid var(--line); border-radius: 10px; }
.field-label {
    font-family: var(--font-mono); font-size: 9px;
    letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px;
}
.field-val { font-size: 13px; font-weight: 500; color: var(--ink); }
.detail-desc { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 24px; }
.detail-desc .desc-text { font-size: 13px; line-height: 1.5; color: var(--ink-soft); margin-top: 6px; }
.detail-actions { display: flex; gap: 8px; }
.detail-actions .btn { flex: 1; }

/* ====================================================
   STUB SCREEN
   ==================================================== */
.stub-box {
    display: flex; flex-direction: column; align-items: center;
    text-align: center; padding: 60px 32px; gap: 12px;
}
.stub-icon {
    width: 64px; height: 64px; border-radius: 50%;
    background: var(--paper-warm); display: grid; place-items: center;
    color: var(--copper); margin-bottom: 8px;
}
.stub-icon svg { width: 32px; height: 32px; }
.stub-title { font-family: var(--font-display); font-size: 22px; font-weight: 500; }
.stub-message { font-size: 14px; color: var(--muted); line-height: 1.5; max-width: 300px; }
