/* ── 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.5; }

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

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

.nav-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.api-status  { font-size: 12px; white-space: nowrap; }
.api-status.online  { color: var(--green); }
.api-status.offline { color: var(--red); }

/* Hamburger butonu */
.hamburger {
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  gap: 5px; width: 36px; height: 36px; padding: 0;
  background: none; border: none; cursor: pointer; border-radius: 6px;
  transition: background .15s;
}
.hamburger:hover { background: var(--bg3); }
.hamburger span {
  display: block; width: 20px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: transform .25s, opacity .25s;
  transform-origin: center;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Drawer */
.nav-drawer {
  position: fixed; top: 52px; right: 0; bottom: 0;
  width: 240px; background: var(--bg2); border-left: 1px solid var(--border);
  z-index: 199; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .25s cubic-bezier(.4,0,.2,1);
}
.nav-drawer.open { transform: translateX(0); }

.nav-links { list-style: none; padding: 12px 8px; flex: 1; }
.nav-links li + li { margin-top: 2px; }
.nav-links a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px; text-decoration: none;
  color: var(--muted); font-weight: 500; font-size: 14px; transition: all .15s;
}
.nav-links a:hover, .nav-links a.active { background: var(--bg3); color: var(--text); }
.nav-links a svg { flex-shrink: 0; opacity: .7; }
.nav-links a.active svg { opacity: 1; }

.nav-drawer-footer { padding: 12px 8px; border-top: 1px solid var(--border); }
.nav-drawer-logout {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px; text-decoration: none;
  color: var(--red); font-size: 14px; font-weight: 500; transition: background .15s;
}
.nav-drawer-logout:hover { background: rgba(239,68,68,.08); }

/* Overlay */
.nav-overlay {
  display: none; position: fixed; inset: 0; z-index: 198;
  background: rgba(0,0,0,.4); backdrop-filter: blur(2px);
}
.nav-overlay.open { display: block; }

/* ── Container ───────────────────────────────────────────────────────────── */
.container { max-width: 1280px; margin: 0 auto; padding: 24px 16px; }
.page-title { font-size: 20px; font-weight: 700; margin-bottom: 20px; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.page-header .page-title { margin-bottom: 0; }

/* ── 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: 12px 16px; border-bottom: 1px solid var(--border); }
.card-header h3 { font-size: 14px; font-weight: 600; }

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

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

/* ── Table ───────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
     color: var(--muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,.02); }
.row-unread td { background: rgba(59,130,246,.04); }

/* ── Sort ────────────────────────────────────────────────────────────────── */
.sort-link { color: var(--muted); text-decoration: none; display: flex; align-items: center; gap: 4px;
             font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.sort-link:hover { color: var(--text); }
.sort-icon { opacity: .4; font-style: normal; }
.sort-icon.active { opacity: 1; color: var(--blue); }

/* ── Filter Bar ──────────────────────────────────────────────────────────── */
.filter-bar { padding: 12px 16px; }
.filter-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search-wrap { position: relative; flex: 1; min-width: 180px; }
.search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
               color: var(--muted); pointer-events: none; z-index: 1; flex-shrink: 0; }
.search-input { width: 100%; padding: 8px 12px 8px 36px; background: var(--bg);
                border: 1px solid var(--border); border-radius: 8px; color: var(--text);
                font-size: 13px; position: relative; }
.search-input:focus { outline: none; border-color: var(--blue); }
.filter-select { padding: 8px 12px; background: var(--bg); border: 1px solid var(--border);
                 border-radius: 8px; color: var(--text); font-size: 13px; cursor: pointer; }

/* ── Bulk Bar ────────────────────────────────────────────────────────────── */
.bulk-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
            background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius);
            padding: 10px 16px; margin-bottom: 12px; }
#bulk-deadline-wrap { display: flex; align-items: center; gap: 8px; }

/* ── Table Columns ───────────────────────────────────────────────────────── */
.col-check   { width: 32px; }
.col-detail  { width: 90px; }
.col-date    { width: 110px; white-space: nowrap; }
.col-deadline { width: 160px; }
.col-note    { min-width: 140px; }
.col-files   { width: 80px; }

