/* DSB Clippings — Redesigned UI */

:root {
    --sidebar-width: 240px;
    --sidebar-bg: #1a1f2e;
    --sidebar-hover: #252b3d;
    --sidebar-active: #2e6be6;
    --brand-blue: #2e6be6;
    --brand-dark: #1a1f2e;
    --text-primary: #1a1a2e;
    --text-muted: #6b7280;
    --bg-page: #f4f6f9;
    --bg-card: #ffffff;
    --border-light: #e5e7eb;
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-page);
    margin: 0;
    color: var(--text-primary);
}

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

/* === Sidebar === */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #c0c4cc;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
}

.sidebar-brand {
    padding: 1.25rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand-icon {
    background: var(--brand-blue);
    color: white;
    font-weight: 800;
    font-size: 0.9rem;
    padding: 0.35rem 0.55rem;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.brand-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.sidebar-nav {
    list-style: none;
    padding: 0.75rem 0;
    margin: 0;
    flex: 1;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1.25rem;
    color: #9ca3af;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.sidebar-nav li a:hover {
    background: var(--sidebar-hover);
    color: #e5e7eb;
}

.sidebar-nav li a.active {
    background: var(--sidebar-hover);
    color: #fff;
    border-left-color: var(--brand-blue);
    font-weight: 500;
}

.sidebar-nav li a i {
    font-size: 1.1rem;
    width: 1.25rem;
    text-align: center;
}

.sidebar-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 0.8rem;
}

.sidebar-footer a {
    color: #9ca3af;
    text-decoration: none;
    display: block;
    padding: 0.35rem 0;
}

.sidebar-footer a:hover { color: #e5e7eb; }

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.5rem;
    color: #6b7280;
}

.logout-link {
    margin-left: auto;
    color: #6b7280 !important;
}
.logout-link:hover { color: #ef4444 !important; }

/* === Main content === */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 1.5rem 2rem;
    min-height: 100vh;
}

/* === Page header === */
.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.page-header p {
    color: var(--text-muted);
    margin: 0.25rem 0 0;
    font-size: 0.9rem;
}

/* === Workflow panel (the main search interface) === */
.workflow-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}

.workflow-steps {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.workflow-steps .step {
    flex: 1;
    min-width: 200px;
}

.workflow-steps .step label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.workflow-steps .step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--brand-blue);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    margin-right: 0.35rem;
}

.workflow-steps .step-action {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    padding-bottom: 0;
}

.btn-search {
    background: var(--brand-blue);
    color: #fff;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
    height: 38px;
}

.btn-search:hover { background: #2558c4; color: #fff; }
.btn-search:disabled { opacity: 0.6; cursor: not-allowed; }

/* === Stats row === */
.stats-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    flex: 1;
    min-width: 150px;
}

.stat-card .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 0.15rem;
}

.stat-card.stat-highlight {
    border-color: var(--brand-blue);
    border-width: 2px;
}

.stat-card.stat-highlight .stat-value {
    color: var(--brand-blue);
}

/* === Results table === */
.results-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    overflow: hidden;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap;
    gap: 0.75rem;
}

.results-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.results-actions {
    display: flex;
    gap: 0.5rem;
}

.results-panel .table {
    margin: 0;
}

.results-panel .table th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    background: #f9fafb;
    border-bottom: 1px solid var(--border-light);
    padding: 0.65rem 1rem;
}

.results-panel .table td {
    padding: 0.6rem 1rem;
    vertical-align: middle;
    font-size: 0.88rem;
    border-bottom: 1px solid #f3f4f6;
}

.results-panel .table tbody tr:hover {
    background: #f8fafc;
}

/* Outlet pill */
.outlet-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #f1f5f9;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 500;
    color: #334155;
}

/* Valuation badge */
.val-badge {
    display: inline-block;
    background: #ecfdf5;
    color: #059669;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
}

.val-badge.val-high {
    background: #dbeafe;
    color: #1d4ed8;
}

/* Soporte badge */
.soporte-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

/* === Empty state === */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    display: block;
    opacity: 0.4;
}

.empty-state p {
    font-size: 0.95rem;
    margin: 0;
}

/* === Loading spinner === */
.search-loading {
    display: none;
    text-align: center;
    padding: 2rem;
}

.search-loading.active {
    display: block;
}

.search-loading .spinner-border {
    width: 2rem;
    height: 2rem;
    color: var(--brand-blue);
}

/* === Buttons === */
.btn-export {
    background: #059669;
    color: #fff;
    border: none;
    padding: 0.4rem 0.85rem;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    text-decoration: none;
    transition: background 0.15s;
}
.btn-export:hover { background: #047857; color: #fff; }

.btn-pdf {
    background: #dc2626;
    color: #fff;
    border: none;
    padding: 0.4rem 0.85rem;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    text-decoration: none;
    transition: background 0.15s;
}
.btn-pdf:hover { background: #b91c1c; color: #fff; }

.btn-manual {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-light);
    padding: 0.4rem 0.85rem;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    text-decoration: none;
    transition: all 0.15s;
}
.btn-manual:hover { border-color: #9ca3af; color: var(--text-primary); }

/* === Login page === */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--sidebar-bg) 0%, #2d3548 100%);
}

.login-card {
    background: #fff;
    border-radius: 12px;
    padding: 2.5rem;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-card .brand-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-card .brand-header .brand-icon {
    font-size: 1.2rem;
    padding: 0.5rem 0.75rem;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.login-card .brand-header h2 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin: 0.5rem 0 0;
}

.login-card .brand-header p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0.25rem 0 0;
}

/* === Responsive === */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    .brand-text, .sidebar-nav li a span, .sidebar-footer a span { display: none; }
    .sidebar-nav li a { justify-content: center; padding: 0.75rem; }
    .main-content { margin-left: 60px; padding: 1rem; }
    .workflow-steps { flex-direction: column; }
}
