/* ========================================
   CapVermell Renovation Dashboard v6
   Juna-inspired · Premium Dark · Responsive
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-base: #0b1120;
    --bg-surface: #101828;
    --bg-card: #151e30;
    --bg-elevated: #1a2540;
    --bg-input: #0e1625;
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --border-active: rgba(99, 120, 255, 0.4);
    --text-primary: #eaeef5;
    --text-secondary: #94a3c0;
    --text-muted: #5d6b88;
    --accent: #5b6fff;
    --accent-dim: rgba(91, 111, 255, 0.14);
    --accent-light: #7b8cff;
    --green: #2dd4a0;
    --green-dim: rgba(45, 212, 160, 0.12);
    --amber: #f0b040;
    --amber-dim: rgba(240, 176, 64, 0.12);
    --red: #f05555;
    --red-dim: rgba(240, 85, 85, 0.1);
    --blue: #4a90ff;
    --blue-dim: rgba(74, 144, 255, 0.12);
    --cyan: #3ecdc6;
    --purple: #9b6dff;
    --purple-dim: rgba(155, 109, 255, 0.12);
    --radius-xl: 20px;
    --radius-lg: 16px;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-pill: 100px;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-glow: 0 0 80px rgba(91, 111, 255, 0.06);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    overflow-x: hidden;
}

/* Subtle atmospheric gradients */
body::before {
    content: '';
    position: fixed;
    top: -20%;
    left: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, rgba(70, 80, 180, 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    bottom: -15%;
    right: -10%;
    width: 45%;
    height: 45%;
    background: radial-gradient(circle, rgba(110, 70, 200, 0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.dashboard {
    position: relative;
    z-index: 1;
    max-width: 1480px;
    margin: 0 auto;
    padding: 24px 32px 48px;
}

/* ===== LOGIN ===== */
.login-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-base);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.login-overlay::before {
    content: '';
    position: fixed;
    top: 30%;
    left: 40%;
    width: 40%;
    height: 40%;
    background: radial-gradient(circle, rgba(91, 111, 255, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.login-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    width: 400px;
    max-width: 90vw;
    text-align: center;
    position: relative;
}

.login-box h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.login-box .login-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.login-box input {
    display: block;
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

.login-box input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.login-box button {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
    margin-top: 8px;
}

.login-box button:hover {
    background: var(--accent-light);
    transform: translateY(-1px);
}

.login-error {
    color: var(--red);
    font-size: 12px;
    margin-top: 12px;
}

/* ===== HEADER ===== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-logo {
    font-size: 28px;
    line-height: 1;
}

.header-text h1 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.header-text p {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 2px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.logout-btn {
    background: transparent;
    border: 1px solid rgba(240, 72, 72, 0.2);
    color: var(--red);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}

.logout-btn:hover {
    background: var(--red-dim);
    border-color: rgba(240, 72, 72, 0.4);
}

.clock {
    font-size: 24px;
    font-weight: 300;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
}

.day-indicator {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 4px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    font-weight: 500;
}

/* ===== SUMMARY GRID ===== */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}

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

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    opacity: 0.6;
}

.stat-card:nth-child(1)::before {
    background: var(--accent);
}

.stat-card:nth-child(2)::before {
    background: var(--red);
}

.stat-card:nth-child(3)::before {
    background: var(--blue);
}

.stat-card:nth-child(4)::before {
    background: var(--cyan);
}

.stat-card:nth-child(5)::before {
    background: var(--purple);
}

.stat-card:nth-child(6)::before {
    background: var(--amber);
}

.stat-card:nth-child(7)::before {
    background: var(--green);
}

.stat-card:nth-child(8)::before {
    background: var(--blue);
}

.stat-card:nth-child(9)::before {
    background: var(--purple);
}

.stat-card:hover {
    border-color: var(--border-hover);
}

.stat-icon {
    font-size: 16px;
    margin-right: 6px;
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    margin-top: 6px;
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.progress-bar-bg {
    height: 3px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 3px;
    margin-top: 10px;
    overflow: hidden;
}

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

/* ===== TOOLBAR ===== */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 14px;
    flex-wrap: wrap;
}

.view-toggle {
    display: flex;
    gap: 2px;
    background: var(--bg-card);
    padding: 3px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.view-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    white-space: nowrap;
}

.view-btn:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
}

.view-btn.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px rgba(91, 111, 255, 0.25);
}

.filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    display: flex;
    gap: 2px;
    background: var(--bg-card);
    padding: 3px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.filter-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    padding: 4px 8px;
    display: flex;
    align-items: center;
}

.filter-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}

