@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* =============================================
   Zakup — платформа закупок на понижение
   Sleek Dark Mode + Light Theme Toggle
   ============================================= */

/* --- Dark Theme (Default) --- */
:root {
    --primary: #38bdf8;
    --primary-dark: #0ea5e9;
    --primary-light: rgba(56, 189, 248, 0.12);
    --primary-glow: rgba(56, 189, 248, 0.25);

    /* Aliases — 3 color palette: primary + success + danger */
    --accent: var(--primary);
    --accent-light: var(--primary-light);
    --success: #34d399;
    --success-light: rgba(52, 211, 153, 0.12);
    --danger: #f87171;
    --danger-light: rgba(248, 113, 113, 0.12);
    --warning: var(--primary);
    --warning-light: var(--primary-light);
    --info: var(--primary);
    --info-light: var(--primary-light);

    /* Dark surfaces */
    --bg-base: #0b0f19;
    --bg-surface: #111827;
    --bg-elevated: #1e293b;
    --bg-overlay: #1e293b;

    /* Dark grays */
    --gray-50: #1e293b;
    --gray-100: #1e293b;
    --gray-200: rgba(255, 255, 255, 0.08);
    --gray-300: rgba(255, 255, 255, 0.12);
    --gray-400: #64748b;
    --gray-500: #94a3b8;
    --gray-600: #cbd5e1;
    --gray-700: #e2e8f0;
    --gray-800: #f1f5f9;
    --gray-900: #f8fafc;

    /* Borders & Radius */
    --border-color: rgba(255, 255, 255, 0.06);
    --border-subtle: rgba(255, 255, 255, 0.04);
    --radius: 12px;
    --radius-lg: 20px;

    /* Shadows */
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 40px rgba(56, 189, 248, 0.08);

    /* Glassmorphism (dark) */
    --glass-bg: rgba(17, 24, 39, 0.7);
    --glass-border: 1px solid rgba(255, 255, 255, 0.06);

    /* Card */
    --card-bg: rgba(30, 41, 59, 0.6);
    --card-border: 1px solid rgba(255, 255, 255, 0.06);
    --card-hover-border: rgba(56, 189, 248, 0.2);

    /* Inputs */
    --input-bg: rgba(15, 23, 42, 0.8);
    --input-border: rgba(255, 255, 255, 0.1);
    --input-focus-border: var(--primary);
    --input-focus-glow: rgba(56, 189, 248, 0.2);

    /* Text */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Login */
    --login-bg: radial-gradient(ellipse at 20% 50%, rgba(56, 189, 248, 0.08) 0%, transparent 50%),
                var(--bg-base);

    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --theme-transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Light Theme --- */
[data-theme="light"] {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: rgba(59, 130, 246, 0.08);
    --primary-glow: rgba(59, 130, 246, 0.15);

    --accent: var(--primary);
    --accent-light: var(--primary-light);
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.08);
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.08);
    --warning: var(--primary);
    --warning-light: var(--primary-light);
    --info: var(--primary);
    --info-light: var(--primary-light);

    /* Light surfaces */
    --bg-base: #f8fafc;
    --bg-surface: #ffffff;
    --bg-elevated: #ffffff;
    --bg-overlay: #ffffff;

    /* Light grays */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Borders */
    --border-color: rgba(0, 0, 0, 0.08);
    --border-subtle: rgba(0, 0, 0, 0.04);

    /* Shadows */
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 40px rgba(59, 130, 246, 0.06);

    /* Glassmorphism (light) */
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: 1px solid rgba(255, 255, 255, 0.6);

    /* Card */
    --card-bg: rgba(255, 255, 255, 0.8);
    --card-border: 1px solid rgba(0, 0, 0, 0.06);
    --card-hover-border: rgba(59, 130, 246, 0.3);

    /* Inputs */
    --input-bg: rgba(255, 255, 255, 0.9);
    --input-border: rgba(0, 0, 0, 0.12);
    --input-focus-border: var(--primary);
    --input-focus-glow: rgba(59, 130, 246, 0.15);

    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    /* Login */
    --login-bg: radial-gradient(ellipse at 30% 20%, hsla(220,100%,94%,1) 0%, transparent 50%),
                var(--bg-base);
}

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-base);
    background-image:
        radial-gradient(ellipse at 15% 80%, rgba(56, 189, 248, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 20%, rgba(129, 140, 248, 0.03) 0%, transparent 50%);
    background-attachment: fixed;
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color var(--theme-transition),
                color var(--theme-transition);
}

