/* ============================================================
   Mali Müşavir Takip Paneli — stil
   GİB Dijital Vergi Dairesi tonları (teal + lacivert)
   ============================================================ */
:root {
    --teal:        #0f8a8d;
    --teal-dark:   #0b6e70;
    --navy:        #2b1a4a;
    --navy-2:      #3a2170;
    --ink:         #1f2430;
    --muted:       #6b7280;
    --line:        #e5e7eb;
    --bg:          #eef1f5;
    --card:        #ffffff;
    --red:         #d64545;
    --red-bg:      #fdecec;
    --green:       #1f9d55;
    --green-bg:    #e7f6ee;
    --amber:       #b7791f;
    --amber-bg:    #fdf3e0;
    --radius:      12px;
    --shadow:      0 1px 3px rgba(16,24,40,.08), 0 1px 2px rgba(16,24,40,.04);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "Segoe UI", Roboto, system-ui, Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    font-size: 14px;
    line-height: 1.45;
}
a { color: var(--teal-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Giriş ekranı ---------- */
.auth-wrap {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
}
.auth-brand {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 55%, var(--teal-dark) 140%);
    color: #fff;
    padding: 56px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.auth-brand .logo {
    display: inline-flex; align-items: center; gap: 14px;
    background: #fff; color: var(--teal-dark);
    padding: 14px 18px; border-radius: 10px; font-weight: 800;
    letter-spacing: .5px; width: max-content; line-height: 1.05;
}
.auth-brand .logo span { font-size: 22px; }
.auth-brand h1 { font-size: 30px; margin: 34px 0 10px; font-weight: 700; }
.auth-brand p  { color: #d7d2ea; max-width: 420px; }
.auth-form-side { display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-card {
    background: var(--card); width: 100%; max-width: 380px;
    padding: 36px 32px; border-radius: 16px; box-shadow: var(--shadow);
}
.auth-card h2 { margin: 0 0 4px; }
.auth-card .sub { color: var(--muted); margin: 0 0 24px; }

/* ---------- Form öğeleri ---------- */
.field { margin-bottom: 16px; }
.field label { display:block; font-weight:600; margin-bottom:6px; font-size:13px; }
.field input, .field select, .field textarea {
    width: 100%; padding: 11px 13px; border: 1px solid var(--line);
    border-radius: 9px; font-size: 14px; font-family: inherit; background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none; border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(15,138,141,.15);
}
.field .err { color: var(--red); font-size: 12px; margin-top: 5px; }
.checkbox { display:flex; align-items:center; gap:8px; }
.checkbox input { width:auto; }

.btn {
    display:inline-flex; align-items:center; gap:8px; justify-content:center;
    padding: 11px 18px; border-radius: 9px; border: 1px solid transparent;
    font-weight: 600; font-size: 14px; cursor: pointer; background: var(--teal);
    color:#fff; font-family: inherit;
}
.btn:hover { background: var(--teal-dark); text-decoration: none; }
.btn.block { width: 100%; }
.btn.ghost { background:#fff; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background:#f6f7f9; }
.btn.danger { background: var(--red); }
.btn.danger:hover { background:#b53535; }
.btn.sm { padding: 7px 12px; font-size: 13px; }

.alert { padding: 11px 14px; border-radius: 9px; margin-bottom: 18px; font-size: 13px; }
.alert.error { background: var(--red-bg); color: var(--red); }
.alert.ok    { background: var(--green-bg); color: var(--green); }
.alert.warn  { background: var(--amber-bg); color: var(--amber); }

/* ---------- Uygulama düzeni ---------- */
.layout { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar {
    background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
    color: #cfc8e6; padding: 22px 16px; display: flex; flex-direction: column;
}
.sidebar .brand {
    color:#fff; font-weight: 800; font-size: 16px; letter-spacing:.3px;
    padding: 6px 10px 18px; display:flex; gap:10px; align-items:center;
}
.sidebar .brand .mark {
    background:#fff; color: var(--teal-dark); border-radius:8px;
    padding: 6px 9px; font-weight:900;
}
.nav a {
    display:flex; align-items:center; gap:10px; color:#cfc8e6;
    padding: 11px 12px; border-radius: 9px; margin-bottom: 3px; font-weight:500;
}
.nav a:hover { background: rgba(255,255,255,.08); color:#fff; text-decoration:none; }
.nav a.active { background: rgba(255,255,255,.14); color:#fff; }
.sidebar .spacer { flex: 1; }
.sidebar .logout { margin-top: auto; }
.sidebar .logout button {
    width:100%; background: rgba(255,255,255,.08); color:#fff; border:none;
    padding: 10px; border-radius:9px; cursor:pointer; font-family:inherit;
}

.main { padding: 26px 30px; }
.topbar { display:flex; align-items:center; justify-content: space-between; margin-bottom: 22px; }
.topbar h1 { margin:0; font-size: 22px; }
.topbar .who { color: var(--muted); }

/* ---------- Kartlar ---------- */
.cards { display:grid; grid-template-columns: repeat(4, 1fr); gap:16px; margin-bottom: 24px; }
.card {
    background: var(--card); border-radius: var(--radius); padding: 18px 20px;
    box-shadow: var(--shadow);
}
.card .k { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.card .v { font-size: 22px; font-weight: 700; }
.card .sub { color: var(--muted); font-size: 12px; margin-top: 6px; }
.card.red  .v { color: var(--red); }
.card.green .v { color: var(--green); }

.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow:hidden; }
.panel .head { padding: 16px 20px; border-bottom:1px solid var(--line); display:flex; align-items:center; justify-content: space-between; }
.panel .head h3 { margin:0; font-size: 16px; }
.panel .body { padding: 6px 0; }

/* ---------- Tablo ---------- */
table { width:100%; border-collapse: collapse; }
th, td { text-align:left; padding: 12px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing:.4px; color: var(--muted); }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.badge { display:inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight:600; }
.badge.ok     { background: var(--green-bg); color: var(--green); }
.badge.error  { background: var(--red-bg);   color: var(--red); }
.badge.never  { background: #eef1f5;         color: var(--muted); }
.badge.pending{ background: var(--amber-bg); color: var(--amber); }
.badge.pasif  { background: var(--red-bg);   color: var(--red); }
.badge.aktif  { background: var(--green-bg); color: var(--green); }

.toolbar { display:flex; gap:10px; align-items:center; margin-bottom:18px; flex-wrap:wrap; }
.toolbar .search { flex:1; max-width: 340px; }
.toolbar .search input { width:100%; padding:10px 13px; border:1px solid var(--line); border-radius:9px; }

/* Satır tazelik tonları (müşteri listesi).
   Hem <tr> hem <td>'ye uygulanır ki arka plan satırı eksiksiz kaplasın. */
tr.fr-fresh, tr.fr-fresh td { background: rgba(31, 157, 85, .12); }    /* yeşil — güncel (24s içinde) */
tr.fr-none,  tr.fr-none  td { background: rgba(43, 26, 74, .10); }     /* hafif koyu — hiç güncellenmedi */
tr.fr-old,   tr.fr-old   td { background: rgba(107, 114, 128, .20); }  /* gri — 24 saati geçmiş */

.fresh-summary { display:flex; gap:10px; flex-wrap:wrap; }
.fresh-summary .pill {
    display:inline-flex; align-items:center; gap:7px; padding:6px 12px;
    border-radius:999px; font-size:13px; font-weight:600; background:#fff;
    border:1px solid var(--line);
}
.fresh-summary .dot { width:10px; height:10px; border-radius:50%; display:inline-block; }
.fresh-summary .dot.fresh { background:#1f9d55; }
.fresh-summary .dot.old   { background:#9ca3af; }
.fresh-summary .dot.none  { background:#3a2170; }

.empty { padding: 40px; text-align:center; color: var(--muted); }
.inline-form { display:inline; }
/* Buton grubu: flex bir iç sarmalayıcıda tutulur; <td>'ye flex VERİLMEZ,
   yoksa hücre arka planı satırı eksik kaplar (dikey kesik oluşur). */
.row-actions { display:flex; gap:8px; justify-content:flex-end; align-items:center; }
td > .row-actions { min-height: 0; }
.grid-2 { display:grid; grid-template-columns: 1fr 1fr; gap:16px; }
.muted { color: var(--muted); }
.mt { margin-top: 22px; }

@media (max-width: 1000px) {
    .cards { grid-template-columns: repeat(2, 1fr); }
    .layout { grid-template-columns: 1fr; }
    .sidebar { flex-direction: row; flex-wrap: wrap; }
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-brand { display:none; }
}

/* GİB ayrıntı verileri */
.section-nav { display:flex; flex-wrap:wrap; gap:8px; margin-bottom: 4px; }
.section-nav a { background: var(--card); box-shadow: var(--shadow); border-radius: 999px; padding: 6px 12px; font-size: 13px; text-decoration:none; }
.gib-doc { padding: 8px 20px 16px; }
.gib-doc details { margin: 8px 0; }
.gib-doc summary { cursor:pointer; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.json-table { overflow-x:auto; }
.json-table table, table.kv { font-size: 13px; }
table.kv th { width: 240px; text-align:left; vertical-align: top; }
table.kv table.kv th { width: 180px; }

/* Ayarlar */
.settings-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; }
.settings-grid .panel .body { padding: 18px 20px; }
.check { display:flex; gap:10px; align-items:flex-start; font-size: 14px; }
.check input { margin-top: 3px; }