/* Mobile: gizle */
@media (max-width: 768px) {
  .hide-mobile { display: none; }
  .mobile-first { }
  .col-detail { width: 70px; }
}

/* ── Deadline Cell ───────────────────────────────────────────────────────── */
.deadline-cell { display: flex; flex-direction: column; gap: 4px; }
.deadline-picker {
  background: transparent; border: 1px dashed var(--border); border-radius: 6px;
  color: var(--muted); font-size: 11px; padding: 3px 6px; width: 130px; cursor: pointer;
}
.deadline-picker:hover { border-color: var(--blue); }
.deadline-picker:focus { outline: none; border-color: var(--blue); color: var(--text); }

/* ── Note Input ──────────────────────────────────────────────────────────── */
.note-input { background: transparent; border: none; color: var(--text); font-size: 13px;
              width: 100%; padding: 4px 0; border-bottom: 1px dashed transparent; }
.note-input:hover, .note-input:focus { outline: none; border-bottom-color: var(--border); }
.note-input::placeholder { color: var(--muted); }

/* ── Custom Checkbox ─────────────────────────────────────────────────────── */
.custom-check { display: inline-flex; align-items: center; cursor: pointer; }
.custom-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.custom-check span {
  width: 16px; height: 16px; border-radius: 4px; flex-shrink: 0;
  border: 1.5px solid var(--border); background: var(--bg);
  display: flex; align-items: center; justify-content: center; transition: all .15s;
}
.custom-check input:checked + span {
  background: var(--blue); border-color: var(--blue);
}
.custom-check input:checked + span::after {
  content: ''; display: block; width: 4px; height: 7px;
  border: 2px solid #fff; border-top: none; border-left: none;
  transform: rotate(45deg) translate(-1px, -1px);
}

/* ── Detay Butonu ────────────────────────────────────────────────────────── */
.detail-btn { position: relative; }
.dot-unread-btn {
  width: 7px; height: 7px; background: #fff; border-radius: 50%;
  display: inline-block; margin-right: 2px; vertical-align: middle; opacity: .9;
}

/* ── Unread dot ──────────────────────────────────────────────────────────── */
.dot-unread { display: inline-block; width: 7px; height: 7px; background: var(--blue);
              border-radius: 50%; margin-right: 4px; vertical-align: middle; flex-shrink: 0; }

/* ── Pagination ──────────────────────────────────────────────────────────── */
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px;
              padding: 14px; border-top: 1px solid var(--border); }
.page-info { font-size: 13px; color: var(--muted); }

/* ── Log Stream ──────────────────────────────────────────────────────────── */
.log-stream { max-height: 340px; overflow-y: auto; padding: 10px 14px;
              font-family: 'SF Mono', 'Fira Code', monospace; font-size: 11px;
              display: flex; flex-direction: column; gap: 2px; }
.log-entry { display: flex; gap: 6px; padding: 2px 0; align-items: baseline; flex-wrap: wrap; }
.log-time  { color: var(--muted); flex-shrink: 0; }
.log-cat   { color: var(--blue);  flex-shrink: 0; }
.log-msg   { color: var(--text); word-break: break-word; }
.log-entry.log-error .log-msg { color: var(--red); }
.log-entry.log-warn  .log-msg { color: var(--yellow); }

/* ── Log Page ────────────────────────────────────────────────────────────── */
.log-page-stream { padding: 8px 0; }
.log-page-entry { padding: 6px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; gap: 8px; }
.log-page-entry:last-child { border-bottom: none; }
.log-context { font-size: 11px; font-family: monospace; opacity: .6; width: 100%; margin-top: 2px; }
.log-level-badge { font-size: 10px; }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 200;
                 display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
         width: 100%; max-width: 480px; max-height: 80vh; display: flex; flex-direction: column; }
.modal-header { display: flex; justify-content: space-between; align-items: center;
                padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 15px; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 18px; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 16px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }

