/* =====================================================================
   Hatirlatici Paneli - Stiller
   Karanlik ve aydinlik tema destegi
   ===================================================================== */

:root {
    --bg: #eef2f7;
    --bg-grad-1: #e0e7ff;
    --bg-grad-2: #eef2f7;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-soft: rgba(37, 99, 235, 0.1);
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --success: #16a34a;
    --warning: #d97706;
    --info: #0891b2;
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 8px 24px rgba(15, 23, 42, 0.04);
    --radius: 14px;
    --radius-sm: 9px;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0b1220;
    --bg-grad-1: #10203a;
    --bg-grad-2: #0b1220;
    --surface: #151d2e;
    --surface-2: #1b2437;
    --text: #e6ecf5;
    --muted: #94a3b8;
    --border: #2a3549;
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --primary-soft: rgba(59, 130, 246, 0.16);
    --danger: #f87171;
    --danger-hover: #ef4444;
    --success: #4ade80;
    --warning: #fbbf24;
    --info: #22d3ee;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background:
        radial-gradient(1200px 600px at 100% -10%, var(--bg-grad-1), transparent 60%),
        var(--bg-grad-2);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background .25s ease, color .25s ease;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 1px 6px;
    border-radius: 6px;
    font-size: .85em;
}

/* ---------- Ust bar ---------- */
.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar__inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 22px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-weight: 700;
    color: var(--text);
    font-size: 17px;
    white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand__logo { font-size: 20px; }

.nav { display: flex; gap: 6px; flex: 1; }

.nav__link {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-weight: 500;
    transition: background .15s ease, color .15s ease;
}
.nav__link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav__link.is-active { background: var(--primary-soft); color: var(--primary); }

.topbar__actions { display: flex; align-items: center; gap: 10px; }

.user-chip {
    color: var(--muted);
    font-size: 14px;
    white-space: nowrap;
}

.icon-btn {
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background .15s ease, transform .15s ease;
}
.icon-btn:hover { background: var(--primary-soft); transform: translateY(-1px); }

html[data-theme="light"] .icon-sun { display: none; }
html[data-theme="dark"]  .icon-moon { display: none; }

/* ---------- Kapsayici ---------- */
.container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 26px 20px 40px;
    flex: 1;
}

.site-footer {
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    padding: 18px;
}

/* ---------- Sayfa basligi ---------- */
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.page-title { margin: 0; font-size: 24px; font-weight: 700; }
.muted { color: var(--muted); margin: 2px 0 0; }

/* ---------- Bildirimler ---------- */
.flashes { margin-bottom: 18px; display: grid; gap: 10px; }

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
    font-size: 14px;
    border-left-width: 4px;
}
.alert--success { border-left-color: var(--success); color: var(--success); background: color-mix(in srgb, var(--success) 8%, var(--surface)); }
.alert--error   { border-left-color: var(--danger);  color: var(--danger);  background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.alert--warning { border-left-color: var(--warning); color: var(--warning); background: color-mix(in srgb, var(--warning) 10%, var(--surface)); }
.alert--info    { border-left-color: var(--info);    color: var(--info);    background: color-mix(in srgb, var(--info) 8%, var(--surface)); }

/* ---------- Kartlar ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    margin-bottom: 22px;
    transition: background .25s ease, border-color .25s ease;
}
.card--form { max-width: 820px; }

.card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.card__head-actions { display: flex; align-items: center; gap: 10px; }
.card__title { margin: 0; font-size: 17px; font-weight: 700; }

.pill {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 3px 11px;
    border-radius: 999px;
    font-size: 12.5px;
}

/* ---------- Istatistikler ---------- */
.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}
.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-top: 3px solid var(--border);
}
.stat--pending { border-top-color: var(--warning); }
.stat--sent    { border-top-color: var(--success); }
.stat--failed  { border-top-color: var(--danger); }
.stat__value { font-size: 30px; font-weight: 800; line-height: 1; }
.stat__label { color: var(--muted); font-size: 13.5px; }

