/* DVargas Dashboard — Dark Theme Preto & Vermelho */
:root {
    --bg: #0a0a0a;
    --sidebar-bg: #111;
    --card-bg: #1a1a1a;
    --text: #f0f0f0;
    --text-secondary: #999;
    --text-muted: #666;
    --brand: #dc2626;
    --brand-dark: #b91c1c;
    --border: #2a2a2a;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.5);
    --shadow-md: 0 4px 12px rgba(0,0,0,.5);
    --shadow-lg: 0 8px 24px rgba(0,0,0,.6);
    --green: #22c55e;
    --green-bg: rgba(34,197,94,.12);
    --amber: #dc2626;
    --amber-bg: rgba(220,38,38,.1);
    --blue: #3b82f6;
    --blue-bg: rgba(59,130,246,.12);
    --red: #ef4444;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --sidebar-width: 260px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

/* ── Layout ── */
.app-layout { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; bottom: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 28px 24px 20px;
    display: flex; align-items: center; gap: 14px;
    border-bottom: 1px solid var(--border);
}

.brand-logo {
    width: 44px; height: 44px;
    background: #1a1a1a;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}
.brand-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 12px; }

.brand-info { display: flex; flex-direction: column; }
.brand-name { font-size: 18px; font-weight: 700; color: var(--text); }
.brand-tag { font-size: 11px; color: var(--text-muted); }

.sidebar-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; }

