/* DLK Operasyon — Kurumsal mavi tasarım sistemi */

:root {
  --brand-900: #0B1F3A;
  --brand-700: #123A66;
  --brand-500: #1E6BB8;
  --brand-400: #3B8DD9;
  --brand-100: #E8F2FC;
  --brand-50:  #F4F8FC;
  --surface:   #FFFFFF;
  --border:    #D7E3F0;
  --text:      #142033;
  --muted:     #5A6B7D;
  --success:   #0F7B4A;
  --warning:   #B86E00;
  --danger:    #C0392B;
  --radius:    12px;
  --shadow:    0 8px 24px rgba(18, 58, 102, 0.08);
  --font-display: "DM Sans", sans-serif;
  --font-body: "Source Sans 3", sans-serif;
  --sidebar-w: 268px;
  --topbar-h: 64px;
  --ease: 180ms ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--brand-50);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .login-title, .topbar-title h1 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

a { color: var(--brand-500); text-decoration: none; }
a:hover { color: var(--brand-700); }

img { max-width: 100%; display: block; }

.muted { color: var(--muted); }
.req { color: var(--danger); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.7rem 1.15rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--ease), border-color var(--ease), transform var(--ease), box-shadow var(--ease);
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--brand-500);
  color: #fff;
  box-shadow: 0 6px 16px rgba(30, 107, 184, 0.25);
}
.btn-primary:hover {
  background: var(--brand-400);
  color: #fff;
}

.btn-block { width: 100%; }

.btn-icon {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
}
.btn-icon span {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--brand-700);
  border-radius: 2px;
}

/* ---------- Forms ---------- */
.form-group {
  margin-bottom: 1.1rem;
}
.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--ease), box-shadow var(--ease);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px rgba(30, 107, 184, 0.15);
}

/* ---------- Alerts ---------- */
.alert {
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  font-size: 0.95rem;
}
.alert-danger { background: #FDECEA; color: var(--danger); border-color: #F5C6C2; }
.alert-success { background: #E8F6EF; color: var(--success); border-color: #B7E0C8; }
.alert-warning { background: #FFF6E5; color: var(--warning); border-color: #F5D9A6; }
.alert-info { background: var(--brand-100); color: var(--brand-700); border-color: #BFD8F2; }

/* ---------- Login ---------- */
.login-page {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 10% 10%, rgba(59, 141, 217, 0.22), transparent 60%),
    linear-gradient(135deg, #0B1F3A 0%, #123A66 45%, #1E6BB8 100%);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}

.login-brand {
  position: relative;
  color: #fff;
  padding: 3.5rem;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.login-brand-inner {
  position: relative;
  z-index: 1;
  max-width: 460px;
}

.login-mark {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(6px);
}

.login-logo {
  height: 56px;
  width: auto;
  margin-bottom: 1.5rem;
  object-fit: contain;
}

.login-title {
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  margin: 0 0 0.75rem;
  font-weight: 700;
}

.login-slogan {
  margin: 0 0 2rem;
  font-size: 1.1rem;
  color: rgba(255,255,255,0.85);
  max-width: 28ch;
}

.login-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
.login-points li {
  padding-left: 1.2rem;
  position: relative;
  color: rgba(255,255,255,0.9);
}
.login-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8EC5F2;
}

.login-brand-glow {
  position: absolute;
  width: 420px;
  height: 420px;
  right: -80px;
  bottom: -100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.18), transparent 70%);
  pointer-events: none;
}

.login-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background:
    linear-gradient(180deg, rgba(244,248,252,0.96), #F4F8FC 40%),
    var(--brand-50);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 2rem;
  animation: fadeUp 280ms ease;
}

.login-card-head h2 {
  margin: 0 0 0.35rem;
  font-size: 1.45rem;
}
.login-card-head p {
  margin: 0 0 1.5rem;
  color: var(--muted);
}

.login-foot {
  margin: 1.5rem 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.login-foot a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.login-foot a:hover {
  text-decoration: underline;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- App shell ---------- */
.app-body { background: var(--brand-50); }

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, var(--brand-900), var(--brand-700));
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.25rem 1.15rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-mark {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(255,255,255,0.12);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.sidebar-brand-text strong {
  font-family: var(--font-display);
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-brand-text span {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.65);
}

.sidebar-nav {
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  overflow-y: auto;
}

.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  color: rgba(255,255,255,0.82);
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  transition: background var(--ease), color var(--ease);
  font-weight: 500;
  font-size: 0.92rem;
}
.sidebar-link:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.sidebar-link.is-active {
  background: rgba(255,255,255,0.14);
  color: #fff;
}
.sidebar-link.is-soon {
  opacity: 0.55;
  cursor: default;
}
.sidebar-link em {
  font-style: normal;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.55);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  padding: 0.1rem 0.35rem;
}

.sidebar-foot {
  padding: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logout:hover { background: rgba(192, 57, 43, 0.25); }

.app-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(18, 58, 102, 0.04);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.25rem;
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar-title {
  flex: 1;
  min-width: 0;
}
.topbar-title h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 650;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.topbar-user-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.25;
}
.topbar-user-meta strong { font-size: 0.9rem; }
.topbar-user-meta span { font-size: 0.78rem; color: var(--muted); }

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--brand-100);
  color: var(--brand-700);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-family: var(--font-display);
}

.content {
  padding: 1.5rem;
  flex: 1;
}

.page-intro { margin-bottom: 1.25rem; }
.page-intro p { margin: 0; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow);
}
.stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--brand-900);
}