/* ---------- Tablo ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
    text-align: left;
    color: var(--muted);
    font-weight: 600;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: .03em;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--surface-2); }
.ta-right { text-align: right; }

.cell-title { font-weight: 600; }
.cell-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.text-danger { color: var(--danger); }
.text-late { color: var(--warning); font-weight: 600; }

.row-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.inline-form { display: inline; }

/* ---------- Etiketler ---------- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
}
.badge--pending { color: var(--warning); background: color-mix(in srgb, var(--warning) 14%, transparent); }
.badge--sent    { color: var(--success); background: color-mix(in srgb, var(--success) 14%, transparent); }
.badge--failed  { color: var(--danger);  background: color-mix(in srgb, var(--danger) 14%, transparent); }
.badge--late    { color: var(--warning); background: color-mix(in srgb, var(--warning) 16%, transparent); margin-left: 6px; }

.empty { color: var(--muted); text-align: center; padding: 26px 10px; margin: 0; }

/* ---------- Butonlar ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 9px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
    text-decoration: none;
    line-height: 1.2;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-hover); }

.btn--ghost { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn--ghost:hover { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }

.btn--danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn--danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

.btn--sm { padding: 6px 11px; font-size: 13px; }
.btn--block { width: 100%; }

/* ---------- Formlar ---------- */
.form { display: grid; gap: 16px; }
.form--inline { grid-template-columns: 1fr auto; align-items: end; gap: 12px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field--grow { flex: 1; }
.field label { font-weight: 600; font-size: 13.5px; }

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="number"],
.field input[type="datetime-local"],
.field select,
.field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text);
    font-family: inherit;
    font-size: 14.5px;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--primary-soft);
}
.field textarea { resize: vertical; min-height: 120px; }

.hint { color: var(--muted); font-size: 12.5px; }

.field--check { justify-content: flex-end; }
.checkbox { display: inline-flex; align-items: center; gap: 9px; font-weight: 500; cursor: pointer; }
.checkbox input { width: 17px; height: 17px; accent-color: var(--primary); }

.form-actions { display: flex; gap: 12px; margin-top: 4px; }

/* ---------- Sifre goster/gizle ---------- */
.password-wrap {
    position: relative;
    width: 100%;
}
.password-wrap input[type="password"],
.password-wrap input[type="text"] {
    width: 100% !important;
    padding-right: 46px !important;
}
.password-toggle {
    position: absolute !important;
    top: 50% !important;
    right: 8px !important;
    transform: translateY(-50%) !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    margin: 0;
    border: 0 !important;
    border-radius: 8px;
    background: transparent !important;
    color: var(--muted);
    cursor: pointer;
    line-height: 1;
    z-index: 2;
    transition: color .15s ease, background .15s ease;
}
.password-toggle:hover { color: var(--text); background: var(--surface-2) !important; }
.password-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.password-toggle svg { display: block; }
.password-toggle .icon-eye-off { display: none; }
.password-toggle.is-visible .icon-eye { display: none; }
.password-toggle.is-visible .icon-eye-off { display: block; }

/* ---------- Kopyalama satiri ---------- */
.copy-row { display: flex; gap: 8px; }
.copy-row input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--muted);
    font-size: 13px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------- Giris / Kurulum ---------- */
.auth-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}
.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 30px;
}
.auth-card--wide { max-width: 540px; }
.auth-card__head { text-align: center; margin-bottom: 22px; }
.auth-card__logo { font-size: 40px; }
.auth-card__title { margin: 10px 0 4px; font-size: 21px; }
.auth-card__subtitle { margin: 0; color: var(--muted); font-size: 14px; }
.auth-card .form { margin-top: 16px; }
.auth-card .alert { margin-bottom: 14px; }
.auth-card .btn { margin-top: 4px; }

/* ---------- Kurulum adimlari ---------- */
.install-steps { display: grid; gap: 8px; margin: 16px 0; }
.install-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    font-size: 14px;
}
.install-step__icon { font-weight: bold; }
.install-step.is-ok .install-step__icon { color: var(--success); }
.install-step.is-fail .install-step__icon { color: var(--danger); }

/* ---------- Duyarli ---------- */
@media (max-width: 760px) {
    .topbar__inner { flex-wrap: wrap; gap: 12px; }
    .nav { order: 3; width: 100%; overflow-x: auto; }
    .user-chip { display: none; }
    .grid-2 { grid-template-columns: 1fr; }
    .stats { grid-template-columns: 1fr; }
    .form--inline { grid-template-columns: 1fr; }
}
