/* =============================================================================
   Curato Agency — Panel Stil Dosyası
   Marka: mor (#7c3aed) aksan, açık tema, yuvarlatılmış köşeler.
============================================================================= */

:root {
  --background: #f7f6fb;
  --foreground: #17161d;
  --card: #ffffff;
  --card-foreground: #17161d;
  --primary: #7c3aed;
  --primary-hover: #6d28d9;
  --primary-foreground: #ffffff;
  --primary-soft: rgba(124, 58, 237, .10);
  --secondary: #f1eef9;
  --secondary-foreground: #3a3550;
  --muted: #f2f1f6;
  --muted-foreground: #6b6878;
  --accent: #ede9fe;
  --accent-foreground: #5b21b6;
  --destructive: #e11d48;
  --destructive-foreground: #ffffff;
  --success: #10b981;
  --warning: #f59e0b;
  --border: #e7e5ef;
  --input: #e2dff0;
  --ring: #7c3aed;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(23,22,29,.06);
  --shadow-md: 0 4px 16px rgba(23,22,29,.08);
  --shadow-lg: 0 12px 32px rgba(23,22,29,.14);
  --sidebar-w: 260px;
}

* { box-sizing: border-box; }
svg { width: 18px; height: 18px; flex-shrink: 0; } /* güvenli varsayılan; daha spesifik kurallar bunu ezer */
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'DM Sans', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--background);
  color: var(--foreground);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: 'Plus Jakarta Sans', 'DM Sans', sans-serif; letter-spacing: -0.02em; margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d8d4e8; border-radius: 8px; }

/* ---------------- Layout shell ---------------- */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w);
  background: var(--card); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 50;
  transition: transform .25s ease;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px; height: 64px; padding: 0 20px;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.sidebar-brand .logo-box {
  width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg,#7c3aed,#a855f7);
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 15px; flex-shrink: 0;
}
.sidebar-brand .brand-name { font-weight: 700; line-height: 1.1; font-size: 15px; }
.sidebar-brand .brand-sub { font-size: 11.5px; color: var(--muted-foreground); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px; }
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 13.7px; font-weight: 500; color: var(--muted-foreground); margin-bottom: 2px;
}
.nav-link:hover { background: var(--accent); color: var(--foreground); }
.nav-link.active { background: var(--primary); color: var(--primary-foreground); box-shadow: var(--shadow-sm); }
.nav-link svg { width: 17px; height: 17px; flex-shrink: 0; }
.nav-section-title {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: #a29dbb; padding: 16px 12px 6px;
}

.sidebar-footer { border-top: 1px solid var(--border); padding: 12px; flex-shrink: 0; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--secondary); color: var(--secondary-foreground);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.user-chip .u-name { font-size: 13.5px; font-weight: 600; }
.user-chip .u-role { font-size: 11.5px; color: var(--muted-foreground); }
.logout-btn {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 10px; margin-top: 4px;
  border: none; background: transparent; color: var(--muted-foreground); border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13.5px; font-weight: 500;
}
.logout-btn:hover { color: var(--destructive); background: rgba(225,29,72,.08); }
.logout-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.main-area { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 24px;
  border-bottom: 1px solid var(--border); background: rgba(255,255,255,.85); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 30;
}
.topbar .spacer { flex: 1; }
.menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: 6px; color: var(--foreground); }
.content { padding: 28px 28px 60px; max-width: 1240px; margin: 0 auto; width: 100%; }

.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(23,22,29,.4); z-index: 45; }

@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-area { margin-left: 0; }
  .menu-toggle { display: inline-flex; }
  .sidebar-backdrop.open { display: block; }
}

/* ---------------- Page header ---------------- */
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-header h1 { font-size: 24px; font-weight: 800; }
.page-header p { color: var(--muted-foreground); font-size: 13.5px; margin-top: 4px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------- Cards / grid ---------------- */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 20px;
}
.card + .card { margin-top: 16px; }
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.stat-card .stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.stat-card .stat-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; }
.stat-card .stat-label { font-size: 12.5px; color: var(--muted-foreground); font-weight: 600; }
.stat-card .stat-value { font-size: 24px; font-weight: 800; margin-top: 2px; }
.stat-card .stat-sub { font-size: 12px; color: var(--muted-foreground); margin-top: 4px; }
.stat-card .stat-sub.up { color: var(--success); }
.stat-card .stat-sub.down { color: var(--destructive); }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
  border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 600; padding: 9px 16px; border: 1px solid transparent;
  transition: .15s ease; white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--primary); color: var(--primary-foreground); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--secondary); color: var(--secondary-foreground); }
