/* ── Reset & Tokens ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0f1117;
  --bg2:       #1a1d27;
  --bg3:       #22263a;
  --border:    #2d3148;
  --text:      #e2e8f0;
  --muted:     #64748b;
  --blue:      #3b82f6;
  --blue-dark: #1d4ed8;
  --green:     #22c55e;
  --red:       #ef4444;
  --orange:    #f97316;
  --yellow:    #eab308;
  --radius:    10px;
  --font:      -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html, body { height: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--font);
       font-size: 14px; line-height: 1.6; }

/* ── Navbar ──────────────────────────────────────────────────────────────── */
.navbar {
  display: flex; align-items: center; gap: 24px;
  padding: 0 24px; height: 56px;
  background: var(--bg2); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}

.nav-brand { display: flex; align-items: center; gap: 10px;
             font-weight: 600; font-size: 15px; text-decoration: none; color: var(--text); }

.nav-links { display: flex; gap: 4px; list-style: none; flex: 1; }
.nav-links a {
  padding: 6px 14px; border-radius: 6px; text-decoration: none;
  color: var(--muted); font-weight: 500; transition: all .15s;
}
.nav-links a:hover, .nav-links a.active {
  background: var(--bg3); color: var(--text);
}

.nav-actions { display: flex; align-items: center; gap: 12px; }
.api-status  { font-size: 13px; }
.api-status.online  { color: var(--green); }
.api-status.offline { color: var(--red); }

/* ── Container ───────────────────────────────────────────────────────────── */
.container { max-width: 1280px; margin: 0 auto; padding: 32px 24px; }
.page-title { font-size: 22px; font-weight: 700; margin-bottom: 24px; }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.card-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.card-header h3 { font-size: 15px; font-weight: 600; }

/* ── Stats Grid ──────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.stat-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  display: flex; flex-direction: column; gap: 8px;
}
.stat-label { font-size: 12px; color: var(--muted); text-transform: uppercase;
              letter-spacing: .05em; }
.stat-value { font-size: 20px; font-weight: 700; }

/* ── Grid ────────────────────────────────────────────────────────────────── */
.grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .grid-two { grid-template-columns: 1fr; } }