[data-theme="light"] body {
    background-image:
        radial-gradient(at 40% 20%, hsla(220,100%,94%,1) 0px, transparent 50%),
        radial-gradient(at 80% 0%, hsla(280,100%,96%,1) 0px, transparent 50%),
        radial-gradient(at 0% 50%, hsla(190,100%,94%,1) 0px, transparent 50%),
        radial-gradient(at 80% 100%, hsla(240,100%,96%,1) 0px, transparent 50%);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* --- Container --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Header --- */
.header {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: var(--glass-border);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background var(--theme-transition),
                border-color var(--theme-transition);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary) !important;
    letter-spacing: -0.5px;
    transition: color var(--theme-transition);
}

.logo:hover {
    color: var(--primary) !important;
}

.header nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header nav a {
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding: 7px 14px;
    border-radius: var(--radius);
    transition: all var(--transition);
    font-weight: 500;
}

.header nav a:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.header nav a[style*="font-weight:600"] {
    color: var(--primary);
    background: var(--primary-light);
}

/* --- Theme Toggle --- */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 1.1rem;
    line-height: 1;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.theme-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
    transform: rotate(15deg);
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: inline; }

[data-theme="light"] .theme-toggle .icon-sun { display: inline; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
    font-family: inherit;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 12px var(--primary-glow);
}

.btn-primary:hover {
    box-shadow: 0 4px 20px var(--primary-glow);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
    border-color: var(--success);
    box-shadow: 0 2px 12px rgba(52, 211, 153, 0.2);
}

.btn-success:hover {
    background: #059669;
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
    box-shadow: 0 2px 12px rgba(248, 113, 113, 0.2);
}

.btn-danger:hover {
    background: #dc2626;
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: #1e293b;
    border-color: var(--warning);
}

.btn-warning:hover {
    background: #d97706;
    color: #1e293b;
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-outline:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 8px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* --- Forms --- */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input, input[type="text"], input[type="number"], input[type="password"],
input[type="email"], input[type="datetime-local"], select, textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.95rem;
    font-family: inherit;
    border: 1px solid var(--input-border);
    border-radius: var(--radius);
    background: var(--input-bg);
    color: var(--text-primary);
    transition: all var(--transition);
    outline: none;
}

.input:focus, input:focus, select:focus, textarea:focus {
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 3px var(--input-focus-glow);
}

.input::placeholder, input::placeholder, textarea::placeholder {
    color: var(--text-muted);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* --- Alerts --- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 0.875rem;
    margin-bottom: 16px;
    border: 1px solid transparent;
    backdrop-filter: blur(8px);
}

.alert-error {
    background: var(--danger-light);
    color: var(--danger);
    border-color: rgba(248, 113, 113, 0.2);
}

.alert-success {
    background: var(--success-light);
    color: var(--success);
    border-color: rgba(52, 211, 153, 0.2);
}

.alert-warning {
    background: var(--warning-light);
    color: var(--warning);
    border-color: rgba(251, 191, 36, 0.2);
}

.alert-info {
    background: var(--info-light);
    color: var(--info);
    border-color: rgba(56, 189, 248, 0.2);
}

/* --- Cards --- */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: var(--card-border);
    overflow: hidden;
    transition: all var(--transition),
                background var(--theme-transition),
                border-color var(--theme-transition);
}

.card:hover {
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
}

[data-theme="light"] .card-header {
    background: rgba(0, 0, 0, 0.015);
}

.card-header h2, .card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
}

.card-actions {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.01);
}
.btn-hint-wrap {
    display: inline-block;
}
.btn-hint {
    display: none;
}

