/* MudiPOS Cloud – Patron Paneli tasarım sistemi */
:root {
  --primary: #1677FF;
  --primary-hover: #0F69E8;
  --primary-active: #0958D9;
  --primary-soft: #EAF3FF;
  --primary-border: #B9D7FF;
  --navy: #10233F;
  --header: #0D2138;
  --background: #F4F7FB;
  --card: #FFFFFF;
  --text: #14213D;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --border: #E2E8F0;
  --divider: #EDF1F5;
  --hover-bg: #F1F6FD;
  --success: #22C55E; --success-soft: #DCFCE7; --success-text: #15803D;
  --warning: #F59E0B; --warning-soft: #FFF4D6; --warning-text: #B45309;
  --danger:  #EF4444; --danger-soft:  #FEECEC; --danger-text:  #DC2626;
  --purple:  #9333EA; --purple-soft:  #F3E8FF; --purple-text:  #7E22CE;
  --cyan:    #06B6D4; --cyan-soft:    #DFF9FC; --cyan-text:    #0E7490;
  --disabled: #CBD5E1;
  --radius-sm: 8px; --radius-md: 10px; --radius-lg: 12px; --radius-xl: 14px; --radius-2xl: 16px;
  --shadow-sm: 0 2px 8px rgba(15,23,42,.06);
  --shadow-md: 0 6px 18px rgba(15,23,42,.10);
  --shadow-modal: 0 20px 60px rgba(15,23,42,.18);
  /* geriye dönük alias */
  --bg: var(--background); --panel: var(--card); --panel-2: var(--hover-bg); --muted: var(--text-secondary);
  --brand: var(--primary); --ok: var(--success); --warn: var(--warning); --bad: var(--danger); --info: var(--cyan);
}
html.dark {
  --background: #0B1626; --card: #10233F; --hover-bg: #172D4F; --border: #22395C; --divider: #1B3050;
  --text: #E8EEF7; --text-secondary: #9FB0C8; --text-muted: #6F82A0;
  --primary-soft: rgba(22,119,255,.16);
  --success-soft: rgba(34,197,94,.16); --success-text: #4ADE80;
  --warning-soft: rgba(245,158,11,.16); --warning-text: #FBBF24;
  --danger-soft: rgba(239,68,68,.16); --danger-text: #F87171;
  --purple-soft: rgba(147,51,234,.16); --purple-text: #C084FC;
  --cyan-soft: rgba(6,182,212,.16); --cyan-text: #22D3EE;
  --shadow-sm: 0 2px 8px rgba(0,0,0,.35); --shadow-md: 0 6px 18px rgba(0,0,0,.45);
}

html, body { background: var(--background); color: var(--text); font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 14px; }
* { -webkit-tap-highlight-color: transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; } ::-webkit-scrollbar-thumb { background: var(--disabled); border-radius: 999px; } ::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
svg.lucide { width: 1.15em; height: 1.15em; stroke-width: 2; flex-shrink: 0; }
h1, h2, h3 { letter-spacing: -.01em; }

/* Kart */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-lg { border-radius: var(--radius-xl); }
.card-hover { transition: transform 150ms ease, box-shadow 150ms ease; cursor: pointer; }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.card-hover:active { transform: translateY(0); }