/* ── Table ───────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
     color: var(--muted); border-bottom: 1px solid var(--border); }
td { border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg3); }

/* ── Log Stream ──────────────────────────────────────────────────────────── */
.log-stream {
  max-height: 400px; overflow-y: auto; padding: 12px 16px;
  font-family: 'SF Mono', 'Fira Code', monospace; font-size: 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.log-entry { display: flex; gap: 8px; padding: 3px 0; }
.log-time  { color: var(--muted); flex-shrink: 0; }
.log-cat   { color: var(--blue);  flex-shrink: 0; min-width: 80px; }
.log-msg   { color: var(--text); }
.log-entry.log-error .log-msg { color: var(--red); }
.log-entry.log-warn  .log-msg { color: var(--yellow); }
.log-entry.log-info  .log-msg { color: var(--text); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 500;
  cursor: pointer; border: 1px solid transparent; text-decoration: none;
  transition: all .15s; white-space: nowrap;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover, .btn-outline.selected { background: var(--bg3); border-color: var(--blue); }
.btn-ghost   { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--bg3); color: var(--text); }
.btn-sm      { padding: 5px 12px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.w-full { width: 100%; }

/* ── Form ────────────────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 12px; color: var(--muted); font-weight: 500; }
input[type="text"], input[type="password"], input[type="datetime-local"] {
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); padding: 10px 14px; font-size: 14px; width: 100%;
  transition: border-color .15s;
}
input:focus { outline: none; border-color: var(--blue); }

/* ── Login Page ──────────────────────────────────────────────────────────── */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 16px;
  padding: 40px; width: 100%; max-width: 420px;
}
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.login-logo h1 { font-size: 20px; font-weight: 700; }
.login-sub { color: var(--muted); margin-bottom: 24px; font-size: 13px; }
.method-badges { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.error-msg { color: var(--red); font-size: 13px; margin-top: 10px; }

/* ── Feature Toggles ─────────────────────────────────────────────────────── */
.feature-list { padding: 8px 0; }
.feature-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.feature-row:last-child { border-bottom: none; }
.feature-info { display: flex; flex-direction: column; gap: 2px; }
.feature-name { font-weight: 500; }
.feature-desc { font-size: 12px; color: var(--muted); }

.toggle { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; background: var(--border);
  border-radius: 24px; cursor: pointer; transition: .2s;
}
.toggle-slider::before {
  content: ''; position: absolute; width: 18px; height: 18px;
  left: 3px; top: 3px; background: white; border-radius: 50%; transition: .2s;
}
.toggle input:checked + .toggle-slider { background: var(--blue); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ── Settings ────────────────────────────────────────────────────────────── */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 20px; }
@media (max-width: 700px) { .settings-grid { grid-template-columns: 1fr; } }
.save-status { font-size: 13px; margin-top: 8px; min-height: 20px; }

/* ── Hatırlatıcı Sayfası ─────────────────────────────────────────────────── */
.hatirlatici-page { background: var(--bg); min-height: 100vh; padding: 24px 16px; }
.hatirlatici-wrap { max-width: 640px; margin: 0 auto; }
.hat-header { display: flex; align-items: center; gap: 10px; margin-bottom: 24px;
              font-size: 18px; font-weight: 700; }

.detail-grid { padding: 4px 0; }
.detail-row { display: flex; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.detail-row:last-child { border-bottom: none; }
.detail-row.highlight { background: rgba(249,115,22,.08); }
.detail-label { width: 140px; color: var(--muted); font-size: 13px; flex-shrink: 0; }
.detail-value { font-weight: 500; }

.taraf-list { padding: 12px 20px; display: flex; flex-direction: column; gap: 8px; }
.taraf-row  { display: flex; align-items: center; gap: 10px; }
.taraf-ad   { font-size: 14px; }

.preset-buttons { display: flex; flex-wrap: wrap; gap: 12px; padding: 0 20px; }
.preset-btn { flex: 1; min-width: 140px; flex-direction: column; padding: 14px; line-height: 1.4; }
.preset-btn small { font-size: 11px; color: var(--muted); }

.custom-reminder-form { display: flex; gap: 12px; padding: 0 20px; flex-wrap: wrap; }
.custom-reminder-form input { flex: 1; min-width: 160px; }

.channel-checks { display: flex; gap: 20px; padding: 0 20px; flex-wrap: wrap; }
.check-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }

.existing-reminders { padding: 0 20px; }
.existing-item { display: flex; align-items: center; padding: 6px 0; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; padding: 3px 8px;
  border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge-blue   { background: rgba(59,130,246,.15);  color: var(--blue); }
.badge-green  { background: rgba(34,197,94,.15);   color: var(--green); }
.badge-red    { background: rgba(239,68,68,.15);   color: var(--red); }
.badge-orange { background: rgba(249,115,22,.15);  color: var(--orange); }
.badge-yellow { background: rgba(234,179,8,.15);   color: var(--yellow); }
.badge-gray   { background: var(--bg3);             color: var(--muted); }

/* ── Google OAuth ────────────────────────────────────────────────────────── */
.oauth-status-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; gap: 12px; flex-wrap: wrap;
}
.oauth-connected { display: flex; align-items: center; gap: 10px; }
.oauth-actions   { display: flex; align-items: center; gap: 8px; }

.google-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; color: #3c4043; border: 1px solid #dadce0;
  font-weight: 500; padding: 8px 16px; border-radius: 8px;
  font-size: 13px; cursor: pointer; text-decoration: none;
  transition: box-shadow .15s;
}
.google-btn:hover { box-shadow: 0 1px 6px rgba(0,0,0,.2); }

/* ── Utilities ───────────────────────────────────────────────────────────── */
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.text-orange { color: var(--orange); }
.text-muted  { color: var(--muted); }
.text-gray   { color: var(--muted); }
.text-center { text-align: center; }
.text-sm     { font-size: 12px; }
.font-mono   { font-family: 'SF Mono', 'Fira Code', monospace; }
.fw-bold     { font-weight: 700; }
.fw-500      { font-weight: 500; }
.mb-8        { margin-bottom: 8px; }
.mb-12       { margin-bottom: 12px; }
.mb-16       { margin-bottom: 16px; }
.mb-20       { margin-bottom: 20px; }
.mb-24       { margin-bottom: 24px; }
.mt-8        { margin-top: 8px; }
.mt-16       { margin-top: 16px; }
.ml-8        { margin-left: 8px; }
.py-24       { padding-top: 24px; padding-bottom: 24px; }
