/* ═══════════════════════════════════════════════════════════
   MavliMusafir — E-Tebligat Yönetim Sistemi
   CODEGA — codega.com.tr
   ═══════════════════════════════════════════════════════════ */

:root {
  --mm-navy:    #1e3a5f;
  --mm-navy2:   #2c5f8a;
  --mm-accent:  #2563eb;
  --mm-accent2: #1d4ed8;
  --mm-bg:      #f0f4f8;
  --mm-surface: #ffffff;
  --mm-border:  #e2e8f0;
  --mm-text:    #1e293b;
  --mm-muted:   #64748b;
  --mm-sidebar-w: 220px;
  --mm-nav-h:   56px;
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--mm-text);
  background: var(--mm-bg);
}

/* ─── Login ──────────────────────────────────────────────── */
.mm-login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
}
.mm-login-wrap { width: 100%; max-width: 420px; padding: 1rem; }
.mm-login-card {
  background: var(--mm-surface);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.mm-login-header {
  background: linear-gradient(135deg, var(--mm-navy), var(--mm-navy2));
  color: #fff;
  text-align: center;
  padding: 2.5rem 2rem 2rem;
}
.mm-login-icon {
  width: 64px; height: 64px;
  background: rgba(255,255,255,.15);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 1rem;
  border: 2px solid rgba(255,255,255,.25);
}
.mm-login-logo {
  margin: 0 auto 1rem;
  width: 88px; height: 88px;
  display: flex; align-items: center; justify-content: center;
}
.mm-login-logo img {
  width: 88px; height: 88px;
  object-fit: contain;
  border-radius: 10px;
  background: transparent;
}
.mm-login-header h4 { font-size: 1.2rem; font-weight: 700; margin-bottom: .25rem; }
.mm-login-header p  { font-size: .85rem; opacity: .75; margin: 0; }
.mm-login-body-inner { padding: 2rem; }
.mm-login-footer {
  text-align: center;
  padding: .75rem;
  background: #f8fafc;
  border-top: 1px solid var(--mm-border);
  font-size: .75rem;
  color: var(--mm-muted);
}

/* ─── Navbar ─────────────────────────────────────────────── */
.mm-app { overflow-x: hidden; }
.mm-navbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--mm-nav-h);
  background: var(--mm-navy);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1rem;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.mm-navbar-left, .mm-navbar-right { display: flex; align-items: center; gap: .75rem; }
