/* ============================================================================
   EDUON tasarim sistemi — kaynak: EDUON-AI-LMS-B2B-Responsive-Tasarim-Kodu
   (app/globals.css) uyarlamasi.

   UYARLAMA NOTLARI:
   - Tailwind import'u kaldirildi (tasarimin kendisi Tailwind sinifi
     kullanmiyor; yalnizca reset icin duruyordu). Kucuk reset eklendi.
   - Kenar cubugu iki kademeli: >1180px tam genislik, <=1180px cekmece.
     Orijinaldeki 82px ikon rayi BILINCLI atlandi: bu portalin menusu
     acilir-kapanir gruplu; ray geniligi grup listesiyle uyusmuyor.
   - Mevcut gorunumler Bootstrap 5 ile yazili; en alttaki "Bootstrap
     uyum katmani" btn/card/table/badge gorunumunu EDUON diline ceker,
     boylece ic sayfalar yeniden yazilmadan yeni dile oturur.
   ============================================================================ */

:root {
  --navy: #071328;
  --navy-soft: #0e1e3c;
  --blue: #356dff;
  --blue-dark: #2457df;
  --purple: #765cff;
  --cyan: #43c9bf;
  --green: #16a66a;
  --orange: #ef8f24;
  --red: #e5484d;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-soft: #f8f9fc;
  --text: #111827;
  --muted: #697386;
  --border: #e5e9f1;
  --shadow: 0 12px 36px rgba(26, 39, 69, 0.06);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; overflow-x: hidden;
  color: var(--text); background: var(--bg);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, select { font: inherit; }
button { cursor: pointer; }

/* ---------------------------------------------------------------- kabuk */
.app-shell { min-height: 100vh; display: flex; background: var(--bg); }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40; width: 252px;
  padding: 28px 18px 18px; color: #fff;
  background: linear-gradient(180deg, var(--navy) 0%, #0b1730 100%);
  display: flex; flex-direction: column;
}
.brand { height: 45px; display: flex; align-items: flex-start; padding: 0 10px; position: relative; letter-spacing: -.03em; }
.brand > a { color: #fff; text-decoration: none; font-size: 22px; font-weight: 800; }
.brand > strong {
  display: grid; place-items: center; height: 23px; min-width: 26px; margin: 0 0 0 6px;
  border-radius: 6px; background: linear-gradient(135deg, #4d8aff, #8b5fff);
  font-size: 12px; letter-spacing: .02em;
}
.brand > small { position: absolute; left: 10px; top: 27px; color: #7f8ba5; font-size: 8px; font-weight: 700; letter-spacing: .24em; }

.sidebar nav { flex: 1; margin-top: 26px; overflow-y: auto; scrollbar-width: none; }
.sidebar nav::-webkit-scrollbar { display: none; }
.nav-section-title { display: block; margin: 0 12px 8px; color: #65728e; font-size: 10px; font-weight: 700; letter-spacing: .14em; }
/* Kategori basliklari ardisik gelir: ilki disindakiler ustunden nefes alsin. */
.nav-group + .nav-section-title { margin-top: 20px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.07); }

/* Menu gruplari (acilir-kapanir) */
.nav-group > button {
  width: 100%; min-height: 44px; margin: 3px 0; padding: 0 10px; border: 0; border-radius: 10px;
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 9px;
  color: #a9b3c8; background: transparent; text-align: left; font-size: 13px; font-weight: 600;
  transition: .18s ease;
}
.nav-group > button:hover { color: #fff; background: rgba(255,255,255,.055); }
.nav-group.aktif > button {
  color: #fff;
  background: linear-gradient(90deg, rgba(60,112,255,.28), rgba(112,91,255,.12));
  box-shadow: inset 3px 0 0 #5d84ff;
}
.nav-code {
  display: grid; place-items: center; width: 28px; height: 28px;
  border: 1px solid rgba(255,255,255,.1); border-radius: 8px;
  color: #7282a0; font-size: 9px; font-weight: 800; letter-spacing: .04em;
}
.nav-group.aktif .nav-code { color: #dbe5ff; border-color: rgba(115,151,255,.42); background: rgba(74,117,255,.12); }
.nav-ok { color: #5d6a86; font-size: 11px; transition: transform .18s ease; }
.nav-group > button[aria-expanded="true"] .nav-ok { transform: rotate(180deg); }

.nav-alt { list-style: none; margin: 0 0 4px; padding: 0 0 0 37px; }
.nav-alt a {
  display: block; padding: 8px 10px; border-radius: 8px;
  color: #8d99b4; text-decoration: none; font-size: 12px; font-weight: 500;
}
.nav-alt a:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav-alt a.aktif { color: #dbe5ff; background: rgba(74,117,255,.14); }
.nav-yakinda { display: block; padding: 8px 10px; color: #55617c; font-size: 12px; cursor: default; }
.nav-yakinda small { margin-left: 6px; padding: 2px 6px; border-radius: 6px; color: #68758e; background: rgba(255,255,255,.06); font-size: 8px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

.sidebar-user {
  min-height: 58px; padding: 10px; border: 1px solid rgba(255,255,255,.08); border-radius: 13px;
  background: rgba(255,255,255,.035);
  display: grid; grid-template-columns: 34px minmax(0,1fr); align-items: center; gap: 9px;
}
.sidebar-user > span, .user-avatar {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  color: #dce5ff; background: #22355d; font-size: 10px; font-weight: 800; overflow: hidden;
}
.sidebar-user img { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; }
.sidebar-user div { min-width: 0; }
.sidebar-user strong, .sidebar-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user strong { color: #f7f9ff; font-size: 11px; }
.sidebar-user small { margin-top: 3px; color: #7e8aa4; font-size: 9px; }

.main-stage { width: calc(100% - 252px); min-width: 0; margin-left: 252px; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  height: 72px; padding: 0 34px; border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.94);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.context-select { min-width: 0; display: flex; align-items: center; gap: 10px; }
.context-select > span {
  display: grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; border-radius: 10px;
  color: #305dd2; background: #edf2ff; font-size: 10px; font-weight: 800;
}
.context-select div { min-width: 0; }
.context-select small, .context-select strong { display: block; }
.context-select small { margin-bottom: 2px; color: #929bad; font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.context-select strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }

.topbar-actions { display: flex; align-items: center; gap: 10px; }
.icon-button {
  position: relative; display: grid; place-items: center; width: 36px; height: 36px;
  border: 1px solid var(--border); border-radius: 10px; color: #606b7e; background: #fff; font-weight: 700;
  text-decoration: none; font-size: 13px;
}
.icon-button:hover { color: var(--blue-dark); border-color: #c9d6f5; }
.user-avatar { margin-left: 2px; color: #fff; background: linear-gradient(135deg, #2f65eb, #6d5ff2); }

/* Dil secici */
.dil-secici { display: flex; padding: 3px; border-radius: 8px; background: #f3f5f8; }
.dil-secici button {
  min-height: 28px; padding: 0 10px; border: 0; border-radius: 6px;
  color: #8891a2; background: transparent; font-size: 10px; font-weight: 800;
}
.dil-secici button.aktif { color: #284fb6; background: #fff; box-shadow: 0 2px 7px rgba(27,39,66,.08); }

.mobile-brand-row, .mobile-scrim { display: none; }

.workspace { padding: 34px; flex: 1; }
.screen-view { max-width: 1500px; margin: 0 auto; }
.shell-footer { padding: 14px 34px; border-top: 1px solid var(--border); color: #929bad; font-size: 10px; }

/* ------------------------------------------------------------ sayfa basi */
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 24px; }
.eyebrow, .section-kicker { display: block; color: #6682c2; font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.page-heading h1 { margin: 6px 0 7px; color: #111827; font-size: clamp(25px, 2.1vw, 34px); line-height: 1.14; letter-spacing: -.035em; }
.page-heading p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.page-actions { display: flex; gap: 9px; flex: 0 0 auto; }

.button { min-height: 39px; padding: 0 15px; border-radius: 9px; border: 1px solid transparent; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.button.primary { color: #fff; background: linear-gradient(135deg, #356dff, #5f60ed); box-shadow: 0 8px 18px rgba(53,109,255,.18); }
.button.primary:hover { color: #fff; background: linear-gradient(135deg, #285ddd, #5454d7); }
.button.secondary { color: #445069; border-color: #dfe4ee; background: #fff; }
.button.compact { min-height: 34px; padding: 0 12px; }
.button.full { width: 100%; justify-content: center; }

/* ----------------------------------------------------------------- kpi */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.kpi-card, .panel { border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); }
.kpi-card { min-width: 0; padding: 17px; border-radius: 14px; display: block; color: inherit; text-decoration: none; }
a.kpi-card:hover { border-color: #c9d6f5; color: inherit; }
.kpi-topline, .kpi-middle, .kpi-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kpi-topline { color: #6c7689; font-size: 10px; font-weight: 700; }
.status-mark { width: 8px; height: 8px; border-radius: 3px; }
.status-mark.blue { background: var(--blue); } .status-mark.green { background: var(--green); }
.status-mark.orange { background: var(--orange); } .status-mark.purple { background: var(--purple); }
.kpi-middle { margin: 13px 0 8px; }
.kpi-middle > strong { white-space: nowrap; color: #111827; font-size: clamp(24px, 2vw, 31px); letter-spacing: -.045em; }
.kpi-foot { justify-content: flex-start; color: #939bac; font-size: 9px; }
.trend { padding: 4px 6px; border-radius: 6px; font-weight: 800; }
.trend.blue { color: #315cd1; background: #edf2ff; } .trend.green { color: #128258; background: #eaf8f2; }
.trend.orange { color: #bd6c16; background: #fff4e6; } .trend.purple { color: #6549d9; background: #f1eeff; }

/* --------------------------------------------------------------- panel */
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; margin-bottom: 18px; }
.panel { min-width: 0; padding: 20px; border-radius: 15px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.panel-head h2 { margin: 5px 0 0; font-size: 15px; letter-spacing: -.02em; }
.count-badge { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; padding: 7px 9px; border-radius: 8px; color: #335dc6; background: #edf2ff; font-size: 9px; font-weight: 800; }
.panel-list { margin-top: 8px; }
.panel-list-item {
  display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 11px; padding: 12px 0;
  border-bottom: 1px solid #edf0f5; align-items: center; color: inherit; text-decoration: none;
}
.panel-list-item:last-child { border-bottom: 0; }
.panel-list-item:hover strong { color: var(--blue-dark); }
.panel-list-item strong { display: block; font-size: 11px; }
.panel-list-item p { margin: 4px 0 0; color: #8992a3; font-size: 9px; line-height: 1.45; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-list-item time { color: #929bad; font-size: 8px; white-space: nowrap; }
.panel-bos { padding: 18px 0 8px; color: #929bad; font-size: 10px; }
.text-button { width: 100%; margin-top: 12px; padding: 10px 0 0; border: 0; color: #315dd1; background: transparent; display: flex; justify-content: space-between; font-size: 9px; font-weight: 800; text-decoration: none; }

/* --------------------------------------------------------------- tablo */
.data-table-wrap { overflow-x: auto; margin: 15px -20px -20px; }
.data-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.data-table th, .data-table td { padding: 12px 20px; border-top: 1px solid #edf0f4; text-align: left; white-space: nowrap; font-size: 10px; }
.data-table th { color: #9099aa; background: #fafbfc; font-size: 8px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.data-table td { color: #4c566a; }
.down { color: #d64248; font-weight: 800; } .up { color: #12875a !important; font-weight: 800; }
.status { display: inline-flex !important; width: max-content; padding: 5px 8px; border-radius: 7px; font-size: 8px; font-weight: 800; }
.status.critical { color: #cc3b40; background: #ffeded; } .status.warning { color: #b96b18; background: #fff3e4; }
.status.watch { color: #315ecf; background: #edf3ff; } .status.active { color: #128258; background: #eaf8f2; }

/* ---------------------------------------------------- Bootstrap uyumu */
/* Ic sayfalar Bootstrap ile yazili; yeniden yazilmadan EDUON diline
   otursunlar diye temel bilesenler burada hizalaniyor. */
.card { border: 1px solid var(--border); border-radius: 15px; box-shadow: var(--shadow); }
.card-header { background: var(--surface-soft); border-bottom-color: var(--border); font-weight: 700; font-size: 13px; }
.btn-primary { background: linear-gradient(135deg, #356dff, #5f60ed); border: 0; box-shadow: 0 8px 18px rgba(53,109,255,.18); font-weight: 700; }
.btn-primary:hover { background: linear-gradient(135deg, #285ddd, #5454d7); }
.btn-outline-primary { color: #3d59cc; border-color: #c9d6f5; font-weight: 700; }
.btn-outline-primary:hover { color: #fff; background: var(--blue); border-color: var(--blue); }
.table thead th { color: #9099aa; background: #fafbfc; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; border-bottom-width: 1px; }
.badge { font-weight: 800; border-radius: 7px; }
.alert { border-radius: 12px; }
.form-control, .form-select { border-radius: 9px; border-color: #e0e5ee; }
.form-control:focus, .form-select:focus { border-color: #9db7f5; box-shadow: 0 0 0 .2rem rgba(53,109,255,.12); }

/* ----------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .app-shell { display: block; }
  .sidebar { width: min(82vw, 294px); transform: translateX(-105%); transition: transform .24s ease; }
  .sidebar.open { transform: translateX(0); box-shadow: 28px 0 60px rgba(7,18,43,.28); }
  .mobile-scrim { position: fixed; inset: 0; z-index: 35; border: 0; background: rgba(4,10,24,.52); opacity: 0; pointer-events: none; transition: .2s; display: block; }
  .mobile-scrim.show { opacity: 1; pointer-events: auto; }
  .main-stage { width: 100%; margin-left: 0; }
  .topbar { height: 62px; padding: 0 16px; position: sticky; top: 0; z-index: 20; }
  .mobile-brand-row { display: flex; align-items: center; gap: 10px; }
  .menu-toggle { width: 35px; height: 35px; border: 1px solid var(--border); border-radius: 9px; color: #3d4960; background: #fff; font-size: 16px; }
  .mobile-brand { display: flex; align-items: center; gap: 5px; letter-spacing: -.03em; }
  .mobile-brand span { font-size: 15px; font-weight: 900; }
  .mobile-brand strong { padding: 4px 5px; border-radius: 5px; color: #fff; background: linear-gradient(135deg,#3c75ff,#735cf1); font-size: 7px; }
  .context-select { display: none; }
  .topbar-actions { margin-left: auto; }
  .workspace { padding: 20px max(16px, env(safe-area-inset-right)) calc(34px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  .kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .page-heading { align-items: stretch; flex-direction: column; gap: 16px; margin-bottom: 18px; }
  .shell-footer { padding: 14px 16px; }
}

@media (max-width: 420px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .data-table-wrap { margin-right: -16px; margin-left: -16px; }
  .data-table th, .data-table td { padding-left: 16px; padding-right: 16px; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

/* ---- AI taslak dugmesi (eduon-ai-taslak.js) ---------------------------- */
.ai-taslak { border: 1px dashed rgba(30,116,253,.45); border-radius: 12px; padding: 12px 14px; background: linear-gradient(135deg, rgba(30,116,253,.05), rgba(16,216,118,.05)); }
.ai-taslak .ai-taslak-dugme.calisiyor { position: relative; padding-left: 2.2em; }
.ai-taslak .ai-taslak-dugme.calisiyor::before { content: ""; position: absolute; left: .8em; top: 50%; width: 1em; height: 1em; margin-top: -.5em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: ai-taslak-donen .7s linear infinite; }
.ai-taslak-durum { margin-top: 6px; white-space: pre-wrap; }
.ai-taslak-durum.ai-taslak-ham { max-height: 220px; overflow: auto; padding: 8px; border-radius: 8px; background: rgba(0,0,0,.04); }
.ai-dolduruldu { animation: ai-dolduruldu 1.4s ease-out; }
@keyframes ai-taslak-donen { to { transform: rotate(360deg); } }
@keyframes ai-dolduruldu { 0% { box-shadow: 0 0 0 3px rgba(16,216,118,.55); background-color: rgba(16,216,118,.14); } 100% { box-shadow: none; } }
@media (prefers-reduced-motion: reduce) { .ai-taslak .ai-taslak-dugme.calisiyor::before, .ai-dolduruldu { animation: none; } }