[data-theme="light"] .card-actions {
    background: rgba(0, 0, 0, 0.01);
}

/* --- Tables --- */
.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

th {
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.02);
    white-space: nowrap;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

[data-theme="light"] th {
    background: rgba(0, 0, 0, 0.02);
}

tr:hover td {
    background: rgba(56, 189, 248, 0.03);
}

[data-theme="light"] tr:hover td {
    background: rgba(59, 130, 246, 0.03);
}

/* --- Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-draft { background: var(--gray-200); color: var(--text-secondary); }
.badge-notified { background: var(--info-light); color: var(--info); }
.badge-active { background: var(--success-light); color: var(--success); }
.badge-extended { background: var(--warning-light); color: var(--warning); }
.badge-finished { background: var(--gray-200); color: var(--text-muted); }

/* --- Login --- */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--login-bg);
    padding: 20px;
    transition: background var(--theme-transition);
}

.login-card {
    background: var(--card-bg);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 48px;
    width: 100%;
    max-width: 440px;
    position: relative;
    transition: background var(--theme-transition),
                border-color var(--theme-transition);
}

.login-logo {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.login-footer a {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.login-footer a:hover {
    color: var(--primary);
}

/* Login theme toggle */
.login-theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
}

/* --- Page Header --- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 24px 0 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.page-header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* --- Admin Dashboard: Lot Grid --- */
.lot-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 24px;
}

.lot-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: var(--card-border);
    transition: all var(--transition);
    overflow: hidden;
}

.lot-card:hover {
    box-shadow: var(--shadow-md), var(--shadow-glow);
    border-color: var(--card-hover-border);
}

.lot-card .card-body {
    padding: 20px;
}

.lot-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.lot-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.lot-card-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.5;
}

.lot-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
    margin-bottom: 8px;
}

.lot-meta-item {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.lot-meta-item strong {
    display: block;
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.lot-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

/* --- Participants Section --- */
.participants-section {
    margin-top: 32px;
}

.participant-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.participant-info {
    display: flex;
    flex-direction: column;
}

.participant-name {
    font-weight: 500;
    color: var(--text-primary);
}

.participant-email {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.add-participant-form {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    align-items: flex-end;
}

.add-participant-form .form-group {
    margin-bottom: 0;
    flex: 1;
}

/* --- Auction Page --- */
.auction-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    margin-top: 24px;
    margin-bottom: 40px;
    align-items: start;
}

.auction-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auction-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 80px;
}

/* Price display */
.price-display {
    text-align: center;
    padding: 24px;
}

.price-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.price-value {
    font-size: 2.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

[data-theme="light"] .price-value {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.price-start {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Current price (auction page) */
.current-price {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 8px 0;
}

/* Timer */
.timer-block {
    text-align: center;
    padding: 16px;
    background: var(--bg-elevated);
    border-radius: var(--radius);
    margin-top: 12px;
    border: 1px solid var(--border-color);
}

.timer-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.timer-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.timer-value.timer-warning {
    color: var(--warning);
}

.timer-value.timer-danger {
    color: var(--danger);
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Bid form */
.bid-form {
    padding: 20px;
}

.bid-input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.bid-input-group input {
    flex: 1;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
}

.bid-hints {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

.bid-hints span {
    display: inline-block;
    margin: 0 8px;
}

.bid-quick-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 12px;
}

.bid-quick-btn {
    padding: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
    font-family: inherit;
}

.bid-quick-btn:hover {
    background: var(--primary);
    color: white;
}

/* Bid list */
.bid-list {
    max-height: 400px;
    overflow-y: auto;
}

.bid-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition);
}

.bid-item:first-child {
    background: var(--success-light);
}

.bid-item-price, .bid-price {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

.bid-item-time, .bid-time {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.bid-item-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.bid-item.bid-new {
    animation: bidFlash 1s ease;
}

.bid-item.bid-best {
    background: var(--success-light);
}

@keyframes bidFlash {
    0% { background: var(--primary-light); }
    100% { background: transparent; }
}

/* Status overlay */
.auction-status-overlay {
    text-align: center;
    padding: 40px 20px;
}

.auction-status-overlay h2 {
    font-size: 1.3rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.auction-status-overlay p {
    color: var(--text-muted);
}

/* Connection indicator */
.connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 8px 16px;
}

.connection-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.connection-dot.connected, .online-dot {
    background: var(--success);
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.4);
}

.connection-dot.disconnected {
    background: var(--danger);
    box-shadow: 0 0 8px rgba(248, 113, 113, 0.4);
}

/* --- Monitor Page --- */
.monitor-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    margin-top: 24px;
    margin-bottom: 40px;
    align-items: start;
}

.monitor-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.monitor-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 80px;
}

.online-list {
    list-style: none;
}

.online-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    flex-shrink: 0;
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.4);
}

