/* =========================================================
   Epaş Ses · Tasarım Sistemi
   Renk Paleti, Tipografi, Bileşenler, Responsive
   ========================================================= */

:root {
  /* Brand */
  --primary: #00acff;
  --primary-dark: #0090d9;
  --primary-darker: #0077b8;
  --primary-light: #e6f7ff;
  --primary-soft: #f0faff;

  /* Neutrals */
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e5e9f2;
  --border-soft: #eef1f6;
  --text: #0f172a;
  --text-2: #334155;
  --text-muted: #64748b;
  --text-soft: #94a3b8;

  /* States */
  --success: #10b981;
  --success-soft: #ecfdf5;
  --warning: #f59e0b;
  --warning-soft: #fffbeb;
  --danger: #ef4444;
  --danger-soft: #fef2f2;
  --info: var(--primary);
  --info-soft: var(--primary-light);

  /* Effects */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 2px 8px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 6px 20px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
  --shadow-primary: 0 8px 24px rgba(0, 172, 255, 0.28);

  /* Radius */
  --radius-sm: 8px;
  --radius: 8px;
  --radius-md: 8px;
  --radius-lg: 8px;
  --radius-xl: 8px;
  --radius-pill: 999px;

  /* Layout */
  --sidebar-w: 264px;
  --sidebar-w-collapsed: 76px;
  --header-h: 68px;

  --transition: 180ms cubic-bezier(.4, 0, .2, 1);
}

/* Dark Mode */
[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #111a2b;
  --surface-2: #0f1827;
  --border: #1e293b;
  --border-soft: #182236;
  --text: #f1f5f9;
  --text-2: #cbd5e1;
  --text-muted: #94a3b8;
  --text-soft: #64748b;
  --primary-light: rgba(0, 172, 255, 0.15);
  --primary-soft: rgba(0, 172, 255, 0.08);
  --success-soft: rgba(16, 185, 129, 0.12);
  --warning-soft: rgba(245, 158, 11, 0.12);
  --danger-soft: rgba(239, 68, 68, 0.12);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
*::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
h4 { font-size: 15px; }

p { margin: 0; color: var(--text-2); }

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }

button { font-family: inherit; cursor: pointer; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-soft); }

/* =====================
   BOOT LOADER
   ===================== */
.boot {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 18px; background: var(--bg);
  z-index: 9999;
}
.boot__logo {
  animation: pulse 1.6s ease-in-out infinite;
}
.boot__spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.boot p { color: var(--text-muted); font-weight: 500; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

/* =====================
   LOGIN
   ===================== */
.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
}
.login__brand {
  position: relative;
  background: url('../../img/bg1.webp') center / cover no-repeat;
  color: white;
  padding: 60px;
  display: flex;
  flex-direction: column;
  background-position: left center;
  justify-content: space-between;
  overflow: hidden;
}
.login__brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgb(0 172 255 / 39%) 0%, rgb(0 87 129 / 27%) 50%, rgb(0 172 255 / 47%) 100%);
  pointer-events: none;
}
.login__logo {
  display: flex; align-items: center; gap: 12px;
  font-size: 22px; font-weight: 700;
  position: relative; z-index: 1;
}
.login__logo .logo-mark {
  width: 44px; height: 44px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  display: grid; place-items: center;
}
.login__hero {
  position: relative; z-index: 1;
}
.login__hero h1 {
  color: white;
  font-size: 36px;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}
.login__hero p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 16px;
  max-width: 460px;
  line-height: 1.6;
}
.login__features {
  position: relative; z-index: 1;
  display: grid; gap: 12px;
  margin-top: 28px;
}
.login__feature {
  display: flex; align-items: center; gap: 10px;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 500;
}
.login__feature svg { width: 18px; height: 18px; flex-shrink: 0; }
.login__copyright {
  position: relative; z-index: 1;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
}
.login__form-wrap {
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
}
.login__form {
  width: 100%; max-width: 420px;
}
.login__form h2 {
  font-size: 28px; font-weight: 700;
  margin-bottom: 6px;
}
.login__form .subtitle {
  color: var(--text-muted);
  margin-bottom: 32px;
}
.login__demo {
  background: var(--primary-soft);
  border: 1px dashed var(--primary);
  padding: 12px 14px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--text-2);
}
.login__demo strong { color: var(--primary-dark); }
.login__error {
  background: var(--danger-soft);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}
