/* Sayaç Takip - özel tasarım sistemi (Bootstrap görünümü kullanılmıyor).
   Bootstrap'ın sadece JS'i (modal/dropdown/collapse davranışı) yükleniyor;
   tüm görsel stil burada tanımlanır. */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #f3f4f8;
    --surface: #ffffff;
    --surface-2: #f7f8fb;
    --border: #e6e8f0;
    --text: #1c2033;
    --text-muted: #7d8399;
    --accent: #4f46e5;
    --accent-dark: #4338ca;
    --accent-soft: #eef0fe;
    --success: #15803d;
    --success-soft: #dcfce7;
    --warning: #b45309;
    --warning-soft: #fef3c7;
    --danger: #b91c1c;
    --danger-soft: #fee2e2;
    --sidebar-bg: #14162a;
    --sidebar-text: #a4a8c3;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(20, 22, 42, .04), 0 4px 16px rgba(20, 22, 42, .05);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, Segoe UI, sans-serif;
    font-size: 14.5px;
    line-height: 1.5;
}
a { color: var(--accent); }
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 700; }

/* ---------- Layout ---------- */
.app-shell { display: flex; min-height: 100vh; align-items: stretch; }
.sidebar {
    width: 250px; flex-shrink: 0; background: var(--sidebar-bg); color: #fff;
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand {
    display: flex; align-items: center; gap: 10px; padding: 22px 22px 18px;
    font-weight: 800; font-size: 1.05rem; color: #fff;
}
.sidebar .brand .brand-icon {
    width: 34px; height: 34px; border-radius: 10px; background: var(--accent);
    display: flex; align-items: center; justify-content: center; font-size: .95rem;
}
.sidebar nav { flex: 1; padding: 6px 12px; }
.sidebar nav a {
    display: flex; align-items: center; gap: 11px; padding: 10px 12px; margin-bottom: 2px;
    color: var(--sidebar-text); text-decoration: none; font-size: .89rem; font-weight: 500;
    border-radius: 10px; transition: .15s;
}
.sidebar nav a i { width: 18px; text-align: center; font-size: .95rem; }
.sidebar nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar nav a.active { background: var(--accent); color: #fff; }
.sidebar .foot { padding: 16px 22px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: .8rem; color: var(--sidebar-text); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 16px 30px; display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 30;
}
.topbar h1 { font-size: 1.15rem; }
.content { padding: 26px 30px 60px; max-width: 1400px; width: 100%; }

/* ---------- Utility ---------- */
.d-flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; min-width: 0; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 6px; } .gap-2 { gap: 10px; } .gap-3 { gap: 16px; }
.text-muted { color: var(--text-muted); }
.text-end { text-align: right; }
.text-center { text-align: center; }
.small { font-size: .82rem; }
.tiny { font-size: .74rem; }
.fw-600 { font-weight: 600; } .fw-700 { font-weight: 700; }
.mono { font-family: 'SFMono-Regular', Consolas, monospace; }
.mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 10px; } .mb-3 { margin-bottom: 16px; } .mb-4 { margin-bottom: 24px; }
.mt-2 { margin-top: 10px; } .mt-3 { margin-top: 16px; }
.w-100 { width: 100%; }
.hidden { display: none !important; }