.monitor-stat {
    text-align: center;
    padding: 16px;
}

.monitor-stat-value {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.monitor-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Audit log */
.log-item {
    padding: 8px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8rem;
}

.log-item-time {
    color: var(--text-muted);
    font-family: 'SF Mono', 'Fira Code', monospace;
    margin-right: 8px;
}

.log-item-action {
    font-weight: 500;
    color: var(--text-secondary);
}

.log-item-details {
    color: var(--text-muted);
    margin-left: 4px;
}

.log-list {
    max-height: 300px;
    overflow-y: auto;
}

/* --- Results Page --- */
.results-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.summary-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: var(--card-border);
    padding: 20px;
    text-align: center;
    transition: all var(--transition);
}

.summary-card:hover {
    box-shadow: var(--shadow-md), var(--shadow-glow);
    border-color: var(--card-hover-border);
}

.summary-value {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    margin-bottom: 4px;
}

.summary-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Result detail layout */
.result-detail-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    margin-bottom: 40px;
    align-items: start;
}

.result-detail-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.result-detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 80px;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.detail-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.detail-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.empty-state p {
    font-size: 0.9rem;
    margin-bottom: 16px;
}

/* --- Dashboard lot cards --- */
.lot-list { display: flex; flex-direction: column; gap: 16px; }
.lot-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    transition: border-color 0.2s;
}
.lot-card:hover { border-color: var(--primary); }
.lot-card--active { border-left: 4px solid var(--success); }
.lot-card--extended { border-left: 4px solid var(--warning); }
.lot-card--finished { border-left: 4px solid var(--text-muted); }
.lot-card-header { flex: 1; }
.lot-card-header h3 { margin: 4px 0 8px; font-size: 1.1rem; }
.lot-card-meta { display: flex; gap: 8px; align-items: center; }
.lot-number { font-size: 0.8rem; color: var(--text-muted); }
.lot-description { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 8px; }
.lot-price { font-size: 0.9rem; margin-bottom: 4px; }
.lot-card-actions { flex-shrink: 0; }
.empty-icon { font-size: 3rem; margin-bottom: 12px; }
.input-sm { padding: 4px 8px; font-size: 0.85rem; border: 1px solid var(--border); border-radius: 6px; background: var(--card-bg); color: var(--text); }
@media (max-width: 600px) {
    .lot-card { flex-direction: column; align-items: stretch; }
    .lot-card-actions { text-align: center; }
}