.filter-btn:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
}

.filter-btn.active {
    background: var(--accent-dim);
    color: var(--accent-light);
    font-weight: 600;
}

/* ===== PROGRESS TOP BAR ===== */
.progress-top-bar {
    margin-bottom: 16px;
    padding: 12px 0 0;
}

.progress-top-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.progress-top-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.progress-top-pct {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-light);
}

/* ===== SUMMARY CARDS ===== */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    opacity: 0.5;
}

.card-progress::before {
    background: var(--accent);
}

.card-locations::before {
    background: var(--blue);
}

.card-switches::before {
    background: var(--green);
}

.card-provision::before {
    background: var(--purple);
}

.card-time::before {
    background: var(--amber);
}

.card-prediction::before {
    background: var(--cyan);
}

.card-inventory::before {
    background: var(--red);
}

.card-jose::before {
    background: var(--blue);
}

.card-jm::before {
    background: var(--purple);
}

.card:hover {
    border-color: var(--border-hover);
}

.card-icon {
    font-size: 18px;
    line-height: 1;
    margin-top: 2px;
}

.card-content {
    flex: 1;
    min-width: 0;
}

.card-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.card-label {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 3px;
}

.progress-bar {
    height: 3px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
}

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

/* ===== TIMELINE BAR ===== */
.timeline-bar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 18px 24px;
    margin-top: 24px;
}

.timeline-bar h3 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--text-primary);
}

.timeline {
    display: flex;
    gap: 6px;
    overflow-x: auto;
}

.timeline-day {
    flex: 1;
    min-width: 120px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    font-size: 11px;
    text-align: center;
    transition: var(--transition);
}

.timeline-day:hover {
    border-color: var(--border-hover);
}

.timeline-day-name {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.timeline-day-count {
    color: var(--text-muted);
    font-size: 10px;
}

.timeline-day-active {
    border-color: var(--border-active);
    background: var(--accent-dim);
}

/* ===== PLAN VIEW ===== */
.plan-day {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    margin-bottom: 16px;
    overflow: hidden;
}

.plan-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
}

.plan-day-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.plan-date {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 13px;
    margin-left: 8px;
}

.plan-day-summary {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    background: var(--bg-elevated);
    padding: 4px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
}

.plan-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.plan-column {
    padding: 4px;
}

.plan-column:first-child {
    border-right: 1px solid var(--border);
}

.plan-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
}

.plan-jose {
    color: var(--blue);
}

.plan-jm {
    color: var(--purple);
}

.plan-col-stats {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
}

/* Plan tasks */
.plan-task {
    margin: 4px 8px;
    padding: 14px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
}

.plan-task:hover {
    border-color: var(--border-hover);
    background: var(--bg-elevated);
}

.plan-task-active {
    border-color: var(--border-active);
    background: rgba(91, 111, 255, 0.04);
}

.plan-task-done {
    opacity: 0.5;
}

.plan-task-main {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.plan-task-icon {
    font-size: 14px;
    margin-top: 2px;
}

.plan-task-info {
    flex: 1;
    min-width: 0;
}

.plan-task-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.plan-task-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
    font-weight: 400;
}

.plan-task-est {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
    padding: 2px 10px;
    background: var(--bg-card);
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
}

.plan-task-controls {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

.plan-task-controls select {
    flex: 1;
    padding: 6px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 11px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    transition: var(--transition);
    appearance: auto;
}

.plan-task-controls select:focus {
    border-color: var(--accent);
}

/* Backlog */
.plan-backlog {
    background: var(--bg-surface);
    border-color: rgba(255, 255, 255, 0.03);
}

.plan-backlog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2px;
    padding: 10px;
}

.plan-replan-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    background: rgba(91, 111, 255, 0.03);
}

.replan-btn {
    padding: 10px 24px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: var(--transition);
    box-shadow: 0 2px 12px rgba(91, 111, 255, 0.2);
}

.replan-btn:hover {
    background: var(--accent-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(91, 111, 255, 0.3);
}

.replan-btn:active {
    transform: translateY(0);
}

.replan-hint {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
}

.est-adjusted {
    font-size: 10px;
    color: var(--amber);
    font-weight: 500;
}

/* ===== PROVISION VIEW ===== */
.prov-intro {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 24px 28px;
    margin-bottom: 16px;
}

.prov-intro h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
}

