/* Manport Operasyon — ortak stiller
   Renkler manport.ae'den: logo lacivert #000025, logo mavisi #0246FF, açık mavi #4F9DFF,
   site mavisi #1681EE, site metin rengi #1E2D3B. */

:root {
  --navy-900: #000025;   /* logo lacivert */
  --navy-800: #0a1446;
  --navy-700: #1e2d3b;   /* site metin rengi */
  --blue-300: #4f9dff;   /* logo açık mavi */
  --blue-500: #1681ee;   /* site mavisi */
  --blue-600: #0246ff;   /* logo mavisi */
  --blue-700: #0236c4;
  --sand-50: #f4f7fc;
  --ink: #1e2d3b;
  --ink-soft: #566577;
  --line: #d8dfea;
  --surface: #ffffff;
  --danger-bg: #fdecec;
  --danger-ink: #a12121;
  --radius: 10px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--sand-50);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2 { line-height: 1.2; margin: 0; }
.muted { color: var(--ink-soft); margin: .25rem 0 0; }
.eyebrow {
  text-transform: uppercase; letter-spacing: .14em; font-size: .75rem;
  font-weight: 600; color: var(--blue-500); margin: 0 0 .75rem;
}

/* ---------- marka ---------- */
.brand { display: inline-flex; align-items: center; gap: .75rem; color: #fff; text-decoration: none; }
.brand-dark { color: var(--navy-800); }
.brand-logo { display: block; height: 64px; width: auto; }
.brand-dark .brand-logo { height: 44px; }
.brand-tag {
  font-size: .72rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  padding-left: .75rem; border-left: 1px solid currentColor; opacity: .85;
}

/* ---------- butonlar ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: inherit; font-weight: 600; border-radius: var(--radius); cursor: pointer;
  padding: .8rem 1.2rem; border: 1px solid transparent; text-decoration: none;
  transition: background-color .15s, border-color .15s, opacity .15s;
}
.btn:focus-visible, input:focus-visible, .ghost:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--blue-500) 40%, transparent); outline-offset: 2px;
}
.btn-primary { background: var(--blue-600); color: #fff; }
.btn-primary:hover { background: var(--blue-700); }
.btn-primary:disabled { opacity: .7; cursor: progress; }
.btn-secondary { background: transparent; color: var(--navy-800); border-color: var(--line); padding: .55rem .9rem; }
.btn-secondary:hover { border-color: var(--navy-700); }

.spinner {
  display: none; width: 1rem; height: 1rem; border-radius: 50%;
  border: 2px solid rgb(255 255 255 / .4); border-top-color: #fff;
  animation: spin .8s linear infinite;
}
.is-loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- giriş sayfası ---------- */
.auth-shell { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }

.auth-brand {
  position: relative; overflow: hidden; color: #fff;
  padding: 2.5rem clamp(1.5rem, 5vw, 4rem);
  display: flex; flex-direction: column; justify-content: flex-start; gap: 2.5rem;
  /* manport.ae ana sayfasındaki STS yapan üç gemi (üstü şeffaf PNG, Wix CDN'den) */
  background:
    url("https://static.wixstatic.com/media/2db8c3_3168d57ca653478a9edf9c11393a7501~mv2.png/v1/fill/w_1600,h_795,al_c,q_85,enc_auto/manport-sts.png")
      center bottom / max(100%, calc(62vh * 2.01)) auto no-repeat,
    linear-gradient(180deg, var(--blue-500) 0%, var(--blue-500) 55%, #0f5fc0 100%);
}
.brand-copy { position: relative; z-index: 1; max-width: 30rem; }
.brand-copy .eyebrow { color: #fff; opacity: .9; }
.brand-copy h1 { color: #fff; font-size: clamp(1.8rem, 3.2vw, 2.6rem); font-weight: 700; letter-spacing: -.01em; }
.brand-copy p:last-child { margin: 1rem 0 0; font-size: 1.05rem; color: #eaf3ff; }
.brand-foot { margin: auto 0 0; font-size: .8rem; color: rgb(255 255 255 / .8); position: relative; z-index: 1; }


.auth-panel { display: grid; place-items: center; padding: 2.5rem 1.5rem; background: var(--surface); }
.auth-form { width: 100%; max-width: 380px; display: grid; gap: 1.1rem; }
.auth-form h2 { font-size: 1.6rem; }
.auth-form > .muted { margin-top: -.75rem; }

.field { display: grid; gap: .4rem; }
label { font-weight: 600; font-size: .9rem; }
input[type="email"], input[type="password"], input[type="text"] {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem .9rem;
  transition: border-color .15s;
}
input:hover { border-color: #b8c1cd; }
input:focus { border-color: var(--blue-500); }

.password-field { position: relative; }
.password-field input { padding-right: 5rem; }
.ghost {
  position: absolute; right: .35rem; top: 50%; transform: translateY(-50%);
  font: inherit; font-size: .85rem; font-weight: 600; color: var(--blue-600);
  background: none; border: 0; border-radius: 6px; padding: .35rem .6rem; cursor: pointer;
}
.ghost:hover { background: var(--sand-50); }


.alert {
  background: var(--danger-bg); color: var(--danger-ink); border-radius: var(--radius);
  padding: .75rem .9rem; font-size: .92rem; border-left: 3px solid var(--danger-ink);
}
.help { font-size: .85rem; color: var(--ink-soft); margin: .5rem 0 0; text-align: center; }

@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-brand { padding: 1.25rem 1rem calc(50vw + .5rem); gap: 1.25rem; background-size: 100% auto, auto; }
  .brand-logo { height: 52px; }
  .brand-copy h1 { font-size: 1.5rem; }
  .brand-copy p:last-child { font-size: .95rem; }
  .brand-foot { display: none; }
  .auth-panel { place-items: start center; padding: 2rem 1rem 3rem; }
}

/* ---------- uygulama paneli ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .9rem clamp(1rem, 4vw, 2.5rem); background: var(--surface); border-bottom: 1px solid var(--line);
}
/* Hesap menüsü (sağ üst): avatar + ad/rol → açılır menü */
.account { position: relative; }
.account-trigger {
  list-style: none; display: flex; align-items: center; gap: .65rem; cursor: pointer;
  min-height: 44px; padding: .3rem .5rem .3rem .3rem; border-radius: 999px; border: 1px solid transparent;
}
.account-trigger::-webkit-details-marker { display: none; }
.account-trigger:hover, .account[open] .account-trigger { border-color: var(--line); background: var(--sand-50); }
.account-trigger:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue-500) 40%, transparent); outline-offset: 2px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--navy-900); color: #fff; font-size: .8rem; font-weight: 700; letter-spacing: .03em;
}
.user-meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.role { font-size: .78rem; color: var(--ink-soft); }
.chevron { width: 16px; height: 16px; color: var(--ink-soft); transition: transform .15s; }
.account[open] .chevron { transform: rotate(180deg); }
.menu {
  position: absolute; right: 0; top: calc(100% + .4rem); z-index: 20; min-width: 220px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .4rem;
  box-shadow: 0 12px 32px rgb(0 0 37 / .12);
}
.menu-head { display: flex; flex-direction: column; padding: .55rem .7rem .7rem; border-bottom: 1px solid var(--line); margin-bottom: .3rem; }
.menu-item {
  display: block; width: 100%; text-align: left; font: inherit; font-weight: 500; color: var(--ink);
  background: none; border: 0; border-radius: 8px; padding: .7rem; min-height: 44px; cursor: pointer;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--sand-50); outline: none; }