.mm-brand {
  display: flex; align-items: center; gap: .5rem;
  color: #fff; text-decoration: none; font-weight: 700; font-size: 1rem; white-space: nowrap;
}
.mm-brand i { color: #93c5fd; font-size: 1.1rem; }
.mm-sidebar-toggle {
  background: none; border: none; color: rgba(255,255,255,.8);
  font-size: 1.1rem; cursor: pointer; padding: .4rem .6rem;
  border-radius: 6px; transition: background .2s;
}
.mm-sidebar-toggle:hover { background: rgba(255,255,255,.1); }
.mm-nav-surum {
  font-size: .75rem; color: rgba(255,255,255,.5);
  background: rgba(255,255,255,.08); padding: .25rem .6rem; border-radius: 20px;
}
.mm-user-btn {
  background: rgba(255,255,255,.12) !important;
  border: 1px solid rgba(255,255,255,.2) !important;
  color: #fff !important; font-size: .85rem;
  display: flex; align-items: center; gap: .5rem;
}
.mm-user-btn:hover { background: rgba(255,255,255,.2) !important; }
.mm-avatar {
  width: 28px; height: 28px; background: var(--mm-accent);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; color: #fff; flex-shrink: 0;
}

/* ─── Sidebar ────────────────────────────────────────────── */
.mm-sidebar {
  position: fixed; top: var(--mm-nav-h); left: 0; bottom: 0;
  width: var(--mm-sidebar-w);
  background: var(--mm-surface);
  border-right: 1px solid var(--mm-border);
  display: flex; flex-direction: column;
  z-index: 900; transition: transform .25s ease;
  box-shadow: 2px 0 12px rgba(0,0,0,.06);
}
.mm-sidebar-nav {
  flex: 1; overflow-y: auto;
  padding: 1rem .75rem;
  display: flex; flex-direction: column;
}
.mm-sidebar-section {
  font-size: .65rem; font-weight: 700;
  letter-spacing: .08em; color: var(--mm-muted);
  padding: .25rem .5rem .5rem; margin-top: .5rem;
}
.mm-sidebar-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem .75rem; border-radius: 8px;
  text-decoration: none; color: var(--mm-muted);
  font-weight: 500; transition: all .15s; margin-bottom: 2px;
}
.mm-sidebar-item i { width: 18px; text-align: center; font-size: .95rem; }
.mm-sidebar-item:hover { background: #f1f5f9; color: var(--mm-navy); }
.mm-sidebar-item.active { background: #eff6ff; color: var(--mm-accent); font-weight: 600; }
.mm-sidebar-item.active i { color: var(--mm-accent); }
.mm-sidebar-item.text-danger-mm { color: #ef4444; }
.mm-sidebar-item.text-danger-mm:hover { background: #fef2f2; }
.mm-sidebar-footer { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--mm-border); }

/* CODEGA Badge */
.mm-codega-badge {
  text-align: center; padding: .75rem .5rem .5rem;
  font-family: 'Bebas Neue', 'Impact', sans-serif;
  font-size: 1rem; letter-spacing: .15em; color: var(--mm-muted); opacity: .6;
}
.mm-codega-badge .mm-e { color: #dc2626; text-shadow: 0 0 8px rgba(220,38,38,.5); }

/* Overlay */
.mm-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.4); z-index: 850;
}
.mm-overlay.show { display: block; }

/* ─── Main Content ───────────────────────────────────────── */
.mm-main {
  margin-left: var(--mm-sidebar-w);
  margin-top: var(--mm-nav-h);
  padding: 1.5rem;
  min-height: calc(100vh - var(--mm-nav-h));
  transition: margin-left .25s;
}
.mm-main.sidebar-hidden { margin-left: 0; }

/* Page Header */
.mm-page-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 1rem;
  margin-bottom: 1.25rem; flex-wrap: wrap;
}
.mm-page-header h5 { font-size: 1rem; font-weight: 700; color: var(--mm-navy); }
.breadcrumb { font-size: .78rem; }
.breadcrumb a { color: var(--mm-accent); text-decoration: none; }

/* ─── Stat Cards ─────────────────────────────────────────── */
.mm-stat-card {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.25rem; border-radius: 12px;
  background: var(--mm-surface); border: 1px solid var(--mm-border);
  box-shadow: 0 2px 8px rgba(0,0,0,.05); height: 100%;
}
.mm-stat-icon {
  width: 48px; height: 48px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0; color: #fff;
}
.mm-stat-num { font-size: 1.75rem; font-weight: 800; line-height: 1; }
.mm-stat-lbl { font-size: .65rem; font-weight: 700; letter-spacing: .06em; color: var(--mm-muted); margin-top: 2px; }
.mm-stat-blue  .mm-stat-icon  { background: #3b82f6; }
.mm-stat-red   .mm-stat-icon  { background: #ef4444; }
.mm-stat-green .mm-stat-icon  { background: #22c55e; }
.mm-stat-yellow .mm-stat-icon { background: #f59e0b; }
.mm-stat-blue   { border-top: 3px solid #3b82f6; }
.mm-stat-red    { border-top: 3px solid #ef4444; }
.mm-stat-green  { border-top: 3px solid #22c55e; }
.mm-stat-yellow { border-top: 3px solid #f59e0b; }

/* ─── İşlem Bar ──────────────────────────────────────────── */
.mm-islem-bar {
  background: var(--mm-surface); border: 1px solid var(--mm-border);
  border-radius: 10px; padding: .6rem 1rem;
}
.mm-islem-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .8rem; padding: .3rem .75rem; border-radius: 20px;
}
.mm-islem-badge.bekliyor { background: #f1f5f9; color: #64748b; }
.mm-islem-badge.isleme   { background: #fef9c3; color: #854d0e; }
.mm-islem-badge.tamam    { background: #dcfce7; color: #166534; }

/* ─── Filter Bar ─────────────────────────────────────────── */
.mm-filter-bar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .75rem;
  background: var(--mm-surface); border: 1px solid var(--mm-border);
  border-radius: 10px; padding: .6rem 1rem; margin-bottom: 1rem;
}
.mm-tabs { display: flex; gap: .25rem; flex-wrap: wrap; }
.mm-tab {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .35rem .8rem; border-radius: 6px;
  font-size: .82rem; font-weight: 500; color: var(--mm-muted);
  text-decoration: none; transition: all .15s;
}
.mm-tab:hover { background: #f1f5f9; color: var(--mm-text); }
.mm-tab.active { background: var(--mm-accent); color: #fff; font-weight: 600; }
.mm-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.mm-dot.red    { background: #ef4444; }
.mm-dot.yellow { background: #f59e0b; }
.mm-dot.green  { background: #22c55e; }

/* ─── Table ──────────────────────────────────────────────── */
.mm-table-wrap {
  background: var(--mm-surface); border: 1px solid var(--mm-border);
  border-radius: 12px; overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.mm-table { margin: 0; font-size: .82rem; }
.mm-table thead th {
  background: #f8fafc; font-size: .72rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; color: var(--mm-muted);
  border-bottom: 1px solid var(--mm-border); padding: .7rem 1rem; white-space: nowrap;
}
.mm-table tbody td { padding: .75rem 1rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.mm-table tbody tr:last-child td { border-bottom: none; }
.mm-table tbody tr:hover { background: #f8fafc; }
.mm-table tbody tr.mm-row-warn { background: #fffbeb; }
.mm-table tbody tr.mm-row-warn:hover { background: #fef3c7; }

/* ─── Empty ──────────────────────────────────────────────── */
.mm-empty { text-align: center; padding: 4rem 2rem; color: var(--mm-muted); }
.mm-empty i { font-size: 3.5rem; margin-bottom: 1rem; opacity: .3; display: block; }
.mm-empty p { font-size: 1rem; margin-bottom: 1.5rem; }

/* ─── Detay Modal ────────────────────────────────────────── */
.mm-detay-label {
  font-size: .72rem; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
  color: var(--mm-muted); margin-bottom: .2rem;
}
.mm-detay-val { font-size: .9rem; color: var(--mm-text); margin-bottom: .25rem; }

/* ─── Güncelleme ─────────────────────────────────────────── */
.mm-update-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}

/* ─── Card ───────────────────────────────────────────────── */
.mm-card { background: var(--mm-surface); border: 1px solid var(--mm-border); border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.mm-card-header {
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--mm-border);
  font-weight: 600; font-size: .9rem; color: var(--mm-navy);
  display: flex; align-items: center; gap: .5rem;
}
.mm-card-body { padding: 1.25rem; }

/* ─── Buttons ────────────────────────────────────────────── */
.mm-btn-primary {
  background: linear-gradient(135deg, var(--mm-accent), var(--mm-accent2));
  color: #fff; border: none; transition: all .2s;
}
.mm-btn-primary:hover {
  background: linear-gradient(135deg, var(--mm-accent2), #1e40af);
  color: #fff; transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,99,235,.35);
}
.mm-btn-primary:disabled { opacity: .6; transform: none; box-shadow: none; }

/* ─── Toast ──────────────────────────────────────────────── */
.mm-toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  z-index: 9999; display: flex; flex-direction: column; gap: .5rem;
}
.mm-toast {
  background: var(--mm-navy); color: #fff;
  padding: .75rem 1.25rem; border-radius: 10px; font-size: .85rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  display: flex; align-items: center; gap: .6rem;
  animation: mmToastIn .25s ease; max-width: 340px;
}
.mm-toast.success { background: #166534; }
.mm-toast.error   { background: #991b1b; }
.mm-toast.info    { background: #1e40af; }
@keyframes mmToastIn {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
@keyframes mmToastOut {
  from { transform: translateX(0); opacity: 1; }
  to   { transform: translateX(110%); opacity: 0; }
}
.mm-toast.removing { animation: mmToastOut .25s ease forwards; }

/* ─── Ayarlar Toggle ─────────────────────────────────────── */
.mm-toggle { position: relative; display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; }
.mm-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.mm-toggle-slider {
  width: 44px; height: 24px; background: #cbd5e1; border-radius: 12px;
  transition: background .2s; flex-shrink: 0;
}
.mm-toggle-slider::after {
  content: ''; position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  background: #fff; border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.mm-toggle input:checked + .mm-toggle-slider { background: var(--mm-accent); }
.mm-toggle input:checked + .mm-toggle-slider::after { transform: translateX(20px); }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .mm-sidebar { transform: translateX(-100%); }
  .mm-sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.2); }
  .mm-main { margin-left: 0 !important; padding: 1rem; }
  .mm-stat-num { font-size: 1.4rem; }
  .mm-page-header { flex-direction: column; align-items: flex-start; }
  .mm-filter-bar { flex-direction: column; align-items: flex-start; }
  .mm-table-wrap { overflow-x: auto; }
}

/* ─── Belge Görünümü ─────────────────────────────────────── */
.mm-belge-wrap {
  border: 1px solid var(--mm-border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: .75rem;
  font-family: 'Georgia', 'Times New Roman', serif;
}
.mm-belge-header {
  background: var(--mm-navy);
  color: #fff;
  padding: .85rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
}
.mm-belge-kurum { font-weight: 700; font-size: .95rem; }
.mm-belge-no    { font-size: .75rem; opacity: .75; font-family: monospace; }
.mm-belge-konu  {
  background: #f0f4f8;
  padding: .75rem 1.25rem;
  font-weight: 700;
  font-size: .95rem;
  border-bottom: 1px solid var(--mm-border);
  color: var(--mm-navy);
}
.mm-belge-icerik {
  padding: 1.25rem;
  white-space: pre-wrap;
  font-size: .88rem;
  line-height: 1.75;
  color: #1e293b;
  min-height: 80px;
  background: #fff;
}

/* ─── Arşiv Satırı ───────────────────────────────────────── */
.mm-arsiv-row td { opacity: .7; }

/* Süresi doldu */
.badge-suresi_doldu { background: #6c757d; color: #fff; }
.durum-suresi_doldu { color: #6c757d; font-weight: 600; }