/* ── File Item ───────────────────────────────────────────────────────────── */
.file-item { display: flex; align-items: center; justify-content: space-between;
             padding: 10px 0; border-bottom: 1px solid var(--border); gap: 12px; }
.file-item:last-child { border-bottom: none; }
.file-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.file-icon { font-size: 20px; flex-shrink: 0; }
.file-name { font-size: 13px; word-break: break-word; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
       padding: 7px 14px; border-radius: 7px; 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 10px; font-size: 12px; border-radius: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.w-full { width: 100%; }

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

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

/* ── Feature Toggles ─────────────────────────────────────────────────────── */
.feature-list { padding: 4px 0; }
.feature-row { display: flex; justify-content: space-between; align-items: center;
               padding: 14px 16px; 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; font-size: 13px; }
.feature-desc { font-size: 11px; color: var(--muted); }

.toggle { position: relative; width: 42px; height: 22px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: var(--border); border-radius: 22px;
                 cursor: pointer; transition: .2s; }
.toggle-slider::before { content: ''; position: absolute; width: 16px; height: 16px;
                          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: 14px; padding: 16px; }
@media (max-width: 600px) { .settings-grid { grid-template-columns: 1fr; } }
.save-status { font-size: 12px; margin-top: 6px; min-height: 18px; }

/* ── Google OAuth ────────────────────────────────────────────────────────── */
.oauth-status-bar { display: flex; align-items: center; justify-content: space-between;
                    padding: 14px 16px; gap: 12px; flex-wrap: wrap; }
.oauth-connected { display: flex; align-items: center; gap: 8px; }
.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: 7px 14px; border-radius: 7px;
              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); }

/* ── Hatırlatıcı Sayfası ─────────────────────────────────────────────────── */
.hatirlatici-page { background: var(--bg); min-height: 100vh; padding: 20px 12px; }
.hatirlatici-wrap { max-width: 600px; margin: 0 auto; }
.hat-header { display: flex; align-items: center; gap: 10px; margin-bottom: 20px;
              font-size: 17px; font-weight: 700; }
.detail-grid { padding: 2px 0; }
.detail-row { display: flex; padding: 10px 16px; border-bottom: 1px solid var(--border); gap: 8px; }
.detail-row:last-child { border-bottom: none; }
.detail-row.highlight { background: rgba(249,115,22,.06); }
.detail-label { width: 130px; color: var(--muted); font-size: 12px; flex-shrink: 0; padding-top: 2px; }
.detail-value { font-weight: 500; font-size: 13px; word-break: break-word; }

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

.preset-buttons { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 16px; }
.preset-btn { flex: 1; min-width: 130px; flex-direction: column; padding: 12px; line-height: 1.4; text-align: center; }
.preset-btn small { font-size: 11px; color: var(--muted); }
.preset-btn.selected { border-color: var(--blue); background: rgba(59,130,246,.1); }

.custom-reminder-form { display: flex; gap: 10px; flex-wrap: wrap; }
.custom-reminder-form input { flex: 1; min-width: 150px; }
.channel-checks { display: flex; gap: 16px; flex-wrap: wrap; }
.check-label { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; }
.existing-reminders { }
.existing-item { display: flex; align-items: center; padding: 5px 0; flex-wrap: wrap; gap: 4px; }
.btn-delete-reminder { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 13px; padding: 2px 6px; border-radius: 4px; transition: color .15s, background .15s; }
.btn-delete-reminder:hover { color: #f56565; background: rgba(245,101,101,.1); }

/* ── Hatırlatıcı deadline section ───────────────────────────────────────── */
.deadline-input-section {
  padding: 14px 20px 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.deadline-set-row { display: flex; align-items: center; gap: 10px; }
#deadline-picker-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#reminder-form-wrap { padding: 0 20px 16px; transition: opacity .2s; }

/* ── Deadline warning card ───────────────────────────────────────────────── */
.deadline-warning-card { border-color: rgba(249,115,22,.3); }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 2px 7px; 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); }

/* ── 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; font-size: 12px; }
.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; }
