/* ==========================================================
   AutoDigital Simian - Stiluri globale
   ========================================================== */
:root {
    --primary: #0b3d91;
    --primary-light: #1e63d8;
    --primary-lighter: #3b8bf2;
    --secondary: #f59e0b;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #f59e0b;
    --info: #0ea5e9;
    --bg: #f4f6f9;
    --bg-card: #ffffff;
    --text: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--primary-light); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Auth pages ===== */
.auth-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0b3d91 0%, #1e63d8 100%);
    padding: 20px;
}
.auth-card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 40px;
    width: 100%;
    max-width: 460px;
}
.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-logo img { max-width: 280px; }
.auth-card h1 { font-size: 24px; margin-bottom: 8px; color: var(--primary); }
.auth-card .subtitle { color: var(--text-muted); margin-bottom: 24px; font-size: 14px; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 14px; color: var(--text-muted); }

/* ===== Forms ===== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(30,99,216,0.1);
}
.form-group textarea { min-height: 80px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    font-family: inherit;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-light); }
.btn-secondary { background: #e5e7eb; color: var(--text); }
.btn-secondary:hover { background: #d1d5db; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #15803d; }
.btn-warning { background: var(--warning); color: white; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== Alerts ===== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
    border-left: 4px solid;
}
.alert-success { background: #d1fae5; color: #065f46; border-color: var(--success); }
.alert-danger  { background: #fee2e2; color: #991b1b; border-color: var(--danger); }
.alert-warning { background: #fef3c7; color: #92400e; border-color: var(--warning); }
.alert-info    { background: #dbeafe; color: #1e40af; border-color: var(--info); }

/* ===== Topbar & Sidebar Layout ===== */
.app-layout { display: flex; flex: 1; min-height: 100vh; }
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #0b3d91 0%, #1e3a8a 100%);
    color: white;
    padding: 0;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    z-index: 100;
}
.sidebar-logo {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}
.sidebar-logo img { max-width: 200px; }
.sidebar-nav { padding: 16px 0; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.08); color: white; }
.sidebar-nav a.active { background: rgba(255,255,255,0.12); color: white; border-left-color: var(--secondary); }
.sidebar-nav a svg { width: 20px; height: 20px; flex-shrink: 0; }
.sidebar-section { padding: 12px 20px 4px; font-size: 11px; text-transform: uppercase; opacity: 0.5; letter-spacing: 1px; }
.sidebar-user { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.1); margin-top: 20px; font-size: 13px; }
.sidebar-user .name { font-weight: 600; }
.sidebar-user .email { opacity: 0.7; font-size: 12px; }

.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
}
.topbar {
    background: white;
    padding: 14px 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar-title { font-size: 20px; font-weight: 600; color: var(--text); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-actions .badge {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.content { padding: 24px; flex: 1; }

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .mobile-menu-btn { display: block !important; }
}
.mobile-menu-btn { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.mobile-menu-btn svg { width: 24px; height: 24px; color: var(--text); }

/* ===== Cards & Stats ===== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.card-header h2 { font-size: 18px; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.stat-icon {
    width: 50px; height: 50px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.stat-icon svg { width: 24px; height: 24px; }
.stat-icon.bg-primary { background: #dbeafe; color: var(--primary); }
.stat-icon.bg-success { background: #d1fae5; color: var(--success); }
.stat-icon.bg-warning { background: #fef3c7; color: var(--warning); }
.stat-icon.bg-danger  { background: #fee2e2; color: var(--danger); }
.stat-icon.bg-info    { background: #e0f2fe; color: var(--info); }

.stat-value { font-size: 24px; font-weight: 700; }
.stat-label { font-size: 13px; color: var(--text-muted); }

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; }
table.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.table th, .table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.table th { background: #f9fafb; font-weight: 600; color: var(--text-muted); font-size: 12px; text-transform: uppercase; }
.table tbody tr:hover { background: #f9fafb; }

/* ===== Badges ===== */
.badge-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}
.badge-asteptare, .badge-programata { background: #e0e7ff; color: #3730a3; }
.badge-in_lucru, .badge-confirmata   { background: #fef3c7; color: #92400e; }
.badge-finalizat, .badge-finalizata  { background: #d1fae5; color: #065f46; }
.badge-anulata, .badge-suspendat     { background: #fee2e2; color: #991b1b; }

/* ===== Booking calendar ===== */
.booking-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    background: var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.booking-day-header {
    background: var(--primary);
    color: white;
    padding: 10px;
    text-align: center;
    font-weight: 600;
    font-size: 12px;
}
.booking-cell {
    background: white;
    min-height: 110px;
    padding: 6px;
    font-size: 12px;
    position: relative;
}
.booking-cell .date-num { font-weight: 600; margin-bottom: 4px; }
.booking-cell.other-month { background: #f9fafb; color: var(--text-muted); }
.booking-cell.today { background: #eff6ff; }
.booking-slot {
    background: #dbeafe;
    color: #1e3a8a;
    padding: 3px 6px;
    border-radius: 3px;
    margin-top: 2px;
    font-size: 11px;
    cursor: pointer;
    border-left: 3px solid var(--primary-light);
}
.booking-slot.full { background: #fee2e2; color: #991b1b; border-left-color: var(--danger); cursor: not-allowed; }
.booking-slot.booked-by-me { background: #d1fae5; color: #065f46; border-left-color: var(--success); }

/* ===== Misc ===== */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-2 { margin-top: 16px; }
.flex { display: flex; gap: 8px; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
@media (max-width: 900px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state svg { width: 80px; height: 80px; opacity: 0.3; margin-bottom: 16px; }

.qr-setup { text-align: center; padding: 16px; }
.qr-setup img { max-width: 220px; border: 1px solid var(--border); border-radius: 8px; padding: 8px; background: white; }
.secret-box { background: #f4f6f9; padding: 10px; border-radius: 6px; font-family: monospace; font-size: 16px; letter-spacing: 2px; margin: 12px 0; word-break: break-all; }

.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 20px; gap: 4px; }
.tab {
    padding: 10px 16px;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab:hover { color: var(--primary-light); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Live status pulse */
.status-pulse {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--success);
    margin-right: 6px;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); }
    100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}