/* --- Utility --- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.8rem; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

/* Price formatting */
.price {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Scrollbar styling (dark) */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .auction-layout {
        grid-template-columns: 1fr;
    }

    .auction-sidebar {
        position: static;
    }

    .monitor-layout {
        grid-template-columns: 1fr;
    }

    .monitor-sidebar {
        position: static;
    }

    .result-detail-grid {
        grid-template-columns: 1fr;
    }

    .result-detail-sidebar {
        position: static;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .lot-meta {
        grid-template-columns: 1fr 1fr;
    }

    .price-value, .current-price {
        font-size: 2rem;
    }

    .bid-quick-buttons {
        grid-template-columns: repeat(2, 1fr);
    }

    .add-participant-form {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    .login-card {
        padding: 24px;
    }

    .lot-meta {
        grid-template-columns: 1fr;
    }

    .lot-actions {
        flex-direction: column;
    }

    .lot-actions .btn {
        width: 100%;
    }
}
/* --- JTBD Auction Panel Updates --- */
.bid-panel-wrapper { position: sticky; bottom: 20px; z-index: 50; margin-top: 24px; }
.fast-bid-group { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 20px; }
@media (min-width: 600px) { .fast-bid-group { grid-template-columns: repeat(4, 1fr); } }
.fast-bid-btn { font-weight: 600; font-family: monospace; white-space: nowrap; }
.bid-input-wrapper { margin-bottom: 16px; }
.bid-input-group { position: relative; display: flex; align-items: center; }
.bid-input-group input { font-size: 1.5rem; font-weight: 700; font-family: monospace; padding-right: 40px; text-align: center; border-width: 2px; }
.currency-label { position: absolute; right: 16px; font-size: 1.2rem; color: var(--text-muted); font-weight: bold; }
.bid-stats { margin-top: 8px; font-weight: 500; font-family: monospace; }
.bid-submit-btn { text-transform: uppercase; letter-spacing: 1px; box-shadow: 0 4px 15px var(--primary-glow); font-size: 1.1rem; }
.bid-submit-btn:active { transform: scale(0.98); }
@keyframes slideDownHighlight { 0% { opacity: 0; transform: translateY(-10px); background-color: var(--primary-glow); } 100% { opacity: 1; transform: translateY(0); background-color: transparent; } }
.new-bid-anim { animation: slideDownHighlight 1.5s cubic-bezier(0.4, 0, 0.2, 1); }
@keyframes urgencyPulse { 0% { color: var(--text-primary); text-shadow: none; } 50% { color: var(--warning); text-shadow: 0 0 10px var(--warning-light); } 100% { color: var(--text-primary); text-shadow: none; } }
.timer.urgent { animation: urgencyPulse 1.5s ease-in-out 3; }

/* --- Доторговка: крупный пурпурный badge + таймер --- */
.badge-extended,
#lotStatus.badge-extended {
    background: rgba(168, 85, 247, 0.20);
    color: #e9d5ff;           /* light purple — читается и в dark, и в light */
    font-size: 1.1rem;
    padding: 8px 18px;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.35), 0 0 12px rgba(168, 85, 247, 0.25);
}
/* Light theme — darker purple for readability */
[data-theme="light"] .badge-extended,
[data-theme="light"] #lotStatus.badge-extended {
    background: rgba(168, 85, 247, 0.14);
    color: #7e22ce;
}
/* Extended mode: center badge + timer, wsStatus keeps its own spot */
.auction-status-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.auction-status-row:has(.badge-extended) {
    justify-content: center;
    gap: 16px;
    padding: 8px 0;
}
.auction-status-row:has(.badge-extended) .connection-status {
    flex-basis: 100%;
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.7;
}
.auction-status-row:has(.badge-extended) .timer,
.auction-status-row:has(#lotStatus.badge-extended) .timer {
    font-size: 2.2rem;
    color: #ef4444;                         /* ярко-красный — dark theme */
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    padding: 4px 14px;
    background: rgba(239, 68, 68, 0.12);
    border-radius: 10px;
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.35);
    animation: extendedPulse 2s ease-in-out 3;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.35);
}
[data-theme="light"] .auction-status-row:has(.badge-extended) .timer {
    color: #dc2626;                         /* насыщенный красный на светлом */
    background: rgba(239, 68, 68, 0.10);
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.45);
    font-weight: 800;
    text-shadow: none;
}
[data-theme="light"] .badge-extended,
[data-theme="light"] #lotStatus.badge-extended {
    color: #9333ea;                         /* насыщенный пурпурный */
    background: rgba(168, 85, 247, 0.14);
    box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.45);
    font-weight: 800;
}
@keyframes extendedPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.45), 0 0 0 1px rgba(168, 85, 247, 0.35); }
    50%      { box-shadow: 0 0 0 10px rgba(168, 85, 247, 0), 0 0 0 1px rgba(168, 85, 247, 0.35); }
}