.prov-intro p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

.prov-location {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    margin-bottom: 12px;
    overflow: hidden;
    transition: var(--transition);
}

.prov-location:hover {
    border-color: var(--border-hover);
}

.prov-done {
    border-color: rgba(34, 201, 122, 0.15);
}

.prov-partial {
    border-color: rgba(91, 111, 255, 0.12);
}

.prov-loc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
}

.prov-loc-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
}

.prov-loc-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 8px;
    font-weight: 400;
}

.prov-loc-status {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: var(--radius-pill);
}

.prov-status-done {
    background: var(--green-dim);
    color: var(--green);
}

.prov-status-partial {
    background: var(--accent-dim);
    color: var(--accent-light);
}

.loc-order {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 12px;
    margin-right: 4px;
}

/* Switch table */
.switch-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.switch-table th {
    text-align: left;
    padding: 10px 16px;
    background: var(--bg-elevated);
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.switch-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    vertical-align: middle;
}

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

.switch-table tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

/* Status pills */
.sw-status {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.sw-pending {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
}

.sw-mapped {
    background: var(--blue-dim);
    color: var(--blue);
}

.sw-cloned {
    background: var(--purple-dim);
    color: var(--purple);
}

.sw-active {
    background: var(--amber-dim);
    color: var(--amber);
}

.sw-done {
    background: var(--green-dim);
    color: var(--green);
}

/* Provision inputs */
.prov-serial-col {
    min-width: 200px;
}

.serial-input-wrapper {
    position: relative;
}

.serial-input {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 12px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    outline: none;
    transition: var(--transition);
}

.serial-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.serial-input.mapped {
    border-color: rgba(34, 201, 122, 0.3);
    color: var(--green);
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-sm);
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.ac-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.ac-item:hover {
    background: var(--accent-dim);
    color: var(--text-primary);
}

.ac-serial {
    font-family: 'SF Mono', monospace;
    font-weight: 500;
}

.ac-model {
    color: var(--text-muted);
    font-size: 10px;
}

/* Action buttons */
.prov-btn {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
    background: transparent;
    color: var(--text-secondary);
}

.prov-btn:hover {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent-light);
}

.prov-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.prov-btn-clone {
    background: var(--accent-dim);
    color: var(--accent-light);
    border-color: rgba(91, 111, 255, 0.2);
}

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

.prov-btn-start {
    background: var(--green-dim);
    color: var(--green);
    border-color: rgba(34, 201, 122, 0.2);
}

.prov-btn-start:hover {
    background: rgba(34, 201, 122, 0.2);
}

.prov-btn-done {
    background: var(--green);
    color: white;
    border-color: var(--green);
}

/* Timer */
.timer-display {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    padding: 3px 10px;
    background: var(--bg-surface);
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
}

.timer-running {
    color: var(--amber);
    border-color: rgba(229, 160, 48, 0.2);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* ===== GRID VIEW (Reemplazo) ===== */
.locations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 12px;
}

.location-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 20px 24px;
    transition: var(--transition);
}

.location-card:hover {
    border-color: var(--border-hover);
}

.location-card.card-done {
    border-color: rgba(34, 201, 122, 0.12);
}

.loc-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}

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

.loc-card-id {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 2px;
}

.loc-card-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-hab {
    background: var(--accent-dim);
    color: var(--accent-light);
}

.badge-pub {
    background: var(--purple-dim);
    color: var(--purple);
}

.badge-infra {
    background: var(--cyan);
    color: var(--bg-base);
}

.loc-card-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.loc-stat {
    text-align: center;
    padding: 10px 8px;
    background: var(--bg-surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.loc-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.loc-stat-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
    font-weight: 500;
}

.loc-card-provision {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: 500;
}

/* Switch items in grid cards */
.switch-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    font-size: 12px;
    transition: var(--transition);
}

.switch-item:hover {
    border-color: var(--border-hover);
}

.switch-item-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 12px;
}

.switch-item-meta {
    color: var(--text-muted);
    font-size: 11px;
}

.switch-item-go {
    font-size: 11px;
    padding: 4px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    transition: var(--transition);
}

.switch-item-go:hover {
    background: var(--accent-dim);
    color: var(--accent-light);
    border-color: var(--accent);
}

/* ===== INVENTORY VIEW ===== */
.inv-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    margin-bottom: 16px;
    overflow: hidden;
}

.inv-section h3 {
    font-size: 16px;
    font-weight: 700;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
}

