:root {
    --plotina-red: #c8102e;
    --plotina-red-light: #e63950;
    --plotina-dark: #0a0a0f;
    --plotina-panel: #12121a;
    --plotina-card: rgba(30, 30, 42, 0.75);
    --plotina-border: rgba(255, 255, 255, 0.08);
    --plotina-text: #e8e8ec;
    --plotina-muted: #8b8b9a;
    --plotina-accent: #c8102e;
    --plotina-accent-glow: rgba(200, 16, 46, 0.25);
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    --transition: all 0.2s ease;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--plotina-text);
    background: var(--plotina-dark);
    line-height: 1.5;
    min-height: 100vh;
}

/* Login page */
.login-page {
    background: radial-gradient(circle at 30% 20%, rgba(200, 16, 46, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(60, 60, 80, 0.4) 0%, transparent 50%),
                var(--plotina-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-wrapper {
    width: 100%;
    max-width: 440px;
}

.glass {
    background: var(--plotina-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--plotina-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.login-card {
    padding: 40px;
    text-align: center;
}

.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 28px;
}

.logo-large {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--plotina-red) 0%, var(--plotina-red-light) 100%);
    color: white;
    font-weight: 800;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    box-shadow: 0 8px 24px var(--plotina-accent-glow);
}

.logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--plotina-red) 0%, var(--plotina-red-light) 100%);
    color: white;
    font-weight: 800;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.brand-name { font-weight: 800; font-size: 1.3rem; letter-spacing: 0.5px; color: white; }
.brand-sub { font-size: 0.85rem; color: var(--plotina-muted); }

.login-card h1 { margin: 24px 0 8px; font-size: 1.6rem; color: white; font-weight: 700; }
.login-desc { color: var(--plotina-muted); margin-bottom: 28px; font-size: 0.95rem; }

.input-group { text-align: left; margin-bottom: 20px; }
.input-group label { display: block; margin-bottom: 8px; font-size: 0.9rem; font-weight: 500; color: var(--plotina-text); }
.input-group input {
    width: 100%;
    padding: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--plotina-border);
    border-radius: var(--radius-sm);
    color: white;
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}
.input-group input:focus { border-color: var(--plotina-red); box-shadow: 0 0 0 3px var(--plotina-accent-glow); }

.btn-primary {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--plotina-red) 0%, var(--plotina-red-light) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 16px var(--plotina-accent-glow);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 24px var(--plotina-accent-glow); }

.login-footer { margin-top: 24px; font-size: 0.8rem; color: var(--plotina-muted); }

.alert {
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.9rem;
}
.alert.error { background: rgba(200, 16, 46, 0.15); color: #ff8a9a; border: 1px solid rgba(200, 16, 46, 0.3); }

/* Dashboard layout */
.dashboard-page {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--plotina-panel);
    border-right: 1px solid var(--plotina-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px;
    border-bottom: 1px solid var(--plotina-border);
}

.project-badge {
    margin: 20px 20px 10px;
    padding: 16px;
    background: rgba(200, 16, 46, 0.12);
    border: 1px solid rgba(200, 16, 46, 0.25);
    border-radius: var(--radius-sm);
}
.project-label { display: block; font-size: 0.75rem; color: var(--plotina-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.project-name { display: block; color: white; font-size: 0.95rem; font-weight: 600; }

.nav-menu { flex: 1; padding: 12px; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    color: var(--plotina-muted);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 4px;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.04); color: var(--plotina-text); }
.nav-item.active { background: rgba(200, 16, 46, 0.15); color: white; border: 1px solid rgba(200, 16, 46, 0.25); }

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--plotina-border);
    font-size: 0.8rem;
    color: var(--plotina-muted);
}
.sidebar-footer a { display: block; margin-top: 8px; color: var(--plotina-red-light); text-decoration: none; }

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 24px 28px;
    max-width: calc(100% - 260px);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
    padding: 12px 18px;
    background: var(--plotina-card);
    border: 1px solid var(--plotina-border);
    border-radius: var(--radius-sm);
    backdrop-filter: blur(12px);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    max-width: 420px;
}
.search-box input {
    background: transparent;
    border: none;
    color: var(--plotina-text);
    font-size: 0.95rem;
    outline: none;
    width: 100%;
}
.search-box input::placeholder { color: var(--plotina-muted); }

.topbar-actions { display: flex; align-items: center; gap: 14px; }
.user-chip {
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--plotina-border);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--plotina-muted);
}
.help-link { color: var(--plotina-muted); text-decoration: none; font-size: 0.9rem; }
.help-link:hover { color: var(--plotina-red-light); }