.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px; border-radius: 10px;
    color: var(--text-secondary); text-decoration: none;
    font-size: 14px; font-weight: 500;
    transition: all .15s;
}
.nav-item svg { width: 20px; height: 20px; opacity: .6; flex-shrink: 0; }
.nav-item:hover { background: #1e1e1e; color: #fff; }
.nav-item:hover svg { opacity: .8; }
.nav-item:not(.disabled):hover { background: rgba(220,38,38,.08); color: #ef4444; }

.nav-item.active {
    background: rgba(220,38,38,.12); color: #ef4444; font-weight: 600;
}
.nav-item.active svg { opacity: 1; color: #ef4444; }
.nav-item.disabled { opacity: .3; cursor: not-allowed; }
.nav-item.disabled:hover { background: transparent; color: var(--text-secondary); }

.sidebar-footer {
    padding: 16px 24px; border-top: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.user-mini { font-size: 13px; color: var(--text-secondary); }
.logout-link { font-size: 12px; color: var(--text-muted); text-decoration: none; }
.logout-link:hover { color: var(--red); }

/* ── Main ── */
.main-content { margin-left: var(--sidebar-width); flex: 1; padding: 36px 40px; max-width: 1000px; }

.top-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.page-title { font-size: 24px; font-weight: 700; color: var(--text); }
.page-subtitle { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }

/* ── Stats ── */
.stats-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-bottom: 32px; }

.stat-card {
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px;
    display: flex; align-items: center; gap: 16px;
    box-shadow: var(--shadow-sm);
}
.stat-icon-bg {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
}
.stat-card.available .stat-icon-bg { background: var(--green-bg); }
.stat-card.booked .stat-icon-bg { background: var(--amber-bg); }
.stat-card.rate .stat-icon-bg { background: var(--blue-bg); }

.stat-info { display: flex; flex-direction: column; gap: 2px; }
.stat-label { font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .5px; }
.stat-value { font-size: 28px; font-weight: 700; }
.stat-card.available .stat-value { color: var(--green); }
.stat-card.booked .stat-value { color: #ef4444; }
.stat-card.rate .stat-value { color: var(--blue); }

/* ── Agenda ── */
.agenda-container {
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.agenda-section-label {
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 1.5px; color: var(--text-muted);
    padding: 16px 24px 8px;
}

/* ── Timeline ── */
.timeline { display: flex; flex-direction: column; }

.slot-row {
    display: flex; align-items: center; padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    transition: background .15s;
}
.slot-row:last-child { border-bottom: none; }
.slot-row:hover { background: rgba(255,255,255,.03); }

.slot-time {
    width: 72px; font-size: 17px; font-weight: 600;
    color: var(--text); font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}
.slot-info { flex: 1; display: flex; align-items: center; gap: 12px; }

.slot-status {
    padding: 5px 12px; border-radius: 20px;
    font-size: 12px; font-weight: 600; flex-shrink: 0;
}
.slot-row.available .slot-status { background: var(--green-bg); color: var(--green); }
.slot-row.booked .slot-status { background: rgba(220,38,38,.12); color: #ef4444; }
.slot-row.available .slot-client { color: var(--text-muted); font-size: 14px; flex: 1; }
.slot-row.booked .slot-client { color: var(--text); font-weight: 500; font-size: 14px; }

.slot-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.slot-row.available .slot-dot { background: var(--green); }
.slot-row.booked .slot-dot { background: #ef4444; }

.slot-barber { color: var(--text-secondary); font-size: 12px; margin-left: 12px; white-space: nowrap; }

/* ── Delete ── */
.btn-delete {
    width: 34px; height: 34px; border-radius: 8px;
    border: 1px solid transparent; background: transparent;
    color: var(--text-muted); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all .15s; flex-shrink: 0; margin-left: 4px;
}
.btn-delete svg { width: 16px; height: 16px; }
.btn-delete:hover { background: rgba(239,68,68,.1); color: var(--red); border-color: rgba(239,68,68,.3); }
.btn-delete:disabled { opacity: .5; cursor: not-allowed; }

/* ── Lunch ── */
.lunch-break {
    display: flex; align-items: center; gap: 14px;
    padding: 20px 24px; background: #151515;
    border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.lunch-icon { font-size: 18px; }
.lunch-text { font-size: 13px; color: var(--text-muted); }
.lunch-text span { color: var(--text-secondary); }

/* ── Date Nav ── */
.date-nav { display: flex; align-items: center; gap: 8px; }
.date-btn {
    width: 36px; height: 36px; border-radius: 10px;
    border: 1px solid var(--border); background: var(--card-bg);
    color: var(--text-secondary); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all .15s; flex-shrink: 0;
}
.date-btn svg { width: 18px; height: 18px; }
.date-btn:hover { background: #222; color: #fff; border-color: #444; }
.date-btn.today {
    width: auto; padding: 0 14px; font-size: 13px; font-weight: 600;
    color: #ef4444; border-color: #dc2626; background: rgba(220,38,38,.1);
}
.date-btn.today:hover { background: #dc2626; color: #fff; }
.date-picker {
    padding: 8px 12px; border-radius: 10px;
    border: 1px solid var(--border); background: var(--card-bg);
    color: var(--text); font-size: 13px; font-family: inherit;
    cursor: pointer; outline: none; transition: border .2s;
}
.date-picker:focus { border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220,38,38,.15); }

/* ── Empty/Loading ── */
.empty-state { padding: 48px 24px; text-align: center; color: var(--text-muted); font-size: 14px; }
.loading-spinner { display: flex; align-items: center; justify-content: center; padding: 48px; }
.spinner-circle {
    width: 28px; height: 28px; border: 3px solid var(--border);
    border-top-color: #dc2626; border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Login Page ── */
.login-page {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #050505 0%, #111 50%, #0a0000 100%);
}
.login-card {
    background: #1a1a1a; border-radius: 20px; border: 1px solid #2a2a2a;
    padding: 48px 44px; width: 100%; max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,.5); text-align: center;
}

.login-logo-img {
    width: 260px;
    height: auto;
    margin: 0 auto 28px;
    display: block;
    filter: drop-shadow(0 8px 24px rgba(220,38,38,.25));
}

.login-card h1 { font-size: 24px; font-weight: 700; margin-bottom: 4px; color: #fff; }
.login-card .subtle { color: #666; font-size: 14px; margin-bottom: 32px; }

.login-card label {
    display: block; text-align: left; font-size: 12px; font-weight: 600;
    color: #888; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px;
}

.login-card input {
    width: 100%; padding: 13px 16px; border: 1.5px solid #333;
    border-radius: 10px; font-size: 15px; font-family: inherit;
    color: #f0f0f0; background: #111; transition: border .2s; margin-bottom: 16px;
}
.login-card input:focus {
    outline: none; border-color: #dc2626; background: #1a1a1a;
    box-shadow: 0 0 0 3px rgba(220,38,38,.15);
}

.login-card button {
    width: 100%; padding: 14px;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #fff; border: none; border-radius: 12px;
    font-size: 16px; font-weight: 600; font-family: inherit;
    cursor: pointer; transition: transform .1s, box-shadow .2s;
    box-shadow: 0 4px 15px rgba(220,38,38,.3);
}
.login-card button:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(220,38,38,.4); }
.login-card button:active { transform: translateY(0); }

.login-card .error-msg { color: var(--red); font-size: 13px; margin-top: 12px; display: none; }
.login-card .footer-note { margin-top: 28px; font-size: 12px; color: #444; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .sidebar { width: 72px; }
    .sidebar-header { padding: 20px 10px; justify-content: center; }
    .brand-info { display: none; }
    .sidebar-nav { padding: 12px 8px; }
    .nav-item { justify-content: center; padding: 12px; }
    .nav-item span { display: none; }
    .nav-item svg { width: 22px; height: 22px; margin: 0; }
    .sidebar-footer { justify-content: center; padding: 12px; }
    .user-mini, .logout-link { font-size: 0; }
    .main-content { margin-left: 72px; padding: 24px 16px; }
    .stats-row { grid-template-columns: 1fr; }
    .slot-time { width: 60px; font-size: 15px; }
}
