/* ========== 1. LAYOUT BİLEŞENLERİ (Header, Sidebar, Footer) ========== */
body { background: var(--bg-body); color: var(--text-main); height: 100vh; overflow: hidden; display: flex; }
body.staff-mode .boss-only { display: none !important; }

#auth-layer {
    position: fixed; inset: 0; z-index: 5000;
    background: linear-gradient(135deg, #FDFBF9 0%, #F3E6E6 100%);
    display: flex; align-items: center; justify-content: center;
}
.login-card {
    background: rgba(255,255,255,0.95); backdrop-filter: blur(10px);
    width: 400px; padding: 40px; border-radius: 20px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    text-align: center; border: 1px solid rgba(255,255,255,0.5);
}

aside {
    width: var(--sidebar-width); background: var(--bg-sidebar); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; padding: 24px; transition: 0.3s;
}
main { flex: 1; display: flex; flex-direction: column; overflow: hidden; position: relative; }

header {
    height: var(--header-height); background: var(--bg-card); border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center; padding: 0 32px;
}
.user-profile { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.avatar {
    width: 36px; height: 36px; background: var(--primary); color: white;
    border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 600;
}

.logo { font-size: 22px; font-weight: 800; color: var(--text-main); margin-bottom: 40px; display: flex; align-items: center; gap: 10px; }
.nav-item {
    padding: 12px 16px; border-radius: 8px; color: var(--text-muted); cursor: pointer;
    display: flex; align-items: center; gap: 12px; margin-bottom: 4px; font-weight: 500; transition: 0.2s;
}
.nav-item:hover { background: #F9FAFB; color: var(--primary-dark); }
.nav-item.active { background: #FFF5F5; color: var(--primary-dark); font-weight: 600; }
.nav-item i { width: 20px; text-align: center; }

/* ========== 2. SAYFA BİLEŞENLERİ (Kartlar, Tablolar, Formlar, Takvim) ========== */
.content-scroll { flex: 1; overflow-y: auto; padding: 32px; }
.view-section { display: none; animation: fadeIn 0.3s ease; }
.view-section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-bottom: 32px; }
.stat-card { background: var(--bg-card); padding: 24px; border-radius: var(--radius); box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03); border: 1px solid var(--border); position: relative; }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 16px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--text-main); }
.stat-label { color: var(--text-muted); font-size: 14px; font-weight: 500; }

.charts-row { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; margin-bottom: 32px; }
.chart-card { background: var(--bg-card); padding: 24px; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); height: 350px; }
.doughnut-card { display: flex; flex-direction: column; align-items: center; }
.doughnut-wrapper { height: 220px; width: 100%; position: relative; display: flex; justify-content: center; margin-top: 10px; }