.login__error.show { display: block; }
.login__links {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px;
  margin: 12px 0 24px;
}
.login__links a { font-weight: 500; }
.login__form .checkbox-label { font-size: 13px; color: var(--text-2); }

@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .login__brand { padding: 32px; }
  .login__brand .login__hero h1 { font-size: 28px; }
  .login__brand .login__features { display: none; }
}
.login__copyright-link {
  color: var(--bg);
  text-decoration: none;
  font-weight: 500;
}
.login__copyright-link:hover {
  color: var(--primary-dark);
}

/* =====================
   APP SHELL
   ===================== */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  transition: grid-template-columns var(--transition);
}
.app-shell.collapsed {
  grid-template-columns: var(--sidebar-w-collapsed) 1fr;
}

/* SIDEBAR */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow: hidden;
  z-index: 50;
}
.sidebar__header {
  height: var(--header-h);
  padding: 0 22px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar__brand {
  display: flex; align-items: center; gap: 12px;
  font-weight: 700; font-size: 18px;
  color: var(--text);
  white-space: nowrap;
}
.sidebar__brand .logo-mark {
  width: 38px; height: 38px;
  background: var(--primary);
  border-radius: 10px;
  display: grid; place-items: center;
  color: white;
  flex-shrink: 0;
  box-shadow: var(--shadow-primary);
}
.sidebar__brand span small {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: -2px;
}
.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
}
.sidebar__group-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 14px 14px 8px;
}
.sidebar__item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  color: var(--text-2);
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 2px;
  position: relative;
  transition: all var(--transition);
  white-space: nowrap;
}
.sidebar__item:hover {
  background: var(--surface-2);
  color: var(--text);
}
.sidebar__item.active {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
}
.sidebar__item.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%; transform: translateY(-50%);
  width: 3px; height: 22px;
  background: var(--primary);
  border-radius: 0 4px 4px 0;
}
.sidebar__item svg {
  width: 20px; height: 20px;
  flex-shrink: 0;
  stroke-width: 2;
}
.sidebar__item .badge {
  margin-left: auto;
}
.sidebar__footer {
  padding: 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.app-shell.collapsed .sidebar__brand span,
.app-shell.collapsed .sidebar__item span,
.app-shell.collapsed .sidebar__item .badge,
.app-shell.collapsed .sidebar__group-label {
  display: none;
}
.app-shell.collapsed .sidebar__item {
  justify-content: center;
  padding: 10px;
}

/* Sidebar overlay sadece mobilde kullanılır; masaüstünde gizli olmalı */
.sidebar-overlay { display: none; }

/* HEADER */
.app-header {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  display: flex; align-items: center; gap: 16px;
  position: sticky; top: 0;
  z-index: 40;
}
.app-header__title h1 {
  font-size: 18px;
  font-weight: 600;
}
.app-header__title .breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.app-header__search {
  flex: 1;
  max-width: 420px;
  margin: 0 auto;
  position: relative;
}
.app-header__search input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: all var(--transition);
}
.app-header__search input:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.app-header__search svg {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--text-muted);
}
.app-header__actions {
  display: flex; align-items: center; gap: 8px;
  margin-left: auto;
}
.icon-btn {
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  display: grid; place-items: center;
  color: var(--text-2);
  position: relative;
  transition: all var(--transition);
}
.icon-btn:hover { background: var(--surface-2); color: var(--primary); border-color: var(--primary-light); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .dot {
  position: absolute; top: 8px; right: 9px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--surface);
}
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  transition: all var(--transition);
}
.user-chip:hover { background: var(--surface-2); }
.user-chip .avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-darker) 100%);
  display: grid; place-items: center;
  color: white; font-weight: 600; font-size: 13px;
}
.user-chip__info { line-height: 1.1; text-align: left; }
.user-chip__info b { font-size: 13px; font-weight: 600; display: block; color: var(--text); }
.user-chip__info small { font-size: 11px; color: var(--text-muted); }

/* MAIN */
.app-main {
  padding: 28px;
  min-height: calc(100vh - var(--header-h));
}
.page-toolbar {
  display: flex; align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}
.page-toolbar h2 {
  font-size: 22px; font-weight: 700;
}
.page-toolbar .spacer { flex: 1; }

/* =====================
   FORM
   ===================== */
.field {
  display: flex; flex-direction: column;
  gap: 6px;
}
.field > label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}
.field > label .required { color: var(--danger); }
.field .hint { font-size: 12px; color: var(--text-muted); }
.field .error-msg {
  font-size: 12px;
  color: var(--danger);
  font-weight: 500;
  display: none;
}
.field.has-error .error-msg { display: block; }
.field.has-error .input,
.field.has-error .select,
.field.has-error .textarea {
  border-color: var(--danger);
}