.btn-secondary:hover { background: #e6e1f7; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--foreground); }
.btn-outline:hover { background: var(--muted); }
.btn-ghost { background: transparent; color: var(--muted-foreground); }
.btn-ghost:hover { background: var(--muted); color: var(--foreground); }
.btn-danger { background: var(--destructive); color: #fff; }
.btn-danger:hover { background: #be123c; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-icon { padding: 8px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------------- Forms ---------------- */
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
label { display: block; font-size: 12.7px; font-weight: 600; margin-bottom: 6px; color: var(--secondary-foreground); }
label .req { color: var(--destructive); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
input[type=datetime-local], input[type=tel], input[type=search], textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--input); border-radius: var(--radius-sm);
  background: #fff; color: var(--foreground); font-size: 13.7px; font-family: inherit;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px var(--primary-soft); }
.help-text { font-size: 11.7px; color: var(--muted-foreground); margin-top: 5px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }

/* ---------------- Table ---------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: 13.3px; min-width: 640px; }
thead th {
  text-align: left; padding: 12px 16px; font-size: 11.3px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted-foreground); font-weight: 700; border-bottom: 1px solid var(--border); background: var(--muted);
}
tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--accent); }
.table-empty { padding: 40px 20px; text-align: center; color: var(--muted-foreground); }

/* ---------------- Badges ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; border: 1px solid transparent; white-space: nowrap;
}
.badge-slate { background: #eef0f4; color: #52525b; border-color: #dfe1e8; }
.badge-sky { background: #e0f2fe; color: #0369a1; border-color: #bae6fd; }
.badge-amber { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.badge-rose { background: #ffe4e6; color: #9f1239; border-color: #fecdd3; }
.badge-violet { background: var(--primary-soft); color: var(--primary); border-color: rgba(124,58,237,.25); }
.badge-emerald { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }

/* ---------------- Kanban ---------------- */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(260px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
@media (max-width: 1023px) { .kanban { grid-template-columns: repeat(4, 84vw); } }
.kanban-col { background: var(--muted); border-radius: var(--radius); border-top: 3px solid var(--border); padding: 12px; min-height: 200px; }
.kanban-col.c-bekliyor { border-top-color: #94a3b8; }
.kanban-col.c-devam-ediyor { border-top-color: #a78bfa; }
.kanban-col.c-tamamlandi { border-top-color: #34d399; }
.kanban-col.c-iptal { border-top-color: #fb7185; }
.kanban-col-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; padding: 0 4px; }
.kanban-col-head h3 { font-size: 13px; font-weight: 700; }
.kanban-count { font-size: 11px; background: #fff; border: 1px solid var(--border); padding: 1px 8px; border-radius: 999px; color: var(--muted-foreground); }
.kanban-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 10px;
  box-shadow: var(--shadow-sm); cursor: pointer;
}
.kanban-card:hover { box-shadow: var(--shadow-md); }
.kanban-card .kc-title { font-size: 13.3px; font-weight: 600; margin-bottom: 8px; }
.kanban-card .kc-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.kanban-card .kc-customer { font-size: 11.5px; color: var(--muted-foreground); }

/* ---------------- Modal ---------------- */
.modal-backdrop { display: none; position: fixed; inset: 0; background: rgba(23,22,29,.45); z-index: 100; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.modal-backdrop.open { display: flex; }
.modal { background: #fff; border-radius: var(--radius-lg); width: 100%; max-width: 560px; box-shadow: var(--shadow-lg); }
.modal.modal-lg { max-width: 780px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 16px; font-weight: 700; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--muted-foreground); padding: 4px; }
.modal-body { padding: 20px 22px; max-height: 74vh; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 22px; border-top: 1px solid var(--border); }

/* ---------------- Alerts / flash ---------------- */
.alert { border-radius: var(--radius-sm); padding: 12px 16px; font-size: 13.3px; margin-bottom: 14px; border: 1px solid transparent; }
.alert-success { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.alert-error { background: #ffe4e6; color: #9f1239; border-color: #fecdd3; }
.alert-info { background: #e0f2fe; color: #0369a1; border-color: #bae6fd; }

/* ---------------- Tabs ---------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab-link { padding: 10px 14px; font-size: 13.3px; font-weight: 600; color: var(--muted-foreground); border-bottom: 2px solid transparent; white-space: nowrap; }
.tab-link.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---------------- Auth (login) ---------------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 20% 20%, #ede9fe, #f7f6fb 60%); padding: 20px; }
.auth-card { width: 100%; max-width: 400px; background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 36px 32px; border: 1px solid var(--border); }
.auth-logo { display: flex; flex-direction: column; align-items: center; margin-bottom: 22px; }
.auth-logo .logo-box { width: 56px; height: 56px; border-radius: 16px; margin-bottom: 12px; }
.auth-card h1 { font-size: 20px; text-align: center; }
.auth-card p.sub { text-align: center; color: var(--muted-foreground); font-size: 13px; margin-top: 4px; margin-bottom: 24px; }

/* ---------------- Misc ---------------- */
.text-muted { color: var(--muted-foreground); }
.text-sm { font-size: 12.5px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.mt-1{margin-top:4px;} .mt-2{margin-top:8px;} .mt-3{margin-top:12px;} .mt-4{margin-top:16px;}
.mb-1{margin-bottom:4px;} .mb-2{margin-bottom:8px;} .mb-3{margin-bottom:12px;} .mb-4{margin-bottom:16px;}
.w-full { width: 100%; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted-foreground); }
.empty-state svg { width: 44px; height: 44px; margin-bottom: 12px; opacity: .5; }
.progress-bar { height: 6px; background: var(--muted); border-radius: 999px; overflow: hidden; }
.progress-bar > div { height: 100%; background: var(--primary); }
.pill-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.pill-filter a, .pill-filter button { padding: 7px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600; border: 1px solid var(--border); background: #fff; color: var(--muted-foreground); cursor: pointer; }
.pill-filter a.active, .pill-filter button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.notif-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--destructive); border: 2px solid #fff; }
.dropdown { position: relative; }
.dropdown-menu { display: none; position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 320px; max-height: 420px; overflow-y: auto; z-index: 60; }
.dropdown-menu.open { display: block; }
.dropdown-item { padding: 12px 16px; border-bottom: 1px solid var(--border); display: block; font-size: 12.7px; }
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item.unread { background: var(--accent); }
.file-chip { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 12.5px; margin-bottom: 6px; }
.file-chip .fc-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-close { cursor: pointer; color: var(--muted-foreground); }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
