/* =========================================================
   HidroMAP Teklif Takip Sistemi — tasarım sistemi
   1. Değişkenler  2. Temel  3. Düzen  4. Bileşenler
   5. Formlar      6. Tablolar 7. Sayfalara özel  8. Duyarlı
   ========================================================= */

/* 1. Değişkenler ------------------------------------------------ */
:root {
    --primary: #c81e2b;
    --primary-dark: #a31621;
    --primary-soft: #fdecee;
    --ink: #0f172a;
    --ink-2: #334155;
    --muted: #64748b;
    --line: #e2e8f0;
    --line-strong: #cbd5e1;
    --bg: #f3f5f9;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --nav-bg: #111827;
    --nav-ink: #cbd5e1;
    --success: #15803d;
    --success-soft: #dcfce7;
    --warn: #b45309;
    --warn-soft: #fef3c7;
    --info: #1d4ed8;
    --info-soft: #dbeafe;
    --danger: #b91c1c;
    --danger-soft: #fee2e2;
    --violet: #6d28d9;
    --violet-soft: #ede9fe;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
    --shadow-lg: 0 10px 30px rgba(15, 23, 42, .18);
    --nav-w: 264px;
    --top-h: 64px;
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* 2. Temel ------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(200, 30, 43, .35); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: 400;
    font-style: normal;
    font-size: 20px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    width: 1em;
    height: 1em;
    overflow: hidden;
    white-space: nowrap;
    vertical-align: middle;
    flex: none;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    -webkit-font-feature-settings: 'liga';
    font-feature-settings: 'liga';
}

/* 3. Düzen ------------------------------------------------------ */
.app { display: flex; min-height: 100vh; }

