/* Reklav CRM - Ana Stil Dosyası */
:root {
    --bg: #0f1117;
    --bg2: #161b27;
    --bg3: #1e2433;
    --bg4: #252c3d;
    --border: #2d3550;
    --border2: #3d4870;
    --text: #e8ecf4;
    --text2: #8b96b0;
    --text3: #5a6380;
    --accent: #6366f1;
    --accent2: #818cf8;
    --accent-bg: rgba(99,102,241,0.12);
    --green: #10b981;
    --green-bg: rgba(16,185,129,0.12);
    --amber: #f59e0b;
    --amber-bg: rgba(245,158,11,0.12);
    --red: #ef4444;
    --red-bg: rgba(239,68,68,0.12);
    --blue: #3b82f6;
    --blue-bg: rgba(59,130,246,0.12);
    --purple: #a855f7;
    --sidebar-w: 240px;
    --radius: 8px;
    --radius-lg: 12px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
}

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

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

/* ---- SIDEBAR ---- */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-logo {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo .logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
}

.sidebar-logo .logo-sub {
    font-size: 11px;
    color: var(--text3);
    margin-top: 2px;
}

.sidebar-nav {
    padding: 12px 0;
    flex: 1;
}

.nav-section {
    padding: 8px 16px 4px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    color: var(--text2);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    border-left: 3px solid transparent;
    text-decoration: none;
}

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

.nav-item.active {
    color: var(--accent2);
    background: var(--accent-bg);
    border-left-color: var(--accent);
}

.nav-item .nav-icon {
    width: 18px;
    text-align: center;
    font-size: 15px;
    flex-shrink: 0;
}

.nav-badge {
    margin-left: auto;
    background: var(--red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.sidebar-user {
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-user .user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.sidebar-user .user-role {
    font-size: 11px;
    color: var(--text3);
}

/* ---- MAIN ---- */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-bar {
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.page-subtitle {
    font-size: 12px;
    color: var(--text3);
    margin-top: 1px;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.content-area {
    padding: 24px 28px;
    flex: 1;
}

/* ---- AVATAR ---- */
.avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
    flex-shrink: 0;
    color: #fff;
}

.avatar-sm { width: 26px; height: 26px; font-size: 10px; }
.avatar-lg { width: 44px; height: 44px; font-size: 15px; }

/* ---- CARDS ---- */
.card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    margin-bottom: 16px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.card-sub {
    font-size: 12px;
    color: var(--text3);
    margin-top: 2px;
}

/* ---- GRID ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ---- STAT CARDS ---- */
.stat-card {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
}

.stat-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}

.stat-meta {
    font-size: 12px;
    color: var(--text3);
    margin-top: 6px;
}

.stat-icon {
    font-size: 22px;
    margin-bottom: 8px;
}

/* ---- BUTTONS ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid transparent;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.btn-primary:hover { background: #4f46e5; color: #fff; }

.btn-secondary {
    background: var(--bg4);
    color: var(--text2);
    border-color: var(--border2);
}
.btn-secondary:hover { color: var(--text); background: var(--bg3); }

.btn-success {
    background: var(--green-bg);
    color: var(--green);
    border-color: rgba(16,185,129,0.3);
}
.btn-success:hover { background: var(--green); color: #fff; }

.btn-danger {
    background: var(--red-bg);
    color: var(--red);
    border-color: rgba(239,68,68,0.3);
}
.btn-danger:hover { background: var(--red); color: #fff; }

.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; }
.btn-icon { padding: 7px; width: 34px; height: 34px; justify-content: center; }

/* ---- FORMS ---- */
.form-group { margin-bottom: 16px; }
.form-row { display: grid; gap: 14px; margin-bottom: 16px; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text2);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

input[type=text], input[type=email], input[type=password],
input[type=date], input[type=tel], input[type=url],
input[type=number], select, textarea {
    width: 100%;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 9px 12px;
    font-size: 13.5px;
    color: var(--text);
    font-family: inherit;
    transition: border-color 0.15s;
    outline: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    background: var(--bg4);
}

select option { background: var(--bg3); }
textarea { resize: vertical; min-height: 80px; line-height: 1.6; }

.form-check { display: flex; align-items: center; gap: 8px; }
.form-check input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.form-check label { margin: 0; text-transform: none; font-size: 13px; font-weight: 400; letter-spacing: 0; color: var(--text2); cursor: pointer; }

/* Checkbox grupları (servis seçimi) */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.checkbox-pill {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 12px;
    color: var(--text2);
    cursor: pointer;
    transition: all 0.15s;
}

.checkbox-pill input { display: none; }
.checkbox-pill:has(input:checked) {
    background: var(--accent-bg);
    border-color: var(--accent);
    color: var(--accent2);
}

/* ---- TABLES ---- */
.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    text-align: left;
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 13.5px;
    vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }

tbody tr:hover td { background: var(--bg3); }

/* ---- BADGES ---- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.badge-high { background: rgba(239,68,68,0.15); color: #f87171; }
.badge-normal { background: rgba(59,130,246,0.15); color: #60a5fa; }
.badge-low { background: rgba(100,116,139,0.15); color: #94a3b8; }

.status-waiting { background: rgba(245,158,11,0.15); color: #fbbf24; }
.status-progress { background: rgba(99,102,241,0.15); color: #818cf8; }
.status-done { background: rgba(16,185,129,0.15); color: #34d399; }
.status-cancel { background: rgba(100,116,139,0.15); color: #64748b; }

.cst-aktif { background: rgba(16,185,129,0.15); color: #34d399; }
.cst-teklif { background: rgba(99,102,241,0.15); color: #818cf8; }
.cst-pasif { background: rgba(245,158,11,0.15); color: #fbbf24; }
.cst-kayip { background: rgba(239,68,68,0.15); color: #f87171; }
.cst-lead { background: rgba(168,85,247,0.15); color: #c084fc; }

.badge-overdue { background: rgba(239,68,68,0.2); color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.badge-today { background: rgba(245,158,11,0.2); color: #fbbf24; border: 1px solid rgba(245,158,11,0.3); }

/* ---- TASK ITEMS ---- */
.task-list { }

.task-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
}

.task-item:last-child { border-bottom: none; }

.task-item:hover { background: var(--bg3); margin: 0 -22px; padding: 12px 22px; border-radius: var(--radius); }

.task-check {
    width: 18px; height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
    margin-top: 2px;
    flex-shrink: 0;
}

.task-body { flex: 1; min-width: 0; }

.task-title {
    font-size: 14px;
    color: var(--text);
    line-height: 1.4;
    font-weight: 500;
}

.task-title.done {
    text-decoration: line-through;
    color: var(--text3);
}

.task-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
    flex-wrap: wrap;
}