.section { display: none; }
.section.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.section-header { margin-bottom: 24px; }
.section-header h1 { margin: 0; font-size: 1.5rem; color: white; }
.section-header p { margin: 6px 0 0; color: var(--plotina-muted); font-size: 0.95rem; }

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--plotina-card);
    border: 1px solid var(--plotina-border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: var(--transition);
}
.stat-card:hover { border-color: rgba(255, 255, 255, 0.15); transform: translateY(-2px); }
.stat-icon {
    width: 48px;
    height: 48px;
    background: rgba(200, 16, 46, 0.12);
    border: 1px solid rgba(200, 16, 46, 0.25);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}
.stat-info { display: flex; flex-direction: column; }
.stat-label { font-size: 0.8rem; color: var(--plotina-muted); }
.stat-value { font-size: 1.5rem; color: white; font-weight: 700; }
.stat-card.completion .stat-icon { background: rgba(39, 174, 96, 0.12); border-color: rgba(39, 174, 96, 0.25); }

/* Dashboard grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}
@media (max-width: 1100px) { .dashboard-grid { grid-template-columns: 1fr; } }

.panel {
    background: var(--plotina-card);
    border: 1px solid var(--plotina-border);
    border-radius: var(--radius);
    padding: 22px;
    backdrop-filter: blur(12px);
}
.panel h2 { margin-top: 0; font-size: 1.05rem; color: white; margin-bottom: 18px; font-weight: 600; }

/* Lots grid */
.lots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}
.lot-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--plotina-border);
    border-radius: var(--radius-sm);
    padding: 18px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}
.lot-card:hover { border-color: var(--plotina-red); background: rgba(200, 16, 46, 0.08); }
.lot-icon { font-size: 2rem; margin-bottom: 10px; }
.lot-name { font-size: 0.9rem; color: var(--plotina-text); font-weight: 500; line-height: 1.3; }
.lot-count { font-size: 0.75rem; color: var(--plotina-muted); margin-top: 6px; }

/* Upload */
.upload-zone {
    border: 2px dashed var(--plotina-border);
    border-radius: var(--radius);
    padding: 36px;
    text-align: center;
    position: relative;
    transition: var(--transition);
}
.upload-zone.dragover { border-color: var(--plotina-red); background: rgba(200, 16, 46, 0.08); }
.upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}
.upload-prompt { pointer-events: none; }
.upload-icon { font-size: 2.5rem; margin-bottom: 12px; }
.upload-prompt strong { display: block; font-size: 1.05rem; margin-bottom: 6px; color: white; }
.upload-prompt span { color: var(--plotina-muted); font-size: 0.9rem; }
.upload-current { margin-top: 14px; font-size: 0.85rem; color: var(--plotina-muted); }

.progress {
    margin-top: 20px;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
    display: none;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--plotina-red), var(--plotina-red-light));
    width: 0%;
    transition: width 0.2s;
}
#upload-status { margin-top: 12px; font-size: 0.9rem; }
#upload-status .success { color: #5ee0a0; }
#upload-status .error { color: #ff8a9a; }

/* Browser */
.breadcrumb { margin: 12px 0; font-size: 0.9rem; color: var(--plotina-muted); }
.breadcrumb span { cursor: pointer; color: var(--plotina-red-light); }
.breadcrumb span:hover { text-decoration: underline; }

#browser { display: grid; gap: 8px; }
.item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--plotina-border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.item:hover { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.15); }
.item-icon { font-size: 1.5rem; width: 32px; text-align: center; }
.item-name { flex: 1; cursor: pointer; font-weight: 500; color: var(--plotina-text); }
.item-name.file { cursor: default; }
.item-meta { font-size: 0.8rem; color: var(--plotina-muted); white-space: nowrap; }

/* Recent */
#recent, #recent-full { display: grid; gap: 8px; }
.recent-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--plotina-border);
    border-radius: var(--radius-sm);
}
.recent-icon { font-size: 1.4rem; }
.recent-info { flex: 1; }
.recent-name { font-weight: 500; color: var(--plotina-text); }
.recent-path { font-size: 0.8rem; color: var(--plotina-muted); }
.recent-date { font-size: 0.8rem; color: var(--plotina-muted); white-space: nowrap; }

.empty { color: var(--plotina-muted); font-style: italic; padding: 20px; text-align: center; }
.loading { color: var(--plotina-muted); font-style: italic; padding: 16px; }

.mt { margin-top: 16px; }
select {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--plotina-border);
    border-radius: var(--radius-sm);
    color: white;
    font-size: 0.95rem;
}
select option { background: var(--plotina-panel); }

@media (max-width: 800px) {
    .sidebar { width: 100%; position: relative; }
    .main-content { margin-left: 0; max-width: 100%; }
    .dashboard-page { flex-direction: column; }
}