.extension-note {
    background: rgba(168, 85, 247, 0.08);
    border-left: 3px solid rgba(168, 85, 247, 0.5);
    color: var(--text-secondary);
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 12px;
    font-size: 0.92rem;
    line-height: 1.45;
}
.extension-note b { color: #d8b4fe; }
[data-theme="light"] .extension-note { background: rgba(168, 85, 247, 0.07); color: var(--text-secondary); }
[data-theme="light"] .extension-note b { color: #7e22ce; }

.btn-icon { padding: 6px; border-radius: 50%; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.price-pulsed { background: var(--primary-light) !important; }
.price-updated { color: var(--success); transform: scale(1.05); transition: all 0.2s; }


/* --- Auction split layout (history left, bid panel right) --- */
.auction-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
    align-items: start;
}
.auction-split .bid-panel-wrapper { position: static; margin-top: 0; }
.auction-split .auction-history-col .bid-list {
    max-height: 520px;
    overflow-y: auto;
}
@media (max-width: 860px) {
    .auction-split { grid-template-columns: 1fr; gap: 8px; margin-top: 8px; }
    .auction-split .auction-history-col { order: 2; }
    .auction-split .bid-panel-wrapper  { order: 1; }
}

/* --- Mobile compact auction page --- */
@media (max-width: 600px) {
    /* Compact header */
    .lot-header h1 { font-size: 1rem; margin-bottom: 4px; }
    .lot-header p { font-size: 0.8rem; margin-bottom: 4px; }
    .lot-header .lot-status-bar { gap: 6px; font-size: 0.8rem; }

    /* Compact price card */
    .price-card .card-body { padding: 8px 12px; }
    .current-price { font-size: 1.5rem; margin: 2px 0; }

    /* Compact bid panel */
    .bid-panel .card-header { padding: 8px 12px 4px; }
    .bid-panel .card-body { padding: 6px 12px 12px; }
    .fast-bid-group { gap: 4px; margin-bottom: 8px; }
    .fast-bid-btn { font-size: 0.8rem; padding: 6px 4px; }
    .bid-input-group input { font-size: 1.2rem; padding: 8px; }
    .currency-label { font-size: 1rem; right: 10px; }
    .bid-submit-btn { font-size: 0.9rem; padding: 10px; }
    .bid-input-wrapper { margin-bottom: 8px; }

    /* Hide sound banner on mobile to save space */
    #soundBanner { display: none !important; }

    /* Compact cards */
    .card { margin-bottom: 6px; }
    .card-header { padding: 8px 12px; }
    .card-header h3 { font-size: 0.9rem; }

    /* Compact bid history */
    .bid-list { max-height: 150px; }
    .bid-item { padding: 4px 8px; font-size: 0.8rem; }

    /* Compact waiting screen */
    .waiting-icon { font-size: 2rem; }
    .waiting-card h2 { font-size: 1.1rem; }
    .waiting-card p { font-size: 0.8rem; margin: 4px 0; }

    /* Hide description on mobile */
    .hide-mobile { display: none !important; }

    /* Reduce overall spacing */
    .container { padding: 0 8px; }
    .page-header { margin-bottom: 6px; }
    .page-header h1 { font-size: 1rem; }

    /* Auction header compact */
    .auction-header { margin-bottom: 4px; }
    .auction-header h1 { font-size: 1rem; line-height: 1.2; }
    .auction-status-row { margin-top: 4px; }
    .extension-note { font-size: 0.75rem; padding: 6px 8px; }
}

/* --- Lot status borders (admin dashboard) --- */
.lot-card { transition: border-color 0.2s, box-shadow 0.2s; }
.lot-card.lot-status-active,
.lot-card.lot-status-extended {
    border: 2px solid var(--success);
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.12);
}
.lot-card.lot-status-finished {
    border: 2px solid var(--danger);
    opacity: 0.9;
}
.lot-card.lot-status-draft {
    border: 2px dashed var(--gray-400);
}
.lot-card.lot-status-notified {
    border: 2px solid var(--warning);
}

/* ===== MOBILE: compact auction — everything on one screen ===== */
@media (max-width: 600px) {
    .hide-mobile { display: none !important; }
    .container { padding: 0 6px; }

    /* Header: tight single line */
    .header .container { padding: 0 8px; }
    .header .logo { font-size: 0.9rem; }
    .auction-header { margin-bottom: 0; }
    .auction-header h1 { font-size: 0.8rem; line-height: 1.3; margin: 0; text-align: center; }
    .auction-status-row { margin-top: 2px; gap: 4px; flex-wrap: nowrap; }
    .auction-status-row .badge { font-size: 0.65rem; padding: 1px 5px; }
    .auction-status-row .timer { font-size: 0.8rem; }
    .auction-status-row .connection-status { font-size: 0.65rem; }

    /* Доторговка на мобилке: компактно в одну строку */
    .badge-extended, #lotStatus.badge-extended { font-size: 0.65rem !important; padding: 2px 6px !important; }
    .auction-status-row:has(.badge-extended) { justify-content: flex-start; gap: 6px; padding: 0; }
    .auction-status-row:has(.badge-extended) .timer,
    .auction-status-row:has(#lotStatus.badge-extended) .timer {
        font-size: 0.9rem !important; padding: 2px 6px !important; border-radius: 4px;
    }
    .auction-status-row:has(.badge-extended) .connection-status { flex-basis: auto; font-size: 0.6rem; }

    /* Price: no card wrapper, just the number */
    .price-card { margin-bottom: 0; border: none; background: none; box-shadow: none; }
    .price-card .card-body { padding: 2px 0; text-align: center; }
    .current-price { font-size: 1.4rem; margin: 0; line-height: 1; }
    .price-card .text-sm { font-size: 0.65rem; }

    /* Hide sound banner */
    #soundBanner { display: none !important; }

    /* Split layout: bid panel first, minimal gap */
    .auction-split { gap: 2px; margin-top: 0; }

    /* Bid panel: remove chrome */
    .bid-panel { border-radius: 6px; }
    .bid-panel .card-header { padding: 3px 8px 0; }
    .bid-panel .card-header h3 { font-size: 0.75rem; margin: 0; }
    .bid-panel .card-body { padding: 3px 8px 6px; }
    .bid-panel .card-body > p { font-size: 0.65rem; margin-bottom: 3px; }

    /* Fast-bid: always 4 columns, tiny */
    .fast-bid-group { grid-template-columns: repeat(4, 1fr) !important; gap: 3px; margin-bottom: 4px; }
    .fast-bid-btn { font-size: 0.6rem; padding: 4px 1px; border-radius: 4px; min-height: 0; }

    /* Input row: compact */
    .bid-input-wrapper { margin-bottom: 3px; }
    .bid-input-wrapper > label { font-size: 0.7rem; margin-bottom: 1px; display: block; }
    .bid-input-group input { font-size: 1rem; padding: 5px 6px; border-radius: 4px; }
    .currency-label { font-size: 0.8rem; right: 6px; }
    .bid-stats { font-size: 0.6rem; margin-top: 1px; }

    /* Submit button: compact but tappable */
    .bid-submit-btn { font-size: 0.8rem; padding: 8px; letter-spacing: 0; border-radius: 5px; margin-top: 2px; }

    /* History: very small, below fold is OK */
    .auction-history-col .card-header { padding: 3px 8px; }
    .auction-history-col .card-header h3 { font-size: 0.75rem; }
    .bid-list { max-height: 80px; overflow-y: auto; }
    .bid-item { padding: 1px 6px; font-size: 0.7rem; line-height: 1.3; }
    .empty-state { padding: 6px; }
    .empty-state p { font-size: 0.7rem; margin: 0; }
    .card { margin-bottom: 2px; }

    /* Page header */
    .page-header { margin-bottom: 2px; }
    .page-header h1 { font-size: 0.85rem; }

    /* Nav bar compact */
    nav { gap: 4px; font-size: 0.75rem; }
    nav .btn-sm { font-size: 0.7rem; padding: 2px 6px; }
}