/* ---------- Stat cards ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.stat-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px; display: flex; align-items: center; gap: 15px; box-shadow: var(--shadow);
}
.stat-icon { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.15rem; flex-shrink: 0; }
.stat-value { font-size: 1.55rem; font-weight: 800; line-height: 1.15; }
.stat-label { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); font-weight: 700; }
.tone-indigo { background: var(--accent-soft); color: var(--accent); }
.tone-green { background: var(--success-soft); color: var(--success); }
.tone-red { background: var(--danger-soft); color: var(--danger); }
.tone-amber { background: var(--warning-soft); color: var(--warning); }

/* ---------- Panel / card ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.panel-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; font-weight: 700; gap: 10px; flex-wrap: wrap; }
.panel-body { padding: 20px; }
.panel-body.pad-0 { padding: 0; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border-radius: var(--radius-sm);
    font-size: .85rem; font-weight: 600; border: 1px solid transparent; cursor: pointer;
    text-decoration: none; transition: .15s; background: var(--surface-2); color: var(--text);
    font-family: inherit;
}
.btn:hover { filter: brightness(0.97); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--surface-2); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: 6px 11px; font-size: .78rem; border-radius: 8px; }
.btn-icon { width: 32px; height: 32px; padding: 0; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Forms ---------- */
.input, select.input, textarea.input {
    width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: .87rem; background: var(--surface); color: var(--text); font-family: inherit;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-sm { padding: 6px 10px; font-size: .8rem; border-radius: 8px; }
label.field-label { font-size: .78rem; font-weight: 700; color: var(--text-muted); display: block; margin-bottom: 5px; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-secondary { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }

/* ---------- Table ---------- */
.table-clean { width: 100%; border-collapse: collapse; font-size: .85rem; }
.table-clean th {
    text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em;
    color: var(--text-muted); font-weight: 700; padding: 11px 18px; border-bottom: 1px solid var(--border);
    background: var(--surface-2); white-space: nowrap;
}
.table-clean td { padding: 12px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table-clean tr:last-child td { border-bottom: none; }
.table-clean tbody tr:hover td { background: var(--surface-2); }
.table-scroll { overflow-x: auto; }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: .85rem; display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 10px; }
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-danger { background: var(--danger-soft); color: var(--danger); }
.alert-info { background: var(--accent-soft); color: var(--accent); }
.alert .btn-close { margin-left: auto; }

/* ---------- Accordion (Bootstrap JS collapse davranışını kullanır) ---------- */
.acc-item { border-bottom: 1px solid var(--border); }
.acc-item:last-child { border-bottom: none; }
.acc-header {
    width: 100%; text-align: left; padding: 16px 20px; background: none; border: none; cursor: pointer;
    display: flex; align-items: center; gap: 14px; font-family: inherit; color: inherit;
}
.acc-header:hover { background: var(--surface-2); }
.acc-chevron { margin-left: auto; color: var(--text-muted); transition: transform .2s; flex-shrink: 0; }
.acc-header[aria-expanded="true"] .acc-chevron { transform: rotate(180deg); }
.collapse:not(.show) { display: none; }
.collapse.show, .collapsing { display: block; }
.acc-body-inner { padding: 0 20px 20px; background: var(--surface-2); }

/* ---------- Modal (Bootstrap JS ile) ---------- */
.modal { position: fixed; inset: 0; z-index: 1055; display: none; outline: 0; overflow-y: auto; }
.modal.show { display: block; }
.modal-dialog { max-width: 480px; margin: 64px auto; position: relative; padding: 0 16px; }
.modal-dialog-sm { max-width: 380px; }
.modal-content { background: var(--surface); border-radius: var(--radius); box-shadow: 0 24px 60px rgba(10, 12, 30, .3); overflow: hidden; }
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; font-weight: 700; }
.modal-header.tone-dark { background: var(--sidebar-bg); color: #fff; }
.modal-body { padding: 20px; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 16, 33, .55); z-index: 1050; }
.btn-close { background: none; border: none; font-size: 1.05rem; cursor: pointer; color: var(--text-muted); line-height: 1; padding: 4px; }
.btn-close.on-dark { color: rgba(255, 255, 255, .8); }

/* ---------- Dropdown (Bootstrap JS ile) ---------- */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
    display: none; position: absolute; right: 0; top: 100%; margin-top: 8px; background: var(--surface);
    border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); min-width: 190px;
    padding: 6px; z-index: 40; list-style: none;
}
.dropdown-menu.show { display: block; }
.dropdown-item {
    display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 8px; color: var(--text);
    text-decoration: none; font-size: .85rem; width: 100%; text-align: left; background: none; border: none;
    cursor: pointer; font-family: inherit;
}
.dropdown-item:hover { background: var(--surface-2); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--border); margin: 6px 4px; }

/* ---------- Progress ---------- */
.meter { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 999px; }

@media (max-width: 900px) {
    .sidebar { display: none; }
    .content { padding: 20px 16px 50px; }
    .topbar { padding: 14px 16px; }
}
