/* ============================================================
   Çiçeldağı Kadın Kooperatifi - Açık Tema Tasarım Sistemi v2
   ============================================================ */

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

/* ---- CSS Variables (Light Theme) ---- */
:root {
    --bg-page: #f3f4f8;
    --bg-card: #ffffff;
    --bg-card-hover: #f8f9fc;
    --bg-input: #f4f5f9;
    --bg-sidebar: #ffffff;
    --bg-header: rgba(255, 255, 255, 0.92);
    --border: #e2e5ef;
    --border-focus: rgba(124, 58, 237, 0.45);

    --text-primary: #1a1a2e;
    --text-secondary: #5a6178;
    --text-muted: #8b92a8;

    --primary: #7c3aed;
    --primary-light: #8b5cf6;
    --primary-dark: #6d28d9;
    --secondary: #ec4899;
    --accent: #0891b2;

    --gradient-primary: linear-gradient(135deg, #7c3aed, #ec4899);
    --gradient-soft: linear-gradient(135deg, #f0e7ff, #fde8f3);

    --success: #059669;
    --success-bg: rgba(5, 150, 105, 0.08);
    --success-border: rgba(5, 150, 105, 0.2);
    --warning: #d97706;
    --warning-bg: rgba(217, 119, 6, 0.08);
    --warning-border: rgba(217, 119, 6, 0.2);
    --danger: #dc2626;
    --danger-bg: rgba(220, 38, 38, 0.07);
    --danger-border: rgba(220, 38, 38, 0.2);
    --info: #2563eb;
    --info-bg: rgba(37, 99, 235, 0.07);
    --info-border: rgba(37, 99, 235, 0.2);

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.03);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 999px;

    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);

    --header-height: 62px;
    --sidebar-width: 260px;
    --bottom-nav-height: 68px;
}

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

html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg-page);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.hidden { display: none !important; }

/* ---- Login Screen ---- */
#login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0e7ff 0%, #fde8f3 50%, #e8f4fd 100%);
    position: relative;
    overflow: hidden;
}

#login-screen::before {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.08), transparent 70%);
    top: -150px; right: -150px;
    animation: float 8s ease-in-out infinite;
}

#login-screen::after {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.06), transparent 70%);
    bottom: -150px; left: -150px;
    animation: float 6s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, -20px); }
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 44px 40px;
    width: 100%;
    max-width: 430px;
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo .logo-icon {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-lg);
    margin: 0 auto 14px;
    overflow: hidden;
}

.login-logo .logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.login-logo h1 {
    font-size: 20px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.3;
}

.login-logo p {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 4px;
}

.login-error {
    background: var(--danger-bg);
    color: var(--danger);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 14px;
    display: none;
    border: 1px solid var(--danger-border);
}

.login-error.show { display: block; animation: shake 0.4s ease; }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* ---- Forms ---- */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }

.form-control {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 14px;
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
    background: #fff;
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%235a6178' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

textarea.form-control { min-height: 80px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.form-checkbox {
    display: flex; align-items: center; gap: 8px;
    cursor: pointer; font-size: 14px; color: var(--text-secondary);
}
.form-checkbox input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 11px 22px; border: none; border-radius: var(--radius-md);
    font-family: var(--font); font-size: 14px; font-weight: 600;
    cursor: pointer; transition: var(--transition); outline: none; white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-primary); color: white;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.25);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    background: var(--bg-input); color: var(--text-primary);
    border: 1.5px solid var(--border);
}
.btn-secondary:hover { background: #ebedf3; border-color: #cdd1de; }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #047857; }

.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover { background: #b45309; }

.btn-danger { background: transparent; color: var(--danger); border: 1.5px solid var(--danger-border); }
.btn-danger:hover { background: var(--danger-bg); }

.btn-sm { padding: 8px 16px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-xs { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: var(--radius-md); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ---- App Shell ---- */
#app-shell { min-height: 100vh; background: var(--bg-page); }

/* Header */
#app-header {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--header-height);
    background: var(--bg-header);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; padding: 0 20px;
    z-index: 100; gap: 14px;
}

.header-logo {
    display: flex; align-items: center; gap: 10px;
    font-weight: 700; font-size: 15px; min-width: fit-content;
}

.header-logo .logo-sm {
    width: 36px; height: 36px; border-radius: var(--radius-sm);
    overflow: hidden; display: flex; align-items: center; justify-content: center;
}

.header-logo .logo-sm img { width: 100%; height: 100%; object-fit: cover; }

.header-logo span {
    background: var(--gradient-primary);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

.header-spacer { flex: 1; }

.header-actions { display: flex; align-items: center; gap: 8px; }

.notification-btn {
    position: relative; width: 40px; height: 40px;
    border-radius: var(--radius-md); background: var(--bg-input);
    border: 1px solid var(--border); color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: var(--transition); font-size: 17px;
}
.notification-btn:hover { background: #ebedf3; color: var(--text-primary); }

.notification-badge {
    position: absolute; top: -4px; right: -4px;
    min-width: 18px; height: 18px; border-radius: var(--radius-full);
    background: var(--danger); color: white;
    font-size: 10px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    padding: 0 5px; animation: pulse 2s infinite;
}

@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }

.user-menu {
    display: flex; align-items: center; gap: 10px;
    padding: 5px 12px 5px 5px; border-radius: var(--radius-md);
    background: var(--bg-input); border: 1px solid var(--border);
    cursor: pointer; transition: var(--transition);
}
.user-menu:hover { background: #ebedf3; }

.user-avatar {
    width: 32px; height: 32px; border-radius: var(--radius-sm);
    background: var(--gradient-primary);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px; color: white; flex-shrink: 0;
}

.user-info { display: none; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); line-height: 1.2; }
.user-role { font-size: 11px; color: var(--text-muted); line-height: 1.2; }

/* Sidebar */
#sidebar {
    position: fixed; top: var(--header-height); left: 0; bottom: 0;
    width: var(--sidebar-width); background: var(--bg-sidebar);
    border-right: 1px solid var(--border); padding: 16px 12px;
    overflow-y: auto; z-index: 90; display: none;
}

.nav-section { margin-bottom: 22px; }
.nav-section-title { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; padding: 0 12px; margin-bottom: 6px; }

.nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 12px; border-radius: var(--radius-md);
    color: var(--text-secondary); font-size: 14px; font-weight: 500;
    cursor: pointer; transition: var(--transition); margin-bottom: 2px;
}
.nav-item:hover { background: var(--bg-input); color: var(--text-primary); }
.nav-item.active { background: #f0e7ff; color: var(--primary); font-weight: 600; }

.nav-item .nav-icon { width: 20px; text-align: center; font-size: 16px; }
.nav-item .nav-badge { margin-left: auto; min-width: 20px; height: 20px; border-radius: var(--radius-full); background: var(--primary); color: white; font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; padding: 0 6px; }

/* Bottom Navigation */
#bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    height: var(--bottom-nav-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-around;
    padding: 0 4px; padding-bottom: env(safe-area-inset-bottom, 0);
    z-index: 90;
}

.bottom-nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 6px 8px; border-radius: var(--radius-sm);
    color: var(--text-muted); font-size: 10px; font-weight: 500;
    cursor: pointer; transition: var(--transition); min-width: 52px;
}
.bottom-nav-item .nav-icon { font-size: 20px; transition: var(--transition); }
.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-item.active .nav-icon { transform: scale(1.12); }

/* Main Content */
#main-content {
    margin-top: var(--header-height);
    padding: 20px;
    padding-bottom: calc(var(--bottom-nav-height) + 20px);
    min-height: calc(100vh - var(--header-height));
}

/* ---- Page Header ---- */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; flex-wrap: wrap; gap: 12px; }
.page-title { font-size: 23px; font-weight: 700; color: var(--text-primary); }
.page-subtitle { font-size: 14px; color: var(--text-secondary); margin-top: 2px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- Stat Cards ---- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 26px; }

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