.sidebar {
    position: fixed; inset: 0 auto 0 0;
    width: var(--nav-w);
    background: var(--nav-bg);
    color: var(--nav-ink);
    display: flex; flex-direction: column;
    z-index: 50;
    transition: transform .25s ease;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 20px 16px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand img { width: 44px; height: 44px; border-radius: 10px; background: #fff; }
.brand-name { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.brand-name b { color: #ff5a5f; font-weight: 700; }
.brand-sub { display: block; font-size: 12px; color: #94a3b8; font-weight: 500; }

.nav { flex: 1; overflow-y: auto; padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav-title { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #64748b; padding: 14px 12px 6px; }
.nav a, .nav-btn {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    color: var(--nav-ink); font-weight: 500; font-size: 14.5px;
    background: none; border: 0; width: 100%; text-align: left;
    transition: background .15s, color .15s;
}
.nav a:hover, .nav-btn:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.nav a.aktif { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(200, 30, 43, .35); }
.nav .count { margin-left: auto; font-size: 12px; background: rgba(255, 255, 255, .14); color: #fff; padding: 1px 8px; border-radius: 99px; }
.sidebar-foot { padding: 12px; border-top: 1px solid rgba(255, 255, 255, .08); display: flex; flex-direction: column; gap: 2px; }
.nav-cta { margin: 4px 12px 8px; }

.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, .55); z-index: 40; }

.main { flex: 1; margin-left: var(--nav-w); min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
    position: sticky; top: 0; z-index: 30;
    height: var(--top-h);
    display: flex; align-items: center; gap: 12px;
    padding: 0 28px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 18px; font-weight: 700; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .menu-toggle { display: none; }

.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 10px; background: none; border: 1px solid transparent; padding: 4px 8px 4px 4px; border-radius: 99px; }
.user-btn:hover { background: var(--surface-2); border-color: var(--line); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; font-size: 13px; display: grid; place-items: center; flex: none; }
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }
.user-info { text-align: left; line-height: 1.25; }
.user-info strong { display: block; font-size: 13.5px; }
.user-info small { color: var(--muted); font-size: 12px; }

.dropdown-panel {
    position: absolute; right: 0; top: calc(100% + 8px);
    min-width: 220px; background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); padding: 6px; z-index: 60;
}
.dropdown-panel a, .dropdown-panel button {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 9px 12px; border-radius: 8px; border: 0; background: none;
    color: var(--ink-2); font-size: 14px; text-align: left;
}
.dropdown-panel a:hover, .dropdown-panel button:hover { background: var(--surface-2); text-decoration: none; }

.content { flex: 1; padding: 28px; width: 100%; max-width: 1440px; margin: 0 auto; }
.footer { padding: 18px 28px; border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 6px 24px; justify-content: center; text-align: center; }
.footer a { color: var(--ink-2); font-weight: 600; }

/* 4. Bileşenler ------------------------------------------------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.page-head h2 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.page-head p { color: var(--muted); font-size: 14px; margin-top: 2px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 14px; margin-bottom: 8px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card { margin-top: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-head h3 .material-symbols-outlined { color: var(--primary); }
.card-body { padding: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.grid-2 > .card + .card { margin-top: 0; }
.grid-2.grid-3-2 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.stack > * + * { margin-top: 20px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 9px 16px; border-radius: var(--radius-sm);
    border: 1px solid transparent; font-weight: 600; font-size: 14px; line-height: 1.3;
    background: var(--surface); color: var(--ink-2); border-color: var(--line-strong);
    transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
    white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: #166534; border-color: #166534; }
.btn-warn { background: #d97706; border-color: #d97706; color: #fff; }
.btn-warn:hover { background: #b45309; border-color: #b45309; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #991b1b; border-color: #991b1b; }
.btn-outline-danger { color: var(--danger); border-color: #fca5a5; }
.btn-outline-danger:hover { background: var(--danger-soft); }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-icon { width: 34px; height: 34px; padding: 0; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); display: inline-grid; place-items: center; }
.btn-icon:hover { background: var(--surface-2); text-decoration: none; }
.btn-icon.edit:hover { color: var(--info); border-color: #93c5fd; background: var(--info-soft); }
.btn-icon.revise:hover { color: var(--warn); border-color: #fcd34d; background: var(--warn-soft); }
.btn-icon.delete:hover { color: var(--danger); border-color: #fca5a5; background: var(--danger-soft); }
.btn-icon.pdf:hover { color: var(--danger); border-color: #fca5a5; background: var(--danger-soft); }
.btn-icon.excel:hover { color: var(--success); border-color: #86efac; background: var(--success-soft); }
.btn-icon.publish:hover { color: var(--success); border-color: #86efac; background: var(--success-soft); }
.actions { display: inline-flex; gap: 6px; }
.inline-form { display: inline; margin: 0; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px 3px 6px; border-radius: 99px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.badge .material-symbols-outlined { font-size: 16px; }
.badge-onay { background: var(--success-soft); color: var(--success); }
.badge-bekle { background: var(--warn-soft); color: var(--warn); }
.badge-red { background: var(--danger-soft); color: var(--danger); }
.badge-revize { background: var(--violet-soft); color: var(--violet); }
.badge-taslak { background: #e2e8f0; color: var(--ink-2); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }

.alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid; margin-bottom: 14px; font-size: 14px; }
.alert .material-symbols-outlined { margin-top: 1px; }
.alert-basari { background: var(--success-soft); border-color: #86efac; color: #14532d; }
.alert-hata { background: var(--danger-soft); border-color: #fca5a5; color: #7f1d1d; }
.alert-uyari { background: var(--warn-soft); border-color: #fcd34d; color: #78350f; }
.alert-bilgi { background: var(--info-soft); border-color: #93c5fd; color: #1e3a8a; }
.alert-close { margin-left: auto; background: none; border: 0; color: inherit; opacity: .6; padding: 0; line-height: 1; }
.alert-close:hover { opacity: 1; }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .material-symbols-outlined { font-size: 44px; color: var(--line-strong); margin-bottom: 8px; width: 44px; height: 44px; }
.empty p { margin-bottom: 14px; }

.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }
.pagination .info { color: var(--muted); font-size: 13px; }
.pages { display: flex; gap: 4px; flex-wrap: wrap; }
.page-btn { min-width: 34px; height: 34px; padding: 0 8px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink-2); font-size: 13.5px; font-weight: 500; }
.page-btn:hover { background: var(--surface-2); text-decoration: none; }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-btn.disabled { opacity: .4; pointer-events: none; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.stat-label { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat-number { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; margin-top: 2px; overflow-wrap: anywhere; }
.stat-number.sm { font-size: 18px; }
.stat-hint { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.stat-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--primary-soft); color: var(--primary); }
.stat-icon .material-symbols-outlined { font-size: 24px; }
.stat-icon.ok { background: var(--success-soft); color: var(--success); }
.stat-icon.wait { background: var(--warn-soft); color: var(--warn); }
.stat-icon.no { background: var(--danger-soft); color: var(--danger); }
.stat-icon.info { background: var(--info-soft); color: var(--info); }

.detail-list { display: grid; }
.detail-row { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.detail-row:last-child { border-bottom: 0; }
.detail-row dt { color: var(--muted); font-size: 13.5px; }
.detail-row dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.note-box { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--warn-soft); border: 1px solid #fcd34d; color: #78350f; font-size: 14px; white-space: pre-line; }
.info-box { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--info-soft); color: #1e3a8a; font-size: 13.5px; }

.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rank-list li:last-child { border-bottom: 0; }
.rank-list .count { font-weight: 700; color: var(--primary); white-space: nowrap; }

/* 5. Formlar ---------------------------------------------------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-all { grid-column: 1 / -1; }
.span-2 { grid-column: span 2; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.req { color: var(--primary); }
.field small { color: var(--muted); font-size: 12.5px; }
.input, select.input, textarea.input {
    width: 100%; min-height: 42px; padding: 9px 12px;
    border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--ink);
    transition: border-color .15s, box-shadow .15s;
}
textarea.input { min-height: 96px; resize: vertical; }
.input::placeholder { color: #94a3b8; }
.input:hover { border-color: #94a3b8; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(200, 30, 43, .15); }
.input[readonly] { background: var(--surface-2); color: var(--muted); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14.5px; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); flex: none; }
.radio-group { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.inline-sentence { line-height: 2.4; }
.inline-sentence .input { display: inline-block; width: 84px; min-height: 36px; text-align: center; margin: 0 4px; padding: 4px 8px; }
.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 20px 0 10px; }
.section-title:first-child { margin-top: 0; }
.js-hidden { display: none; }

.ac { position: relative; }
.ac-list {
    position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg); max-height: 280px; overflow-y: auto; min-width: 240px;
}
.ac-item { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.ac-item:last-child { border-bottom: 0; }
.ac-item:hover, .ac-item.on { background: var(--primary-soft); }
.ac-item strong { display: block; font-size: 14px; }
.ac-item small { color: var(--muted); font-size: 12.5px; }

/* 6. Tablolar --------------------------------------------------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar .grow { flex: 1 1 280px; }
.search { position: relative; display: flex; gap: 8px; align-items: center; }
.search .input { padding-left: 40px; }
.search > .material-symbols-outlined { position: absolute; left: 12px; top: 11px; color: var(--muted); pointer-events: none; }
.filter-wrap { position: relative; }
.filter-panel { position: absolute; left: 0; top: calc(100% + 6px); z-index: 25; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 10px; min-width: 210px; display: flex; flex-direction: column; gap: 2px; }
.filter-panel .check { padding: 8px 10px; border-radius: 8px; }
.filter-panel .check:hover { background: var(--surface-2); }
.bulk-bar { display: none; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 12px; background: var(--ink); color: #fff; border-radius: var(--radius-sm); font-size: 14px; }
.bulk-bar.on { display: flex; }
.bulk-bar .btn { border-color: rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .1); color: #fff; }
.bulk-bar .btn:hover { background: rgba(255, 255, 255, .2); }
.bulk-bar .btn-danger { background: var(--danger); border-color: var(--danger); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; padding: 12px 14px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafbfd; }
.table tr[data-href] { cursor: pointer; }
.table .col-check { width: 44px; padding-right: 0; }
.table input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); }
.table .sub { display: block; color: var(--muted); font-size: 12.5px; }
.table td[data-label="Firma"] { min-width: 200px; }
.table .num { text-align: right; white-space: nowrap; }
.table tfoot td { background: var(--surface-2); font-weight: 700; }

/* 7. Sayfalara özel -------------------------------------------- */
/* Giriş */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 600px at 10% -10%, #fde2e4 0, transparent 60%), radial-gradient(900px 500px at 110% 110%, #fed7aa 0, transparent 55%), var(--bg); }
.auth-card { width: 100%; max-width: 980px; display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); border-radius: 24px; overflow: hidden; box-shadow: 0 30px 60px -20px rgba(15, 23, 42, .3); }
.auth-form { padding: 48px 48px 32px; display: flex; flex-direction: column; justify-content: center; }
.auth-form .logo { width: 200px; margin: 0 auto 28px; }
.auth-form h2 { font-size: 22px; text-align: center; margin-bottom: 4px; }
.auth-form .lead { color: var(--muted); text-align: center; margin-bottom: 22px; font-size: 14px; }
.auth-form .field + .field { margin-top: 14px; }
.auth-form .btn { margin-top: 20px; padding: 12px; font-size: 15px; }
.input-icon { position: relative; }
.input-icon > .material-symbols-outlined { position: absolute; left: 12px; top: 11px; color: var(--muted); pointer-events: none; }
.input-icon .input { padding-left: 42px; }
.pw-toggle { position: absolute; right: 6px; top: 4px; width: 34px; height: 34px; border: 0; background: none; color: var(--muted); border-radius: 8px; display: grid; place-items: center; }
.pw-toggle:hover { background: var(--surface-2); }
.auth-copy { margin-top: 28px; text-align: center; font-size: 12px; color: var(--muted); }
.auth-art { background: linear-gradient(135deg, #c81e2b 0%, #f97316 100%); display: grid; place-items: center; padding: 40px; }
.auth-art img { width: 100%; max-width: 340px; border-radius: 32px; box-shadow: 0 20px 40px rgba(0, 0, 0, .25); }
.error-page { text-align: center; max-width: 440px; padding: 40px 32px; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); }
.error-page .code { font-size: 64px; font-weight: 800; color: var(--primary); line-height: 1; }
.error-page h2 { margin: 12px 0 8px; }
.error-page p { color: var(--muted); margin-bottom: 20px; }

/* Dashboard */
.welcome { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; padding: 20px; margin-bottom: 20px; background: linear-gradient(135deg, #1f2937, #111827); color: #fff; border: 0; }
.welcome .who { display: flex; align-items: center; gap: 16px; flex: 1 1 260px; min-width: 0; }
.welcome h2 { font-size: 20px; }
.welcome small { color: #94a3b8; }
.welcome .last { margin-top: 6px; font-size: 13.5px; color: #cbd5e1; }
.welcome .last a { color: #fff; font-weight: 600; text-decoration: underline; }
.welcome-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; flex: 2 1 420px; }
.welcome-stat { background: rgba(255, 255, 255, .08); border-radius: 10px; padding: 10px 12px; text-align: center; }
.welcome-stat b { display: block; font-size: 22px; line-height: 1.2; }
.welcome-stat span { font-size: 12px; color: #cbd5e1; }
.chart-box { position: relative; height: 300px; }
.donut-wrap { display: flex; align-items: center; justify-content: center; gap: 28px; flex-wrap: wrap; }
.donut { width: 190px; height: 190px; border-radius: 50%; position: relative; flex: none; }
.donut::after { content: ''; position: absolute; inset: 38px; background: var(--surface); border-radius: 50%; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; min-width: 160px; }
.legend li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.legend .dot { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.legend .pct { margin-left: auto; font-weight: 700; padding-left: 12px; }

/* Teklif formu */
.kalem { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); padding: 16px; }
.kalem + .kalem { margin-top: 14px; }
.kalem-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-weight: 700; }
.kalem-total { text-align: right; font-weight: 700; margin-top: 10px; color: var(--ink-2); }
.totals { margin-top: 18px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--primary-soft); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.totals strong { font-size: 18px; color: var(--primary-dark); }

/* Teklif detayı */
.detail-head { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.detail-head .title { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.detail-head h2 { font-size: 22px; }
.status-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.timeline li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.grand-total { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; padding: 16px 20px; border-top: 1px solid var(--line); }
.grand-total .line { font-size: 18px; font-weight: 700; color: var(--primary-dark); }

dialog.confirm { border: 0; border-radius: 16px; padding: 0; width: min(420px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); color: var(--ink); }
dialog.confirm::backdrop { background: rgba(15, 23, 42, .55); }
.confirm-body { padding: 24px; }
.confirm-body h3 { font-size: 18px; margin-bottom: 8px; }
.confirm-body p { color: var(--muted); }
.confirm-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 24px 24px; }

.help-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.help-grid h3 { margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.help-grid h3 .material-symbols-outlined { color: var(--primary); }
.help-grid ul { margin: 0; padding-left: 20px; color: var(--ink-2); }
.help-grid li { margin-bottom: 6px; }

/* 8. Duyarlı ---------------------------------------------------- */
@media (max-width: 1180px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .welcome-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    body.nav-open .sidebar { transform: none; }
    body.nav-open { overflow: hidden; }
    body.nav-open .sidebar-overlay { display: block; }
    .main { margin-left: 0; }
    .topbar .menu-toggle { display: inline-grid; }
    .topbar { padding: 0 16px; }
    .content { padding: 18px 16px; }
    .grid-2, .grid-2.grid-3-2, .help-grid { grid-template-columns: minmax(0, 1fr); }
    .auth-card { grid-template-columns: 1fr; max-width: 480px; }
    .auth-art { display: none; }
    .auth-form { padding: 36px 24px 24px; }
}

@media (max-width: 760px) {
    .user-info { display: none; }
    .form-grid, .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .detail-row { grid-template-columns: 1fr; gap: 2px; }
    .page-head h2 { font-size: 20px; }
    .toolbar > * { flex: 1 1 calc(50% - 10px); }
    .toolbar > .grow, .toolbar > .field, .toolbar > select { flex: 1 1 100%; }
    .toolbar .btn { width: 100%; }
    .toolbar .filter-wrap .btn { width: 100%; }
    .search .input { flex: 1 1 100%; }

    /* Tablolar mobilde kart listesine dönüşür */
    .table-wrap { overflow: visible; }
    .table.responsive thead { display: none; }
    .table.responsive, .table.responsive tbody, .table.responsive tr, .table.responsive td { display: block; width: 100%; }
    .table.responsive tbody tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin: 12px; width: auto; padding: 4px 14px; box-shadow: var(--shadow); }
    .table.responsive tbody tr:hover { background: var(--surface); }
    .table.responsive td { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 9px 0; border: 0; border-bottom: 1px dashed var(--line); text-align: right; }
    .table.responsive td:last-child { border-bottom: 0; }
    .table.responsive td::before { content: attr(data-label); font-size: 12.5px; font-weight: 600; color: var(--muted); text-align: left; flex: none; }
    .table.responsive td { flex-wrap: wrap; }
    .table.responsive td .sub { flex: 0 0 100%; text-align: right; }
    .table.responsive td.col-check { width: 100%; padding-right: 0; }
    .table.responsive td.col-check::before { content: 'Seç'; }
    .table.responsive td.no-label::before { display: none; }
    .table.responsive .num { text-align: right; }
    .card > .table-wrap { background: var(--bg); border-radius: 0 0 var(--radius) var(--radius); padding-bottom: 2px; }
    .pagination { justify-content: center; }
    .pagination .info { width: 100%; text-align: center; }
    .form-actions .btn { flex: 1 1 100%; }
    .detail-head .status-actions, .detail-head .page-actions { width: 100%; }
    .status-actions .btn { flex: 1 1 calc(50% - 8px); }
    .grand-total { align-items: stretch; }
    .kalem { padding: 12px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { padding: 12px; flex-direction: column-reverse; align-items: flex-start; }
    .stat-number { font-size: 22px; }
    .stat-icon { width: 38px; height: 38px; }
    .welcome-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .brand-name { font-size: 18px; }
    .donut { width: 160px; height: 160px; }
    .donut::after { inset: 32px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

/* Bildirimler */
.bildirim-menu { margin-left: auto; }
.topbar h1 { flex: 1; }
.bildirim-btn { position: relative; }
.bildirim-sayac { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 99px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; }
.bildirim-panel { width: min(360px, calc(100vw - 24px)); padding: 0; max-height: 70vh; overflow-y: auto; }
.bildirim-panel-baslik { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.bildirim-oge { display: block; width: 100%; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; border-radius: 0; }
.bildirim-oge:hover { background: var(--surface-2); }
.bildirim-oge strong { display: block; font-size: 13.5px; }
.bildirim-oge span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.bildirim-oge small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.bildirim-oge.okunmamis { background: var(--primary-soft); }
.bildirim-oge.okunmamis strong::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-right: 6px; }
.bildirim-bos { padding: 18px; text-align: center; color: var(--muted); font-size: 13.5px; }
.bildirim-liste { list-style: none; margin: 0; padding: 0; }
.bildirim-liste li { display: flex; align-items: flex-start; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.bildirim-liste li:last-child { border-bottom: 0; }
.bildirim-liste li.okunmamis { background: var(--primary-soft); }
.bildirim-ikon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--info-soft); color: var(--info); }
.bildirim-ikon.duyuru { background: var(--warn-soft); color: var(--warn); }
.bildirim-ikon.imza { background: var(--violet-soft); color: var(--violet); }
.bildirim-metin { flex: 1; min-width: 0; }
.bildirim-metin p { margin: 2px 0 4px; color: var(--ink-2); font-size: 14px; overflow-wrap: anywhere; }
@media (max-width: 760px) {
    .bildirim-liste li { flex-wrap: wrap; padding: 12px 14px; }
    .bildirim-liste .actions { margin-left: 50px; }
}