:root {
  --navy:#111827; --side:#172033; --blue:#2563eb; --cyan:#06b6d4; --orange:#f97316; --green:#16a34a;
  --purple:#7c3aed; --pink:#db2777; --bg:#eef4ff; --card:#ffffff; --text:#1f2937; --muted:#64748b; --line:#dbe4f0;
  --soft-blue:#dbeafe; --soft-orange:#ffedd5; --soft-green:#dcfce7; --soft-purple:#ede9fe;
}
body[data-theme="emerald"] {
  --side:#0f2a22; --blue:#059669; --cyan:#14b8a6; --orange:#d97706; --green:#16a34a;
  --purple:#0f766e; --bg:#edfdf6; --muted:#55706a; --line:#cfe7df;
  background:linear-gradient(135deg,#f6fffb 0%,#e7fff5 48%,#fff7ed 100%);
}
body[data-theme="graphite"] {
  --side:#101216; --blue:#475569; --cyan:#0ea5e9; --orange:#eab308; --green:#22c55e;
  --purple:#64748b; --bg:#f3f4f6; --muted:#6b7280; --line:#d1d5db;
  background:linear-gradient(135deg,#f8fafc 0%,#e5e7eb 52%,#f1f5f9 100%);
}
body[data-theme="sunset"] {
  --side:#2a1320; --blue:#e11d48; --cyan:#fb7185; --orange:#f97316; --green:#16a34a;
  --purple:#be185d; --bg:#fff1f2; --muted:#76515c; --line:#ffd1d9;
  background:linear-gradient(135deg,#fff7ed 0%,#fff1f2 46%,#fdf2f8 100%);
}
* { box-sizing:border-box; }
body { margin:0; font-family:Inter,Segoe UI,Arial,sans-serif; color:var(--text); background:linear-gradient(135deg,#f8fbff 0%,#eef4ff 45%,#fff7ed 100%); height:100vh; display:flex; overflow:hidden; }
.sidebar { width:290px; background:linear-gradient(180deg,#0f172a,#1e293b 55%,#111827); color:white; display:flex; flex-direction:column; box-shadow:18px 0 45px rgba(15,23,42,.18); }
body[data-theme="emerald"] .sidebar { background:linear-gradient(180deg,#052e2b,#064e3b 58%,#0f2a22); }
body[data-theme="graphite"] .sidebar { background:linear-gradient(180deg,#09090b,#27272a 58%,#111827); }
body[data-theme="sunset"] .sidebar { background:linear-gradient(180deg,#3b0a20,#881337 58%,#2a1320); }
.brand { padding:26px 24px; border-bottom:1px solid rgba(255,255,255,.1); }
.brand .logo { background:white; color:#0054a6; font-weight:900; font-size:30px; letter-spacing:1px; border-radius:18px; padding:18px; text-align:center; box-shadow:0 18px 40px rgba(0,0,0,.2); }
.brand small { display:block; color:#cbd5e1; margin-top:14px; line-height:1.45; }
.nav-title { padding:22px 24px 8px; color:#94a3b8; font-size:12px; text-transform:uppercase; letter-spacing:.12em; font-weight:800; }
.nav-item { margin:5px 14px; padding:13px 15px; border-radius:14px; color:#cbd5e1; cursor:pointer; display:flex; align-items:center; gap:12px; font-weight:700; transition:.2s; border:1px solid transparent; }
.nav-item:hover { background:rgba(255,255,255,.08); color:white; transform:translateX(3px); }
.nav-item.active { background:linear-gradient(135deg,var(--blue),var(--cyan)); color:white; box-shadow:0 14px 30px rgba(37,99,235,.35); }
.nav-sub { margin:0 0 4px; }
.nav-sub:not(.open) { display:none; }
.nav-toggle { margin:3px 22px 4px 34px; border:1px solid rgba(255,255,255,.12); background:rgba(255,255,255,.06); color:#cbd5e1; border-radius:11px; padding:9px 12px; text-align:left; cursor:pointer; font-size:12px; font-weight:900; }
.nav-toggle:hover { background:rgba(255,255,255,.10); color:white; }
.nav-sub-item { margin:3px 22px 3px 34px; padding:9px 12px; border-radius:11px; font-size:12px; color:#aab7cc; }
.nav-sub-item:before { content:""; width:6px; height:6px; border-radius:999px; background:#64748b; display:inline-block; }
.nav-sub-item.active:before { background:white; }
.sidebar .sidebar-logo { padding:12px 14px; }
.sidebar .sidebar-logo img { width:170px; margin-bottom:8px; }
.sidebar .sidebar-logo small { font-size:12px; line-height:1.35; }
.sidebar-logo strong { display:block; color:#fff; font-size:20px; font-weight:1000; margin-bottom:8px; }
.app-logo-box { width:180px; height:74px; max-width:100%; display:none; align-items:center; justify-content:center; border:1px solid rgba(255,255,255,.16); border-radius:14px; background:rgba(255,255,255,.08); padding:8px; margin-bottom:10px; }
.app-logo-box.has-logo { display:flex; }
.app-logo-box img { width:100%; height:100%; object-fit:contain; display:block; }
.sidebar .nav-title { padding:14px 24px 5px; font-size:11px; }
.sidebar .nav-item { margin:3px 14px; padding:10px 13px; border-radius:12px; }
.sidebar .nav-toggle { margin:3px 22px 4px 34px; padding:8px 11px; }
.sidebar .nav-sub-item { margin:2px 22px 2px 34px; padding:8px 11px; }
.sidebar .footer-note { padding:12px 18px; }
.footer-note { margin-top:auto; padding:20px 24px; color:#94a3b8; font-size:12px; border-top:1px solid rgba(255,255,255,.1); }
.user-footer { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.user-footer small { display:block; color:#94a3b8; font-weight:900; text-transform:uppercase; letter-spacing:.06em; font-size:10px; }
.user-footer strong { display:block; color:white; margin-top:3px; font-size:13px; max-width:150px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.user-footer button { border:1px solid rgba(255,255,255,.16); background:rgba(255,255,255,.09); color:white; border-radius:10px; padding:8px 10px; cursor:pointer; font-weight:900; }
.user-footer button:hover { background:rgba(255,255,255,.16); }
.mobile-drawer-close,.mobile-bottom-nav,.mobile-menu-backdrop { display:none; }
.main { flex:1; display:flex; flex-direction:column; min-width:0; }
.topbar { position:relative; background:rgba(255,255,255,.78); backdrop-filter:blur(14px); border-bottom:1px solid rgba(219,228,240,.9); padding:18px 28px; display:grid; grid-template-columns:auto minmax(0,1fr); justify-content:stretch; align-items:center; gap:14px; }
.rate-toggle { position:static; border:1px solid var(--line); border-radius:14px; padding:10px 13px; background:white; color:#0f172a; box-shadow:0 8px 22px rgba(15,23,42,.08); font-weight:1000; cursor:pointer; }
.title-area h1 { margin:0; font-size:23px; color:#0f172a; }
.title-area p { margin:4px 0 0; color:var(--muted); font-size:13px; }
.rate-panel { position:absolute; left:28px; top:68px; z-index:40; display:none; gap:12px; align-items:center; flex-wrap:wrap; width:min(520px,calc(100vw - 56px)); padding:12px; border:1px solid var(--line); border-radius:18px; background:rgba(255,255,255,.96); box-shadow:0 18px 42px rgba(15,23,42,.18); }
body.rate-panel-open .rate-panel { display:flex; }
.rate-chip { background:white; border:1px solid var(--line); border-radius:16px; padding:9px 12px; display:flex; gap:8px; align-items:center; box-shadow:0 8px 22px rgba(15,23,42,.06); font-weight:800; }
.rate-chip input { width:92px; border:0; background:#f8fafc; padding:7px; border-radius:10px; text-align:center; font-weight:800; color:#0f172a; }
.content { flex:1; overflow:auto; padding:28px; }
.hero { position:relative; overflow:hidden; border-radius:28px; padding:38px; color:white; background:radial-gradient(circle at 18% 20%,rgba(255,255,255,.22),transparent 30%),linear-gradient(135deg,#0054a6,#2563eb 45%,#06b6d4); box-shadow:0 24px 60px rgba(37,99,235,.25); }
.hero h2 { margin:0; font-size:34px; }
.hero p { max-width:790px; font-size:17px; line-height:1.6; opacity:.93; }
.quick-grid,.stats { display:grid; grid-template-columns:repeat(4,minmax(170px,1fr)); gap:18px; margin:22px 0; }
.stat-card,.quick-card { background:rgba(255,255,255,.86); border:1px solid rgba(219,228,240,.9); border-radius:22px; padding:20px; box-shadow:0 14px 36px rgba(15,23,42,.08); }
.stat-card small,.quick-card small { color:var(--muted); font-weight:900; text-transform:uppercase; font-size:11px; letter-spacing:.08em; }
.stat-card strong,.quick-card strong { display:block; margin-top:7px; font-size:24px; color:#0f172a; }
.quick-card { cursor:pointer; transition:.18s; border-top:5px solid var(--blue); }
.quick-card:nth-child(2) { border-top-color:var(--orange); }
.quick-card:nth-child(3) { border-top-color:var(--green); }
.quick-card:nth-child(4) { border-top-color:var(--purple); }
.quick-card:hover { transform:translateY(-4px); box-shadow:0 20px 48px rgba(15,23,42,.14); }
.machine-directory-page { min-height:100%; }
.machine-directory-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.machine-directory-card { border:1px solid rgba(219,228,240,.95); border-radius:18px; background:white; padding:18px; box-shadow:0 14px 34px rgba(15,23,42,.08); cursor:pointer; transition:.18s; }
.machine-directory-card:hover { transform:translateY(-3px); box-shadow:0 20px 44px rgba(15,23,42,.14); }
.machine-directory-card small { color:#64748b; font-weight:950; text-transform:uppercase; font-size:11px; letter-spacing:.05em; }
.machine-directory-card strong { display:block; margin-top:8px; color:#0f172a; font-size:20px; }
.machine-directory-card p { color:#64748b; font-weight:750; line-height:1.45; }
.machine-directory-card span { display:inline-flex; border-radius:999px; background:#eef6ff; color:#1d4ed8; padding:8px 10px; font-weight:1000; }
.toolbar { display:flex; justify-content:space-between; gap:16px; align-items:center; margin-bottom:16px; flex-wrap:wrap; }
.search { flex:1; min-width:260px; position:relative; }
.search input { width:100%; border:1px solid var(--line); border-radius:16px; padding:13px 16px 13px 44px; background:white; box-shadow:0 10px 26px rgba(15,23,42,.06); font-weight:700; }
.search span { position:absolute; left:16px; top:12px; color:#64748b; }
.pill { border:0; border-radius:999px; padding:11px 16px; font-weight:900; cursor:pointer; color:white; background:linear-gradient(135deg,var(--orange),#f59e0b); box-shadow:0 12px 28px rgba(249,115,22,.22); }
.pill.cache { background:linear-gradient(135deg,#475569,#0f172a); color:white; box-shadow:0 12px 28px rgba(15,23,42,.18); }
.table-shell { background:white; border-radius:24px; border:1px solid var(--line); box-shadow:0 18px 48px rgba(15,23,42,.10); overflow:hidden; }
table { width:100%; border-collapse:separate; border-spacing:0; font-size:13px; min-width:1320px; }
.quote-table {
  min-width: 0 !important;
}
th { position:sticky; top:0; z-index:2; background:linear-gradient(180deg,#f8fafc,#eef4ff); color:#334155; padding:13px 10px; text-align:left; border-bottom:1px solid var(--line); font-size:12px; text-transform:uppercase; letter-spacing:.04em; }
td { padding:10px; border-bottom:1px solid #edf2f7; vertical-align:middle; }
tr:hover td { background:#f8fbff; }
td.desc { min-width:260px; font-weight:800; color:#0f172a; }
td.code { font-family:ui-monospace,SFMono-Regular,Consolas,monospace; color:#2563eb; font-weight:800; }
.num { text-align:right; font-variant-numeric:tabular-nums; font-weight:800; }
.calc { background:#f8fafc; color:#0f172a; border-radius:12px; padding:7px 9px; display:inline-block; min-width:82px; text-align:right; }
input.cell, select.cell { width:100%; border:1px solid transparent; background:transparent; padding:7px 8px; border-radius:10px; font-weight:750; color:#0f172a; }
tr.editing input.cell, tr.editing select.cell { background:#fff7d6; border-color:#facc15; }
input.cell:disabled, select.cell:disabled { color:#334155; opacity:1; appearance:none; }
.action { display:flex; gap:6px; }
.btn { border:0; border-radius:12px; padding:8px 10px; color:white; font-weight:900; cursor:pointer; }
.btn-edit { background:linear-gradient(135deg,var(--blue),var(--cyan)); }
.btn-save { background:linear-gradient(135deg,var(--green),#22c55e); display:none; }
.btn-sale { background:linear-gradient(135deg,var(--green),#22c55e); display:inline-block; }
.btn-add { background:linear-gradient(135deg,var(--green),#22c55e); white-space:nowrap; }
.btn-add.added { background:linear-gradient(135deg,#64748b,#94a3b8); }
tr.editing .btn-save { display:inline-block; }
tr.editing .btn-edit { display:none; }
.badge { display:inline-flex; align-items:center; gap:6px; background:#eef6ff; color:#1d4ed8; border:1px solid #bfdbfe; border-radius:999px; padding:7px 10px; font-weight:900; }
.empty { padding:35px; text-align:center; color:var(--muted); font-weight:800; }
@media(max-width:1050px) { .sidebar{width:230px} .quick-grid,.stats{grid-template-columns:repeat(2,1fr)} .topbar{align-items:flex-start; flex-direction:column} }

.home-hero { display:grid; grid-template-columns:minmax(0,1.5fr) minmax(280px,.7fr); gap:18px; align-items:stretch; margin-bottom:18px; }
.dash-hero { display:grid; grid-template-columns:minmax(0,1.45fr) minmax(280px,.65fr); gap:16px; margin-bottom:16px; align-items:stretch; }
.dash-hero > div:first-child { min-height:270px; border-radius:18px; padding:30px; color:white; background:linear-gradient(135deg,#0f172a,#2563eb); box-shadow:0 18px 42px rgba(37,99,235,.18); display:flex; flex-direction:column; justify-content:center; }
.dash-hero h2 { max-width:680px; margin:16px 0 10px; color:white; font-size:34px; line-height:1.08; }
.dash-hero p { max-width:620px; margin:0; color:#dbeafe; font-weight:750; line-height:1.55; }
.dash-health { border:1px solid #e2e8f0; border-radius:18px; background:white; padding:20px; display:flex; flex-direction:column; justify-content:center; align-items:center; text-align:center; box-shadow:0 14px 34px rgba(15,23,42,.08); }
.dash-health span,.dash-health small { color:#64748b; font-size:12px; font-weight:900; text-transform:uppercase; letter-spacing:.05em; }
.dash-health strong { margin:6px 0 10px; color:#0f172a; font-size:38px; }
.gauge-card { width:168px; height:84px; position:relative; overflow:hidden; margin:2px 0 8px; }
.gauge-card:before { content:""; position:absolute; inset:0; border-radius:168px 168px 0 0; background:conic-gradient(from 270deg,#ef4444 0 20%,#f59e0b 20% 42%,#22c55e 42% 76%,#e5e7eb 76% 100%); }
.gauge-card:after { content:""; position:absolute; left:24px; right:24px; bottom:-60px; height:120px; border-radius:120px 120px 0 0; background:white; }
.gauge-card i { position:absolute; left:50%; bottom:4px; width:76px; height:3px; background:#111827; transform-origin:left center; transform:rotate(-38deg); z-index:2; border-radius:999px; }
.dash-kpi-grid { display:grid; grid-template-columns:repeat(6,minmax(120px,1fr)); gap:10px; margin-bottom:12px; }
.dash-kpi-grid article { background:white; border:1px solid #e5e7eb; border-radius:10px; padding:15px; min-height:104px; box-shadow:0 8px 22px rgba(15,23,42,.05); }
.dash-kpi-grid small { display:block; color:#64748b; font-size:10px; text-transform:uppercase; font-weight:1000; letter-spacing:.04em; }
.dash-kpi-grid strong { display:block; margin-top:8px; color:#0f172a; font-size:25px; line-height:1; }
.dash-kpi-grid span { display:block; margin-top:8px; color:#64748b; font-size:11px; font-weight:800; }
.dash-board { display:grid; grid-template-columns:minmax(0,1.2fr) minmax(280px,.8fr); gap:12px; margin-bottom:18px; }
.dash-panel { background:white; border:1px solid #e5e7eb; border-radius:10px; padding:16px; box-shadow:0 10px 26px rgba(15,23,42,.06); }
.dash-panel-head { display:flex; justify-content:space-between; gap:12px; margin-bottom:12px; }
.dash-panel h3 { margin:0; color:#0f172a; font-size:16px; }
.dash-panel p { margin:4px 0 0; color:#64748b; font-size:12px; font-weight:800; }
.trend-panel { min-height:265px; }
.pipeline-panel { min-height:265px; }
.machine-panel { grid-column:1 / -1; }
.bar-chart { height:190px; display:flex; align-items:end; gap:10px; padding:10px 8px 24px; border-left:1px solid #eef2f7; border-bottom:1px solid #eef2f7; }
.bar-chart span { flex:1; position:relative; height:100%; display:flex; align-items:end; justify-content:center; gap:2px; }
.bar-chart span:before,.bar-chart span:after { content:""; width:38%; border-radius:5px 5px 0 0; display:block; }
.bar-chart span:before { height:var(--win); background:linear-gradient(180deg,#86efac,#22c55e); }
.bar-chart span:after { height:var(--loss); background:linear-gradient(180deg,#fda4af,#e11d48); }
.bar-chart b { position:absolute; bottom:-20px; color:#64748b; font-size:10px; font-weight:900; }
.chart-legend { display:flex; align-items:center; gap:7px; color:#64748b; font-size:11px; font-weight:900; }
.chart-legend i { width:10px; height:10px; border-radius:3px; display:inline-block; }
.chart-legend .won { background:#22c55e; }
.chart-legend .lost { background:#e11d48; margin-left:8px; }
.funnel { display:flex; flex-direction:column; align-items:center; gap:8px; padding-top:12px; }
.funnel span { height:42px; display:flex; align-items:center; justify-content:center; color:white; font-weight:950; font-size:12px; clip-path:polygon(7% 0,93% 0,82% 100%,18% 100%); background:#a78bfa; }
.funnel span:nth-child(1) { width:94%; background:#c084fc; }
.funnel span:nth-child(2) { width:72%; background:#818cf8; }
.funnel span:nth-child(3) { width:52%; background:#38bdf8; }
.funnel span:nth-child(4) { width:34%; background:#34d399; }
.funnel b { margin-left:8px; }
.machine-showcase { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.machine-showcase article { border:1px solid #e2e8f0; background:#f8fafc; border-radius:10px; padding:14px; }
.machine-showcase small { color:var(--blue); font-size:10px; font-weight:1000; text-transform:uppercase; letter-spacing:.06em; }
.machine-showcase strong { display:block; margin-top:5px; color:#0f172a; font-size:16px; }
.machine-showcase p { margin:8px 0 0; color:#475569; line-height:1.45; font-size:12px; font-weight:750; }
body[data-theme="emerald"] .dash-hero > div:first-child { background:linear-gradient(135deg,#052e2b,#059669); }
body[data-theme="graphite"] .dash-hero { grid-template-columns:1fr; }
body[data-theme="graphite"] .dash-hero > div:first-child { background:#18181b; border-radius:8px; min-height:220px; }
body[data-theme="graphite"] .dash-health { align-items:flex-start; text-align:left; border-radius:8px; }
body[data-theme="graphite"] .dash-kpi-grid article, body[data-theme="graphite"] .dash-panel { border-radius:4px; box-shadow:none; border-color:#d1d5db; }
body[data-theme="graphite"] .dash-board { grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(280px,.7fr); }
body[data-theme="graphite"] .machine-panel { grid-column:auto; }
body[data-theme="graphite"] .machine-showcase { grid-template-columns:1fr; }
body[data-theme="sunset"] .dash-hero { grid-template-columns:minmax(0,1fr); }
body[data-theme="sunset"] .dash-hero > div:first-child { background:linear-gradient(135deg,#4c0519,#e11d48,#f97316); border-radius:28px; }
body[data-theme="sunset"] .dash-health { display:none; }
body[data-theme="sunset"] .dash-board { grid-template-columns:minmax(0,1fr); }
body[data-theme="sunset"] .dash-panel { border-radius:22px; }
body[data-theme="sunset"] .machine-showcase article { border-radius:18px; background:#fff7ed; }
.home-hero-copy { min-height:310px; border-radius:24px; padding:34px; color:white; background:linear-gradient(135deg,rgba(2,6,23,.92),rgba(0,84,166,.88)); box-shadow:0 24px 58px rgba(15,23,42,.22); display:flex; flex-direction:column; justify-content:center; overflow:hidden; }
body[data-theme="emerald"] .home-hero-copy { background:linear-gradient(135deg,#042f2e,#059669); }
body[data-theme="graphite"] .home-hero-copy { background:linear-gradient(135deg,#0f172a,#475569); }
body[data-theme="sunset"] .home-hero-copy { background:linear-gradient(135deg,#4c0519,#e11d48); }
.home-kicker { width:max-content; max-width:100%; border:1px solid rgba(255,255,255,.22); border-radius:999px; padding:8px 12px; color:#bfdbfe; font-size:12px; font-weight:1000; text-transform:uppercase; letter-spacing:.06em; background:rgba(255,255,255,.08); }
.home-hero-copy h2 { max-width:650px; margin:18px 0 12px; font-size:38px; line-height:1.08; color:white; }
.home-hero-copy p { max-width:610px; margin:0; color:#dbeafe; font-weight:750; font-size:16px; line-height:1.55; }
.home-actions { display:flex; gap:10px; flex-wrap:wrap; margin-top:24px; }
.home-primary,.home-secondary { border:0; border-radius:14px; padding:12px 16px; color:white; cursor:pointer; font-weight:1000; }
.home-primary { background:linear-gradient(135deg,#16a34a,#22c55e); box-shadow:0 14px 30px rgba(22,163,74,.28); }
.home-secondary { background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.20); }
.home-hero-panel { border:1px solid rgba(219,228,240,.95); border-radius:24px; padding:22px; background:rgba(255,255,255,.92); box-shadow:0 18px 42px rgba(15,23,42,.10); display:flex; flex-direction:column; justify-content:center; gap:12px; }
.home-hero-panel img { width:190px; max-width:100%; margin-bottom:8px; }
.home-demo-mark { display:flex; flex-direction:column; gap:4px; padding:16px; border-radius:16px; color:#fff; background:linear-gradient(135deg,#0f172a,#2563eb); box-shadow:0 14px 28px rgba(37,99,235,.22); }
.home-demo-mark strong { font-size:24px; letter-spacing:.04em; }
.home-demo-mark span { color:rgba(255,255,255,.78); font-size:12px; font-weight:900; text-transform:uppercase; }
.home-panel-line { display:flex; align-items:center; justify-content:space-between; gap:12px; border:1px solid #e2e8f0; border-radius:14px; padding:13px 14px; background:#f8fafc; }
.home-panel-line span,.home-stat small,.home-section-head p,.home-product-grid small,.home-news-list span { color:#64748b; font-size:11px; font-weight:1000; text-transform:uppercase; letter-spacing:.05em; }
.home-panel-line strong { color:#0f172a; font-size:22px; }
.home-stats { display:grid; grid-template-columns:repeat(4,minmax(160px,1fr)); gap:14px; margin-bottom:18px; }
.home-stat,.home-section { background:rgba(255,255,255,.90); border:1px solid rgba(219,228,240,.95); border-radius:22px; box-shadow:0 14px 34px rgba(15,23,42,.08); }
.home-stat { padding:18px; border-top:5px solid #2563eb; }
.home-stat:nth-child(2) { border-top-color:#f97316; }
.home-stat:nth-child(3) { border-top-color:#16a34a; }
.home-stat:nth-child(4) { border-top-color:#7c3aed; }
.home-stat strong { display:block; margin:7px 0 4px; color:#0f172a; font-size:25px; line-height:1.1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.home-stat span { color:#64748b; font-size:12px; font-weight:800; }
.home-section { padding:20px; margin-bottom:18px; }
.home-section-head { display:flex; justify-content:space-between; gap:14px; align-items:flex-start; margin-bottom:14px; }
.home-section-head h3 { margin:0; color:#0f172a; font-size:18px; }
.home-section-head p { margin:5px 0 0; }
.home-section-head a { color:#2563eb; text-decoration:none; font-weight:1000; white-space:nowrap; }
.home-split { display:grid; grid-template-columns:minmax(0,1.25fr) minmax(320px,.75fr); gap:18px; }
.home-product-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.home-product-grid article,.home-news-list a { border:1px solid #e2e8f0; border-radius:16px; background:#f8fafc; padding:16px; }
.home-product-grid strong { display:block; margin-top:5px; color:#0f172a; font-size:20px; }
.home-product-grid p,.home-news-list p { margin:8px 0 0; color:#475569; line-height:1.45; font-size:13px; font-weight:750; }
.home-news-list { display:grid; gap:10px; }
.home-news-list a { display:block; text-decoration:none; transition:.16s; }
.home-news-list a:hover { transform:translateY(-2px); border-color:#bfdbfe; background:#eef6ff; }
.home-news-list strong { display:block; margin-top:5px; color:#0f172a; font-size:15px; }
.home-sector-list { display:grid; gap:10px; }
.home-sector-list details { border:1px solid #dbeafe; border-radius:16px; background:#f8fafc; overflow:hidden; box-shadow:0 10px 24px rgba(15,23,42,.05); }
.home-sector-list details[open] { border-color:#93c5fd; background:#ffffff; }
.home-sector-list summary { list-style:none; cursor:pointer; padding:16px 132px 16px 18px; position:relative; background:linear-gradient(180deg,#ffffff,#f1f7ff); }
.home-sector-list summary::-webkit-details-marker { display:none; }
.home-sector-list summary:before { content:"Detayi ac"; position:absolute; right:48px; top:50%; transform:translateY(-50%); color:#2563eb; font-size:11px; font-weight:1000; text-transform:uppercase; letter-spacing:.04em; }
.home-sector-list details[open] summary:before { content:"Detayi kapat"; color:#16a34a; }
.home-sector-list summary:after { content:"+"; position:absolute; right:16px; top:50%; transform:translateY(-50%); width:24px; height:24px; border-radius:999px; display:grid; place-items:center; color:#2563eb; background:#dbeafe; font-weight:1000; }
.home-sector-list details[open] summary:after { content:"-"; background:#dcfce7; color:#16a34a; }
.home-sector-list span { color:#64748b; font-size:11px; font-weight:1000; text-transform:uppercase; letter-spacing:.05em; }
.home-sector-list strong { display:block; margin-top:5px; color:#0f172a; font-size:16px; line-height:1.25; }
.home-sector-list p { margin:0; padding:2px 18px 14px; color:#475569; line-height:1.65; font-size:13px; font-weight:750; }
.home-sector-list details > a { display:inline-block; margin:0 18px 18px; color:#2563eb; text-decoration:none; font-weight:1000; }
.demo-brief-grid,.module-strip { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.demo-brief-grid article,.module-strip article { border:1px solid #e2e8f0; border-radius:16px; background:#f8fafc; padding:16px; }
.demo-brief-grid small { color:var(--blue); font-size:11px; font-weight:1000; text-transform:uppercase; letter-spacing:.06em; }
.demo-brief-grid strong,.module-strip strong { display:block; margin-top:5px; color:#0f172a; font-size:18px; }
.demo-brief-grid p,.module-strip p { margin:8px 0 0; color:#475569; line-height:1.5; font-size:13px; font-weight:750; }
.module-strip article { background:linear-gradient(180deg,#ffffff,#f8fafc); }
.module-strip span { display:grid; place-items:center; width:34px; height:34px; border-radius:12px; color:#fff; background:linear-gradient(135deg,var(--blue),var(--cyan)); font-weight:1000; margin-bottom:10px; }
@media(max-width:1180px) { .home-hero,.home-split { grid-template-columns:1fr; } .home-stats { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:1180px) { .demo-brief-grid,.module-strip { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:680px) { .home-hero-copy { padding:24px; min-height:260px; background:linear-gradient(135deg,rgba(2,6,23,.94),rgba(0,84,166,.90)); } .home-hero-copy h2 { font-size:28px; } .home-stats,.home-product-grid,.demo-brief-grid,.module-strip { grid-template-columns:1fr; } .home-sector-list summary { padding-right:56px; } .home-sector-list summary:before { display:none; } }


/* Giriş paneli */
#loginOverlay { position:fixed; inset:0; z-index:20000; display:flex; align-items:center; justify-content:center; background:radial-gradient(circle at 20% 20%,rgba(6,182,212,.22),transparent 30%),linear-gradient(135deg,#06142d,#0f172a 55%,#0054a6); padding:24px; }
.login-card { width:min(420px,100%); background:rgba(255,255,255,.96); border:1px solid rgba(219,228,240,.9); border-radius:28px; padding:30px; box-shadow:0 30px 90px rgba(0,0,0,.35); text-align:center; }
.login-card h2 { margin:0; color:#0f172a; font-size:24px; }
.login-card p { margin:8px 0 20px; color:#64748b; font-weight:700; }
.login-card input { width:100%; border:1px solid #dbe4f0; border-radius:16px; padding:13px 15px; margin-bottom:12px; font-size:15px; font-weight:800; background:#f8fafc; }
.login-card button { width:100%; border:0; border-radius:16px; padding:13px 15px; font-size:15px; font-weight:1000; color:white; cursor:pointer; background:linear-gradient(135deg,var(--blue),var(--cyan)); box-shadow:0 14px 32px rgba(37,99,235,.28); }
.remember-row { display:flex; align-items:center; gap:8px; margin:0 0 12px; color:#475569; font-weight:900; text-align:left; }
.remember-row input { width:auto; margin:0; accent-color:var(--blue); }
.login-card .link-btn { margin-top:10px; background:transparent; color:#2563eb; box-shadow:none; border:1px solid #dbeafe; }
#forgotOverlay { position:fixed; inset:0; z-index:21000; display:flex; align-items:center; justify-content:center; background:rgba(15,23,42,.72); padding:24px; }
.forgot-card { max-width:460px; }
.login-error { display:none; margin-top:12px; color:#dc2626; font-weight:900; }

/* Seçili ürün reçetesi / teklif alanı */
.select-check { width:20px; height:20px; accent-color:var(--green); cursor:pointer; }
.quote-actions { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.pill.green { background:linear-gradient(135deg,var(--green),#22c55e); color:white; border-color:transparent; }
.pill.orange { background:linear-gradient(135deg,var(--orange),#f59e0b); color:white; border-color:transparent; }
.pill.red { background:linear-gradient(135deg,#dc2626,#f97316); color:white; border-color:transparent; }
#quoteModal { display:none; position:fixed; inset:0; background:rgba(15,23,42,.78); z-index:9999; overflow:auto; padding:26px; }
#quoteModal.show { display:block; }
.quote-toolbar { max-width:1120px; margin:0 auto 14px; display:flex; justify-content:flex-end; gap:10px; flex-wrap:wrap; }
.quote-paper { max-width:1120px; margin:0 auto; background:white; color:#111827; border-radius:18px; box-shadow:0 28px 90px rgba(0,0,0,.35); overflow:hidden; }
.quote-head { padding:28px 34px; display:flex; justify-content:space-between; gap:24px; align-items:flex-start; border-bottom:4px solid #0054a6; background:linear-gradient(135deg,#ffffff,#f8fbff); }
.quote-logo-box { width:230px; height:96px; flex:0 0 230px; display:none; align-items:center; justify-content:center; border:1px solid #dbe4f0; border-radius:16px; background:white; padding:10px; box-shadow:0 10px 24px rgba(15,23,42,.08); }
.quote-logo-box.has-logo { display:flex; }
.quote-logo-box img { width:100%; height:100%; object-fit:contain; display:block; }
.company-info { text-align:right; font-size:12px; line-height:1.55; color:#334155; }
.company-info strong { display:block; color:#0f172a; font-size:16px; margin-bottom:5px; }
.quote-title { padding:22px 34px 8px; display:flex; justify-content:space-between; gap:20px; flex-wrap:wrap; }
.quote-title h2 { margin:0; font-size:25px; color:#0f172a; }
.quote-meta { display:grid; grid-template-columns:repeat(2,minmax(130px,1fr)); gap:8px; font-size:13px; }
.quote-meta div { background:#f8fafc; border:1px solid #e2e8f0; border-radius:10px; padding:8px 10px; }
.quote-body { padding:18px 34px 30px; }
.quote-table-wrap { overflow:auto; border:1px solid #e2e8f0; border-radius:14px; }
.quote-table { width:100%; border-collapse:collapse; font-size:12px; }
.quote-table th { background:#0f172a; color:white; padding:10px; text-align:left; white-space:nowrap; }
.quote-table td { padding:9px 10px; border-bottom:1px solid #e2e8f0; vertical-align:top; }
.quote-table .num { text-align:right; white-space:nowrap; }
.quote-remove { background:#fee2e2; color:#991b1b; border:0; border-radius:8px; padding:6px 9px; cursor:pointer; font-weight:800; }
.quote-select { width:18px; height:18px; accent-color:var(--green); cursor:pointer; }
.quote-summary { margin-top:18px; display:flex; justify-content:flex-end; }
.quote-summary-box { min-width:310px; background:#f8fafc; border:1px solid #e2e8f0; border-radius:16px; padding:16px; }
.quote-summary-row { display:flex; justify-content:space-between; padding:7px 0; border-bottom:1px dashed #cbd5e1; font-weight:800; }
.quote-summary-row:last-child { border-bottom:0; font-size:18px; color:#0054a6; }
.quote-note { margin-top:20px; color:#64748b; font-size:12px; line-height:1.5; }
.quote-validity-note { margin-top:16px; border:1px solid #bfdbfe; background:#eff6ff; color:#1e3a8a; border-radius:12px; padding:11px 13px; font-size:13px; font-weight:900; line-height:1.35; }
.empty-quote { padding:45px; text-align:center; color:#64748b; font-weight:800; }

/* Reçete kârlılık ve satış fiyatı paneli */
.quote-profit-panel { margin:0 0 16px; background:linear-gradient(135deg,#0f172a,#1e3a8a 55%,#0891b2); color:white; border-radius:18px; padding:18px; box-shadow:0 16px 44px rgba(15,23,42,.18); }
.quote-profit-head { display:flex; justify-content:space-between; gap:16px; align-items:flex-start; flex-wrap:wrap; margin-bottom:14px; }
.quote-profit-head h3 { margin:0; font-size:18px; }
.quote-profit-head p { margin:5px 0 0; color:#dbeafe; font-size:12px; font-weight:750; }
.quote-profit-controls { display:flex; gap:9px; flex-wrap:wrap; align-items:center; }
.quote-profit-controls label { background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.18); border-radius:13px; padding:8px 10px; font-size:12px; font-weight:900; }
.quote-profit-controls input { width:76px; margin-left:6px; border:0; border-radius:10px; padding:7px; text-align:center; font-weight:900; }
.quote-profit-controls button { border:0; border-radius:12px; padding:9px 12px; font-weight:1000; cursor:pointer; color:#0f172a; background:white; }
.quote-profit-grid { display:grid; grid-template-columns:repeat(5,minmax(140px,1fr)); gap:10px; }
.quote-profit-card { background:rgba(255,255,255,.13); border:1px solid rgba(255,255,255,.20); border-radius:15px; padding:12px; }
.quote-profit-card small { display:block; color:#dbeafe; font-size:11px; font-weight:900; text-transform:uppercase; letter-spacing:.05em; }
.quote-profit-card strong { display:block; margin-top:6px; font-size:19px; color:white; }
.quote-profit-card.warn strong { color:#fde68a; }
.quote-qty-input { width:78px; border:1px solid #bfdbfe; background:#eff6ff; color:#0f172a; border-radius:10px; padding:7px 8px; text-align:right; font-weight:900; }
.quote-price-input { width:105px; border:1px solid #bfdbfe; background:#eff6ff; color:#0f172a; border-radius:10px; padding:7px 8px; text-align:right; font-weight:900; }
.quote-discount-chip { display:inline-block; background:#ecfeff; border:1px solid #a5f3fc; color:#155e75; border-radius:999px; padding:5px 8px; font-weight:900; }
@media(max-width:1050px){ .quote-profit-grid{grid-template-columns:repeat(2,1fr)} }



.quote-modal-layout { max-width:1620px; margin:0 auto; display:grid; grid-template-columns:minmax(760px,1fr) 300px 260px; gap:14px; align-items:start; }
.quote-modal-layout .quote-paper { margin:0; width:100%; max-width:1120px; }
.quote-side-panel,.quote-market-panel { position:sticky; top:72px; background:rgba(255,255,255,.96); border:1px solid #dbe4f0; border-radius:22px; padding:18px; box-shadow:0 24px 70px rgba(0,0,0,.25); color:#0f172a; }
.quote-side-panel h3 { margin:0 0 6px; font-size:18px; }
.quote-side-panel p { margin:0 0 14px; color:#64748b; font-size:12px; line-height:1.45; font-weight:750; }
.side-card { background:#f8fafc; border:1px solid #e2e8f0; border-radius:16px; padding:12px; margin-bottom:10px; }
.side-card small { display:block; color:#64748b; font-size:11px; font-weight:1000; text-transform:uppercase; letter-spacing:.04em; }
.side-card strong { display:block; margin-top:6px; font-size:20px; color:#0f172a; }
.side-card.profit strong { color:#16a34a; }
.side-card.warn strong { color:#dc2626; }
.side-field { margin-top:12px; }
.side-field.customer { margin-top:0; margin-bottom:12px; padding-bottom:12px; border-bottom:1px solid #e2e8f0; }
.side-field label { display:block; font-size:12px; color:#334155; font-weight:1000; margin-bottom:6px; }
.side-field input { width:100%; border:1px solid #cbd5e1; border-radius:13px; padding:11px 12px; font-size:16px; font-weight:1000; text-align:right; background:white; }
.side-field.customer input { text-align:left; }
.side-field.customer button { width:100%; margin-top:8px; border:0; border-radius:12px; padding:10px 12px; color:white; background:linear-gradient(135deg,var(--blue),var(--cyan)); font-weight:1000; cursor:pointer; }
.side-field input:focus { outline:3px solid #dbeafe; border-color:#2563eb; }
.side-help { margin-top:10px; padding:10px; border-radius:14px; background:#eff6ff; color:#1e40af; font-size:12px; font-weight:800; line-height:1.45; }
.side-buttons { display:flex; gap:8px; margin-top:12px; flex-wrap:wrap; }
.side-mini-btn { border:0; border-radius:12px; padding:9px 10px; font-weight:1000; cursor:pointer; color:white; background:linear-gradient(135deg,#2563eb,#06b6d4); }
.side-mini-btn.gray { background:linear-gradient(135deg,#64748b,#94a3b8); }
.market-panel { margin-top:14px; border-top:1px solid #e2e8f0; padding-top:14px; }
.quote-market-panel { display:flex; flex-direction:column; min-height:calc(100vh - 100px); max-height:calc(100vh - 100px); overflow:hidden; }
.market-head { display:flex; justify-content:space-between; align-items:flex-start; gap:10px; margin-bottom:10px; }
.market-head h4 { margin:0; font-size:14px; color:#0f172a; }
.market-head p { margin:3px 0 0; font-size:11px; color:#64748b; font-weight:800; }
.market-head button { border:0; border-radius:11px; padding:8px 10px; color:white; cursor:pointer; font-weight:1000; background:linear-gradient(135deg,#0f766e,#14b8a6); }
.market-content { display:grid; gap:8px; max-height:260px; overflow:auto; padding-right:3px; }
.quote-market-panel .market-content { flex:1 1 auto; max-height:none; align-content:start; }
.market-row { background:#f8fafc; border:1px solid #e2e8f0; border-radius:13px; padding:0; overflow:hidden; }
.market-row[open] { background:white; border-color:#bfdbfe; }
.market-row summary { list-style:none; cursor:pointer; display:grid; grid-template-columns:minmax(0,1fr) auto; gap:4px 10px; align-items:center; padding:10px 34px 10px 10px; position:relative; }
.market-row summary::-webkit-details-marker { display:none; }
.market-row summary:after { content:"+"; position:absolute; right:10px; top:50%; transform:translateY(-50%); width:18px; height:18px; border-radius:999px; display:grid; place-items:center; background:#dbeafe; color:#2563eb; font-size:13px; font-weight:1000; }
.market-row[open] summary:after { content:"-"; background:#dcfce7; color:#16a34a; }
.market-row summary > strong { color:#0f172a; font-size:13px; white-space:nowrap; }
.market-row summary > small { grid-column:1 / -1; color:#64748b; font-size:10px; font-weight:900; }
.market-title { color:#0f172a; font-size:12px; line-height:1.3; font-weight:1000; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.market-query { color:#64748b; font-size:10px; line-height:1.3; font-weight:900; margin:-3px 0 7px; overflow-wrap:anywhere; }
.market-rate { color:#475569; font-size:10px; font-weight:1000; margin:-2px 0 8px; }
.market-price { display:flex; justify-content:space-between; align-items:baseline; gap:8px; margin-bottom:8px; }
.market-price strong { color:#0f172a; font-size:15px; }
.market-price span { color:#64748b; font-size:11px; font-weight:900; }
.market-source-ranges { display:grid; gap:5px; margin:0; padding:2px 10px 8px; }
.market-source-range { display:flex; justify-content:space-between; gap:8px; border-top:1px dashed #dbe4f0; padding-top:5px; color:#64748b; font-size:10px; font-weight:900; }
.market-source-range strong { color:#0f172a; text-align:right; overflow-wrap:anywhere; }
.market-links { display:flex; gap:6px; flex-wrap:wrap; padding:0 10px 10px; }
.market-links a { text-decoration:none; color:#1d4ed8; background:#eff6ff; border:1px solid #bfdbfe; border-radius:999px; padding:4px 7px; font-size:11px; font-weight:900; }
.market-empty { color:#64748b; background:#f8fafc; border:1px dashed #cbd5e1; border-radius:13px; padding:12px; font-size:12px; line-height:1.4; font-weight:800; }
@media(max-width:1400px){ .quote-modal-layout{grid-template-columns:1fr;} .quote-side-panel,.quote-market-panel{position:static; order:-1;} }

/* =========================================================
   REÇETE TABLOSU + PDF / PRINT - TEK VE TEMİZ BLOK
   ========================================================= */
.quote-modal-layout {
  max-width: 1620px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(760px, 1fr) 300px 260px;
  gap: 14px;
  align-items: start;
}

.quote-modal-layout .quote-paper {
  margin: 0;
  width: 100%;
  max-width: 1120px;
}

.quote-table-wrap {
  width: 100%;
  overflow-x: hidden !important;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
}

.quote-table {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
  font-size: 12px;
}

.quote-table th,
.quote-table td {
  vertical-align: middle !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.quote-table th {
  background: #0f172a;
  color: #fff;
  padding: 10px 8px;
  font-weight: 900;
}

.quote-table td {
  padding: 8px 8px;
  border-bottom: 1px solid #e2e8f0;
  font-weight: 800;
}

/* Ekranda 9 kolon var: Seç, #, Ürün, Kod, Birim, İskonto, Adet, Toplam, İşlem */
.quote-table th:nth-child(1), .quote-table td:nth-child(1) { width: 52px; text-align: center; }
.quote-table th:nth-child(2), .quote-table td:nth-child(2) { width: 46px; text-align: center; }
.quote-table th:nth-child(3), .quote-table td:nth-child(3) { width: auto; min-width: 205px; text-align: left; }
.quote-table th:nth-child(4), .quote-table td:nth-child(4) { width: 115px; text-align: center; }
.quote-table th:nth-child(5), .quote-table td:nth-child(5) { width: 108px; text-align: center; }
.quote-table th:nth-child(6), .quote-table td:nth-child(6) { width: 92px; text-align: center; }
.quote-table th:nth-child(7), .quote-table td:nth-child(7) { width: 78px; text-align: center; }
.quote-table th:nth-child(8), .quote-table td:nth-child(8) { width: 116px; text-align: center; }
.quote-table th:nth-child(9), .quote-table td:nth-child(9) { width: 70px; text-align: center; }

.quote-table td b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-price-input {
  width: 82px !important;
  max-width: 82px !important;
  height: 32px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #0f172a;
  border-radius: 10px;
  padding: 6px 8px;
  text-align: center !important;
  font-weight: 900;
  box-sizing: border-box;
}

.quote-price-input.qty {
  width: 62px !important;
  max-width: 62px !important;
}
.quote-price-input.discount {
  width: 66px !important;
  max-width: 66px !important;
}

.quote-remove {
  white-space: nowrap;
}

/* Sol makine menüsü işlem butonları */
.machine-nav { justify-content: space-between; gap: 8px; }
.add-machine-nav { color:#ffffff; background:rgba(124,58,237,.16); border-color:rgba(167,139,250,.32); }
.machine-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.machine-actions { display: flex; gap: 4px; opacity: 0; transition: .2s; }
.machine-nav:hover .machine-actions { opacity: 1; }
.machine-actions button {
  border: 0;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  cursor: pointer;
  background: rgba(255,255,255,.14);
  color: white;
  font-size: 13px;
}
.machine-actions button:hover { background: rgba(255,255,255,.28); }

/* PDF / Yazdırma */
@media print {
  @page {
    size: A4 portrait;
    margin: 8mm;
  }

  html,
  body {
    width: 210mm !important;
    min-height: 297mm !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: white !important;
  }

  body {
    display: block !important;
    height: auto !important;
  }

  body * {
    visibility: hidden !important;
  }

  #quoteModal,
  #quoteModal * {
    visibility: visible !important;
  }

  #quoteModal {
    display: block !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
    min-height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    background: white !important;
    overflow: visible !important;
  }

  .quote-toolbar,
  .quote-side-panel,
  .quote-market-panel,
  .quote-remove,
  .quote-select,
  .quote-select-head,
  .quote-note {
    display: none !important;
  }

  .quote-modal-layout {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .quote-paper {
    width: 100% !important;
    max-width: none !important;
    margin: 0 auto !important;
    padding: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
    transform: none !important;
    zoom: 1 !important;
  }

  .quote-head {
    padding: 10px 18px 12px !important;
    border-bottom: 3px solid #0054a6 !important;
  }

  .company-info {
    font-size: 9px !important;
    line-height: 1.35 !important;
  }

  .company-info strong {
    font-size: 12px !important;
  }

  .quote-title {
    padding: 12px 18px 8px !important;
  }

  .quote-title h2 {
    font-size: 19px !important;
  }

  .quote-title p {
    font-size: 11px !important;
    margin: 4px 0 0 !important;
  }

  .quote-meta {
    grid-template-columns: repeat(2, 110px) !important;
    gap: 5px !important;
    font-size: 9px !important;
  }

  .quote-meta div {
    padding: 5px 7px !important;
    border-radius: 7px !important;
  }

  .quote-body {
    padding: 10px 18px 12px !important;
  }

  .quote-table-wrap {
    border-radius: 8px !important;
    overflow: hidden !important;
  }

  .quote-table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
    font-size: 10px !important;
  }

  .quote-table th,
  .quote-table td {
    padding: 5px 6px !important;
    line-height: 1.22 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    vertical-align: middle !important;
    text-align: center !important;
  }

  /* Print'te checkbox ve işlem kolonu yok. Kalan kolonlar: #, Ürün, Kod, Birim, İskonto, Adet, Toplam */
  .quote-table th:nth-child(1), .quote-table td:nth-child(1),
  .quote-table th:nth-child(9), .quote-table td:nth-child(9) {
    display: none !important;
  }

  .quote-table th:nth-child(2), .quote-table td:nth-child(2) { width: 32px !important; text-align: center !important; }
  .quote-table th:nth-child(3), .quote-table td:nth-child(3) { width: auto !important; text-align: left !important; }
  .quote-table th:nth-child(4), .quote-table td:nth-child(4) { width: 95px !important; text-align: center !important; }
  .quote-table th:nth-child(5), .quote-table td:nth-child(5) { width: 85px !important; text-align: center !important; }
  .quote-table th:nth-child(6), .quote-table td:nth-child(6) { width: 58px !important; text-align: center !important; }
  .quote-table th:nth-child(7), .quote-table td:nth-child(7) { width: 48px !important; text-align: center !important; }
  .quote-table th:nth-child(8), .quote-table td:nth-child(8) { width: 82px !important; text-align: center !important; }

  .quote-price-input {
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
    font-size: 10px !important;
    font-weight: 900 !important;
    text-align: center !important;
    color: #0f172a !important;
  }

  .quote-summary {
    margin-top: 12px !important;
    justify-content: flex-end !important;
  }

  .quote-summary-box {
    min-width: 260px !important;
    max-width: 280px !important;
    padding: 10px 12px !important;
    border-radius: 10px !important;
  }

  .quote-summary-row {
    padding: 4px 0 !important;
    font-size: 11px !important;
    line-height: 1.25 !important;
  }

  .quote-summary-row:last-child {
    font-size: 13px !important;
  }
}
.btn-delete {
  background: linear-gradient(135deg,#dc2626,#ef4444);
}

.pill.danger {
  background: linear-gradient(135deg,#dc2626,#ef4444);
  color: white;
}


/* =========================================================
   ANA MAKİNE TABLOSU - STABİL SON DÜZEN
   Bu blok sadece ana ürün tablosunu düzeltir.
   Reçete/PDF tablolarına dokunmaz.
   ========================================================= */

#machine .table-shell {
  overflow-x: auto !important;
  overflow-y: visible !important;
  border-radius: 24px !important;
}

#machine table:not(.quote-table) {
  width: 100% !important;
  table-layout: fixed !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  font-size: 12px !important;
}

#machine table:not(.quote-table) th,
#machine table:not(.quote-table) td {
  height: 48px !important;
  padding: 8px 9px !important;
  vertical-align: middle !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  line-height: 1.25 !important;
}

#machine table:not(.quote-table) th {
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: .035em !important;
  text-align: left !important;
}

/* 1 - Toplu seçim checkbox */
#machine table:not(.quote-table) th:nth-child(1),
#machine table:not(.quote-table) td:nth-child(1) {
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  text-align: center !important;
}

#machine table:not(.quote-table) input.row-delete-check,
#machine table:not(.quote-table) #selectAllRows {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  max-width: 16px !important;
  display: inline-block !important;
  opacity: 1 !important;
  visibility: visible !important;
  accent-color: var(--green) !important;
  margin: 0 !important;
}

/* 2 - Reçete/Ekle */
#machine table:not(.quote-table) th:nth-child(2),
#machine table:not(.quote-table) td:nth-child(2) {
  width: 85px !important;
  min-width: 85px !important;
  max-width: 90px !important;
  text-align: center !important;
}

/* 3 - S.N */
#machine table:not(.quote-table) th:nth-child(3),
#machine table:not(.quote-table) td:nth-child(3) {
  width: 45px !important;
  min-width: 45px !important;
  max-width: 70px !important;
  text-align: center !important;
}

/* 4 - Ürün Açıklaması */
#machine table:not(.quote-table) th:nth-child(4),
#machine table:not(.quote-table) td:nth-child(4) {
  width: 150px !important;
  min-width: 150px !important;
  max-width: 150px !important;
  text-align: left !important;
}

/* 5 - Marka */
#machine table:not(.quote-table) th:nth-child(5),
#machine table:not(.quote-table) td:nth-child(5) {
  width: 90px !important;
  min-width: 90px !important;
  max-width: 110px !important;
}

/* 6 - Üretici No */
#machine table:not(.quote-table) th:nth-child(6),
#machine table:not(.quote-table) td:nth-child(6) {
  width: 135px !important;
  min-width: 135px !important;
  max-width: 135px !important;
}

/* 7 - Sipariş Kodu */
#machine table:not(.quote-table) th:nth-child(7),
#machine table:not(.quote-table) td:nth-child(7) {
  width: 105px !important;
  min-width: 105px !important;
  max-width: 125px !important;
}

/* 8 - Birim Fiyat */
#machine table:not(.quote-table) th:nth-child(8),
#machine table:not(.quote-table) td:nth-child(8) {
  width: 105px !important;
  min-width: 105px !important;
  max-width: 125px !important;
  text-align: right !important;
}

/* 9 - Birimi */
#machine table:not(.quote-table) th:nth-child(9),
#machine table:not(.quote-table) td:nth-child(9) {
  width: 50px !important;
  min-width: 50px !important;
  max-width: 80px !important;
  text-align: center !important;
}

/* 10 - İskonto */
#machine table:not(.quote-table) th:nth-child(10),
#machine table:not(.quote-table) td:nth-child(10) {
  width: 90px !important;
  min-width: 90px !important;
  max-width: 100px !important;
  text-align: right !important;
}

/* 11 - İskontolu EUR */
#machine table:not(.quote-table) th:nth-child(11),
#machine table:not(.quote-table) td:nth-child(11) {
  width: 120px !important;
  min-width: 120px !important;
  max-width: 120px !important;
  text-align: right !important;
}

/* 12 - Liste EUR */
#machine table:not(.quote-table) th:nth-child(12),
#machine table:not(.quote-table) td:nth-child(12) {
  width: 120px !important;
  min-width: 120px !important;
  max-width: 120px !important;
  text-align: right !important;
}

/* 13 - Adet */
#machine table:not(.quote-table) th:nth-child(13),
#machine table:not(.quote-table) td:nth-child(13) {
  width: 70px !important;
  min-width: 70px !important;
  max-width: 70px !important;
  text-align: center !important;
}

/* 14 - Toplam EUR */
#machine table:not(.quote-table) th:nth-child(14),
#machine table:not(.quote-table) td:nth-child(14) {
  width: 115px !important;
  min-width: 115px !important;
  max-width: 125px !important;
  text-align: right !important;
}

/* 15 - Toplam TL */
#machine table:not(.quote-table) th:nth-child(15),
#machine table:not(.quote-table) td:nth-child(15) {
  width: 135px !important;
  min-width: 135px !important;
  max-width: 135px !important;
  text-align: right !important;
}

/* 16 - İşlem */
#machine table:not(.quote-table) th:nth-child(16),
#machine table:not(.quote-table) td:nth-child(16) {
  width: 101px !important;
  min-width: 101px !important;
  max-width: 101px !important;
  text-align: center !important;
}

/* Input/select alanları hücreyi patlatmasın */
#machine table:not(.quote-table) input.cell,
#machine table:not(.quote-table) select.cell,
#machine table:not(.quote-table) .text-input {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: 32px !important;
  padding: 6px 8px !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  box-sizing: border-box !important;
}

#machine table:not(.quote-table) input.cell:disabled,
#machine table:not(.quote-table) select.cell:disabled {
  border-color: transparent !important;
  background: transparent !important;
  opacity: 1 !important;
  color: #0f172a !important;
}

#machine table:not(.quote-table) td:nth-child(8) input.cell,
#machine table:not(.quote-table) td:nth-child(10) input.cell,
#machine table:not(.quote-table) td:nth-child(13) input.cell {
  text-align: right !important;
}

#machine table:not(.quote-table) .calc {
  min-width: 78px !important;
  max-width: 100% !important;
  padding: 6px 8px !important;
  font-weight: 500 !important;
  text-align: right !important;
}

#machine table:not(.quote-table) .badge {
  max-width: 100% !important;
  justify-content: center !important;
}

#machine table:not(.quote-table) .action {
  display: flex !important;
  justify-content: center !important;
  gap: 6px !important;
}

#machine table:not(.quote-table) .btn-edit,
#machine table:not(.quote-table) .btn-save {
  padding: 7px 10px !important;
  font-size: 12px !important;
  white-space: nowrap !important;
}

#machine table:not(.quote-table) .btn-add {
  padding: 8px 10px !important;
  font-size: 12px !important;
  white-space: nowrap !important;
}

#machine table:not(.quote-table) .num {
  text-align: right !important;
  font-variant-numeric: tabular-nums !important;
  font-weight: 500 !important;
}

.sidebar-logo {
  text-align: center;
  padding: 20px 15px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo img {
  width: 200px;
  height: auto;
  display: block;
  margin: 0 auto 12px auto;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
}

.sidebar-logo small {
  display: block;
  font-size: 14px;
  color: #aab3c5;
  line-height: 1.4;
}

/* SADECE REÇETE YAZDIR - BOŞ SAYFA ENGELLİ */
@media print {

  @page {
    size: A4 portrait;
    margin: 8mm;
  }

  body.print-mode {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
    background: white !important;
  }

  body.print-mode > *:not(#quoteModal) {
    display: none !important;
  }

  body.print-mode #quoteModal {
    display: block !important;
    position: static !important;
    inset: auto !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    background: white !important;
    overflow: visible !important;
  }

  body.print-mode .quote-toolbar,
  body.print-mode .quote-side-panel,
  body.print-mode .quote-market-panel,
  body.print-mode .quote-remove,
  body.print-mode .quote-select,
  body.print-mode .quote-select-head,
  body.print-mode .quote-note {
    display: none !important;
  }

  body.print-mode .quote-modal-layout {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.print-mode .quote-paper {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
  }

  body.print-mode .quote-head {
    padding: 10px 14px !important;
  }

  body.print-mode .quote-title {
    padding: 10px 14px 6px !important;
  }

  body.print-mode .quote-body {
    padding: 8px 14px 10px !important;
  }

  body.print-mode .quote-table {
    font-size: 9px !important;
  }

  body.print-mode .quote-table th,
  body.print-mode .quote-table td {
    padding: 4px 5px !important;
    line-height: 1.15 !important;
  }
}
.brand-toolbar {
  align-items: center;
  margin-bottom: 20px;
}

.brand-table {
  min-width: 0 !important;
}

.brand-table th,
.brand-table td {
  width: auto !important;
}

.brand-table th:nth-child(1),
.brand-table td:nth-child(1) {
  width: 45% !important;
}

.brand-table th:nth-child(2),
.brand-table td:nth-child(2) {
  width: 25% !important;
  text-align:left !important;
}

.brand-table .brand-name-input {
  text-align:left !important;
}

.brand-table th:nth-child(3),
.brand-table td:nth-child(3) {
  width: 30% !important;
}

.brand-table .btn-save {
  display: none;
}

.brand-table tr.editing .btn-save {
  display: inline-block;
}

.brand-table tr.editing .btn-edit {
  display: none;
}

/* Sadece liste alanlari kaysin; arama, istatistik ve aksiyonlar sabit kalsin. */
.main,
.content {
  min-height: 0;
}

#machine,
#brandsPage,
#quoteStatsPage,
#adminPage {
  height: 100%;
  min-height: 0;
  flex-direction: column;
}

#machine:not([style*="display:none"]):not([style*="display: none"]),
#brandsPage:not([style*="display:none"]):not([style*="display: none"]),
#quoteStatsPage:not([style*="display:none"]):not([style*="display: none"]),
#adminPage:not([style*="display:none"]):not([style*="display: none"]) {
  display: flex !important;
}

#machine .stats {
  flex: 0 0 auto;
}

#machine .toolbar,
#brandsPage .toolbar,
#brandsPage h2,
#quoteStatsPage .stats-header,
#quoteStatsPage .stats-filter,
#quoteStatsPage .stats,
#adminPage .stats-header {
  flex: 0 0 auto;
}

#machine .table-shell,
#brandsPage .table-shell,
#quoteStatsPage .table-shell,
#adminPage .table-shell {
  flex: 1 1 auto;
  min-height: 220px;
  overflow: auto !important;
}

#machine table:not(.quote-table) th,
#brandsPage table th,
#quoteStatsPage table th,
#adminPage table th {
  position: sticky;
  top: 0;
  z-index: 5;
}

.stats-header { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; margin-bottom:10px; }
.stats-header h2 { margin:0; color:#0f172a; font-size:22px; }
.stats-header p { margin:4px 0 0; color:#64748b; font-weight:750; font-size:12px; }
.stats-filter { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:10px; }
.range-btn { border:1px solid #dbe4f0; background:white; color:#334155; border-radius:999px; padding:8px 12px; font-weight:900; cursor:pointer; box-shadow:0 8px 22px rgba(15,23,42,.05); }
.range-btn.active { color:white; border-color:#2563eb; background:linear-gradient(135deg,#2563eb,#06b6d4); box-shadow:0 12px 28px rgba(37,99,235,.22); }
.stats-filter label { display:flex; align-items:center; gap:7px; color:#475569; font-size:12px; font-weight:900; }
.stats-filter input { border:1px solid #dbe4f0; border-radius:12px; padding:7px 9px; color:#0f172a; font-weight:800; background:white; }
#quoteStatsPage .cards { margin-bottom:10px; gap:10px; }
#quoteStatsPage .stat { background:linear-gradient(180deg,rgba(255,255,255,.96),rgba(248,250,252,.9)); border:1px solid rgba(219,228,240,.95); border-radius:14px; padding:12px 14px; box-shadow:0 12px 26px rgba(15,23,42,.06); }
#quoteStatsPage .stat small { display:block; color:#64748b; font-weight:1000; text-transform:uppercase; letter-spacing:.06em; font-size:10px; }
#quoteStatsPage .stat strong { display:block; margin-top:5px; color:#0f172a; font-size:21px; }
#quoteStatsPage .table-shell { min-height:0; overflow:auto !important; }
#quoteStatsPage table th { position:static; }
.stats-grid { flex:1 1 auto; min-height:0; display:grid; grid-template-columns:repeat(12,minmax(0,1fr)); gap:10px; align-content:start; }
.stats-panel { min-height:0; display:flex; flex-direction:column; background:rgba(255,255,255,.72); border:1px solid rgba(219,228,240,.9); border-radius:14px; padding:10px; box-shadow:0 12px 26px rgba(15,23,42,.06); }
#quoteStatsPage .stats-products { grid-column:span 12; order:2; height:clamp(260px,42vh,460px); overflow:hidden; }
#quoteStatsPage .stats-panel:not(.stats-products) { grid-column:span 3; order:1; height:220px; overflow:hidden; }
.stats-panel-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px; flex:0 0 auto; }
.stats-panel-head h3 { margin:0; color:#0f172a; font-size:15px; }
.stats-panel-head input { width:220px; max-width:100%; border:1px solid #dbe4f0; border-radius:11px; padding:8px 10px; font-weight:800; }
.stats-detail-btn { border:1px solid #dbe4f0; background:white; color:#2563eb; border-radius:10px; padding:7px 10px; font-size:11px; font-weight:1000; cursor:pointer; }
.stats-detail-btn:hover { background:#eff6ff; border-color:#bfdbfe; }
.stats-table { width:100%; min-width:0; table-layout:fixed; }
.stats-table.compact { min-width:0; }
.stats-table th { white-space:nowrap; font-size:10px; padding:8px 9px; text-align:center; }
.stats-table td { padding:8px 9px; font-size:12px; line-height:1.2; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.stats-table td { background:white; }
.stats-table td { text-align:center; }
.stats-table th:first-child,
.stats-table .stats-name { text-align:left; }
.stats-table .num { text-align:center; }
.stats-table .stats-name { font-weight:900; color:#0f172a; }
#quoteStatsPage .stats-panel:not(.stats-products) .table-shell { flex:1 1 auto; min-height:0; }
.stats-products .table-shell { overflow:auto !important; flex:1 1 0; min-height:0; background:white; border-radius:12px; }
.stats-products .stats-table th { position:sticky !important; top:0; z-index:3; }
.stats-detail { flex:1 1 auto; min-height:0; display:flex; flex-direction:column; background:rgba(255,255,255,.78); border:1px solid rgba(219,228,240,.9); border-radius:16px; padding:12px; box-shadow:0 12px 28px rgba(15,23,42,.07); }
.stats-detail-head { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:10px; flex:0 0 auto; }
.stats-detail-head h3 { margin:0; color:#0f172a; font-size:18px; }
.stats-detail-head p { margin:4px 0 0; color:#64748b; font-size:12px; font-weight:800; }
.stats-detail-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.stats-detail-actions input { width:260px; max-width:100%; border:1px solid #dbe4f0; border-radius:12px; padding:9px 11px; font-weight:900; color:#0f172a; background:white; }
.stats-detail-table { flex:1 1 auto; min-height:0; overflow:auto !important; }
.stats-detail-table .stats-table th { position:sticky !important; top:0; z-index:4; }
@media(max-width:1180px){ #quoteStatsPage .stats-panel:not(.stats-products) { grid-column:span 6; } }
@media(max-width:1000px){ .stats-grid { grid-template-columns:1fr; } #quoteStatsPage .stats-products,#quoteStatsPage .stats-panel:not(.stats-products) { grid-column:1; } }
.sales-toolbar { margin-top:8px; }
.sales-filter { border:1px solid var(--line); border-radius:14px; padding:11px 13px; background:white; color:#0f172a; font-weight:900; box-shadow:0 10px 26px rgba(15,23,42,.06); }
.sales-table { min-width:1120px; }
.sales-table-shell { flex:1 1 auto; min-height:0; overflow:auto; }
.sales-user-select { width:100%; min-width:150px; border:1px solid #facc15; border-radius:10px; padding:7px 9px; background:#fff7d6; color:#0f172a; font-weight:900; }
.sales-table .action { gap:4px; flex-wrap:wrap; }
.sales-table .btn { border-radius:9px; padding:5px 7px; font-size:11px; line-height:1.1; }
.sale-badge { display:inline-flex; align-items:center; justify-content:center; min-width:74px; border-radius:999px; padding:7px 10px; font-size:12px; font-weight:1000; }
.sale-badge.sold { color:#166534; background:#dcfce7; border:1px solid #86efac; }
.sale-badge.open { color:#92400e; background:#fef3c7; border:1px solid #fde68a; }
#salesPage { height:100%; min-height:0; display:flex; flex-direction:column; }
#salesPage[style*="display:none"] { display:none !important; }
#salesPage .stats {
  flex:0 0 auto;
  margin:12px 0 14px;
  gap:0;
  background:rgba(255,255,255,.86);
  border:1px solid rgba(219,228,240,.95);
  border-radius:18px;
  box-shadow:0 14px 34px rgba(15,23,42,.07);
  overflow:hidden;
}
#salesPage .stat {
  min-height:86px;
  padding:16px 18px;
  background:linear-gradient(180deg,#ffffff,#f8fafc);
  border-right:1px solid #e2e8f0;
  border-top:4px solid #2563eb;
}
#salesPage .stat:nth-child(2) { border-top-color:#16a34a; }
#salesPage .stat:nth-child(3) { border-top-color:#f97316; }
#salesPage .stat:nth-child(4) { border-top-color:#7c3aed; border-right:0; }
#salesPage .stat small {
  display:block;
  color:#64748b;
  font-size:11px;
  font-weight:1000;
  letter-spacing:.05em;
  text-transform:uppercase;
}
#salesPage .stat strong {
  display:block;
  margin-top:9px;
  color:#0f172a;
  font-size:24px;
  line-height:1.1;
  font-variant-numeric:tabular-nums;
}
@media(max-width:1050px) {
  #salesPage .stats { grid-template-columns:repeat(2,minmax(0,1fr)); gap:0; }
  #salesPage .stat:nth-child(2) { border-right:0; }
  #salesPage .stat:nth-child(3), #salesPage .stat:nth-child(4) { border-top-width:4px; border-top-style:solid; }
}
.admin-stack { flex:1 1 auto; min-height:0; display:flex; flex-direction:column; gap:14px; overflow:auto; }
.admin-stack > .stats-panel:first-child { flex:0 0 auto; overflow:visible; }
.admin-stack > .stats-panel { width:100%; }
.admin-users-layout { display:grid; grid-template-columns:minmax(0,1.25fr) minmax(420px,.85fr); gap:14px; align-items:start; }
#themeAdminPanel { flex:0 0 auto; display:block; overflow:visible; padding:12px; }
#themeAdminPanel .stats-panel-head { margin-bottom:8px; }
#themeAdminPanel .muted { margin:0 0 12px; color:#64748b; font-weight:700; }
#mailAdminPanel { flex:0 0 auto; display:block; overflow:visible; padding:12px; position:relative; z-index:1; }
#mailAdminPanel .stats-panel-head { margin-bottom:8px; }
#mailAdminPanel .muted { margin:0 0 12px; color:#64748b; font-weight:700; }
#mailAdminPanel .side-buttons { display:flex; justify-content:flex-end; margin-top:10px; }
.notification-rules { border:1px solid #dbe4f0; border-radius:14px; padding:12px; background:#f8fafc; margin-bottom:14px; }
.notification-rules h4 { margin:4px 0 10px; color:#0f172a; font-size:14px; }
.notification-grid,.notification-recipient-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin-bottom:12px; }
.notification-grid label,.notification-recipient-grid label { display:flex; align-items:center; gap:8px; border:1px solid #e2e8f0; border-radius:12px; background:white; padding:9px 10px; font-size:12px; font-weight:900; color:#334155; }
#notifyCustomEmails { width:100%; border:1px solid #dbe4f0; border-radius:12px; padding:10px 12px; font-weight:800; background:white; color:#0f172a; }
.theme-admin-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin:14px 0; }
.theme-admin-grid button { border:1px solid var(--line); background:#fff; border-radius:12px; padding:14px; text-align:left; cursor:pointer; box-shadow:0 8px 22px rgba(15,23,42,.08); }
.theme-admin-grid button strong { display:block; color:#0f172a; font-size:14px; }
.theme-admin-grid button span { display:block; color:#64748b; font-size:12px; margin-top:5px; }
.theme-admin-grid button.active { border-color:var(--blue); box-shadow:0 0 0 3px rgba(37,99,235,.12); }
#themeAdminPanel .side-mini-btn { width:auto; min-width:150px; }
#logoAdminPanel { flex:0 0 auto; display:block; overflow:visible; padding:12px; }
#logoAdminPanel .muted { margin:0 0 12px; color:#64748b; font-weight:700; }
.logo-admin-grid { display:grid; grid-template-columns:260px minmax(0,1fr); gap:14px; align-items:center; }
.logo-preview-box { width:260px; height:130px; display:flex; align-items:center; justify-content:center; border:1px dashed #cbd5e1; border-radius:16px; background:#f8fafc; padding:12px; color:#64748b; font-weight:900; }
.logo-preview-box img { width:100%; height:100%; object-fit:contain; display:none; }
.logo-preview-box.has-logo { border-style:solid; background:white; }
.logo-admin-form { display:grid; grid-template-columns:1fr; gap:10px; }
.logo-admin-form input { width:100%; border:1px solid #dbe4f0; border-radius:12px; padding:10px 12px; font-weight:800; background:white; color:#0f172a; }
.admin-editor { min-width:0; }
.admin-form { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-bottom:10px; align-items:center; }
.admin-form input,.admin-form select,.admin-logs-panel select { border:1px solid #dbe4f0; border-radius:12px; padding:10px 12px; font-weight:800; background:white; color:#0f172a; }
.admin-form textarea { grid-column:1 / -1; min-height:130px; border:1px solid #dbe4f0; border-radius:12px; padding:10px 12px; font-weight:800; background:white; color:#0f172a; resize:vertical; font-family:inherit; }
.mail-form #mailTo { display:block; }
.admin-form label { display:flex; align-items:center; gap:8px; font-weight:900; color:#475569; }
.permission-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin-bottom:10px; }
.permission-grid label { background:#f8fafc; border:1px solid #e2e8f0; border-radius:12px; padding:8px 10px; font-size:12px; font-weight:900; color:#334155; }
.admin-stack > .stats-panel:first-child .side-buttons { display:flex; gap:8px; justify-content:flex-end; margin-bottom:10px; }
.admin-stack > .stats-panel:first-child .side-mini-btn { width:auto; min-width:96px; }
.admin-table-shell { flex:0 0 auto !important; min-height:0 !important; margin-top:0; max-height:245px; overflow:auto !important; box-shadow:none; border-radius:14px; }
.admin-table-shell .stats-table th,
.admin-table-shell .stats-table td { padding:9px 10px; }
.admin-logs-panel { flex:0 0 auto; min-height:0; display:flex; flex-direction:column; clear:both; position:relative; z-index:0; margin-top:0; }
.admin-logs-panel .stats-panel-head { margin-bottom:0; }
.admin-log-toggle { border:0; background:transparent; color:#0f172a; cursor:pointer; display:flex; align-items:center; gap:9px; padding:4px 0; font-size:15px; font-weight:1000; }
.admin-log-toggle span { display:inline-flex; align-items:center; justify-content:center; width:20px; height:20px; border-radius:7px; background:#eef4ff; color:#2563eb; font-size:12px; }
.admin-log-body { margin-top:10px; height:min(48vh,520px); min-height:260px; overflow:auto; }
.admin-logs-panel.collapsed .admin-log-body { display:none; }
.admin-only { display:none; }
@media(max-width:1200px){ .admin-users-layout { grid-template-columns:1fr; } .admin-form,.permission-grid,.notification-grid,.notification-recipient-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .theme-admin-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:760px){ .admin-form,.permission-grid,.theme-admin-grid,.notification-grid,.notification-recipient-grid,.logo-admin-grid { grid-template-columns:1fr; } .logo-preview-box { width:100%; } }

#crmPage { height:100%; min-height:0; display:flex; flex-direction:column; }
#crmPage[style*="display:none"] { display:none !important; }
.crm-shell { flex:1 1 auto; min-height:0; display:grid; grid-template-columns:minmax(260px,340px) minmax(0,1fr); gap:14px; }
.crm-list-panel,.crm-detail-panel {
  min-height:0;
  background:rgba(255,255,255,.82);
  border:1px solid rgba(219,228,240,.95);
  border-radius:16px;
  padding:12px;
  box-shadow:0 14px 32px rgba(15,23,42,.07);
}
.crm-list-panel { display:flex; flex-direction:column; gap:10px; overflow:hidden; }
.crm-list-head { display:flex; gap:8px; }
.crm-list-head input,.crm-form-grid input,.crm-form-grid select,.crm-detail-panel textarea {
  width:100%;
  border:1px solid #dbe4f0;
  border-radius:12px;
  padding:10px 12px;
  color:#0f172a;
  background:white;
  font-weight:850;
}
.crm-reminders {
  display:flex;
  flex-direction:column;
  gap:6px;
  border:1px solid #fde68a;
  border-radius:12px;
  padding:9px;
  background:#fffbeb;
  color:#92400e;
  font-size:12px;
  font-weight:900;
}
.crm-reminders button { border:0; background:transparent; color:#92400e; text-align:left; font-weight:950; cursor:pointer; padding:2px 0; }
.crm-reminders span { color:#64748b; }
.crm-list { flex:1 1 auto; min-height:0; overflow:auto; display:flex; flex-direction:column; gap:7px; }
.crm-list-item {
  border:1px solid #e2e8f0;
  border-radius:12px;
  background:white;
  padding:10px;
  text-align:left;
  cursor:pointer;
}
.crm-list-item.active { border-color:#2563eb; background:#eff6ff; box-shadow:0 10px 20px rgba(37,99,235,.12); }
.crm-list-item strong { display:block; color:#0f172a; font-size:13px; }
.crm-list-item span { display:block; margin-top:4px; color:#64748b; font-size:11px; font-weight:850; }
.crm-detail-panel { display:flex; flex-direction:column; gap:12px; overflow:auto; }
.crm-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.crm-machine-box {
  border:1px solid #e2e8f0;
  border-radius:14px;
  padding:10px;
  background:#f8fafc;
}
.crm-machine-add { display:flex; gap:8px; align-items:center; }
.crm-machine-add input {
  width:100%;
  border:1px solid #dbe4f0;
  border-radius:12px;
  padding:10px 12px;
  color:#0f172a;
  background:white;
  font-weight:850;
}
.crm-machine-list { display:flex; flex-wrap:wrap; gap:7px; margin-top:9px; }
.crm-machine-chip {
  display:inline-flex;
  align-items:center;
  gap:7px;
  border:1px solid #bfdbfe;
  border-radius:999px;
  padding:6px 8px 6px 10px;
  background:#eff6ff;
  color:#1e3a8a;
  font-size:12px;
  font-weight:950;
}
.crm-machine-chip button {
  border:0;
  border-radius:999px;
  padding:3px 6px;
  background:#dbeafe;
  color:#1e3a8a;
  cursor:pointer;
  font-size:10px;
  font-weight:950;
}
.crm-machine-empty { color:#64748b; font-size:12px; font-weight:850; }
.crm-detail-panel textarea { min-height:105px; resize:vertical; }
.crm-actions { display:flex; justify-content:flex-end; gap:8px; flex-wrap:wrap; }
.crm-history { min-height:260px; display:flex; flex-direction:column; }
.crm-history .table-shell { flex:1 1 auto; min-height:0; overflow:auto; }
@media(max-width:1050px){ .crm-shell { grid-template-columns:1fr; } .crm-list-panel { max-height:360px; } }
@media(max-width:700px){ .crm-form-grid { grid-template-columns:1fr; } .crm-list-head,.crm-machine-add { flex-direction:column; align-items:stretch; } }

#customPartsPage { height:100%; min-height:0; display:flex; flex-direction:column; }
#customPartsPage[style*="display:none"] { display:none !important; }
.custom-parts-head { flex:0 0 auto; }
.custom-part-menu {
  flex:0 0 auto;
  display:grid;
  grid-template-columns:repeat(6,minmax(110px,1fr));
  gap:8px;
  margin:0 0 12px;
}
.custom-part-menu button {
  border:1px solid #dbe4f0;
  border-radius:12px;
  padding:10px 12px;
  background:white;
  color:#334155;
  font-weight:1000;
  cursor:pointer;
  box-shadow:0 8px 18px rgba(15,23,42,.05);
}
.custom-part-menu button.active {
  border-color:#2563eb;
  color:white;
  background:linear-gradient(135deg,#2563eb,#06b6d4);
  box-shadow:0 12px 26px rgba(37,99,235,.22);
}
.custom-part-grid {
  flex:1 1 auto;
  min-height:0;
  display:grid;
  grid-template-columns:minmax(320px,560px);
  justify-content:center;
  align-content:start;
  gap:14px;
  overflow:auto;
  padding:2px 2px 8px;
}
.custom-part-card {
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:12px;
  background:linear-gradient(180deg,rgba(255,255,255,.96),rgba(248,250,252,.9));
  border:1px solid rgba(219,228,240,.95);
  border-radius:16px;
  padding:14px;
  box-shadow:0 14px 30px rgba(15,23,42,.07);
}
.custom-part-title { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.custom-part-title h3 { margin:0; color:#0f172a; font-size:17px; line-height:1.15; }
.custom-part-title small { display:block; margin-top:4px; color:#64748b; font-size:11px; font-weight:900; }
.part-drawing {
  position:relative;
  height:126px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:14px;
  background:linear-gradient(135deg,#eef6ff,#ffffff);
  border:1px solid #dbeafe;
}
.part-drawing.rect::before {
  content:"";
  width:min(72%,220px);
  height:58px;
  border:4px solid #2563eb;
  border-radius:18px;
  background:rgba(37,99,235,.08);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.7);
}
.part-drawing.circle::before {
  content:"";
  width:92px;
  height:92px;
  border:4px solid #2563eb;
  border-radius:50%;
  background:rgba(37,99,235,.08);
  box-shadow:inset 0 0 0 12px rgba(255,255,255,.72), inset 0 0 0 16px rgba(37,99,235,.26);
}
.part-drawing .shape-title { position:absolute; color:#1e3a8a; font-size:11px; font-weight:1000; }
.part-drawing .measure {
  position:absolute;
  display:block;
  min-width:0;
  padding:0;
  background:transparent;
  border:0;
  color:#1e3a8a;
  font-size:11px;
  font-weight:1000;
  line-height:1;
  box-shadow:none;
  white-space:nowrap;
}
.part-drawing .measure-long { top:18px; left:50%; transform:translateX(-50%); }
.part-drawing .measure-short { left:20%; top:41%; transform:translate(-100%,-50%); writing-mode:horizontal-tb; }
.part-drawing .measure-length { top:75px; left:50%; transform:translateX(-50%); }
.part-drawing .measure-circle { top:18px; left:50%; transform:translateX(-50%); }
.part-drawing .measure-thickness { top:50%; left:calc(50% + 56px); transform:translateY(-50%); }
.part-drawing.line i {
  width:min(76%,230px);
  height:9px;
  border-radius:999px;
  background:linear-gradient(90deg,#475569,#0f172a,#475569);
  box-shadow:0 8px 18px rgba(15,23,42,.18);
}
.custom-part-fields { display:grid; grid-template-columns:1fr; gap:8px; }
.custom-part-fields label {
  display:flex;
  flex-direction:column;
  gap:5px;
  color:#475569;
  font-size:11px;
  font-weight:1000;
}
.custom-part-fields input,
.custom-part-fields select {
  width:100%;
  border:1px solid #dbe4f0;
  border-radius:11px;
  padding:9px 10px;
  color:#0f172a;
  font-weight:900;
  background:white;
}
.custom-price-row { display:flex; gap:7px; align-items:center; }
.custom-price-row input { min-width:0; }
.custom-price-row button {
  flex:0 0 auto;
  border:0;
  border-radius:10px;
  padding:9px 12px;
  background:#16a34a;
  color:white;
  font-weight:1000;
  cursor:pointer;
  box-shadow:0 10px 20px rgba(22,163,74,.16);
}
.custom-save-note { min-height:13px; color:#16a34a; font-size:10px; font-weight:1000; }
.custom-settings-card { max-width:760px; width:100%; }
.custom-settings-group { border-top:1px solid #e2e8f0; padding-top:12px; }
.custom-settings-group h4 { margin:0 0 10px; color:#0f172a; font-size:14px; }
.custom-settings-card .custom-part-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }
.custom-part-result {
  margin-top:auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  border-top:1px solid #e2e8f0;
  padding-top:12px;
}
.custom-part-result small { color:#64748b; font-size:11px; font-weight:1000; text-transform:uppercase; }
.custom-part-result strong { color:#0f172a; font-size:20px; font-variant-numeric:tabular-nums; }
@media(max-width:1120px){ .custom-part-menu { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:760px){ .custom-part-menu { grid-template-columns:1fr; } .custom-settings-card .custom-part-fields { grid-template-columns:1fr; } }
@media(max-width:760px){ .custom-part-grid { grid-template-columns:1fr; } .custom-part-title { align-items:stretch; flex-direction:column; } }

/* Responsive genel uyum */
html, body { width:100%; max-width:100%; }
.sidebar { flex:0 0 clamp(220px,18vw,290px); width:clamp(220px,18vw,290px); min-width:0; height:100vh; overflow:hidden; }
.sidebar .footer-note { flex:0 0 auto; margin-top:auto; }
.sidebar .footer-note .user-footer { min-width:0; }
.main,.content { min-width:0; }
.content { padding:clamp(14px,1.6vw,28px); }
.topbar { padding:clamp(12px,1.4vw,18px) clamp(14px,1.8vw,28px); }
.table-shell { max-width:100%; overflow:auto !important; }
.sales-table { min-width:min(1120px,1000px); }
.brand-table,.stats-table { min-width:0; }
.quote-modal-layout { width:100%; grid-template-columns:minmax(640px,1fr) minmax(240px,300px) minmax(220px,260px); }
.quote-modal-layout .quote-paper { max-width:100%; }

@media(max-height:820px) and (min-width:901px){
  .sidebar .sidebar-logo { padding:8px 12px; }
  .sidebar .sidebar-logo img { margin-bottom:5px; }
  .app-logo-box { width:150px; height:58px; }
  .sidebar .sidebar-logo small { font-size:11px; line-height:1.25; }
  .sidebar .nav-title { padding:10px 20px 4px; font-size:10px; }
  .sidebar .nav-item { margin:2px 12px; padding:8px 11px; font-size:13px; }
  .sidebar .nav-toggle { margin:2px 20px 3px 30px; padding:7px 10px; }
  .sidebar .nav-sub-item { margin:2px 20px 2px 30px; padding:7px 10px; font-size:11px; }
  .sidebar .footer-note { padding:8px 14px; }
  .user-footer strong { max-width:112px; }
}

@media(max-height:740px) and (min-width:901px){
  .sidebar .sidebar-logo { padding:6px 10px; }
  .sidebar .sidebar-logo img { margin-bottom:3px; }
  .app-logo-box { width:128px; height:48px; }
  .sidebar .sidebar-logo small { display:none; }
  .sidebar .nav-title { padding:7px 18px 3px; font-size:9px; }
  .sidebar .nav-item { margin:1px 10px; padding:6px 9px; font-size:12px; border-radius:10px; }
  .sidebar .nav-toggle { margin:1px 18px 2px 26px; padding:6px 8px; font-size:11px; }
  .sidebar .nav-sub-item { margin:1px 18px 1px 26px; padding:6px 8px; font-size:10px; }
  .sidebar .footer-note { padding:6px 10px; }
  .user-footer { gap:6px; }
  .user-footer small { font-size:8px; }
  .user-footer strong { max-width:92px; font-size:11px; margin-top:1px; }
  .user-footer button { padding:6px 8px; }
}

@media(max-height:680px) and (min-width:901px){
  .sidebar .sidebar-logo { padding:5px 10px; }
  .app-logo-box { width:112px; height:42px; }
  .sidebar .nav-title { padding:5px 16px 2px; }
  .sidebar .nav-item { padding:5px 8px; font-size:11px; }
  .sidebar .nav-toggle { padding:5px 7px; font-size:10px; }
  .sidebar .nav-title.admin-only,
  .sidebar .nav-item.admin-only { display:none !important; }
  .sidebar .footer-note { padding:4px 8px; }
}

@media(max-width:1280px){
  .quick-grid,.stats,.home-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .dash-kpi-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .dash-board, body[data-theme="graphite"] .dash-board { grid-template-columns:1fr; }
  .machine-panel, body[data-theme="graphite"] .machine-panel { grid-column:auto; }
  .machine-showcase { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .home-hero,.home-split { grid-template-columns:1fr; }
  .quote-modal-layout { grid-template-columns:1fr; max-width:1120px; }
  .quote-side-panel,.quote-market-panel { position:static; min-height:0; max-height:none; }
  .quote-market-panel .market-content { max-height:260px; }
}

@media(max-width:900px){
  body { display:block; height:100dvh; min-height:100dvh; overflow:hidden; background:#eef4ff; }
  body.mobile-menu-open { overflow:hidden; }
  .mobile-menu-backdrop { position:fixed; inset:0; z-index:8999; background:rgba(15,23,42,.48); backdrop-filter:blur(2px); }
  body.mobile-menu-open .mobile-menu-backdrop { display:block; }
  .sidebar {
    position:fixed;
    top:0;
    left:0;
    bottom:0;
    z-index:9000;
    width:min(86vw,360px);
    height:100dvh;
    flex:none;
    max-height:none;
    overflow:auto;
    box-shadow:22px 0 55px rgba(15,23,42,.32);
    transform:translateX(-104%);
    transition:transform .22s ease;
    border-radius:0 22px 22px 0;
    padding-bottom:20px;
  }
  body.mobile-menu-open .sidebar { transform:translateX(0); }
  .sidebar .sidebar-logo { position:sticky; top:0; z-index:3; padding:14px 14px 12px; background:linear-gradient(180deg,rgba(15,23,42,.98),rgba(15,23,42,.88)); backdrop-filter:blur(12px); }
  .sidebar .sidebar-logo small { max-width:260px; }
  .mobile-drawer-close { display:inline-flex; align-items:center; justify-content:center; margin-top:12px; border:1px solid rgba(255,255,255,.16); border-radius:12px; padding:9px 12px; background:rgba(255,255,255,.10); color:white; font-weight:950; }
  .nav-title { padding:13px 16px 5px; }
  .nav-item,.sidebar .nav-item { margin:4px 10px; padding:12px 12px; min-height:44px; font-size:14px; }
  .nav-toggle,.sidebar .nav-toggle { margin:4px 10px; width:calc(100% - 20px); min-height:42px; }
  .nav-sub-item,.sidebar .nav-sub-item { margin:3px 14px 3px 22px; min-height:40px; }
  .sidebar .footer-note { padding:14px 12px 18px; }
  .main { height:100dvh; min-height:100dvh; overflow:hidden; padding-bottom:76px; }
  .topbar { position:sticky; top:0; z-index:20; display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; padding:12px 14px; border-radius:0 0 20px 20px; min-height:64px; }
  .rate-toggle { padding:9px 12px; border-radius:13px; }
  .title-area h1 { font-size:20px; }
  .title-area p { display:none; }
  .rate-panel { left:12px; top:58px; width:calc(100vw - 24px); }
  .rate-chip { flex:1 1 140px; justify-content:space-between; }
  .rate-chip input { width:74px; }
  .pill.cache { display:none; }
  .content { height:100%; overflow:auto; padding:12px 12px 92px; -webkit-overflow-scrolling:touch; }
  .toolbar,.stats-header,.home-section-head,.stats-detail-head { align-items:stretch; flex-direction:column; }
  .search { min-width:0; width:100%; }
  .quick-grid,.stats,.home-stats,.home-product-grid { grid-template-columns:1fr; }
  .dash-hero,.dash-kpi-grid,.machine-showcase,.machine-directory-grid { grid-template-columns:1fr; }
  .home-hero-copy { min-height:240px; padding:22px; background:linear-gradient(135deg,rgba(2,6,23,.94),rgba(0,84,166,.90)); }
  .home-hero-copy h2 { font-size:28px; }
  .stats-filter { align-items:stretch; }
  .stats-filter label,.stats-filter input,.range-btn,.sales-filter { width:100%; }
  .admin-users-layout,.admin-form,.permission-grid { grid-template-columns:1fr; }
  .admin-table-shell { max-height:300px; }
  .quote-head,.quote-title { padding:18px; flex-direction:column; }
  .quote-logo-box { width:100%; max-width:260px; flex-basis:auto; }
  .company-info { text-align:left; }
  .quote-summary { justify-content:stretch; }
  .quote-summary-box { min-width:0; width:100%; }
  .mobile-bottom-nav {
    position:fixed;
    left:10px;
    right:10px;
    bottom:10px;
    z-index:8500;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:6px;
    padding:8px;
    border:1px solid rgba(219,228,240,.95);
    border-radius:22px;
    background:rgba(255,255,255,.94);
    box-shadow:0 18px 42px rgba(15,23,42,.22);
    backdrop-filter:blur(16px);
  }
  .mobile-bottom-nav button {
    flex:1 1 0;
    min-width:0;
    min-height:48px;
    border:0;
    border-radius:16px;
    background:transparent;
    color:#475569;
    font-size:11px;
    font-weight:1000;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:7px 4px;
  }
  .mobile-bottom-nav button span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .mobile-bottom-nav button.active {
    color:white;
    background:linear-gradient(135deg,var(--blue),var(--cyan));
    box-shadow:0 10px 22px rgba(37,99,235,.28);
  }
  .table-shell { border-radius:16px; }
  table { font-size:12px; }
  th,td { padding:9px 8px; }
}

@media(max-width:560px){
  .title-area h1 { font-size:20px; }
  .title-area p { font-size:12px; }
  .pill,.btn,.side-mini-btn { padding:8px 10px; font-size:12px; }
  .table-shell table { min-width:720px; }
  .stats-table.compact { min-width:520px; }
  .quote-table { min-width:720px !important; }
  #quoteModal { padding:10px; }
  .quote-toolbar { justify-content:stretch; }
  .quote-toolbar .pill { flex:1 1 140px; }
  .quote-meta { grid-template-columns:1fr; width:100%; }
  .quote-profit-grid { grid-template-columns:1fr; }
  .login-card { padding:22px; border-radius:20px; }
}
