/**
 * KAI CRM - Ana Stil Dosyası
 * KONUM: public_html/assets/css/style.css
 * Tema: Slate (#1e293b) + Amber (#f59e0b)
 */

:root {
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;

    --amber-400: #fbbf24;
    --amber-500: #f59e0b;
    --amber-600: #d97706;

    --primary: var(--slate-800);
    --secondary: var(--amber-500);

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    --sidebar-width: 260px;
    --header-height: 64px;
}

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

body {
    font-family: 'Inter', sans-serif;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--slate-800);
    background: var(--slate-50);
}

a { color: var(--secondary); text-decoration: none; }
a:hover { color: var(--amber-600); }

/* Layout */
.app-wrapper { display: flex; min-height: 100vh; }
.main-content { flex: 1; margin-left: var(--sidebar-width); }
.page-content { padding: 24px; margin-top: var(--header-height); }

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--primary);
    color: #fff;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
    width: 40px; height: 40px;
    background: var(--secondary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary);
}

.sidebar-title { font-size: 1.25rem; font-weight: 600; }

.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }

.nav-section { margin-bottom: 24px; }
.nav-section-title {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--slate-400);
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--slate-300);
    margin-bottom: 4px;
    transition: all 0.2s;
}

.nav-item:hover { background: rgba(255,255,255,0.1); color: #fff; }
.nav-item.active { background: var(--secondary); color: var(--primary); }
.nav-item i { width: 20px; font-size: 1.125rem; }

.nav-badge {
    background: var(--danger);
    color: #fff;
    font-size: 0.6875rem;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: auto;
}

.sidebar-footer { padding: 16px; border-top: 1px solid rgba(255,255,255,0.1); }

/* Header */
.header {
    position: fixed;
    top: 0; right: 0;
    left: var(--sidebar-width);
    height: var(--header-height);
    background: #fff;
    border-bottom: 1px solid var(--slate-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 900;
}

.header-left, .header-right { display: flex; align-items: center; gap: 16px; }
.page-title { font-size: 1.125rem; font-weight: 600; }

.sidebar-toggle {
    background: none; border: none;
    cursor: pointer; padding: 8px;
    border-radius: 4px;
    color: var(--slate-500);
}
.sidebar-toggle:hover { background: var(--slate-100); }

.header-icon-btn {
    position: relative;
    background: none; border: none;
    cursor: pointer; padding: 8px;
    border-radius: 8px;
    color: var(--slate-500);
}
.header-icon-btn:hover { background: var(--slate-100); }
.header-icon-btn .badge {
    position: absolute;
    top: 2px; right: 2px;
    width: 8px; height: 8px;
    background: var(--danger);
    border-radius: 50%;
}

.user-dropdown {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
}
.user-dropdown:hover { background: var(--slate-100); }

.user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--secondary);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.user-name { font-weight: 500; font-size: 0.875rem; }
.user-role { font-size: 0.75rem; color: var(--slate-400); }

/* Cards */
.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid var(--slate-200);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--slate-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title { font-size: 1rem; font-weight: 600; }
.card-body { padding: 20px; }
.card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--slate-200);
    background: var(--slate-50);
    border-radius: 0 0 12px 12px;
}

/* Stat Cards */
.stat-card { display: flex; align-items: center; gap: 16px; padding: 20px; }

.stat-icon {
    width: 48px; height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}
.stat-icon.primary { background: rgba(245,158,11,0.15); color: var(--secondary); }
.stat-icon.success { background: #d1fae5; color: var(--success); }
.stat-icon.danger { background: #fee2e2; color: var(--danger); }
.stat-icon.info { background: #dbeafe; color: var(--info); }

.stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: 0.8125rem; color: var(--slate-400); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary { background: var(--secondary); color: var(--primary); }
.btn-primary:hover:not(:disabled) { background: var(--amber-600); }

.btn-secondary { background: var(--primary); color: #fff; }
.btn-secondary:hover:not(:disabled) { background: var(--slate-900); }

.btn-outline { background: transparent; border: 1px solid var(--slate-200); color: var(--slate-800); }
.btn-outline:hover:not(:disabled) { background: var(--slate-100); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }

.btn-sm { padding: 6px 12px; font-size: 0.8125rem; }
.btn-icon { width: 36px; height: 36px; padding: 0; }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-label { display: block; margin-bottom: 6px; font-size: 0.875rem; font-weight: 500; }
.form-label .required { color: var(--danger); }

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.9375rem;
    border: 1px solid var(--slate-200);
    border-radius: 8px;
    background: #fff;
    transition: all 0.2s;
}
.form-control:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(245,158,11,0.15);
}
.form-control:disabled { background: var(--slate-100); cursor: not-allowed; }

textarea.form-control { min-height: 100px; resize: vertical; }
select.form-control { cursor: pointer; }

.form-hint { font-size: 0.8125rem; color: var(--slate-400); margin-top: 4px; }
.form-error { font-size: 0.8125rem; color: var(--danger); margin-top: 4px; }

.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.form-row-3 { grid-template-columns: repeat(3, 1fr); }

/* Tables */
.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }

.table th, .table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--slate-200);
}

.table th {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--slate-500);
    text-transform: uppercase;
    letter-spacing: 0.025em;
    background: var(--slate-50);
}

.table tbody tr:hover { background: var(--slate-50); }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 20px;
}
.badge-primary { background: rgba(245,158,11,0.15); color: var(--amber-600); }
.badge-success { background: #d1fae5; color: #047857; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-info { background: #dbeafe; color: #1d4ed8; }
.badge-secondary { background: var(--slate-100); color: var(--slate-600); }

/* Alerts */
.alert {
    padding: 14px 18px;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
}
.alert i { font-size: 1.25rem; flex-shrink: 0; }
.alert-success { background: #d1fae5; color: #047857; border: 1px solid #a7f3d0; }
.alert-warning { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.alert-error { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-info { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--slate-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-title { font-size: 1.125rem; font-weight: 600; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 1.5rem; color: var(--slate-400); }

.modal-body { padding: 20px; }
.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--slate-200);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Pagination */
.pagination { display: flex; align-items: center; gap: 4px; }
.pagination-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--slate-500);
}
.pagination-item:hover { background: var(--slate-100); }
.pagination-item.active { background: var(--secondary); color: var(--primary); }
.pagination-item.disabled { opacity: 0.5; pointer-events: none; }

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--slate-400); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

.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; }
.mt-3 { margin-top: 24px; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

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

/* Login Page */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--slate-900) 100%);
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 420px;
    padding: 40px;
}

.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo-icon {
    width: 60px; height: 60px;
    background: var(--secondary);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 16px;
}
.login-logo h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 4px; }
.login-logo p { color: var(--slate-400); }

/* Animations */
.slide-in { animation: slideIn 0.3s ease; }
@keyframes slideIn {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 1200px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .main-content { margin-left: 0; }
    .header { left: 0; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.active { transform: translateX(0); }
}