.panel-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.section-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.table-wrap { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.data-table th,
.data-table td {
  text-align: left;
  padding: 0.85rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table thead th {
  position: sticky;
  top: 0;
  background: var(--brand-50);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.data-table tbody tr:hover { background: rgba(232, 242, 252, 0.45); }

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--brand-100);
  color: var(--brand-700);
}
.badge-login, .badge-create { background: #E8F6EF; color: var(--success); }
.badge-update, .badge-durum_degisti { background: var(--brand-100); color: var(--brand-700); }
.badge-delete, .badge-login_failed { background: #FDECEA; color: var(--danger); }
.badge-logout, .badge-mail, .badge-upload { background: #FFF6E5; color: var(--warning); }

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
}
.empty-state p {
  margin: 0 0 0.35rem;
  font-weight: 600;
}
.empty-state .muted { font-weight: 400; }

.app-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  color: var(--muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
}

.footer-credit {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.footer-credit:hover {
  text-decoration: underline;
}

/* ---------- Toast ---------- */
.toast-host {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
  display: grid;
  gap: 0.5rem;
}
.toast {
  min-width: 260px;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 0.85rem 1rem;
  animation: fadeUp 200ms ease;
}
.toast-success { border-left: 3px solid var(--success); }
.toast-danger { border-left: 3px solid var(--danger); }
.toast-info { border-left: 3px solid var(--brand-500); }

/* ---------- Error pages ---------- */
.error-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(800px 400px at 50% 0%, rgba(30,107,184,0.12), transparent),
    var(--brand-50);
  padding: 1.5rem;
}
.error-card {
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 2.5rem 2rem;
  max-width: 440px;
}
.error-code {
  margin: 0;
  font-family: var(--font-display);
  font-size: 3rem;
  color: var(--brand-500);
  font-weight: 700;
}
.error-card h1 {
  margin: 0.5rem 0;
  font-size: 1.35rem;
}
.error-card p {
  color: var(--muted);
  margin: 0 0 1.5rem;
}

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

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { min-height: 280px; padding: 2rem; }
  .login-points { display: none; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(86vw, var(--sidebar-w));
    transform: translateX(-105%);
    transition: transform var(--ease);
  }
  .app-shell.sidebar-open .sidebar { transform: translateX(0); }
  .app-shell.sidebar-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(11, 31, 58, 0.45);
    z-index: 35;
  }
  .topbar-user-meta { display: none; }
}

@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr; }
  .content { padding: 1rem; }
  .login-card { padding: 1.35rem; }
}

/* ---------- CRUD toolbar / forms ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.15rem;
}
.toolbar-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.btn-secondary {
  background: var(--surface);
  color: var(--brand-700);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--brand-100); color: var(--brand-900); }

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

.btn-sm {
  padding: 0.4rem 0.7rem;
  font-size: 0.82rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
}
.form-grid .full { grid-column: 1 / -1; }

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.35rem;
  max-width: 920px;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1rem;
  align-items: end;
}
.filter-bar .form-group { margin: 0; min-width: 140px; }
.filter-bar input, .filter-bar select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  font: inherit;
  background: var(--surface);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 1rem;
}
.page-link {
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--brand-700);
  background: var(--surface);
  font-weight: 600;
  font-size: 0.85rem;
}
.page-link.is-active {
  background: var(--brand-500);
  border-color: var(--brand-500);
  color: #fff;
}

.table-actions { display: flex; gap: 0.4rem; }

.map-box {
  height: 320px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 0.35rem;
  background: var(--brand-100);
}
.dlk-marker { background: transparent; border: none; }
.dlk-marker-dot {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--brand-500);
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(18,58,102,0.35);
}

/* Tabs */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}
.tab-btn {
  border: none;
  background: transparent;
  padding: 0.7rem 1rem;
  font: inherit;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--ease), border-color var(--ease);
}
.tab-btn.is-active {
  color: var(--brand-700);
  border-bottom-color: var(--brand-500);
}
.tab-panel { display: none; }
.tab-panel.is-active { display: block; animation: fadeUp 180ms ease; }

.logo-preview {
  width: 120px;
  height: 120px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--brand-50);
  padding: 0.5rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11,31,58,0.45);
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-backdrop.is-open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  width: min(640px, 100%);
  max-height: 85vh;
  overflow: auto;
  padding: 1.25rem;
}
.modal pre {
  background: var(--brand-50);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  overflow: auto;
  font-size: 0.8rem;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.modal-head h3 { margin: 0; font-size: 1.05rem; }

@media (max-width: 700px) {
  .form-grid { grid-template-columns: 1fr; }
}

.badge-durum-beklemede { background: #FFF6E5; color: var(--warning); }
.badge-durum-yolda { background: var(--brand-100); color: var(--brand-700); }
.badge-durum-teslim_edildi { background: #E8F2FC; color: var(--brand-500); }
.badge-durum-tamamlandi { background: #E8F6EF; color: var(--success); }