.input, .select, .textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: all var(--transition);
}
.input::placeholder, .textarea::placeholder { color: var(--text-soft); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.input:disabled, .select:disabled, .textarea:disabled {
  background: var(--surface-2);
  color: var(--text-muted);
}
.textarea { resize: vertical; min-height: 80px; }
.input--with-icon {
  padding-left: 40px;
}
.input-wrap {
  position: relative;
}
.input-wrap > svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}
.input-group {
  display: flex; align-items: stretch;
}
.input-group .input { border-radius: var(--radius) 0 0 var(--radius); border-right: none; }
.input-group .btn { border-radius: 0 var(--radius) var(--radius) 0; }

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-2);
}
.checkbox-label input[type="checkbox"] {
  appearance: none;
  width: 18px; height: 18px;
  border: 1.5px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  position: relative;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}
.checkbox-label input[type="checkbox"]:checked {
  background: var(--primary);
  border-color: var(--primary);
}
.checkbox-label input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px; top: 1px;
  width: 5px; height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.switch {
  position: relative;
  display: inline-block;
  width: 42px; height: 24px;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute; cursor: pointer;
  inset: 0;
  background: var(--border);
  border-radius: 24px;
  transition: var(--transition);
}
.switch span::before {
  content: '';
  position: absolute;
  height: 18px; width: 18px;
  left: 3px; top: 3px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::before { transform: translateX(18px); }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-full { grid-column: 1 / -1; }
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
}

/* =====================
   BUTTON
   ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: inherit;
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  user-select: none;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn--primary {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-primary);
}
.btn--primary:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(0, 172, 255, 0.36);
}
.btn--primary:active { transform: translateY(0); }
.btn--secondary {
  background: var(--surface);
  color: var(--text-2);
  border-color: var(--border);
}
.btn--secondary:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--text-soft);
}
.btn--ghost {
  background: transparent;
  color: var(--text-2);
}
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn--soft {
  background: var(--primary-light);
  color: var(--primary-dark);
}
.btn--soft:hover { background: var(--primary); color: white; }
.btn--danger {
  background: var(--danger);
  color: white;
}
.btn--danger:hover { background: #dc2626; }
.btn--danger-soft {
  background: var(--danger-soft);
  color: var(--danger);
}
.btn--success {
  background: var(--success);
  color: white;
}
.btn--block { width: 100%; }
.btn--sm { padding: 7px 12px; font-size: 12.5px; }
.btn--lg { padding: 13px 22px; font-size: 15px; }
.btn--icon { padding: 8px; width: 36px; height: 36px; }
.btn--icon.btn--sm { width: 30px; height: 30px; padding: 6px; }

.btn-group {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 4px;
  gap: 2px;
}
.btn-group button {
  border: none;
  background: transparent;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  transition: all var(--transition);
}
.btn-group button.active {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
}

/* =====================
   CARD
   ===================== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card__header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
}
.card__header h3 { font-size: 16px; }
.card__header .spacer { flex: 1; }
.card__body { padding: 22px; }
.card__footer {
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  display: flex; gap: 12px; align-items: center;
  justify-content: flex-end;
}

.card--flat { box-shadow: none; }
.card--hover {
  transition: all var(--transition);
}
.card--hover:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* =====================
   STAT CARDS (Dashboard)
   ===================== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex; gap: 16px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}
.stat:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat__icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.stat__icon svg { width: 22px; height: 22px; }
.stat__icon--primary { background: var(--primary-light); color: var(--primary); }
.stat__icon--success { background: var(--success-soft); color: var(--success); }
.stat__icon--warning { background: var(--warning-soft); color: var(--warning); }
.stat__icon--danger { background: var(--danger-soft); color: var(--danger); }
.stat__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stat__label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}
.stat__value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.stat__delta {
  font-size: 12px;
  font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
}
.stat__delta.up { color: var(--success); }
.stat__delta.down { color: var(--danger); }

/* =====================
   BADGE / CHIP
   ===================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
}
.badge--primary { background: var(--primary-light); color: var(--primary-dark); }
.badge--success { background: var(--success-soft); color: var(--success); }
.badge--warning { background: var(--warning-soft); color: var(--warning); }
.badge--danger { background: var(--danger-soft); color: var(--danger); }
.badge--neutral { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.badge--dot::before {
  content: ''; width: 6px; height: 6px;
  background: currentColor; border-radius: 50%;
}

/* =====================
   TABLE
   ===================== */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
}
.table thead th {
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky; top: 0;
}
.table tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-2);
  vertical-align: middle;
}
.table tbody tr:hover td { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody td b { color: var(--text); font-weight: 600; }
.table-actions {
  display: flex; gap: 6px;
  justify-content: flex-end;
}
.table-thumb {
  width: 40px; height: 40px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--surface-2);
  display: grid; place-items: center;
  color: var(--text-muted);
  flex-shrink: 0;
}
.table .cell-with-thumb {
  display: flex; align-items: center; gap: 12px;
}
.table .cell-with-thumb .info { display: flex; flex-direction: column; gap: 2px; }
.table .cell-with-thumb .info small { color: var(--text-muted); font-size: 11.5px; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
}
.empty-state__icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-muted);
  display: grid; place-items: center;
  margin: 0 auto 16px;
}
.empty-state__icon svg { width: 32px; height: 32px; }
.empty-state h3 { margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); margin-bottom: 20px; }

