:root {
  --navy-900: #0b1530;
  --navy-800: #101c3d;
  --navy-700: #17264e;
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --blue-050: #eef4ff;
  --green-600: #16a34a;
  --green-500: #22c55e;
  --amber-600: #d97706;
  --amber-500: #f59e0b;
  --red-600: #dc2626;
  --red-500: #ef4444;
  --slate-900: #0f172a;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --white: #ffffff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, .08), 0 2px 4px rgba(15, 23, 42, .04);
  --shadow-lg: 0 20px 45px rgba(15, 23, 42, .18);
  --ring: 0 0 0 4px rgba(37, 99, 235, .18);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--slate-900);
  background: var(--slate-50);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.02em; }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
.muted { color: var(--slate-500); font-size: 13.5px; }
[hidden] { display: none !important; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid transparent; border-radius: 10px;
  padding: 10px 16px; font-size: 14px; font-weight: 600;
  transition: .18s ease; white-space: nowrap;
}
.btn--primary { background: linear-gradient(135deg, var(--blue-600), var(--blue-500)); color: #fff; box-shadow: 0 6px 16px rgba(37, 99, 235, .28); }
.btn--primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn--primary:active { transform: translateY(0); }
.btn--ghost { background: var(--white); border-color: var(--slate-200); color: var(--slate-700); }
.btn--ghost:hover { background: var(--slate-50); border-color: var(--slate-400); }
.btn--success { background: linear-gradient(135deg, var(--green-600), var(--green-500)); color: #fff; box-shadow: 0 6px 16px rgba(22, 163, 74, .25); }
.btn--success:hover { filter: brightness(1.06); }
.btn--danger { background: #fff; border-color: #fecaca; color: var(--red-600); }
.btn--danger:hover { background: #fef2f2; }
.btn--block { width: 100%; justify-content: center; padding: 13px; font-size: 15px; }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.link { background: none; border: none; color: var(--blue-600); font-size: 12.5px; font-weight: 600; padding: 0; }
.link:hover { text-decoration: underline; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--slate-200);
  background: #fff; color: var(--slate-600); transition: .18s;
}
.icon-btn:hover { background: var(--slate-50); color: var(--slate-900); }

/* ---------- Fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--slate-600); }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--slate-200);
  border-radius: 10px; font-size: 14px; background: #fff; color: var(--slate-900);
  transition: .15s; outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue-500); box-shadow: var(--ring); }
.field textarea { resize: vertical; }
.field--inline { min-width: 140px; }
.field--search { flex: 1; min-width: 220px; }
.field--full { grid-column: 1 / -1; }

.input-icon { position: relative; display: flex; align-items: center; }
.input-icon svg { position: absolute; left: 12px; color: var(--slate-400); pointer-events: none; }
.input-icon input { padding-left: 40px; }
.input-icon__btn { position: absolute; right: 8px; background: none; border: none; color: var(--slate-400); display: flex; padding: 6px; }
.input-icon__btn:hover { color: var(--slate-700); }

/* ---------- Alerts / toast ---------- */
.alert { padding: 11px 14px; border-radius: 10px; font-size: 13.5px; font-weight: 500; }
.alert--error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--slate-900); color: #fff; padding: 12px 20px; border-radius: 12px;
  font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); opacity: 0; transition: .3s; z-index: 999;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast--error { background: var(--red-600); }
.toast--success { background: var(--green-600); }

/* ================= LOGIN ================= */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; position: relative; overflow: hidden; }
.login__bg { position: absolute; inset: 0; background: linear-gradient(135deg, #0b1530 0%, #122349 55%, #1b2f5e 100%); }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; animation: float 14s ease-in-out infinite; }
.blob--1 { width: 460px; height: 460px; background: #2563eb; top: -120px; left: -80px; }
.blob--2 { width: 380px; height: 380px; background: #0ea5e9; bottom: -120px; left: 22%; animation-delay: -4s; }
.blob--3 { width: 300px; height: 300px; background: #6366f1; top: 30%; right: 8%; animation-delay: -8s; }
@keyframes float { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(24px,-28px) scale(1.08); } }
.grid-lines {
  position: absolute; inset: 0; opacity: .12;
  background-image: linear-gradient(rgba(255,255,255,.6) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.6) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%);
}
.login__panel { position: relative; z-index: 2; padding: 48px clamp(28px, 5vw, 72px); display: flex; flex-direction: column; }
.login__brand { color: #fff; justify-content: space-between; }
.login__form-wrap { background: rgba(255,255,255,.98); align-items: center; justify-content: center; }

.brand { display: flex; align-items: center; gap: 14px; }
.brand__logo {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--blue-600), #4f8bff); box-shadow: 0 10px 24px rgba(37,99,235,.45);
}
.brand__logo--sm { width: 42px; height: 42px; border-radius: 12px; }
.brand h1 { font-size: 20px; }
.brand p { font-size: 12.5px; opacity: .75; letter-spacing: .02em; }
.brand__hero h2 { font-size: clamp(28px, 3vw, 42px); line-height: 1.15; margin-bottom: 18px; }
.brand__hero h2 span { background: linear-gradient(120deg, #7db4ff, #a5f3fc); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand__hero p { max-width: 460px; line-height: 1.65; color: rgba(255,255,255,.78); }
.brand__features { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-direction: column; gap: 12px; }
.brand__features li { display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: rgba(255,255,255,.9); }
.brand__foot { font-size: 12.5px; opacity: .5; }

.login__form { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 16px; }
.login__form h3 { font-size: 26px; }
.login__hint { font-size: 12.5px; color: var(--slate-400); text-align: center; }
.login__hint b { color: var(--slate-600); }

/* ================= APP ================= */
.app { min-height: 100vh; background: var(--slate-50); }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 14px 28px; background: #fff; border-bottom: 1px solid var(--slate-200);
  position: sticky; top: 0; z-index: 40;
}
.topbar__left { display: flex; align-items: center; gap: 14px; }
.topbar__title { display: flex; flex-direction: column; }
.topbar__title strong { font-size: 15.5px; }
.topbar__title span { font-size: 12px; }
.topbar__right { display: flex; align-items: center; gap: 18px; }
.usermenu { display: flex; align-items: center; gap: 10px; }
.usermenu__info { display: flex; flex-direction: column; align-items: flex-start; }
.usermenu__info strong { font-size: 13px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--blue-600), #6366f1); color: #fff; font-weight: 700;
}

.container { max-width: 1440px; margin: 0 auto; padding: 22px 28px 60px; display: flex; flex-direction: column; gap: 18px; }
.card { background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.filters { padding: 16px 18px; }
.filters__row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.stat {
  background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  transition: .18s; cursor: pointer;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent, var(--blue-600)); }
.stat__label { font-size: 12.5px; font-weight: 600; color: var(--slate-500); display: flex; align-items: center; gap: 7px; }
.stat__value { font-size: 30px; font-weight: 800; margin-top: 6px; letter-spacing: -.03em; }
.stat__sub { font-size: 11.5px; color: var(--slate-400); margin-top: 2px; }
.stat--total   { --accent: var(--slate-700); }
.stat--green   { --accent: var(--green-500); }
.stat--blue    { --accent: var(--blue-500); }
.stat--amber   { --accent: var(--amber-500); }
.stat--red     { --accent: var(--red-500); }

/* Table */
.table-card { padding: 0; overflow: hidden; }
.table-card__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--slate-100); flex-wrap: wrap; gap: 10px; }
.table-card__head h3 { font-size: 16px; display: flex; align-items: center; gap: 10px; }
.badge { display: inline-flex; align-items: center; background: var(--slate-100); color: var(--slate-600); font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.badge--soft { background: var(--blue-050); color: var(--blue-600); }
.table-card__legend { display: flex; gap: 16px; flex-wrap: wrap; }
.table-card__legend span { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--slate-500); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot--green { background: var(--green-500); } .dot--blue { background: var(--blue-500); }
.dot--amber { background: var(--amber-500); } .dot--red { background: var(--red-500); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 1180px; }
.table th {
  text-align: left; padding: 11px 14px; background: var(--slate-50); color: var(--slate-500);
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--slate-200); white-space: nowrap; position: sticky; top: 0;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--slate-100); vertical-align: top; }
.table tbody tr { transition: .12s; cursor: pointer; }
.table tbody tr:hover { background: var(--blue-050); }
.cell-strong { font-weight: 600; color: var(--slate-900); }
.cell-muted { color: var(--slate-500); }
.cell-clip { max-width: 230px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kayit-no { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12.5px; font-weight: 600; color: var(--blue-600); white-space: nowrap; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip--green { background: #dcfce7; color: #15803d; }
.chip--blue  { background: #dbeafe; color: #1d4ed8; }
.chip--amber { background: #fef3c7; color: #b45309; }
.chip--red   { background: #fee2e2; color: #b91c1c; }
.chip--gray  { background: var(--slate-100); color: var(--slate-600); }

.sure { display: inline-flex; flex-direction: column; gap: 2px; }
.sure__date { font-weight: 600; font-size: 12.5px; }
.sure__kalan { font-size: 11px; font-weight: 600; }
.sure__kalan--ok { color: var(--slate-500); }
.sure__kalan--yaklasan { color: var(--amber-600); }
.sure__kalan--gecen { color: var(--red-600); }

.empty { padding: 60px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty__icon { font-size: 40px; }

/* ---------- Drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 100; }
.drawer__overlay { position: absolute; inset: 0; background: rgba(15, 23, 42, .45); backdrop-filter: blur(2px); animation: fade .2s; }
.drawer__panel {
  position: absolute; top: 0; right: 0; height: 100%; width: min(620px, 100%);
  background: #fff; display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
  animation: slideIn .28s cubic-bezier(.22,.61,.36,1);
}
@keyframes slideIn { from { transform: translateX(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.drawer__head { display: flex; justify-content: space-between; gap: 14px; padding: 20px 24px; border-bottom: 1px solid var(--slate-100); }
.drawer__head h3 { font-size: 19px; margin: 8px 0 4px; }
.drawer__body { flex: 1; overflow-y: auto; padding: 22px 24px; }
.drawer__foot { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 24px; border-top: 1px solid var(--slate-100); background: var(--slate-50); }

.section { margin-bottom: 26px; }
.section__title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--slate-400); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.info { display: flex; flex-direction: column; gap: 3px; }
.info--full { grid-column: 1 / -1; }
.info__label { font-size: 11.5px; font-weight: 600; color: var(--slate-400); text-transform: uppercase; letter-spacing: .03em; }
.info__value { font-size: 14px; color: var(--slate-900); }
.info__value.empty-val { color: var(--slate-300); font-style: italic; }

.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--slate-200); }
.tl-item { position: relative; padding-bottom: 18px; }
.tl-item::before { content: ''; position: absolute; left: -24px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--blue-500); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--blue-050); }
.tl-item__date { font-size: 12px; font-weight: 700; color: var(--blue-600); }
.tl-item__text { font-size: 13.5px; color: var(--slate-700); margin-top: 2px; line-height: 1.5; }
.tl-item__del { position: absolute; right: 0; top: 0; opacity: 0; transition: .15s; }
.tl-item:hover .tl-item__del { opacity: 1; }

.add-process { display: flex; gap: 10px; margin-top: 10px; align-items: flex-end; }
.add-process .field { flex: 1; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 110; display: grid; place-items: center; padding: 24px; }
.modal__overlay { position: absolute; inset: 0; background: rgba(15, 23, 42, .5); backdrop-filter: blur(3px); animation: fade .2s; }
.modal__panel {
  position: relative; width: min(880px, 100%); max-height: 90vh; background: #fff; border-radius: 18px;
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: pop .24s cubic-bezier(.22,.61,.36,1); overflow: hidden;
}
@keyframes pop { from { transform: scale(.97) translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--slate-100); }
.modal__head h3 { font-size: 18px; }
.modal__body { padding: 22px 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.modal__actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .login { grid-template-columns: 1fr; }
  .login__brand { display: none; }
}
@media (max-width: 640px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .form-grid, .info-grid { grid-template-columns: 1fr; }
  .container { padding: 16px; }
  .topbar { padding: 12px 16px; flex-wrap: wrap; }
  .topbar__title span { display: none; }
  .usermenu__info { display: none; }
}