.dashboard { max-width: 1100px; margin: 0 auto; padding: 2.5rem clamp(1rem, 4vw, 2.5rem); }
.dashboard h1 { font-size: 1.8rem; }
.modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; margin-top: 2rem; }
.module {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 1.25rem; display: flex; flex-direction: column; gap: .5rem;
}
.module h2 { font-size: 1.05rem; color: var(--navy-800); }
.module p { margin: 0; color: var(--ink-soft); font-size: .92rem; flex: 1; }
.badge {
  align-self: flex-start; font-size: .72rem; font-weight: 600; letter-spacing: .04em;
  color: var(--blue-600); background: color-mix(in srgb, var(--blue-300) 18%, transparent);
  padding: .2rem .55rem; border-radius: 999px;
}

@media (max-width: 640px) {
  .account-trigger .user-meta { display: none; }   /* ad/rol menünün içinde görünür */
  .dashboard { padding-top: 1.75rem; }
  .dashboard h1 { font-size: 1.5rem; }
  .modules { margin-top: 1.5rem; }
}
@media (max-width: 380px) {
  .topbar .brand-tag { display: none; }
}

/* ---------- dialog ---------- */
.dialog {
  border: 0; border-radius: 14px; padding: 1.75rem; width: min(420px, calc(100vw - 2rem));
  box-shadow: 0 20px 60px rgb(7 22 41 / .25); color: var(--ink);
}
.dialog::backdrop { background: rgb(7 22 41 / .45); }
.dialog-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: .25rem; }
.dialog-actions .btn-secondary { padding: .8rem 1.1rem; }
@media (max-width: 480px) {
  /* Dar ekranda: tam genişlik, birincil buton üstte */
  .dialog { padding: 1.25rem; }
  .dialog-actions { flex-direction: column-reverse; }
  .dialog-actions .btn { width: 100%; }
}
.hint { color: var(--ink-soft); font-size: .8rem; }
.notice {
  background: color-mix(in srgb, var(--blue-300) 18%, #fff); color: var(--blue-600); border-radius: var(--radius);
  padding: .75rem .9rem; font-size: .92rem; border-left: 3px solid var(--blue-500);
}

/* ---------- 404 ---------- */
.notfound main { min-height: 100vh; display: grid; place-content: center; justify-items: start; gap: .75rem; padding: 1rem; max-width: 34rem; margin: 0 auto; }
.notfound h1 { font-size: 2rem; }
.notfound .btn { margin-top: 1rem; }

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