:root {
    --bg-color: #f4f6fb;
    --bg-dark: #0f1117;
    --sidebar-bg: #13151f;
    --sidebar-hover: rgba(255, 255, 255, 0.04);
    --sidebar-active: rgba(212, 168, 40, 0.1);
    --surface-color: #ffffff;
    --primary-color: #d4a828;
    --primary-hover: #e8bc3a;
    --primary-light: rgba(212, 168, 40, 0.08);
    --primary-glow: rgba(212, 168, 40, 0.25);
    --text-dark: #1a1d2e;
    --text-body: #3d4156;
    --text-light: #f0f0f5;
    --text-muted: #8b8fa3;
    --border-color: #e8eaf0;
    --border-dark: rgba(255, 255, 255, 0.06);
    --error-color: #f0465a;
    --error-bg: rgba(240, 70, 90, 0.08);
    --success-color: #2dd4a0;
    --success-bg: rgba(45, 212, 160, 0.08);
    --warning-color: #f5a623;
    --warning-bg: rgba(245, 166, 35, 0.08);
    --info-color: #6382ff;
    --info-bg: rgba(99, 130, 255, 0.08);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-dark);
}

/* ===== UTILS ===== */
.hidden { display: none !important; }
.active { display: block; }
.w-100 { width: 100%; }
.w-50 { width: calc(50% - 10px); }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-danger { color: #fca5a5 !important; }
.text-danger:hover { color: var(--error-color) !important; }

/* ===== LOGIN SCREEN ===== */
#login-screen {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #0f1117 0%, #1a1d30 50%, #0f1117 100%);
    position: relative;
    overflow: hidden;
}

#login-screen::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    pointer-events: none;
}

#login-screen::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(99, 130, 255, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.login-card {
    background: rgba(30, 33, 48, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 44px;
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-dark);
    text-align: center;
    animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-card .logo {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), #e8bc3a);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 20px;
    box-shadow: 0 8px 25px var(--primary-glow);
}

.login-card h2 {
    color: var(--text-light);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.login-card > p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 28px;
}

.login-card .form-group label {
    color: var(--text-muted);
    text-align: left;
}

.login-card input {
    background: rgba(15, 17, 23, 0.6);
    border-color: var(--border-dark);
    color: var(--text-light);
}

.login-card input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.login-card input::placeholder {
    color: var(--text-muted);
}

.login-card .btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #e8bc3a);
    margin-top: 12px;
}

.error-msg {
    color: var(--error-color);
    font-size: 13px;
    margin-top: 16px;
    font-weight: 500;
    padding: 10px;
    background: var(--error-bg);
    border-radius: var(--radius-xs);
    border: 1px solid rgba(240, 70, 90, 0.2);
}

/* ===== DASHBOARD SCREEN ===== */
#dashboard-screen {
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-dark);
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-header h2::before {
    content: '✂️';
    font-size: 20px;
}

.sidebar-brand {
    background: linear-gradient(135deg, var(--primary-color), #f0d060);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-header p {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.nav-links {
    list-style: none;
    padding: 16px 0;
    flex: 1;
}

.nav-item {
    width: 100%;
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 13px 20px;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: var(--text-light);
}

.nav-item.active {
    background: var(--sidebar-active);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.nav-item .nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-dark);
}

/* Mobile sidebar toggle */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 200;
    background: var(--sidebar-bg);
    border: 1px solid var(--border-dark);
    color: var(--text-light);
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    font-size: 20px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
}

/* ===== MAIN CONTENT ===== */
.dashboard-content {
    flex: 1;
    padding: 36px 40px;
    margin-left: 260px;
    overflow-y: auto;
    min-height: 100vh;
}

.panel {
    animation: fadeIn 0.4s ease;
}

.panel-header {
    margin-bottom: 28px;
}

.panel-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: -0.3px;
}

.panel-header p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}

/* ===== CARDS ===== */
.card {
    background: var(--surface-color);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card.p-0 { padding: 0; overflow: hidden; }

.section-subtitle {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-dark);
}

/* ===== STAT CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--surface-color);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-icon.gold { background: var(--primary-light); }
.stat-icon.green { background: var(--success-bg); }
.stat-icon.blue { background: var(--info-bg); }
.stat-icon.red { background: var(--error-bg); }

.stat-info h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
}

.stat-info p {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
}

/* ===== FORMS ===== */
.form-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    gap: 16px;
}