.stat-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0;
    height: 3px; background: var(--gradient-primary);
    opacity: 0; transition: var(--transition);
}
.stat-card:hover::before { opacity: 1; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-icon { width: 40px; height: 40px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 18px; margin-bottom: 10px; }
.stat-icon.purple { background: #f0e7ff; color: var(--primary); }
.stat-icon.pink { background: #fde8f3; color: var(--secondary); }
.stat-icon.green { background: var(--success-bg); color: var(--success); }
.stat-icon.blue { background: var(--info-bg); color: var(--info); }
.stat-icon.orange { background: var(--warning-bg); color: var(--warning); }
.stat-icon.red { background: var(--danger-bg); color: var(--danger); }
.stat-icon.teal { background: rgba(8, 145, 178, 0.08); color: var(--accent); }

.stat-value { font-size: 26px; font-weight: 800; line-height: 1; margin-bottom: 3px; color: var(--text-primary); }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }

/* ---- Cards ---- */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-card); transition: var(--transition); }
.card:hover { border-color: #d0d4e0; }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.card-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.card-body { padding: 18px; }
.card-footer { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }

/* ---- Demand Cards ---- */
.demand-list { display: grid; gap: 14px; }
.demand-group { margin-bottom: 24px; }
.demand-group-header {
    display: flex; align-items: center; gap: 8px;
    font-size: 14px; font-weight: 700; color: var(--text-secondary);
    margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
}

.demand-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 18px;
    cursor: pointer; transition: var(--transition);
    box-shadow: var(--shadow-card);
}
.demand-card:hover { border-color: rgba(124, 58, 237, 0.3); transform: translateY(-1px); box-shadow: var(--shadow-md); }

.demand-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; gap: 10px; }
.demand-product { font-size: 16px; font-weight: 600; }
.demand-quantity { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.demand-description { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; line-height: 1.4; }

.demand-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--text-muted); }
.demand-meta-item { display: flex; align-items: center; gap: 4px; }

