/* ============================================================
   Jusbil Gate — tasarım sistemi
   Jusbil marka kimliğinden türetilmiştir (lacivert + mavi ana,
   turuncu vurgu), güvenlik/operasyon aracına uyarlanmıştır.
   ============================================================ */

:root {
  --ink: #0f1830;
  --ink-soft: #232b4a;
  --ink-mute: #5b6480;
  --paper: #ffffff;
  --cloud: #f6f8fc;
  --mist: #edeff7;
  --line: #e4e7f0;

  --brand: #024ad8;
  --brand-deep: #0138a8;
  --brand-soft: #e9f0ff;
  --accent: #fd4902;
  --accent-soft: #fff0e8;

  --good: #12875a;
  --good-soft: #e6f6ee;
  --warn: #b3720b;
  --warn-soft: #fff4e0;
  --bad: #c22a2a;
  --bad-soft: #fdeaea;

  --grad-hero: radial-gradient(1100px 520px at 82% -10%, rgba(2, 74, 216, 0.28), transparent 60%),
    radial-gradient(800px 460px at 8% 105%, rgba(253, 73, 2, 0.16), transparent 55%),
    linear-gradient(160deg, #0b1330 0%, #0f1830 55%, #0a1226 100%);

  --font-head: "Sora", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(10, 18, 38, 0.06), 0 2px 8px rgba(10, 18, 38, 0.05);
  --shadow-md: 0 2px 6px rgba(10, 18, 38, 0.05), 0 14px 34px rgba(10, 18, 38, 0.1);
  --shadow-brand: 0 10px 26px rgba(2, 74, 216, 0.28);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink-soft);
  background: var(--cloud);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
}

button,
input {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3 {
  font-family: var(--font-head);
  color: var(--ink);
  letter-spacing: -0.01em;
}

/* ---------- Layout: auth (login) screen ---------- */

.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--grad-hero);
  position: relative;
  overflow: hidden;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--paper);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 70px rgba(3, 8, 20, 0.45);
  padding: 40px 36px 36px;
  position: relative;
  z-index: 1;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.brand-row img {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.brand-row .brand-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
}

.brand-row .brand-name span {
  color: var(--brand);
}

.auth-card h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.auth-card p.lead {
  color: var(--ink-mute);
  font-size: 0.92rem;
  margin-bottom: 26px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--cloud);
  font-size: 0.95rem;
  transition:
    border-color 0.15s var(--ease-out),
    background 0.15s var(--ease-out);
}

.field input:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--paper);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 18px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: var(--shadow-brand);
  transition:
    transform 0.15s var(--ease-out),
    background 0.15s var(--ease-out);
}

.btn:hover {
  background: var(--brand-deep);
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.6;
  cursor: default;
  box-shadow: none;
}

.btn.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  box-shadow: none;
  border: 1.5px solid var(--line);
}

.btn.btn-ghost:hover {
  background: var(--mist);
}

.btn.btn-danger {
  background: var(--bad);
  box-shadow: 0 10px 24px rgba(194, 42, 42, 0.25);
}

.btn.btn-danger:hover {
  background: #a52222;
}

.notice {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  display: none;
}

.notice.show {
  display: block;
}

.notice.notice-good {
  background: var(--good-soft);
  color: var(--good);
}

.notice.notice-bad {
  background: var(--bad-soft);
  color: var(--bad);
}

.auth-foot {
  margin-top: 22px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--ink-mute);
}

/* ---------- Layout: app (dashboard) screen ---------- */

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar .brand-row {
  margin: 0;
}

.topbar .who {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.86rem;
  color: var(--ink-mute);
}

.topbar .who strong {
  color: var(--ink);
}

.container {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 28px 20px 60px;
  flex: 1;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.page-head h1 {
  font-size: 1.4rem;
}

.tabs {
  display: flex;
  gap: 6px;
  background: var(--mist);
  padding: 4px;
  border-radius: var(--radius-pill);
  width: fit-content;
  margin-bottom: 20px;
}

.tab {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-mute);
  cursor: pointer;
  border: none;
  background: transparent;
  transition: all 0.15s var(--ease-out);
}

.tab.active {
  background: var(--paper);
  color: var(--brand);
  box-shadow: var(--shadow-sm);
}

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.item {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.item .item-main {
  flex: 1;
  min-width: 0;
}

.item .subject {
  font-weight: 600;
  color: var(--ink);
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item .meta {
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--ink-mute);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.item .meta .from {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 260px;
}

.score-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-weight: 700;
  background: var(--warn-soft);
  color: var(--warn);
  flex-shrink: 0;
}

.score-badge.high {
  background: var(--bad-soft);
  color: var(--bad);
}

.item-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.icon-btn {
  border: 1.5px solid var(--line);
  background: var(--paper);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink-soft);
  transition: all 0.15s var(--ease-out);
  white-space: nowrap;
}

.icon-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}

.icon-btn.danger:hover {
  border-color: var(--bad);
  color: var(--bad);
  background: var(--bad-soft);
}

.icon-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-mute);
}

.empty-state .emoji {
  font-size: 2.4rem;
  margin-bottom: 10px;
}

.loading {
  text-align: center;
  padding: 40px;
  color: var(--ink-mute);
  font-size: 0.9rem;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s var(--ease-out);
  z-index: 100;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 560px) {
  .item {
    flex-wrap: wrap;
  }
  .item-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .item .meta .from {
    max-width: 160px;
  }
}
