/* ===== Ozon Bidder — Unified Design System ===== */

:root {
    --bg-body: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-card: rgba(255,255,255,0.55);
    --bg-card-solid: rgba(255,255,255,0.7);
    --bg-header: rgba(255,255,255,0.3);
    --bg-input: #ffffff;
    --bg-hover: #f2f2f7;
    --bg-nav-link: #f0f7ff;
    --bg-nav-link-active: #007aff;
    --bg-success: #d4edda;
    --bg-warning: #fff3cd;
    --bg-danger: #f8d7da;
    --bg-info: #d1ecf1;

    --text-primary: #1c1c1e;
    --text-secondary: #8e8e93;
    --text-muted: #aeaeb2;
    --text-white: #ffffff;

    --accent: #007aff;
    --accent-hover: #0056b3;
    --success: #34c759;
    --warning: #ff9500;
    --danger: #ff3b30;

    --border: #e5e5ea;
    --border-light: #f0f0f5;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);

    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

button, .btn, select, input { touch-action: manipulation; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ===== HEADER ===== */
.header {
    background: linear-gradient(135deg, rgba(102,126,234,0.85) 0%, rgba(118,75,162,0.85) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 16px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.header-brand h1 {
    font-size: 20px;
    font-weight: 600;
    color: white;
}

.header-brand a {
    padding: 4px 10px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 12px;
    color: white;
    background: rgba(255,255,255,0.15);
    transition: var(--transition);
}

.header-brand a:hover {
    background: rgba(255,255,255,0.25);
}

/* ===== NAVIGATION ===== */
.nav-links {
    display: flex;
    gap: 8px;
    margin-left: auto;
    align-items: center;
}

.nav-links a {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 13px;
    color: white;
    background: rgba(255,255,255,0.15);
    transition: var(--transition);
}

.nav-links a:hover {
    background: rgba(255,255,255,0.25);
}

.nav-links a.active {
    background: rgba(255,255,255,0.35);
    color: white;
}

/* ===== CONTAINER ===== */
.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transition: var(--transition);
}

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

.card-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.card-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    line-height: 1;
}

.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }

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

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

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

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

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input, .form-select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0,122,255,0.15);
}

/* ===== TABLE ===== */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th {
    text-align: left;
    padding: 10px 12px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
    background: #f9f9fb;
}

td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-light);
}

.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ===== TABS ===== */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: rgba(255,255,255,0.3);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-md);
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.tab {
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.tab:hover { color: var(--text-primary); background: var(--bg-hover); }
.tab.active { background: var(--accent); color: white; }

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

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    padding: 16px;
    border-left: 4px solid var(--accent);
    border-top: 1px solid rgba(255,255,255,0.6);
    border-right: 1px solid rgba(255,255,255,0.6);
    border-bottom: 1px solid rgba(255,255,255,0.6);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.stat-sub {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

.badge-success { background: var(--bg-success); color: var(--success); }
.badge-warning { background: var(--bg-warning); color: var(--warning); }
.badge-danger { background: var(--bg-danger); color: var(--danger); }
.badge-info { background: var(--bg-info); color: var(--accent); }

/* ===== ALERTS ===== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success { background: var(--bg-success); color: #155724; }
.alert-danger { background: var(--bg-danger); color: #721c24; }
.alert-warning { background: var(--bg-warning); color: #856404; }
.alert-info { background: var(--bg-info); color: #0c5460; }

/* ===== LOADING ===== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: var(--text-secondary);
    font-size: 14px;
    gap: 10px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ===== LOGOUT BUTTON ===== */
.btn-logout {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    border: none;
    background: rgba(255,59,48,0.8);
    color: white;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
}

.btn-logout:hover { background: rgba(255,59,48,0.9); }

/* ===== STATUS ===== */
.status {
    font-size: 13px;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 500;
}

.status-ok { background: rgba(52,199,89,0.8); color: white; }
.status-error { background: rgba(255,59,48,0.8); color: white; }

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

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.3s;
}

/* ===== TOGGLE SWITCH ===== */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--border);
    border-radius: 24px;
    transition: var(--transition);
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
}

input:checked + .toggle-slider { background: var(--success); }
input:checked + .toggle-slider::before { transform: translateX(20px); }

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

/* ===== UTILITY ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