.calendar-container { background: var(--bg-card); padding: 24px; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); margin-bottom: 32px; }
.calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.calendar-header button { background: var(--bg-body); border: 1px solid var(--border); padding: 8px 16px; border-radius: 8px; cursor: pointer; font-weight: 500; transition: 0.2s; }
.calendar-header button:hover { background: var(--primary); color: white; border-color: var(--primary); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; grid-auto-rows: minmax(110px, auto); }
.calendar-day-name { text-align: center; font-size: 13px; font-weight: 600; color: var(--text-muted); padding-bottom: 8px; }
.calendar-day { background: var(--bg-body); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; cursor: pointer; border: 2px solid transparent; transition: 0.2s; }
.calendar-day.empty { background: #FAFAFA; cursor: default; }
.calendar-day.empty .date-num { color: #D1D5DB; }
.calendar-day:not(.empty):hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); }
.calendar-day.selected { border-color: var(--primary); background: #FFF5F5; }
.calendar-day.today .date-num { background: var(--primary); color: white; border-radius: 50%; }
.date-num { font-weight: 600; font-size: 14px; margin-bottom: 8px; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.app-count { font-size: 12px; font-weight: 500; background: var(--secondary); color: white; padding: 4px 8px; border-radius: 6px; margin-bottom: 4px; text-align: center; }
.app-rev { font-size: 12px; font-weight: 700; color: var(--success); text-align: center; margin-top: auto; }

.table-container { background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); margin-bottom: 32px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 16px 24px; background: #F9FAFB; border-bottom: 1px solid var(--border); color: var(--text-muted); font-size: 12px; font-weight: 600; text-transform: uppercase; }
td { padding: 16px 24px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
tr:hover { background: #F9FAFB; }

.badge { padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; display: inline-block; }
.badge-success { background: #D1FAE5; color: #065F46; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-danger { background: #FEE2E2; color: #991B1B; }
.badge-info { background: #DBEAFE; color: #1E40AF; }

.btn { padding: 8px 16px; border-radius: 6px; border: none; font-weight: 500; cursor: pointer; transition: 0.2s; font-size: 14px; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-outline { background: transparent; border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #DC2626; }

.action-btn { width: 32px; height: 32px; border-radius: 6px; border: none; background: #F3F4F6; color: var(--text-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; margin-right: 4px; transition: 0.2s; }
.action-btn:hover { background: var(--primary); color: white; transform: translateY(-2px); }
.action-btn.approve:hover { background: var(--success); }
.action-btn.cancel:hover { background: var(--danger); }
.action-btn.delete:hover { background: #DC2626; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; }
.form-control { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 8px; outline: none; transition: 0.2s; }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(212, 165, 165, 0.2); }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 2000; display: none; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.modal { background: white; width: 600px; max-height: 90vh; overflow-y: auto; border-radius: 16px; padding: 32px; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); animation: fadeIn 0.3s ease; }
.modal-lg { width: 800px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.shift-input { width: 100%; padding: 8px; border: none; background: transparent; border-radius: 6px; font-size: 13px; font-weight: 500; text-align: center; color: var(--text-main); transition: 0.2s; }
.shift-input:focus { background: #FFF; box-shadow: 0 0 0 2px var(--primary); outline: none; }
.shift-input:hover:not(:focus) { background: #F3F4F6; cursor: pointer; }

.service-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px; }
.service-card { background: var(--bg-card); border-radius: 16px; border: 1px solid var(--border); overflow: hidden; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); transition: 0.2s; }
.service-card:hover { transform: translateY(-4px); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }
.service-img { width: 100%; height: 160px; object-fit: cover; background: #E5E7EB; }
.service-info { padding: 20px; }
.service-title { font-weight: 700; font-size: 16px; margin-bottom: 8px; }
.service-meta { color: var(--text-muted); font-size: 13px; margin-bottom: 16px; display: flex; justify-content: space-between; font-weight: 500; }

/* ========== 3. SIDEBAR OVERLAY ========== */
.sidebar-toggle {
    display: none; background: none; border: none; cursor: pointer;
    font-size: 20px; color: var(--text-main); padding: 8px;
    min-width: var(--touch-target-min); min-height: var(--touch-target-min);
    align-items: center; justify-content: center;
}
.sidebar-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    z-index: 900; display: none; backdrop-filter: blur(4px);
    opacity: 0; transition: opacity 0.3s ease;
}
.sidebar-overlay.active { display: block; opacity: 1; }

/* Giriş kilidi geri sayım */
.login-lock-msg {
    background: #FEE2E2; color: var(--danger); padding: 12px;
    border-radius: 10px; font-size: 13px; font-weight: 600;
    margin-bottom: 16px; display: none;
}
.login-lock-msg.active { display: block; }

/* ========== 4. MASAÜSTÜ STİLLERİ (>1024px) ========== */
/* Masaüstü varsayılan - yukarıdaki stiller zaten masaüstü için */

/* ========== 5. TABLET STİLLERİ (481px–1024px) ========== */
@media (max-width: 1024px) {
    aside {
        position: fixed; left: 0; top: 0; height: 100vh;
        z-index: 950; transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 10px 0 30px rgba(0,0,0,0.1);
    }
    aside.open { transform: translateX(0); }
    .sidebar-toggle { display: flex; }
    main { width: 100%; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .charts-row { grid-template-columns: 1fr; }
    .chart-card { height: 300px; }
    .calendar-grid { gap: 8px; grid-auto-rows: minmax(80px, auto); }
    .calendar-day { padding: 8px; }
    .date-num { font-size: 12px; width: 24px; height: 24px; }
    .app-count { font-size: 10px; padding: 2px 4px; }
    header { padding: 0 16px; }
}

/* ========== 6. MOBİL STİLLER (≤480px) ========== */
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .content-scroll { padding: 16px; }
    header { padding: 0 12px; gap: 8px; }
    header h2 { font-size: 16px; }
    .calendar-grid { gap: 4px; grid-auto-rows: minmax(60px, auto); }
    .calendar-day { padding: 6px; }
    .app-count { display: none; }
    .app-rev { font-size: 10px; }
    .table-container { overflow-x: auto; }
    table { min-width: 600px; }
    .modal { width: 100%; max-width: 95vw; padding: 24px 16px; }
    .grid-2 { grid-template-columns: 1fr; }
    .login-card { width: 100%; max-width: 95vw; padding: 28px 20px; }
    .form-control { min-height: 48px; }
    .login-card .btn { min-height: 48px; }
    .service-grid { grid-template-columns: 1fr; }
}