.table-toolbar {
  padding: 16px 22px;
  display: flex; gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
}
.table-toolbar .spacer { flex: 1; }
.table-toolbar .filters {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}

.pagination {
  padding: 14px 22px;
  display: flex; align-items: center; gap: 12px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.pagination .info { color: var(--text-muted); font-size: 13px; }
.pagination .spacer { flex: 1; }
.pagination-buttons {
  display: flex; gap: 4px;
}
.pagination-buttons button {
  min-width: 34px; height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  font-weight: 500;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--transition);
}
.pagination-buttons button:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}
.pagination-buttons button.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
.pagination-buttons button:disabled { opacity: 0.4; cursor: not-allowed; }

/* =====================
   MODAL
   ===================== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  display: grid; place-items: center;
  z-index: 200;
  padding: 20px;
  animation: fade-in 180ms ease;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: scale-in 180ms ease;
}
.modal--lg { max-width: 760px; }
.modal--xl { max-width: 960px; }
.modal__header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.modal__header h3 { flex: 1; font-size: 17px; }
.modal__close {
  width: 34px; height: 34px;
  border-radius: 8px;
  border: none;
  background: var(--surface-2);
  color: var(--text-2);
  display: grid; place-items: center;
  cursor: pointer;
  transition: all var(--transition);
}
.modal__close:hover { background: var(--danger-soft); color: var(--danger); }
.modal__close svg { width: 18px; height: 18px; }
.modal__body { padding: 24px; overflow-y: auto; flex: 1; }
.modal__footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  display: flex; gap: 10px; align-items: center; justify-content: flex-end;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes scale-in {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* =====================
   TOAST
   ===================== */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  display: flex; flex-direction: column-reverse;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex; align-items: flex-start; gap: 12px;
  min-width: 300px; max-width: 380px;
  box-shadow: var(--shadow-lg);
  animation: toast-in 240ms ease;
}
.toast.removing { animation: toast-out 200ms ease forwards; }
.toast__icon {
  width: 22px; height: 22px;
  flex-shrink: 0;
  display: grid; place-items: center;
}
.toast__icon svg { width: 20px; height: 20px; }
.toast__body { flex: 1; min-width: 0; }
.toast__body b { font-size: 14px; color: var(--text); display: block; margin-bottom: 2px; }
.toast__body p { font-size: 13px; color: var(--text-muted); }
.toast--success .toast__icon { color: var(--success); }
.toast--error .toast__icon { color: var(--danger); }
.toast--warning .toast__icon { color: var(--warning); }
.toast--info .toast__icon { color: var(--primary); }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateX(20px); }
}

/* =====================
   DROPDOWN
   ===================== */
.dropdown { position: relative; display: inline-block; }
.dropdown__menu {
  position: absolute;
  right: 0; top: calc(100% + 6px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  min-width: 200px;
  padding: 6px;
  z-index: 100;
  display: none;
  animation: fade-in 120ms ease;
}
.dropdown.open .dropdown__menu { display: block; }
/* Kart içindeki dropdown açıldığında menünün kart kenarından taşabilmesi için
   kırpmayı geçici olarak kaldır; menü komşu kartların üstünde görünsün. */
.card:has(.dropdown.open) { overflow: visible; position: relative; z-index: 5; }
.dropdown__item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--text-2);
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-weight: 500;
}
.dropdown__item:hover { background: var(--primary-light); color: var(--primary-dark); }
.dropdown__item svg { width: 16px; height: 16px; }
.dropdown__divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