/* Modül kartı (ana menü) */
.module { min-height: 140px; display: flex; flex-direction: column; justify-content: space-between; padding: 20px; text-decoration: none; color: inherit; }
.module .ico { width: 48px; height: 48px; border-radius: var(--radius-md); display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.module .ico svg { width: 24px; height: 24px; }
.module h3 { font-size: 17px; font-weight: 700; margin-top: 16px; }
.module p { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

/* Badge / chip */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.4; }
.chip-muted { background: var(--hover-bg); color: var(--text-secondary); }
.chip-ok    { background: var(--success-soft); color: var(--success-text); }
.chip-warn  { background: var(--warning-soft); color: var(--warning-text); }
.chip-bad   { background: var(--danger-soft);  color: var(--danger-text); }
.chip-info  { background: var(--cyan-soft);    color: var(--cyan-text); }
.chip-brand { background: var(--primary-soft); color: var(--primary); }
.chip-purple{ background: var(--purple-soft);  color: var(--purple-text); }

/* Buton */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: var(--radius-md); font-weight: 600; font-size: 14px; transition: background 150ms ease, color 150ms ease; border: 1px solid transparent; cursor: pointer; white-space: nowrap; }
.btn-brand, .btn-primary { background: var(--primary); color: #fff; } .btn-primary:hover, .btn-brand:hover { background: var(--primary-hover); } .btn-primary:active, .btn-brand:active { background: var(--primary-active); }
.btn-secondary { background: var(--primary-soft); color: var(--primary); } .btn-secondary:hover { background: var(--primary-border); }
.btn-ghost { background: var(--card); color: var(--text); border-color: var(--border); } .btn-ghost:hover { background: var(--hover-bg); }
.btn-success { background: var(--success); color: #fff; } .btn-danger { background: var(--danger); color: #fff; }
.btn-icon { width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: var(--radius-md); background: transparent; color: var(--text-secondary); display: grid; place-items: center; border: 1px solid transparent; }
.btn-icon:hover { background: var(--hover-bg); color: var(--text); }
.btn-lg { min-height: 56px; font-size: 16px; }
.btn[disabled] { background: var(--disabled); color: #fff; pointer-events: none; }

/* Form */
.input { width: 100%; height: 48px; padding: 0 14px; border-radius: var(--radius-md); border: 1px solid #DDE5EF; background: var(--card); color: var(--text); outline: none; font-size: 14px; font-family: inherit; }
html.dark .input { border-color: var(--border); }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(22,119,255,.12); }
.label { display: block; font-size: 13px; font-weight: 600; color: #475569; margin-bottom: 6px; }
html.dark .label { color: var(--text-secondary); }

/* Segment kontrol */
.seg { display: flex; gap: 4px; padding: 4px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg a { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; color: var(--text-secondary); white-space: nowrap; transition: background 150ms ease; }
.seg a:hover { background: var(--hover-bg); }
.seg a.on { background: var(--primary); color: #fff; }

/* Header */
.topbar { position: sticky; top: 0; z-index: 50; height: 64px; background: var(--header); color: #fff; display: flex; align-items: center; gap: 12px; padding: 0 16px; }
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; letter-spacing: -.01em; }
.topbar .brand .mark { width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--primary); display: grid; place-items: center; }
.topbar .back { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: var(--radius-sm); background: rgba(255,255,255,.08); color: #fff; font-weight: 600; font-size: 13px; }
.topbar .back:hover { background: rgba(255,255,255,.14); }
.topbar .ibtn { width: 40px; height: 40px; border-radius: var(--radius-sm); display: grid; place-items: center; color: rgba(255,255,255,.85); background: rgba(255,255,255,.06); }
.topbar .ibtn:hover { background: rgba(255,255,255,.14); color: #fff; }
.topbar .online { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: rgba(255,255,255,.75); }
.topbar .online::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.topbar .online.off::before { background: var(--warning); }

/* Mobil alt tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--card); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 56px; font-size: 11px; font-weight: 600; color: var(--text-muted); }
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a.on { color: var(--primary); }

/* Tablo */
.table { width: 100%; font-size: 14px; border-collapse: separate; border-spacing: 0; }
.table th { position: sticky; top: 0; text-align: left; font-weight: 600; color: var(--text-secondary); font-size: 12px; padding: 0 12px; height: 44px; background: #F8FAFC; border-bottom: 1px solid var(--border); }
html.dark .table th { background: var(--hover-bg); }
.table td { padding: 0 12px; height: 52px; border-bottom: 1px solid var(--divider); }
.table tbody tr:hover td { background: #F8FBFF; } html.dark .table tbody tr:hover td { background: var(--hover-bg); }
.table tr:last-child td { border-bottom: 0; }

/* Liste satırı */
.row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 0; border-bottom: 1px solid var(--divider); }
.row:last-child { border-bottom: 0; }
.row .ico { width: 40px; height: 40px; border-radius: var(--radius-md); display: grid; place-items: center; background: var(--hover-bg); color: var(--text-secondary); flex-shrink: 0; }

.bar { height: 8px; border-radius: 999px; background: var(--divider); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--primary); }

.skeleton { background: linear-gradient(90deg, var(--divider) 25%, var(--card) 50%, var(--divider) 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--radius-sm); }
@keyframes sk { to { background-position: -200% 0; } }

.toast { position: fixed; top: 76px; right: 16px; z-index: 100; background: var(--navy); color: #fff; padding: 12px 16px; border-radius: var(--radius-md); box-shadow: var(--shadow-md); font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; animation: fade 150ms ease; }
@keyframes fade { from { opacity: 0; transform: translateY(-4px); } }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 90; display: none; align-items: center; justify-content: center; background: rgba(15,23,42,.45); padding: 16px; }
.modal.open { display: flex; animation: fade 120ms ease; }
.modal .box { width: 100%; max-width: 480px; background: var(--card); border-radius: var(--radius-lg); box-shadow: var(--shadow-modal); max-height: 90vh; display: flex; flex-direction: column; }
.modal .box.lg { max-width: 720px; }
.modal .m-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--divider); }
.modal .m-head h3 { font-size: 17px; font-weight: 700; }
.modal .m-body { padding: 20px; overflow-y: auto; }
.modal .m-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--divider); }
.modal .x { width: 36px; height: 36px; border-radius: var(--radius-sm); display: grid; place-items: center; color: var(--text-secondary); background: transparent; }
.modal .x:hover { background: var(--hover-bg); color: var(--text); }
