/* ============================================================
   ETSY SELLER HUB - Stylesheet
   Helles, professionelles Design
   ============================================================ */

:root {
    --etsy-orange: #F56400;
    --etsy-orange-light: #FFF3EC;
    --etsy-orange-mid: #FFD9BE;
    
    --bg-body: #F7F5F2;
    --bg-white: #FFFFFF;
    --bg-sidebar: #1C1917;
    --bg-card: #FFFFFF;
    
    --text-primary: #1C1917;
    --text-secondary: #6B6560;
    --text-muted: #9E9892;
    --text-sidebar: #D6D2CE;
    --text-sidebar-active: #FFFFFF;
    
    --border: #EAE8E4;
    --border-light: #F3F1EE;
    
    --green: #16A34A;
    --green-bg: #DCFCE7;
    --blue: #2563EB;
    --blue-bg: #DBEAFE;
    --amber: #D97706;
    --amber-bg: #FEF3C7;
    --red: #DC2626;
    --red-bg: #FEE2E2;
    --purple: #7C3AED;
    --purple-bg: #EDE9FE;
    
    --sidebar-width: 240px;
    --topbar-height: 72px;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

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

body {
    font-family: 'DM Sans', -apple-system, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header {
    padding: 20px 16px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

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

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--etsy-orange);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.logo-name {
    display: block;
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.2;
}

.logo-sub {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
}

.shop-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.shop-avatar {
    width: 34px;
    height: 34px;
    background: var(--etsy-orange);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 12px;
    flex-shrink: 0;
}

.shop-name {
    color: #fff;
    font-weight: 500;
    font-size: 13px;
}

.shop-status {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
    font-size: 11px;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: #22C55E;
    border-radius: 50%;
}

.nav-menu {
    list-style: none;
    padding: 8px 8px;
    flex: 1;
}

.nav-section-label {
    color: rgba(255,255,255,0.25);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 12px 8px 4px;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-sidebar);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 400;
    transition: background 0.15s, color 0.15s;
}

.nav-item a:hover {
    background: rgba(255,255,255,0.07);
    color: #fff;
}

.nav-item.active a {
    background: var(--etsy-orange);
    color: #fff;
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.phase-badge {
    font-size: 10px;
    color: rgba(255,255,255,0.2);
    text-align: center;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 0 28px;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar h1 {
    font-family: 'Fraunces', serif;
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 1px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.date-display {
    color: var(--text-muted);
    font-size: 13px;
}

.content-area {
    padding: 24px 28px;
    flex: 1;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 20px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
}

.card-subtitle {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 2px;
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 20px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--accent-color, var(--etsy-orange));
    border-radius: var(--radius) var(--radius) 0 0;
}

.stat-card.accent-green { --accent-color: var(--green); }
.stat-card.accent-blue  { --accent-color: var(--blue); }
.stat-card.accent-purple { --accent-color: var(--purple); }

.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    font-size: 18px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.stat-value {
    font-family: 'Fraunces', serif;
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.1;
}

.stat-change {
    font-size: 12px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 3px;
}

.stat-change.positive { color: var(--green); }
.stat-change.negative { color: var(--red); }

/* ============================================================
   TABELLEN
   ============================================================ */
.table-wrapper {
    overflow-x: auto;
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.data-table thead tr {
    border-bottom: 2px solid var(--border);
}

.data-table th {
    padding: 10px 12px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

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

.data-table tbody tr:hover {
    background: var(--bg-body);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-pending    { background: var(--amber-bg); color: var(--amber); }
.badge-processing { background: var(--blue-bg); color: var(--blue); }
.badge-shipped    { background: var(--purple-bg); color: var(--purple); }
.badge-delivered  { background: var(--green-bg); color: var(--green); }
.badge-cancelled  { background: var(--red-bg); color: var(--red); }
.badge-refunded   { background: #F3F4F6; color: #6B7280; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.15s;
}

.btn-primary {
    background: var(--etsy-orange);
    color: white;
}
.btn-primary:hover { background: #D95800; }

.btn-secondary {
    background: var(--bg-body);
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 6px 10px;
}
.btn-ghost:hover { background: var(--bg-body); color: var(--text-primary); }

.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ============================================================
   STERNE
   ============================================================ */
.star { font-size: 16px; }
.star-filled { color: #F59E0B; }
.star-empty { color: #D1D5DB; }

/* ============================================================
   CHART BARS (CSS-basiert)
   ============================================================ */
.mini-chart {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 48px;
}

.mini-bar {
    flex: 1;
    background: var(--etsy-orange-mid);
    border-radius: 3px 3px 0 0;
    min-height: 4px;
    transition: background 0.2s;
}

.mini-bar:hover { background: var(--etsy-orange); }

/* ============================================================
   GRID LAYOUTS
   ============================================================ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* ============================================================
   LEERE ZUSTÄNDE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state h3 { font-size: 16px; color: var(--text-secondary); margin-bottom: 6px; }

/* ============================================================
   FILTER / SEARCH BAR
   ============================================================ */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.search-input {
    padding: 8px 12px 8px 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    font-size: 13px;
    color: var(--text-primary);
    outline: none;
    width: 240px;
    position: relative;
}

.search-input:focus { border-color: var(--etsy-orange); }

.search-wrap {
    position: relative;
}

.search-wrap svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

select.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    font-size: 13px;
    color: var(--text-primary);
    outline: none;
    cursor: pointer;
}

select.filter-select:focus { border-color: var(--etsy-orange); }

/* ============================================================
   PRODUCT IMAGE PLACEHOLDER
   ============================================================ */
.listing-thumb {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    background: var(--etsy-orange-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

/* ============================================================
   PROGRESS BARS
   ============================================================ */
.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--etsy-orange);
    border-radius: 10px;
    transition: width 0.6s ease;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

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

.modal {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 28px;
    width: 90%;
    max-width: 520px;
    box-shadow: var(--shadow-md);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-family: 'Fraunces', serif;
    font-size: 18px;
    font-weight: 600;
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-group { margin-bottom: 14px; }
.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-white);
    outline: none;
    transition: border 0.15s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--etsy-orange);
}

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

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-success { background: var(--green-bg); color: var(--green); }
.alert-error   { background: var(--red-bg); color: var(--red); }
.alert-info    { background: var(--blue-bg); color: var(--blue); }
.alert-warning { background: var(--amber-bg); color: var(--amber); }

/* ============================================================
   TOPLISTE RANKING
   ============================================================ */
.rank-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.rank-1 { background: #FEF3C7; color: #D97706; }
.rank-2 { background: #F3F4F6; color: #6B7280; }
.rank-3 { background: #FEE2E2; color: #DC2626; }
.rank-other { background: var(--bg-body); color: var(--text-muted); }

/* ============================================================
   REVENUE CHART
   ============================================================ */
.revenue-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 80px;
    padding: 0 4px;
}

.rev-bar {
    flex: 1;
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    cursor: pointer;
    transition: opacity 0.15s;
    position: relative;
}

.rev-bar:hover { opacity: 0.75; }

.rev-bar-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: white;
    font-size: 10px;
    padding: 3px 6px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
}

.rev-bar:hover .rev-bar-tooltip { display: block; }

/* ============================================================
   UTILITIES
   ============================================================ */
.text-muted   { color: var(--text-muted); }
.text-small   { font-size: 12px; }
.text-right   { text-align: right; }
.text-center  { text-align: center; }
.font-bold    { font-weight: 600; }
.font-serif   { font-family: 'Fraunces', serif; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.flex  { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.nowrap { white-space: nowrap; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .main-content { margin-left: 0; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