/* =====================
   ARANABILIR SEÇİM KUTUSU (searchable select)
   Tıklayınca açılır: üstte arama, altta kayan liste.
   ===================== */
.ss { position: relative; }
.ss__trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  text-align: left; cursor: pointer;
}
.ss__trigger.is-placeholder { color: var(--text-muted); }
.ss__trigger svg { flex-shrink: 0; opacity: .55; }
.ss__panel {
  display: none;
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .14);
  z-index: 60;
  overflow: hidden;
}
.ss.open .ss__panel { display: block; }
.ss__search { padding: 8px; border-bottom: 1px solid var(--border); }
.ss__list { max-height: 240px; overflow-y: auto; padding: 6px; }
.ss__item {
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--text-2);
  cursor: pointer;
}
.ss__item:hover { background: var(--primary-light); color: var(--primary-dark); }
.ss__item.is-selected { font-weight: 600; color: var(--primary-dark); }
.ss__empty { padding: 12px; text-align: center; color: var(--text-muted); font-size: 13px; }
/* Panel açıkken kartın kırpmasını kaldır ki liste dışarı taşabilsin */
.card:has(.ss.open) { overflow: visible; position: relative; z-index: 5; }

/* =====================
   CHART CONTAINER
   ===================== */
.chart-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
  margin-bottom: 24px;
}
@media (max-width: 1100px) {
  .chart-grid { grid-template-columns: 1fr; }
}
.chart-wrap {
  position: relative;
  height: 320px;
}

/* =====================
   PRODUCT IMAGE UPLOADER
   ===================== */
.uploader {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-muted);
}
.uploader:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.uploader svg { width: 32px; height: 32px; margin-bottom: 8px; }
.uploader.has-image { padding: 8px; }
.uploader img { max-width: 100%; max-height: 200px; border-radius: 8px; }

/* =====================
   PROFILE / SETTINGS
   ===================== */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
  overflow-x: auto;
}
.tabs__item {
  padding: 11px 18px;
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  font-size: 14px;
  transition: all var(--transition);
}
.tabs__item:hover { color: var(--text); }
.tabs__item.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* =====================
   STOCK BAR
   ===================== */
.stock-bar {
  display: flex; align-items: center; gap: 10px;
}
.stock-bar__bar {
  flex: 1;
  height: 6px;
  background: var(--border-soft);
  border-radius: 3px;
  overflow: hidden;
  min-width: 80px; max-width: 140px;
}
.stock-bar__fill {
  height: 100%;
  border-radius: 3px;
  transition: width var(--transition);
}
.stock-bar__fill--ok { background: var(--success); }
.stock-bar__fill--warn { background: var(--warning); }
.stock-bar__fill--danger { background: var(--danger); }

/* =====================
   UTILS
   ===================== */
.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }
.mb-6 { margin-bottom: 24px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.text-muted { color: var(--text-muted); }
.text-soft { color: var(--text-soft); }
.text-sm { font-size: 12.5px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 18px; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* =====================
   MOBILE / RESPONSIVE
   ===================== */
.mobile-only { display: none; }

@media (max-width: 900px) {
  :root { --header-h: 60px; }
  .mobile-only { display: inline-flex; }
  .desktop-only { display: none !important; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 280px;
    transform: translateX(-100%);
    transition: transform var(--transition);
    box-shadow: var(--shadow-lg);
  }
  .app-shell.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 49;
  }
  .app-shell.sidebar-open .sidebar-overlay { display: block; }
  .app-main { padding: 18px; }
  .app-header { padding: 0 16px; }
  .app-header__search { display: none; }
  .user-chip__info { display: none; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat { padding: 16px; }
  .stat__value { font-size: 20px; }
  .stat__icon { width: 40px; height: 40px; }
  .login__form-wrap { padding: 24px 18px; }
}

@media (max-width: 520px) {
  .stat-grid { grid-template-columns: 1fr; }
  .table thead th, .table tbody td { padding: 10px 12px; font-size: 12.5px; }
  .modal__body { padding: 18px; }
  .modal__header, .modal__footer { padding: 14px 18px; }
}

/* Print styles for barcode/PDF */
@media print {
  body * { visibility: hidden; }
  .print-area, .print-area * { visibility: visible; }
  .print-area {
    position: absolute;
    left: 0; top: 0;
    width: 100%;
  }
}
