/* Aksu Muhasebe — arayüz stilleri */
:root {
    --bg: #f4f6fb;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --text: #0f172a;
    --text-2: #334155;
    --muted: #64748b;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --primary: #4f46e5;
    --primary-600: #4338ca;
    --primary-50: #eef2ff;
    --ok: #059669;
    --ok-50: #ecfdf5;
    --warn: #b45309;
    --warn-50: #fffbeb;
    --danger: #dc2626;
    --danger-50: #fef2f2;
    --info: #0369a1;
    --info-50: #f0f9ff;
    --sidebar: #0f172a;
    --sidebar-2: #111c33;
    --sidebar-text: #cbd5e1;
    --sidebar-muted: #64748b;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
    --shadow-lg: 0 20px 50px rgba(15, 23, 42, .18);
    --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --sidebar-w: 272px;
    color-scheme: light;
}

.tone-indigo { --tone: #6366f1; }
.tone-blue { --tone: #3b82f6; }
.tone-amber { --tone: #f59e0b; }
.tone-teal { --tone: #14b8a6; }
.tone-green { --tone: #10b981; }
.tone-violet { --tone: #8b5cf6; }
.tone-red { --tone: #ef4444; }
.tone-cyan { --tone: #06b6d4; }
.tone-slate { --tone: #94a3b8; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
}
img { max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; font-size: .9em; }
[hidden] { display: none !important; }

/* ---------- Yerleşim ---------- */
.app { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { padding: 24px 28px 48px; max-width: 1480px; width: 100%; }

/* ---------- Kenar menü ---------- */
.sidebar {
    position: sticky; top: 0;
    width: var(--sidebar-w); height: 100vh;
    flex-shrink: 0;
    display: flex; flex-direction: column;
    background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
    color: var(--sidebar-text);
    border-right: 1px solid rgba(255, 255, 255, .04);
    z-index: 40;
}
.brand {
    display: flex; align-items: center; gap: 12px;
    padding: 20px 20px 16px;
    color: #fff;
}
.brand:hover { text-decoration: none; }
.brand-mark {
    display: grid; place-items: center;
    width: 40px; height: 40px; border-radius: 12px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff; font-weight: 800; font-size: 18px;
    box-shadow: 0 6px 18px rgba(99, 102, 241, .45);
    flex-shrink: 0;
}
.brand-mark-lg { width: 52px; height: 52px; font-size: 24px; border-radius: 15px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { color: var(--sidebar-muted); font-size: 12px; }

.nav { flex: 1; overflow-y: auto; padding: 4px 12px 16px; scrollbar-width: thin; scrollbar-color: #334155 transparent; }
.nav-caption {
    margin: 18px 10px 6px;
    font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
    color: var(--sidebar-muted);
}
.nav-link {
    position: relative;
    display: flex; align-items: center; gap: 12px;
    padding: 8px 10px; margin: 2px 0;
    border-radius: 11px;
    color: var(--sidebar-text);
    font-weight: 500;
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: background .15s, color .15s;
}
.nav-link::-webkit-details-marker { display: none; }
.nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav-link.is-active, .nav-link.is-parent-active { color: #fff; background: rgba(255, 255, 255, .08); }
.nav-link.is-active::before {
    content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px;
    border-radius: 0 3px 3px 0; background: var(--tone, var(--primary));
}
.nav-icon {
    display: grid; place-items: center;
    width: 34px; height: 34px; border-radius: 10px;
    background: rgba(255, 255, 255, .06);
    flex-shrink: 0;
}
.nav-link.is-active .nav-icon, .nav-link.is-parent-active .nav-icon {
    background: color-mix(in srgb, var(--tone, #6366f1) 28%, transparent);
}
.nav-icon img { width: 22px; height: 22px; object-fit: contain; }
.nav-label { flex: 1; min-width: 0; }
.nav-toggle {
    position: relative; width: 18px; height: 18px; border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, .14);
}
.nav-toggle::before, .nav-toggle::after {
    content: ""; position: absolute; left: 50%; top: 50%;
    width: 8px; height: 1.6px; background: currentColor; border-radius: 2px;
    transform: translate(-50%, -50%);
}
.nav-toggle::after { transform: translate(-50%, -50%) rotate(90deg); transition: transform .15s; }
.nav-group[open] > summary .nav-toggle::after { transform: translate(-50%, -50%) rotate(0deg); }
.nav-sub { padding: 2px 0 6px 22px; margin-left: 17px; border-left: 1px solid rgba(255, 255, 255, .08); }
.nav-sublink {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 10px; border-radius: 9px;
    color: var(--sidebar-text); font-size: 13.5px;
}
.nav-sublink img { width: 18px; height: 18px; object-fit: contain; opacity: .9; }
.nav-sublink:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav-sublink.is-active { background: rgba(255, 255, 255, .1); color: #fff; font-weight: 600; }

.sidebar-foot {
    display: flex; align-items: center; gap: 8px;
    padding: 14px 22px; font-size: 12px; color: var(--sidebar-muted);
    border-top: 1px solid rgba(255, 255, 255, .06);
}
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }

/* ---------- Üst bar ---------- */
.topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 14px;
    padding: 14px 28px;
    background: rgba(244, 246, 251, .86);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 20px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title p { margin: 0; color: var(--muted); font-size: 12.5px; }
.menu-btn { display: none; }
.icon-btn {
    display: inline-grid; place-items: center;
    width: 40px; height: 40px; border-radius: 11px;
    border: 1px solid var(--border); background: var(--surface); color: var(--text);
    cursor: pointer;
}
.user-menu { position: relative; }
.user-chip {
    display: flex; align-items: center; gap: 10px;
    padding: 5px 12px 5px 5px; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--border);
    cursor: pointer; list-style: none;
}
.user-chip::-webkit-details-marker { display: none; }
.avatar {
    display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
    background: var(--primary-50); color: var(--primary); font-weight: 700;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-meta b { font-size: 13px; }
.user-meta small { color: var(--muted); font-size: 11.5px; }
.dropdown {
    position: absolute; right: 0; top: calc(100% + 8px);
    min-width: 210px; padding: 6px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
    box-shadow: var(--shadow-lg);
}
.dropdown a, .dropdown button {
    display: block; width: 100%; text-align: left;
    padding: 9px 12px; border-radius: 8px; border: 0; background: none;
    color: var(--text); font: inherit; cursor: pointer;
}
.dropdown a:hover, .dropdown button:hover { background: var(--surface-2); text-decoration: none; }
.dropdown form { margin: 4px 0 0; padding-top: 4px; border-top: 1px solid var(--border); }
.dropdown-danger { color: var(--danger) !important; }

/* ---------- Kartlar ve bileşenler ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
}
.card-title { font-size: 16px; margin-bottom: 14px; }
.section { margin-top: 28px; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.section-head h3 { font-size: 16px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.eyebrow { margin: 0 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); }
.hint { color: var(--muted); font-size: 12.5px; margin: 4px 0 14px; }

.hero {
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    background: linear-gradient(120deg, #eef2ff 0%, #ffffff 55%, #f0fdfa 100%);
}
.hero h2 { font-size: 24px; margin-bottom: 6px; }
.hero p { margin: 0; max-width: 640px; }
.hero-badge {
    display: flex; align-items: center; gap: 8px; white-space: nowrap;
    padding: 8px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--border);
    font-weight: 600; color: var(--text-2);
}

.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.module-card {
    display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
    padding: 18px; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--border);
    color: var(--text); box-shadow: var(--shadow);
    transition: transform .15s, border-color .15s, box-shadow .15s;
}
.module-card:hover { transform: translateY(-2px); border-color: var(--tone); text-decoration: none; box-shadow: 0 12px 30px rgba(15, 23, 42, .1); }
.module-icon {
    display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px;
    background: color-mix(in srgb, var(--tone) 14%, #fff);
}
.module-icon img { width: 28px; height: 28px; object-fit: contain; }
.module-name { font-weight: 600; }

.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 9px; border-radius: 999px;
    font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.badge-soft { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.badge-primary { background: var(--primary-50); color: var(--primary-600); }
.badge-ok { background: var(--ok-50); color: var(--ok); }
.badge-danger { background: var(--danger-50); color: var(--danger); }
.badge-warn { background: var(--warn-50); color: var(--warn); }

.alert {
    margin-bottom: 16px; padding: 12px 16px;
    border-radius: var(--radius-sm); border: 1px solid; font-weight: 500;
}
.alert-success { background: var(--ok-50); border-color: #a7f3d0; color: #065f46; }
.alert-error { background: var(--danger-50); border-color: #fecaca; color: #991b1b; }
.alert-warning { background: var(--warn-50); border-color: #fde68a; color: #92400e; }
.alert-info { background: var(--info-50); border-color: #bae6fd; color: #075985; }

/* ---------- Butonlar ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 40px; padding: 0 16px;
    border-radius: 10px; border: 1px solid transparent;
    font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, a:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--primary) 35%, transparent); outline-offset: 2px;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(79, 70, 229, .25); }
.btn-primary:hover { background: var(--primary-600); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn-danger-ghost { background: var(--surface); color: var(--danger); border-color: #fecaca; }
.btn-danger-ghost:hover { background: var(--danger-50); }
.btn-sm { min-height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }

/* ---------- Formlar ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field small { color: var(--muted); font-size: 12px; }
input[type="text"], input[type="password"], input[type="email"], input[type="date"], input[type="number"], input[type="search"], input[type="tel"], select, textarea {
    width: 100%; min-height: 42px; padding: 9px 12px;
    border: 1px solid var(--border-strong); border-radius: 10px;
    background: #fff; color: var(--text); font: inherit;
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); outline: none; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
.fieldset { border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 14px 16px 2px; margin: 4px 0 16px; }
.fieldset legend { padding: 0 6px; font-weight: 600; color: var(--text-2); font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.align-start { align-items: start; gap: 20px; }
.form-card { max-width: 980px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 8px; border-top: 1px solid var(--border); margin-top: 8px; }
.inline { display: inline; margin: 0; }

.filter-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 14px; padding: 16px 18px 2px; margin-bottom: 16px; }
.filter-bar .field { min-width: 180px; }
.filter-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }

/* ---------- Tablolar ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.toolbar-title { display: flex; align-items: center; gap: 10px; }
.toolbar-title h2 { font-size: 18px; }
.toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.table-card { padding: 0; overflow: hidden; }
.table-head { padding: 12px 18px; border-bottom: 1px solid var(--border); color: var(--muted); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
    padding: 11px 16px; text-align: left;
    font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafbff; }
.table tr.is-muted td { color: var(--muted); }
.t-right { text-align: right !important; }
.t-center { text-align: center !important; }
.actions { white-space: nowrap; }
.actions > * + * { margin-left: 6px; }
.perm-table td, .perm-table th { padding: 9px 12px; }

.pager { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 18px; border-top: 1px solid var(--border); }
.pager a { min-width: 34px; padding: 6px 10px; text-align: center; border-radius: 8px; border: 1px solid var(--border); color: var(--text); }
.pager a.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }

.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.role-card { padding: 18px; }
.role-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.role-head h3 { font-size: 15px; }
.role-card p { margin: 6px 0; }
.role-meta { font-size: 12.5px; color: var(--text-2); }
.role-actions { display: flex; gap: 6px; margin-top: 10px; }

.details { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; margin: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; font-weight: 500; }

.empty-state { text-align: center; padding: 48px 24px; max-width: 620px; margin: 24px auto; }
.empty-state h2 { margin: 12px 0 8px; }
.empty-state p { margin: 0 0 20px; }
.empty-icon { display: inline-grid; place-items: center; width: 72px; height: 72px; border-radius: 20px; background: var(--primary-50); }
.empty-icon img { width: 44px; height: 44px; object-fit: contain; }
.error-code { margin: 0; font-size: 44px; font-weight: 800; color: var(--primary); }

/* ---------- Giriş ekranları ---------- */
.auth-body {
    min-height: 100vh;
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(99, 102, 241, .28), transparent 60%),
        radial-gradient(900px 500px at 110% 110%, rgba(20, 184, 166, .22), transparent 60%),
        #0f172a;
}
.auth-shell { max-width: 460px; margin: 0 auto; padding: 48px 16px; }
.auth-brand { display: flex; align-items: center; gap: 14px; color: #fff; margin-bottom: 22px; }
.auth-brand b { display: block; font-size: 20px; }
.auth-brand small { color: #94a3b8; }
.auth-card { padding: 28px; box-shadow: var(--shadow-lg); }
.auth-card h1 { font-size: 22px; margin-bottom: 4px; }
.auth-card > .muted { margin: 0 0 20px; }

/* ---------- Mobil ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); z-index: 35; }
@media (max-width: 1024px) {
    .sidebar {
        position: fixed; left: 0; top: 0; bottom: 0;
        transform: translateX(-100%); transition: transform .2s ease;
        box-shadow: var(--shadow-lg);
    }
    body.menu-open .sidebar { transform: translateX(0); }
    .menu-btn { display: inline-grid; }
    .topbar { padding: 12px 16px; }
    .content { padding: 18px 16px 40px; }
}
@media (max-width: 720px) {
    .grid-2 { grid-template-columns: 1fr; }
    .user-meta { display: none; }
    .user-chip { padding: 4px; }
    .hero { flex-direction: column; align-items: flex-start; }
    .details { grid-template-columns: 1fr; gap: 2px; }
    .details dd { margin-bottom: 10px; }
    .filter-bar .field { min-width: 0; flex: 1 1 100%; }
    /* Tablolar kart görünümüne geçer */
    .table thead { display: none; }
    .table tr { display: block; padding: 10px 14px; border-bottom: 1px solid var(--border); }
    .table td { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border: 0; text-align: right; }
    .table td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: left; }
    .table td.actions { justify-content: flex-end; padding-top: 8px; }
    .table td.actions::before { content: none; }
    .perm-table td { justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
@media print {
    .sidebar, .topbar, .backdrop, .btn, .toolbar-actions, .filter-bar { display: none !important; }
    body { background: #fff; }
    .content { padding: 0; }
    .card { box-shadow: none; border-color: #ddd; }
}

/* Firma logosu */
.brand-logo { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: #fff; padding: 4px; flex-shrink: 0; overflow: hidden; }
.brand-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.brand-logo-lg { width: 64px; height: 64px; border-radius: 16px; }
.logo-row { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.logo-actions { flex: 1; min-width: 240px; }
.logo-actions form { margin-top: 10px; }
.logo-preview { display: grid; place-items: center; width: 180px; height: 110px; border: 1px dashed var(--border); border-radius: 12px; background: repeating-conic-gradient(#e2e8f0 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.logo-preview img { max-width: 160px; max-height: 94px; object-fit: contain; }
.offline-icon { border-radius: 14px; }