.form-group {
    margin-bottom: 16px;
    text-align: left;
}

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

input, select {
    width: 100%;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-dark);
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

input::placeholder {
    color: #b0b4c4;
}

input:focus, select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-group input {
    width: auto;
    accent-color: var(--primary-color);
}

.checkbox-group label {
    margin-bottom: 0;
    cursor: pointer;
    text-transform: none;
    font-size: 14px;
    color: var(--text-body);
}

/* ===== BUTTONS ===== */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #e8bc3a);
    color: #000;
    border: none;
    padding: 11px 22px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    margin-top: 8px;
    letter-spacing: 0.2px;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

#dashboard-screen .btn-primary {
    width: auto;
    padding: 10px 24px;
}

.btn-secondary {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 8px;
}

.btn-secondary:hover {
    background: var(--bg-color);
    color: var(--text-dark);
    border-color: #d1d5e0;
}

/* ===== TABLE ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 14px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.data-table th {
    background: var(--bg-color);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.data-table tr:hover td {
    background: rgba(244, 246, 251, 0.5);
}

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

/* Action Buttons */
.btn-edit, .btn-delete {
    border: none;
    padding: 6px 14px;
    border-radius: var(--radius-xs);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-edit {
    background: var(--info-bg);
    color: var(--info-color);
    border: 1px solid rgba(99, 130, 255, 0.2);
}

.btn-edit:hover {
    background: var(--info-color);
    color: #fff;
}

.btn-delete {
    background: var(--error-bg);
    color: var(--error-color);
    border: 1px solid rgba(240, 70, 90, 0.2);
}

.btn-delete:hover {
    background: var(--error-color);
    color: #fff;
}

/* ===== STATUS BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge.barbeiro {
    background: var(--primary-light);
    color: var(--primary-color);
}

.badge.funcionario {
    background: var(--info-bg);
    color: var(--info-color);
}

.badge.ativo {
    background: var(--success-bg);
    color: var(--success-color);
}

.badge.finalizado {
    background: var(--info-bg);
    color: var(--info-color);
}

.badge.cancelado {
    background: var(--error-bg);
    color: var(--error-color);
}

/* ===== AGENDA CARDS ===== */
.agenda-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.agenda-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: var(--transition);
}

.agenda-item:hover {
    box-shadow: var(--shadow-md);
    border-color: #d8dae5;
}

.agenda-time {
    background: var(--bg-color);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    text-align: center;
    flex-shrink: 0;
    min-width: 70px;
}

.agenda-time .time {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
}

.agenda-time .date {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.agenda-details {
    flex: 1;
}

.agenda-details .client-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
}

.agenda-details .service-name {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

.agenda-details .barber-name {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.agenda-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-status {
    padding: 6px 12px;
    border-radius: var(--radius-xs);
    font-size: 11px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-status.finalizar {
    background: var(--success-bg);
    color: var(--success-color);
    border: 1px solid rgba(45, 212, 160, 0.2);
}

.btn-status.finalizar:hover {
    background: var(--success-color);
    color: #fff;
}

.btn-status.cancelar {
    background: var(--error-bg);
    color: var(--error-color);
    border: 1px solid rgba(240, 70, 90, 0.2);
}

.btn-status.cancelar:hover {
    background: var(--error-color);
    color: #fff;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-body);
    margin-bottom: 4px;
}

.empty-state p {
    font-size: 13px;
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 14px;
    z-index: 9999;
    transition: var(--transition);
    opacity: 1;
    transform: translateY(0);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
}

.toast.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.toast.success { background: var(--success-color); }
.toast.error { background: var(--error-color); }

/* ===== EDIT CARD ===== */
.card-edit {
    border-left: 3px solid var(--info-color);
}

.card-edit .section-subtitle {
    color: var(--info-color);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: flex;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .dashboard-content {
        margin-left: 0;
        padding: 24px 16px;
        padding-top: 70px;
    }

    .form-row {
        flex-direction: column;
    }

    .w-50 { width: 100%; }

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

    .agenda-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .agenda-actions {
        width: 100%;
        margin-top: 8px;
    }

    .data-table th:nth-child(3),
    .data-table td:nth-child(3) {
        display: none;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