.task-meta-item {
    font-size: 11px;
    color: var(--text3);
    display: flex;
    align-items: center;
    gap: 3px;
}

.task-actions { display: flex; gap: 4px; align-items: center; opacity: 0; transition: opacity 0.15s; }
.task-item:hover .task-actions { opacity: 1; }

/* ---- PROGRESS BAR ---- */
.progress-bar {
    height: 6px;
    background: var(--bg4);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--accent);
    transition: width 0.4s;
}

/* ---- ALERTS / FLASH ---- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-success { background: var(--green-bg); color: var(--green); border: 1px solid rgba(16,185,129,0.3); }
.alert-error { background: var(--red-bg); color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.alert-warning { background: var(--amber-bg); color: var(--amber); border: 1px solid rgba(245,158,11,0.3); }
.alert-info { background: var(--blue-bg); color: #60a5fa; border: 1px solid rgba(59,130,246,0.3); }

/* ---- MODALS ---- */
.modal-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 200;
    justify-content: center;
    align-items: flex-start;
    padding: 60px 20px 20px;
    overflow-y: auto;
}

.modal-backdrop.show { display: flex; }

.modal {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;
    padding: 24px 26px;
    position: relative;
    animation: modalIn 0.2s ease;
}

.modal-lg { max-width: 720px; }

@keyframes modalIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-title { font-size: 16px; font-weight: 600; }

.modal-close {
    background: none; border: none;
    color: var(--text3); cursor: pointer;
    font-size: 20px; padding: 2px 6px;
    border-radius: var(--radius);
    transition: color 0.15s;
}
.modal-close:hover { color: var(--text); }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* ---- FILTERS ---- */
.filter-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.filter-bar select, .filter-bar input {
    width: auto;
    padding: 7px 12px;
    font-size: 13px;
}

/* ---- ACTIVITY LOG ---- */
.activity-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.activity-item:last-child { border-bottom: none; }

.activity-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent);
    margin-top: 6px;
    flex-shrink: 0;
}

.activity-text { font-size: 13px; color: var(--text2); line-height: 1.5; }
.activity-time { font-size: 11px; color: var(--text3); margin-top: 2px; }
.activity-user { font-weight: 600; color: var(--text); }
.activity-entity { color: var(--accent2); font-weight: 500; }

/* ---- MEMBER OVERVIEW ---- */
.member-card {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
}

.member-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.member-stats {
    display: flex;
    gap: 16px;
    margin-top: 10px;
}

.member-stat {
    text-align: center;
}

.member-stat-val { font-size: 18px; font-weight: 700; color: var(--text); }
.member-stat-label { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.05em; }

/* ---- DEVIR BANNER ---- */
.devir-banner {
    background: var(--amber-bg);
    border: 1px solid rgba(245,158,11,0.25);
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--amber);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---- OVERDUE BANNER ---- */
.overdue-banner {
    background: var(--red-bg);
    border: 1px solid rgba(239,68,68,0.25);
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #f87171;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---- USER COLOR DOT ---- */
.user-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

/* ---- CUSTOMER DETAIL ---- */
.detail-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.detail-row:last-child { border-bottom: none; }
.detail-label { width: 160px; flex-shrink: 0; color: var(--text3); font-weight: 500; }
.detail-value { color: var(--text); flex: 1; }

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
    :root { --sidebar-w: 200px; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.2s; }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .content-area { padding: 16px; }
    .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
    .top-bar { padding: 12px 16px; }
}

/* ---- LOGIN PAGE ---- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 20px;
}

.login-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 40px;
    width: 100%;
    max-width: 400px;
}

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

.login-logo h1 { font-size: 24px; font-weight: 800; color: var(--text); }
.login-logo p { font-size: 13px; color: var(--text3); margin-top: 4px; }

/* ---- TABS ---- */
.tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.tab-btn {
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text3);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    transition: color 0.15s;
}

.tab-btn:hover { color: var(--text2); }
.tab-btn.active { color: var(--accent2); border-bottom-color: var(--accent); }

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ---- EMPTY STATE ---- */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text3);
}

.empty-state-icon { font-size: 36px; margin-bottom: 10px; }
.empty-state p { font-size: 14px; }

/* ---- MISC ---- */
.text-muted { color: var(--text3); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.fw-600 { font-weight: 600; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.ml-auto { margin-left: auto; }
.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.tag { background: var(--bg4); color: var(--text2); border: 1px solid var(--border); border-radius: 4px; padding: 2px 7px; font-size: 11px; font-weight: 500; }

.overdue-row td { background: rgba(239,68,68,0.04) !important; }
