:root {
  --navy: #10151f;
  --navy-2: #171e2c;
  --navy-3: #222c3f;
  --paper: #f5f6f8;
  --card: #ffffff;
  --border: #e3e6ec;
  --text: #1b2130;
  --text-dim: #6b7280;
  --accent: #ff7a3d;
  --accent-dim: #ffe3d1;
  --blue: #4f6df5;
  --green: #1fa971;
  --red: #e15554;
  --amber: #d99b26;
  --radius: 10px;
  font-size: 15px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .brand {
  font-family: "Space Grotesk", "Inter", sans-serif;
  letter-spacing: -0.01em;
}

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

/* ---------- Layout ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--navy);
  color: #cbd3e1;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
}

.sidebar .brand {
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.sidebar .brand-sub {
  color: #8891a3;
  font-size: 0.75rem;
  margin-bottom: 28px;
}

.nav-section { margin-bottom: 22px; }
.nav-label {
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: #6d7688;
  margin: 0 0 8px 10px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  color: #cbd3e1;
  font-size: 0.92rem;
  margin-bottom: 2px;
}
.nav-link:hover { background: var(--navy-3); text-decoration: none; color: #fff; }
.nav-link.active { background: var(--accent); color: #1b1200; font-weight: 600; }

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--navy-3);
  padding-top: 14px;
  font-size: 0.82rem;
}
.sidebar-footer .user-name { color: #fff; font-weight: 600; }
.sidebar-footer .role-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--navy-3);
  color: #9fb0ff;
  font-size: 0.7rem;
}

.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 1.15rem; margin: 0; }

.content { padding: 26px 28px 60px; }

/* ---------- Notification bell ---------- */
.notif-wrap { position: relative; }
.notif-bell {
  position: relative;
  cursor: pointer;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}
.notif-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--red); color: #fff;
  font-size: 0.65rem; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}
.notif-dropdown {
  display: none;
  position: absolute;
  top: 48px; right: 0;
  width: 340px;
  max-height: 420px;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(10, 15, 30, 0.15);
  z-index: 50;
}
.notif-dropdown.open { display: block; }
.notif-dropdown-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; border-bottom: 1px solid var(--border); font-weight: 600;
}
.notif-dropdown-header button {
  font-size: 0.75rem; background: none; border: none; color: var(--blue); cursor: pointer;
}
.notif-item {
  padding: 11px 14px; border-bottom: 1px solid var(--border);
  font-size: 0.85rem; cursor: pointer;
}
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: #fff6ef; }
.notif-item .notif-time { display: block; color: var(--text-dim); font-size: 0.72rem; margin-top: 3px; }
.notif-empty { padding: 24px 14px; text-align: center; color: var(--text-dim); font-size: 0.85rem; }

/* ---------- Cards / stats ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.stat-card .num { font-family: "Space Grotesk", sans-serif; font-size: 1.7rem; font-weight: 700; }
.stat-card .label { color: var(--text-dim); font-size: 0.8rem; margin-top: 2px; }
.stat-card.accent { border-color: var(--accent); }
.stat-card.accent .num { color: var(--accent); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 20px;
}
.card h2, .card h3 { margin-top: 0; }

.two-col { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 950px) { .two-col { grid-template-columns: 1fr; } }

/* ---------- Table ---------- */
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--text-dim); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; }
tr:hover td { background: #fafbfc; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
}
.badge-yeni { background: #e8edff; color: var(--blue); }
.badge-devam_ediyor { background: #fff1e2; color: var(--amber); }
.badge-beklemede { background: #f1f1f1; color: #666; }
.badge-tamamlandi { background: #e3f7ec; color: var(--green); }
.badge-iptal { background: #fdeaea; color: var(--red); }

.badge-dusuk { background: #f1f1f1; color: #777; }
.badge-normal { background: #e8edff; color: var(--blue); }
.badge-yuksek { background: #fdeaea; color: var(--red); }

/* ---------- Forms ---------- */
label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 5px; margin-top: 14px; }
label:first-child { margin-top: 0; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=search], input[type=file], select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}
textarea { resize: vertical; min-height: 90px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .form-row { grid-template-columns: 1fr; } }
.help-text { font-size: 0.76rem; color: var(--text-dim); margin-top: 4px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary { background: var(--accent); color: #241300; }
.btn-primary:hover { background: #ff8f5b; text-decoration: none; }
.btn-outline { background: #fff; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--text-dim); text-decoration: none; }
.btn-danger { background: #fff; border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; text-decoration: none; }
.btn-sm { padding: 5px 11px; font-size: 0.76rem; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Login ---------- */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--navy);
  background-image: radial-gradient(circle at 20% 20%, #1b2436 0%, var(--navy) 60%);
}
.login-box {
  width: 380px; background: var(--card); border-radius: 14px; padding: 34px 32px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.35);
}
.login-box .brand { font-size: 1.5rem; margin-bottom: 2px; }
.login-box .brand-sub { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 24px; }

/* ---------- Flash messages ---------- */
.flash { padding: 11px 15px; border-radius: 8px; margin-bottom: 14px; font-size: 0.88rem; }
.flash-success { background: #e3f7ec; color: var(--green); }
.flash-danger { background: #fdeaea; color: var(--red); }
.flash-warning { background: #fff6e0; color: var(--amber); }
.flash-info { background: #e8edff; color: var(--blue); }

/* ---------- Activity timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 0.87rem;
}
.timeline li:last-child { border-bottom: none; }
.timeline .who { font-weight: 600; }
.timeline .when { color: var(--text-dim); font-size: 0.75rem; }
.timeline .tag {
  display: inline-block; font-size: 0.68rem; padding: 1px 7px; border-radius: 4px;
  background: var(--navy-3); color: #cbd3e1; margin-right: 6px; text-transform: uppercase;
}

/* ---------- File list ---------- */
.file-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px;
  font-size: 0.85rem;
}
.file-item .file-meta { color: var(--text-dim); font-size: 0.75rem; }

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-dim); }

.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; align-items: end; }
.filter-bar > div { min-width: 160px; }

.kpi-inline { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 800px) {
  .sidebar { display: none; }
  .content { padding: 18px; }
}