.inv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.inv-table th {
    text-align: left;
    padding: 10px 20px;
    background: var(--bg-elevated);
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.inv-table td {
    padding: 10px 20px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

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

.inv-table tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

.inv-add-row td {
    padding: 8px 16px;
}

.inv-add-row input,
.inv-add-row select {
    width: 100%;
    padding: 8px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 12px;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

.inv-add-row input:focus,
.inv-add-row select:focus {
    border-color: var(--accent);
}

.inv-btn-add {
    padding: 6px 16px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}

.inv-btn-add:hover {
    background: var(--accent-light);
}

.inv-btn-del {
    background: transparent;
    border: 1px solid rgba(240, 72, 72, 0.15);
    color: var(--red);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 10px;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}

.inv-btn-del:hover {
    background: var(--red-dim);
}

.inv-expected-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 10px;
    font-weight: 600;
}

.inv-ok {
    background: var(--green-dim);
    color: var(--green);
}

.inv-warn {
    background: var(--amber-dim);
    color: var(--amber);
}

.inv-danger {
    background: var(--red-dim);
    color: var(--red);
}

/* ===== CONFIG CLONE MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 480px;
    width: 90vw;
    color: var(--text-primary);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}

.modal-content h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.modal-content p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 20px;
}

.modal-info {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.modal-info strong {
    color: var(--text-primary);
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-actions button {
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}

.modal-btn-cancel {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.modal-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.04);
}

.modal-btn-confirm {
    background: var(--accent);
    border: none;
    color: white;
    box-shadow: 0 2px 12px rgba(91, 111, 255, 0.25);
}

.modal-btn-confirm:hover {
    background: var(--accent-light);
}

.clone-progress {
    margin-top: 16px;
    padding: 12px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 12px;
    color: var(--text-secondary);
}

.clone-progress .progress-bar-bg {
    margin-top: 8px;
}

/* ===== NOTES ===== */
.prov-notes textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 12px;
    font-family: inherit;
    min-height: 50px;
    resize: vertical;
    outline: none;
    transition: var(--transition);
}

.prov-notes textarea:focus {
    border-color: var(--accent);
}

.prov-notes label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 6px;
    margin-top: 12px;
}

/* ===== HIDDEN UTILITY ===== */
.hidden {
    display: none !important;
}

/* ===== RESPONSIVE ===== */

/* Large screens */
@media (max-width: 1400px) {
    .dashboard {
        padding: 20px 24px 40px;
    }

    .locations-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
}

/* Tablet */
@media (max-width: 1100px) {
    .summary-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .locations-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

/* Mobile landscape / small tablet */
@media (max-width: 768px) {
    .dashboard {
        padding: 16px 16px 32px;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .summary-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .stat-card {
        padding: 12px 14px;
    }

    .stat-value {
        font-size: 20px;
    }

    .stat-label {
        font-size: 9px;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .view-toggle {
        width: 100%;
    }

    .view-btn {
        flex: 1;
        text-align: center;
        font-size: 11px;
        padding: 7px 8px;
    }

    .filters {
        width: 100%;
    }

    .filter-group {
        flex: 1;
    }

    .filter-btn {
        flex: 1;
        text-align: center;
        font-size: 10px;
        padding: 5px 4px;
    }

    .locations-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .location-card {
        padding: 14px;
    }

    .plan-columns {
        grid-template-columns: 1fr;
    }

    .plan-column:first-child {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .plan-day-header {
        padding: 10px 14px;
    }

    .plan-day-header h3 {
        font-size: 14px;
    }

    .plan-backlog-grid {
        grid-template-columns: 1fr;
    }

    .plan-replan-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 10px 14px;
    }

    .replan-btn {
        width: 100%;
        text-align: center;
    }

    .replan-hint {
        text-align: center;
    }

    .switch-table {
        display: block;
        overflow-x: auto;
    }

    .prov-loc-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .modal-content {
        padding: 24px 20px;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions button {
        width: 100%;
        text-align: center;
    }
}

/* Mobile portrait */
@media (max-width: 480px) {
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-value {
        font-size: 18px;
    }

    .clock {
        font-size: 20px;
    }

    .header-text h1 {
        font-size: 16px;
    }

    .login-box {
        padding: 32px 24px;
    }

    .loc-card-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
    }

    .loc-stat {
        padding: 8px 4px;
    }

    .loc-stat-value {
        font-size: 16px;
    }
}