/* Progress Bar */
.progress-bar { width: 100%; height: 6px; background: #edf0f7; border-radius: var(--radius-full); overflow: hidden; margin-top: 4px; }
.progress-fill { height: 100%; border-radius: var(--radius-full); background: var(--gradient-primary); transition: width 0.6s ease; }
.progress-fill.green { background: var(--success); }
.progress-fill.orange { background: var(--warning); }
.progress-fill.red { background: var(--danger); }
.progress-text { font-size: 12px; color: var(--text-muted); display: flex; justify-content: space-between; margin-bottom: 4px; }

/* ---- Badges ---- */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--radius-full); font-size: 11px; font-weight: 600; letter-spacing: 0.2px; }
.badge-active { background: var(--info-bg); color: var(--info); border: 1px solid var(--info-border); }
.badge-completed { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.badge-cancelled { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }
.badge-pending { background: #f0f1f5; color: var(--text-secondary); border: 1px solid var(--border); }
.badge-in_progress { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }
.badge-delivered { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.badge-awaiting_sale { background: var(--info-bg); color: var(--info); border: 1px solid var(--info-border); }
.badge-sold { background: #f0e7ff; color: var(--primary); border: 1px solid rgba(124,58,237,0.2); }
.badge-payment_received { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.badge-paid { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }

.badge-high { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }
.badge-medium { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }
.badge-low { background: var(--info-bg); color: var(--info); border: 1px solid var(--info-border); }

.badge-role-genel_mudur { background: #f0e7ff; color: var(--primary); }
.badge-role-mudur { background: rgba(8,145,178,0.08); color: var(--accent); }
.badge-role-calisan { background: var(--success-bg); color: var(--success); }

/* ---- Assignment Cards ---- */
.assignment-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 15px;
    margin-bottom: 10px; transition: var(--transition);
    box-shadow: var(--shadow-xs);
}
.assignment-card:hover { background: var(--bg-card-hover); border-color: #d0d4e0; }

.assignment-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; flex-wrap: wrap; gap: 8px; }
.assignment-woman { font-weight: 600; font-size: 14px; color: var(--text-primary); }
.assignment-details { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.assignment-detail { display: flex; align-items: center; gap: 4px; }
.assignment-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Days Remaining */
.days-remaining { display: inline-flex; align-items: center; gap: 3px; padding: 3px 8px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; }
.days-remaining.safe { background: var(--success-bg); color: var(--success); }
.days-remaining.warning { background: var(--warning-bg); color: var(--warning); }
.days-remaining.danger { background: var(--danger-bg); color: var(--danger); }
.days-remaining.overdue { background: var(--danger); color: white; }

/* ---- Activity Feed ---- */
.activity-list { display: flex; flex-direction: column; }
.activity-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.activity-item:last-child { border-bottom: none; }

.activity-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.activity-icon.login { background: var(--info-bg); color: var(--info); }
.activity-icon.demand { background: #f0e7ff; color: var(--primary); }
.activity-icon.assignment { background: #fde8f3; color: var(--secondary); }
.activity-icon.status { background: var(--success-bg); color: var(--success); }
.activity-icon.user { background: var(--warning-bg); color: var(--warning); }
.activity-icon.evaluation { background: rgba(8,145,178,0.08); color: var(--accent); }
.activity-icon.finance { background: #fef3c7; color: #92400e; }

.activity-content { flex: 1; min-width: 0; }
.activity-text { color: var(--text-primary); line-height: 1.4; }
.activity-user { font-weight: 600; color: var(--primary); }
.activity-time { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ---- Star Rating ---- */
.star-rating { display: inline-flex; gap: 4px; }
.star-rating .star { cursor: pointer; font-size: 22px; color: #d1d5db; transition: var(--transition); }
.star-rating .star.filled { color: #f59e0b; }
.star-rating .star:hover { transform: scale(1.15); }

.star-display { display: inline-flex; align-items: center; gap: 2px; font-size: 14px; }
.star-display .star-filled { color: #f59e0b; }
.star-display .star-empty { color: #d1d5db; }
.score-value { font-size: 14px; font-weight: 600; margin-left: 5px; color: var(--text-primary); }

/* ---- Profile Cards ---- */
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }

.profile-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 18px;
    cursor: pointer; transition: var(--transition); box-shadow: var(--shadow-card);
}
.profile-card:hover { border-color: rgba(124,58,237,0.3); transform: translateY(-1px); box-shadow: var(--shadow-md); }

.profile-header { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.profile-avatar { width: 48px; height: 48px; border-radius: var(--radius-md); background: var(--gradient-primary); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; color: white; flex-shrink: 0; }
.profile-name { font-size: 15px; font-weight: 600; }
.profile-village { font-size: 13px; color: var(--text-secondary); }

.profile-scores { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.profile-score { text-align: center; padding: 10px 6px; background: var(--bg-input); border-radius: var(--radius-sm); }
.profile-score-value { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.profile-score-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.profile-footer { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-secondary); }

/* ---- User List ---- */
.user-list { display: grid; gap: 10px; }

.user-card {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 18px; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: var(--radius-md);
    transition: var(--transition); box-shadow: var(--shadow-xs);
}
.user-card:hover { background: var(--bg-card-hover); }
.user-card-info { flex: 1; min-width: 0; }
.user-card-name { font-weight: 600; font-size: 15px; }
.user-card-username { font-size: 13px; color: var(--text-secondary); }
.user-card-meta { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.user-card-actions { display: flex; gap: 6px; }

/* ---- Modal ---- */
#modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
    z-index: 200; display: none;
    align-items: center; justify-content: center; padding: 20px;
}
#modal-overlay.show { display: flex; animation: fadeIn 0.2s ease; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-xl); width: 100%; max-width: 520px;
    max-height: 85vh; overflow-y: auto;
    box-shadow: var(--shadow-lg); animation: modalSlide 0.3s ease;
}

@keyframes modalSlide { from { opacity: 0; transform: translateY(15px) scale(0.98); } to { opacity: 1; transform: none; } }

.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 17px; font-weight: 600; }
.modal-close { width: 32px; height: 32px; border-radius: var(--radius-sm); background: transparent; border: none; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 18px; transition: var(--transition); }
.modal-close:hover { background: var(--bg-input); color: var(--text-primary); }
.modal-body { padding: 22px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border); }

/* ---- Toast ---- */
#toast-container { position: fixed; top: calc(var(--header-height) + 12px); right: 16px; z-index: 300; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }

.toast {
    padding: 13px 18px; border-radius: var(--radius-md);
    font-size: 14px; font-weight: 500;
    box-shadow: var(--shadow-lg); pointer-events: auto;
    min-width: 280px; max-width: 400px;
    display: flex; align-items: center; gap: 8px;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 3.5s forwards;
}
.toast-success { background: var(--success); color: white; }
.toast-error { background: var(--danger); color: white; }
.toast-warning { background: var(--warning); color: white; }
.toast-info { background: var(--info); color: white; }

@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateX(40px); } }

/* ---- Notification Panel ---- */
.notif-panel {
    position: fixed; top: var(--header-height); right: 0;
    width: 360px; max-height: calc(100vh - var(--header-height) - 20px);
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 0 0 0 var(--radius-lg); box-shadow: var(--shadow-lg);
    z-index: 150; display: none; flex-direction: column;
}
.notif-panel.show { display: flex; animation: slideRight 0.25s ease; }

@keyframes slideRight { from { opacity: 0; transform: translateX(15px); } to { opacity: 1; transform: none; } }

.notif-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.notif-panel-body { overflow-y: auto; flex: 1; }
.notif-item { display: flex; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--border); transition: var(--transition); cursor: pointer; }
.notif-item:hover { background: var(--bg-card-hover); }
.notif-item.unread { background: #faf8ff; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.notif-dot.info { background: var(--info); }
.notif-dot.success { background: var(--success); }
.notif-dot.warning { background: var(--warning); }
.notif-dot.danger { background: var(--danger); }
.notif-text { font-size: 13px; color: var(--text-primary); line-height: 1.4; }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.notif-empty { padding: 36px 18px; text-align: center; color: var(--text-muted); font-size: 14px; }

/* ---- Filter Bar ---- */
.filter-bar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.filter-bar .form-control { max-width: 200px; padding: 9px 14px; font-size: 13px; }
.search-input { flex: 1; min-width: 180px; position: relative; }
.search-input input { padding-left: 36px; }
.search-input::before { content: '🔍'; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 14px; z-index: 1; }

/* ---- Ranking ---- */
.ranking-list { display: grid; gap: 8px; }
.ranking-item { display: flex; align-items: center; gap: 12px; padding: 13px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-xs); }
.ranking-position { width: 32px; height: 32px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; flex-shrink: 0; }
.ranking-position.gold { background: #fef3c7; color: #92400e; }
.ranking-position.silver { background: #f1f5f9; color: #64748b; }
.ranking-position.bronze { background: #fde8d8; color: #9a3412; }
.ranking-position.normal { background: var(--bg-input); color: var(--text-muted); }
.ranking-info { flex: 1; min-width: 0; }
.ranking-name { font-weight: 600; font-size: 14px; }
.ranking-village { font-size: 12px; color: var(--text-muted); }
.ranking-score { font-size: 18px; font-weight: 700; color: var(--primary); }

/* ---- Detail Page ---- */
.detail-back { display: inline-flex; align-items: center; gap: 5px; color: var(--text-secondary); font-size: 14px; cursor: pointer; margin-bottom: 14px; transition: var(--transition); font-weight: 500; }
.detail-back:hover { color: var(--primary); }

.detail-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 22px; }
.detail-info-item { padding: 13px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-xs); }
.detail-info-label { font-size: 12px; color: var(--text-muted); margin-bottom: 3px; }
.detail-info-value { font-size: 15px; font-weight: 600; color: var(--text-primary); }

.section-divider { display: flex; align-items: center; gap: 12px; margin: 24px 0 14px; }
.section-divider h3 { font-size: 15px; font-weight: 600; white-space: nowrap; color: var(--text-primary); }
.section-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ---- Empty State ---- */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-icon { font-size: 44px; margin-bottom: 14px; opacity: 0.5; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-text { font-size: 14px; max-width: 400px; margin: 0 auto; }

/* ---- Table ---- */
.table-responsive { overflow-x: auto; border-radius: var(--radius-md); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; padding: 11px 14px; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; background: var(--bg-input); border-bottom: 1px solid var(--border); }
.data-table td { padding: 11px 14px; font-size: 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:hover td { background: var(--bg-card-hover); }
.data-table tr:last-child td { border-bottom: none; }

/* ---- Performance Bars ---- */
.perf-bar-group { margin-bottom: 12px; }
.perf-bar-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.perf-bar-label span:first-child { color: var(--text-secondary); }
.perf-bar-label span:last-child { font-weight: 600; color: var(--text-primary); }
.perf-bar { width: 100%; height: 8px; background: #edf0f7; border-radius: var(--radius-full); overflow: hidden; }
.perf-bar-fill { height: 100%; border-radius: var(--radius-full); transition: width 0.8s ease; }
.perf-bar-fill.purple { background: var(--primary); }
.perf-bar-fill.pink { background: var(--secondary); }
.perf-bar-fill.cyan { background: var(--accent); }
.perf-bar-fill.green { background: var(--success); }

/* ---- Finance Specific ---- */
.finance-pipeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-bottom: 22px; }

.pipeline-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 14px;
    text-align: center; box-shadow: var(--shadow-xs);
}
.pipeline-card .pipeline-value { font-size: 22px; font-weight: 800; margin-bottom: 2px; }
.pipeline-card .pipeline-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.pipeline-card.positive .pipeline-value { color: var(--success); }
.pipeline-card.warning .pipeline-value { color: var(--warning); }
.pipeline-card.danger .pipeline-value { color: var(--danger); }
.pipeline-card.info .pipeline-value { color: var(--info); }
.pipeline-card.primary .pipeline-value { color: var(--primary); }

.payment-pending-item {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 16px; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: var(--radius-md);
    margin-bottom: 8px; box-shadow: var(--shadow-xs);
}
.payment-pending-item .payment-info { flex: 1; min-width: 0; }
.payment-pending-item .payment-name { font-weight: 600; font-size: 14px; }
.payment-pending-item .payment-detail { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.payment-pending-item .payment-amount { font-size: 18px; font-weight: 700; color: var(--primary); white-space: nowrap; }
.payment-pending-item .payment-days { font-size: 12px; color: var(--text-muted); margin-top: 2px; text-align: right; }

/* Employee Performance Cards */
.employee-perf-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 16px;
    box-shadow: var(--shadow-xs); margin-bottom: 10px;
}
.employee-perf-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.employee-perf-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; }
.employee-perf-stat { text-align: center; padding: 8px; background: var(--bg-input); border-radius: var(--radius-sm); }
.employee-perf-stat .stat-num { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.employee-perf-stat .stat-lbl { font-size: 10px; color: var(--text-muted); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.3px; }

/* Loading */
.loading { display: flex; align-items: center; justify-content: center; padding: 40px; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tab { padding: 10px 16px; font-size: 14px; font-weight: 500; color: var(--text-muted); cursor: pointer; transition: var(--transition); border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--text-secondary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---- Responsive ---- */
@media (min-width: 768px) {
    .user-info { display: block; }
    #sidebar { display: block; }
    #bottom-nav { display: none; }
    #main-content { margin-left: var(--sidebar-width); padding: 26px 30px; padding-bottom: 30px; }
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
    .notif-panel { width: 400px; }
}

@media (max-width: 767px) {
    .page-title { font-size: 20px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-value { font-size: 22px; }
    .form-row { grid-template-columns: 1fr; }
    .filter-bar .form-control { max-width: none; }
    .profile-grid { grid-template-columns: 1fr; }
    .detail-info-grid { grid-template-columns: repeat(2, 1fr); }
    .login-card { padding: 30px 22px; margin: 0 16px; }
    .notif-panel { width: 100%; border-radius: 0; }
    .modal { margin: 10px; max-height: 90vh; }
    #toast-container { right: 10px; left: 10px; }
    .toast { min-width: 0; max-width: none; }
    .finance-pipeline { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 380px) {
    .stats-grid { grid-template-columns: 1fr; }
    .bottom-nav-item { min-width: 44px; padding: 6px 4px; }
    .finance-pipeline { grid-template-columns: 1fr; }
}

/* ---- Utilities ---- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary); }
.text-money { font-family: 'Inter', monospace; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.fw-600 { font-weight: 600; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================================
   Finans & Performans (v3)
   ============================================================ */

/* ---- Admin rozeti ---- */
.badge-role-admin { background: #fef2f2; color: var(--danger); }

/* ---- Form bölüm başlığı / finans ipucu ---- */
.form-section-title {
    margin: 22px 0 12px; padding-top: 16px; border-top: 1px solid var(--border);
    font-size: 13px; font-weight: 700; letter-spacing: 0.3px; color: var(--primary);
    text-transform: uppercase;
}
.fin-hint {
    margin: -4px 0 16px; padding: 10px 14px; border-radius: var(--radius-sm);
    background: var(--bg-input); font-size: 13px; color: var(--text-secondary);
}

/* ---- Finans özet kartları ---- */
.fin-cards {
    display: grid; gap: 14px; margin-bottom: 24px;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.fin-card {
    position: relative; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 16px 18px 16px 20px;
    box-shadow: var(--shadow-card); overflow: hidden;
}
.fin-card::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
    background: var(--primary);
}
.fin-card.purple::before { background: var(--primary); }
.fin-card.cyan::before { background: var(--accent); }
.fin-card.green::before { background: var(--success); }
.fin-card.blue::before { background: var(--info); }
.fin-card.orange::before { background: var(--warning); }
.fin-card.red::before { background: var(--danger); }
.fin-card-icon { font-size: 22px; margin-bottom: 6px; }
.fin-card-label { font-size: 11px; font-weight: 700; letter-spacing: 0.5px; color: var(--text-muted); text-transform: uppercase; }
.fin-card-value { font-size: 24px; font-weight: 800; color: var(--text-primary); margin: 4px 0 2px; }
.fin-card-sub { font-size: 12px; color: var(--text-secondary); }

/* ---- Trend grafiği ---- */
.fin-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; font-size: 13px; color: var(--text-secondary); }
.fin-legend .dot { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.dot.green { background: var(--success); }
.dot.red { background: var(--danger); }
.dot.purple { background: var(--primary); }
.fin-chart { display: flex; gap: 8px; align-items: flex-end; min-height: 220px; }
.fin-chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.fin-bars { display: flex; align-items: flex-end; gap: 4px; height: 160px; width: 100%; justify-content: center; }
.fin-bar { width: 22%; min-height: 2px; border-radius: 4px 4px 0 0; transition: var(--transition); }
.fin-bar.green { background: var(--success); }
.fin-bar.red { background: var(--danger); }
.fin-bar.purple { background: var(--primary); }
.fin-chart-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.fin-chart-vals { display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 10px; font-weight: 600; }

/* ---- Finans tabloları ---- */
.fin-table th.num, .fin-table td.num { text-align: right; white-space: nowrap; }
.fin-table .fin-total-row td { background: var(--bg-input); border-top: 2px solid var(--border); font-size: 14px; }
.fin-table .fin-total-row:hover td { background: var(--bg-input); }
.fin-amount { font-weight: 700; }
.count-pill {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 22px; height: 22px; padding: 0 7px; border-radius: var(--radius-full);
    background: var(--warning-bg); color: var(--warning); font-size: 12px; font-weight: 700;
}

/* ---- Performans ---- */
.perf-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.perf-person-card { padding: 16px; }
.perf-person-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.perf-person-name { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.perf-person-role { margin-top: 3px; }
.perf-money { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.perf-money > div { flex: 1; }
.perf-money-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; }
.perf-money-value { font-size: 17px; font-weight: 800; margin-top: 2px; }
.perf-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0 10px; }
.perf-metric { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; background: var(--bg-input); border-radius: var(--radius-sm); }
.perf-metric-val { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.perf-metric-lbl { font-size: 10px; color: var(--text-muted); text-align: center; }
.perf-last { font-size: 12px; color: var(--text-muted); }

@media (max-width: 640px) {
    .fin-chart-vals { display: none; }
    .fin-card-value { font-size: 20px; }
}

/* ============================================================
   Koyu Tema (data-theme="dark")
   ============================================================ */
html[data-theme="dark"] {
    --bg-page: #0f1117;
    --bg-card: #181b25;
    --bg-card-hover: #20242f;
    --bg-input: #1c2029;
    --bg-sidebar: #14171f;
    --bg-header: rgba(20, 23, 31, 0.92);
    --border: #2b3140;
    --border-focus: rgba(139, 92, 246, 0.55);
    --text-primary: #f0f2f7;
    --text-secondary: #aeb6c6;
    --text-muted: #7b8497;
    --gradient-soft: linear-gradient(135deg, #241a3a, #321f2e);
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
}
/* Koyu temada açık-renk sabit zeminlerin uyarlanması */
html[data-theme="dark"] .nav-item.active { background: rgba(124, 58, 237, 0.20); }
html[data-theme="dark"] .stat-icon.purple { background: rgba(124, 58, 237, 0.20); }
html[data-theme="dark"] .stat-icon.pink { background: rgba(236, 72, 153, 0.20); }
html[data-theme="dark"] .stat-icon.teal { background: rgba(8, 145, 178, 0.20); }
html[data-theme="dark"] .progress-bar,
html[data-theme="dark"] .perf-bar { background: #2b3140; }
html[data-theme="dark"] .badge-pending { background: #2b3140; color: var(--text-secondary); border-color: #3a4150; }
html[data-theme="dark"] .badge-role-genel_mudur { background: rgba(124, 58, 237, 0.22); }
html[data-theme="dark"] .badge-role-admin { background: rgba(220, 38, 38, 0.22); }
html[data-theme="dark"] .notification-btn:hover { background: #262b37; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #3a4150; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #4a5263; }

/* Koyu temada giriş ekranı ve form alanları okunabilirliği */
html[data-theme="dark"] #login-screen {
    background: linear-gradient(135deg, #15101f 0%, #1a0f18 50%, #0f141d 100%);
}
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select,
html[data-theme="dark"] .form-control {
    color: var(--text-primary);
    background-color: var(--bg-input);
}
/* Tarayıcı otomatik doldurma (autofill) — açık zemin + açık yazı sorununu giderir */
html[data-theme="dark"] input:-webkit-autofill,
html[data-theme="dark"] input:-webkit-autofill:hover,
html[data-theme="dark"] input:-webkit-autofill:focus,
html[data-theme="dark"] input:-webkit-autofill:active,
html[data-theme="dark"] textarea:-webkit-autofill,
html[data-theme="dark"] select:-webkit-autofill {
    -webkit-text-fill-color: var(--text-primary);
    -webkit-box-shadow: 0 0 0 1000px var(--bg-input) inset;
    box-shadow: 0 0 0 1000px var(--bg-input) inset;
    caret-color: var(--text-primary);
    transition: background-color 9999s ease-out 0s;
}
/* Native select açılır listesi (OS) için okunabilir renkler */
html[data-theme="dark"] select.form-control option {
    background-color: #1c2029;
    color: var(--text-primary);
}
