/* ===========================
   HesapBende.Net – Design System
   Deep Navy Corporate Theme
   =========================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #505b68;
  --primary-container: #505b68;
  --on-primary: #ffffff;
  --secondary: #8abda2;
  --surface: #f4f5f7;
  --surface-container: #ffffff;
  --surface-container-low: #f9fafb;
  --surface-container-high: #e2e8f0;
  --on-surface: #1f2937;
  --on-surface-variant: #4b5563;
  --outline: #94a3b8;
  --outline-variant: #e2e8f0;
  --error: #ba1a1a;
  --error-container: #ffdad6;
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --info: #3b82f6;
  --info-light: #dbeafe;
  --sidebar-width: 260px;
  --topbar-height: 72px;
  --radius-sm: 4px;
  --radius: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.10), 0 10px 10px -5px rgba(0,0,0,0.04);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--on-surface);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

.app-container {
  display: flex;
  width: 100%;
  height: calc(100vh - 24px);
  background: var(--surface);
  border-radius: 32px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}

/* ─── SIDEBAR ─────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  height: 100%;
  background: var(--primary-container);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 100;
  box-shadow: 4px 0 24px rgba(0,0,0,0.06);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.logo-mark {
  width: 38px; height: 38px;
  background: rgba(255,255,255,0.12);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.15);
}

.logo-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.logo-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  margin-top: 1px;
}

.sidebar-nav {
  flex: 1;
  padding: 4px 10px;
  overflow-y: auto;
  /* Modern Ince Scrollbar (Firefox) */
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}

/* Modern Ince Scrollbar (Chrome, Safari, Edge) */
.sidebar-nav::-webkit-scrollbar {
  width: 5px;
}
.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 10px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.3);
}

/* ─── GLOBAL SCROLLBAR ────────────────────── */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 6px;
  border: 2px solid var(--surface);
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.nav-section-label {
  font-size: 10.5px;
  font-weight: 700;
  color: rgba(255,255,255,0.35);
  padding: 5px 8px 2px;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px;
  border-radius: var(--radius);
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s ease;
  position: relative;
  margin-bottom: 1px;
  cursor: pointer;
}

.nav-item:hover {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.9);
}

.nav-item.active {
  background: rgba(255,255,255,0.12);
  color: #ffffff;
  font-weight: 600;
  border-radius: 12px;
}

.nav-icon { font-size: 18px !important; flex-shrink: 0; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 34px; height: 34px;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.user-name { font-size: 13px; font-weight: 600; color: #fff; }
.user-role { font-size: 11px; color: rgba(255,255,255,0.4); }

/* ─── MAIN WRAPPER ────────────────────────── */
.main-wrapper {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
}

/* ─── TOPBAR ──────────────────────────────── */
.topbar {
  height: auto;
  min-height: 88px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 40px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left {}
.page-title { font-size: 20px; font-weight: 700; color: var(--primary-container); letter-spacing: -0.01em; }
.page-subtitle { font-size: 12px; color: var(--outline); margin-top: 1px; }
.topbar-right { display: flex; gap: 10px; align-items: center; }

/* ─── PAGE CONTENT ────────────────────────── */
.page-content { 
  flex: 1; 
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.page { display: none; }
.page.active { 
  display: flex; 
  flex-direction: column; 

  position: absolute;
  top: 0;
  left: 40px;
  right: 40px;
  bottom: 40px;
  overflow-y: auto; 
}

/* ─── STAT CARDS ──────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border: none;
  border-radius: 24px;
  padding: 16px 20px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

.stat-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--on-surface-variant);
  margin-bottom: 4px;
  margin-top: 12px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--primary-container);
  letter-spacing: -0.02em;
  line-height: 1;
}

.stat-sub {
  font-size: 12px;
  color: var(--outline);
  margin-top: 6px;
}

.stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 8px;
}

.badge-success { background: var(--success-light); color: #065f46; }
.badge-danger  { background: var(--error-container); color: #93000a; }
.badge-warning { background: var(--warning-light); color: #92400e; }
.badge-info    { background: var(--info-light); color: #1e40af; }
.badge-neutral { background: var(--surface-container-high); color: var(--on-surface-variant); }

/* ─── CARD ────────────────────────────────── */
.card {
  background: #fff;
  border: none;
  border-radius: 24px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 16px;
  border-bottom: none;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary-container);
}

.card-body { padding: 20px; }

/* ─── TABLE ───────────────────────────────── */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th {
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--outline);
  padding: 12px 24px;
  border-bottom: 2px solid var(--surface-container-high);
  background: #fff;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
}

td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--surface-container-low);
  color: var(--on-surface);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-container-low); }

.td-mono {
  font-family: 'Inter', monospace;
  font-weight: 500;
  font-size: 12px;
  white-space: nowrap !important;
  min-width: 110px;
}

.col-amount {
  text-align: right !important;
  white-space: nowrap !important;
  min-width: 130px;
}

/* ─── COMPACT TABLES FOR POPUPS ───────────── */
.table-sm th, .table-sm td {
  padding: 10px 14px !important;
  font-size: 12.5px !important;
}

/* ─── TRANSACTIONS LIST TABLE ───────────── */
.table-tx th, .table-tx td {
  padding: 8px 12px !important;
  font-size: 12.5px !important;
}
.sortable {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s;
}
.sortable:hover {
  background-color: var(--surface-container-high);
}

/* ─── FIT SCREEN CARD (For Lists) ─────────── */
.fit-screen-card {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  margin-bottom: 0 !important;
}

.fit-screen-card .table-wrap {
  flex: 1;
  overflow-y: auto;
}

/* ─── STATUS CHIPS ────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.chip-sales-invoice   { background: #dbeafe; color: #1e40af; }
.chip-sales-payment   { background: var(--success-light); color: #065f46; }
.chip-purchase-invoice{ background: var(--warning-light); color: #92400e; }
.chip-purchase-payment{ background: #ede9fe; color: #5b21b6; }

/* ─── BUTTONS ─────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary-container);
  color: #fff;
}
.btn-primary:hover { background: var(--primary); box-shadow: var(--shadow); }

.btn-secondary {
  background: #fff;
  color: var(--primary-container);
  border: 1.5px solid var(--outline-variant);
}
.btn-secondary:hover { background: var(--surface-container-low); border-color: var(--outline); }

.btn-danger {
  background: var(--error-container);
  color: var(--error);
  border: 1.5px solid #f9c0bb;
}
.btn-danger:hover { background: #fdc8c4; }

.btn-success {
  background: var(--success-light);
  color: #065f46;
}
.btn-success:hover { background: #a7f3d0; }

.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-icon { padding: 7px; border-radius: var(--radius-sm); }

/* ─── FORM ELEMENTS ───────────────────────── */
.form-group { margin-bottom: 16px; }

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--on-surface-variant);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

input, select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--outline-variant);
  border-radius: var(--radius);
  font-size: 13.5px;
  font-family: 'Inter', sans-serif;
  color: var(--on-surface);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
  appearance: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary-container);
  box-shadow: 0 0 0 3px rgba(30, 41, 59, 0.08);
}

input[type="file"] {
  padding: 8px;
  background: var(--surface-container-low);
  cursor: pointer;
}

select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2375777d' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; }

textarea { resize: vertical; min-height: 80px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ─── SEARCH ──────────────────────────────── */
.search-box {
  position: relative;
}
.search-box input {
  padding-left: 36px;
}
.search-box .material-icons {
  position: absolute;
  left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--outline);
  font-size: 18px !important;
  pointer-events: none;
}

/* ─── TOOLBAR ─────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.toolbar-left { display: flex; gap: 10px; flex-wrap: wrap; }
.toolbar-right { display: flex; gap: 8px; }

/* ─── MODAL ───────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.hidden { display: none; }

.modal-box {
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.2s ease;
}

.pdf-export-container {
  background: white;
  padding: 30px;
  border-radius: 8px;
}
.pdf-export-container .table-wrap {
  border: none;
  box-shadow: none;
}
.pdf-export-container table {
  border-collapse: collapse;
}
.pdf-export-container th, .pdf-export-container td {
  border-bottom: 1px solid #edf2f7;
  padding: 10px;
}

.modal-box.modal-lg { max-width: 1060px; }

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(-8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--outline-variant);
}

.modal-title { font-size: 17px; font-weight: 700; color: var(--primary-container); }

.modal-close {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  border: none; background: var(--surface-container);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--outline);
  transition: background 0.15s;
}
.modal-close:hover { background: var(--surface-container-high); }
.modal-close .material-icons { font-size: 18px !important; }

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--outline-variant);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ─── KDV HESAP KUTUSU ────────────────────── */
.vat-calc-box {
  background: var(--surface-container-low);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-top: 4px;
}

.vat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 13px;
  color: var(--on-surface-variant);
}

.vat-row.total {
  border-top: 1px solid var(--outline-variant);
  margin-top: 6px;
  padding-top: 10px;
  font-weight: 700;
  color: var(--on-surface);
  font-size: 14px;
}

/* ─── CHART AREA ──────────────────────────── */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.chart-card {
  background: #fff;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.chart-card canvas { max-height: 220px; }

/* ─── TOAST ───────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--primary-container);
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  min-width: 260px;
  animation: toastIn 0.25s ease;
}

.toast.error { background: var(--error); }
.toast.success { background: #065f46; }
.toast.warning { background: #92400e; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ─── EMPTY STATE ─────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--outline);
  text-align: center;
}

.empty-state .material-icons { font-size: 48px !important; margin-bottom: 12px; opacity: 0.4; }
.empty-state h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; color: var(--on-surface-variant); }
.empty-state p { font-size: 13px; }

/* ─── ENTITY DETAIL ───────────────────────── */
.entity-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--primary-container);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  color: #fff;
}

.entity-avatar {
  width: 52px; height: 52px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.2);
}

.entity-name { font-size: 20px; font-weight: 700; }
.entity-meta { font-size: 13px; opacity: 0.7; margin-top: 3px; }
.entity-balance { margin-left: auto; text-align: right; }
.entity-balance-label { font-size: 11px; opacity: 0.6; text-transform: uppercase; letter-spacing: 0.05em; }
.entity-balance-value { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }

/* ─── SECTION TITLE ───────────────────────── */
.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-container);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ─── RESPONSIVE ──────────────────────────── */
@media (max-width: 768px) {

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
  z-index: 9998;
}
.sidebar-overlay.active {
  display: block;
}

  .sidebar { 
    position: fixed; 
    z-index: 9999;
    top: 0; 
    left: 0; 
    height: 100vh; 
    transform: translateX(-100%); 
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    box-shadow: 10px 0 30px rgba(0,0,0,0.5); 
  }
  .sidebar.open { transform: translateX(0); }
  #mobile-menu-btn { display: flex !important; }
  .main-wrapper { margin-left: 0; }
  .chart-grid { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .page-content { padding: 0; }
  .page.active {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }
  .topbar { flex-wrap: wrap; padding: 16px; padding-bottom: 50px; position: relative; }
  #exchange-rates-container {
    position: absolute !important;
    bottom: 8px;
    left: 16px;
    right: 16px;
    width: auto !important;
    justify-content: space-between;
  }
  .stat-grid { grid-template-columns: 1fr !important; }
  .dash-main-grid { grid-template-columns: 1fr !important; }
  .dash-bottom-grid { grid-template-columns: 1fr !important; }
}

/* ─── LOADING ─────────────────────────────── */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--outline-variant);
  border-top-color: var(--primary-container);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── BALANCE COLORS ──────────────────────── */
.balance-positive { color: #065f46; font-weight: 600; }
.balance-negative { color: var(--error); font-weight: 600; }
.balance-zero     { color: var(--outline); }

/* ─── PDF LINK ────────────────────────────── */
.pdf-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--info);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--info-light);
  transition: background 0.15s;
}
.pdf-link:hover { background: #bfdbfe; }

/* ─── FILTER BAR ──────────────────────────── */
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: flex-end;
}

.filter-bar .form-group {
  margin-bottom: 0;
  min-width: 140px;
}

/* ─── KDV RAPOR PANEL ─────────────────────── */
.vat-report-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.vat-section {
  background: #fff;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.vat-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--outline-variant);
}

.vat-section-title.sales { color: #1e40af; }
.vat-section-title.purchase { color: #92400e; }

/* ─── RECURRING REMINDERS (NEW) ────────────── */
.recurring-banner {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-left: 4px solid var(--warning);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.banner-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.banner-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-variant);
  color: var(--on-surface-variant);
}

.banner-text h4 {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
}

.banner-text p {
  font-size: 12px;
  color: #64748b;
}

.banner-btn {
  background: #fff;
  border: 1px solid #e2e8f0;
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.banner-btn:hover {
  background: #f8fafc;
  border-color: var(--warning);
  color: var(--warning);
}

.recurring-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.summary-box {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
}

.summary-box.done { background: #f0fdf4; border-color: #bbf7d0; }
.summary-box.pending { background: #fffcf0; border-color: #fef3c7; }

.summary-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  font-size: 13px;
}

.summary-item:last-child { border: none; }
ion-title.purchase { color: #92400e; }

.vat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px dashed var(--outline-variant);
}

.vat-item:last-child { border-bottom: none; }
.vat-item-label { color: var(--on-surface-variant); }
.vat-item-value { font-weight: 600; font-variant-numeric: tabular-nums; }

.vat-result-box {
  background: var(--primary-container);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ─── RECURRING TRANSACTIONS ──────────────── */
.recurring-reminder-card {
  border-left: 4px solid var(--info) !important;
}

.pending-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pending-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface-container-low);
  border-radius: var(--radius-md);
  border: 1px solid var(--outline-variant);
  transition: all 0.2s ease;
}

.pending-item:hover {
  background: #fff;
  border-color: var(--info);
  box-shadow: var(--shadow-sm);
}

.pending-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pending-item-name {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--on-surface);
}

.pending-item-meta {
  font-size: 11px;
  color: var(--outline);
}

.pending-item-amount {
  font-weight: 700;
  font-size: 14px;
  color: var(--primary-container);
  font-variant-numeric: tabular-nums;
}

.pending-item-actions {
  display: flex;
  gap: 8px;
}

.reminder-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--error);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* ─── UTILITY CLASSES ────────────────────── */
.hidden { display: none !important; }
.flex { display: flex !important; }
.flex-col { flex-direction: column !important; }
.items-center { align-items: center !important; }
.justify-between { justify-content: space-between !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.w-full { width: 100% !important; }
.font-bold { font-weight: 700 !important; }
.font-semibold { font-weight: 600 !important; }
.important-footer {
  margin-top: 40px;
  padding: 15px 0;
  border-top: 1px solid #e2e8f0;
  font-size: 11px !important;
  color: #94a3b8 !important;
  text-align: center;
  width: 100%;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

@media print {
  .no-print { display: none !important; }
  
  /* Repeat headers on every page */
  thead { display: table-header-group; }
  tfoot { display: table-footer-group; }
  
  /* Avoid breaking a row across pages */
  tr { page-break-inside: avoid; }
  
  /* Ensure colors are printed */
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  
  body { background: #fff !important; }
  .app-container { box-shadow: none !important; border-radius: 0 !important; }
}

/* Ensure thead is always treated as header group for exports */
thead { display: table-header-group; }
/* ─── SETTINGS TABS ───────────────────────── */
.settings-tab-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.settings-tab-btn .material-icons {
  font-size: 20px;
}

.settings-tab-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.settings-tab-btn.active {
  background: #1e293b;
  color: white;
  box-shadow: 0 4px 12px rgba(30, 41, 59, 0.2);
}

.settings-tab-content.hidden {
  display: none;
}

.settings-tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

input[type="checkbox"] {
  appearance: auto;
  width: auto;
  padding: 0;
  cursor: pointer;
}

/* =========================================
   GÖRÜNTÜLEYİCİ ROLÜ (VIEWER) KISITLAMALARI
   ========================================= */
body.role-viewer .action-edit,
body.role-viewer .action-delete,
body.role-viewer .action-add,
body.role-viewer button[onclick*="delete"],
body.role-viewer button[onclick*="openForm"],
body.role-viewer button[onclick*="openTransactionForm"],
body.role-viewer button[onclick*="deleteTransaction"],
body.role-viewer button[onclick*="Transactions.openForm"],
body.role-viewer button[onclick*="Suppliers.openForm"],
body.role-viewer button[onclick*="Partners.openForm"],
body.role-viewer button[onclick*="Items.openForm"],
body.role-viewer button[onclick*="Settings.save"],
body.role-viewer button[onclick*="Accounts.openForm"],
body.role-viewer button[onclick*="addExpense"],
body.role-viewer button[onclick*="deleteExpense"],
body.role-viewer button[onclick*="Recurring.openForm"],
body.role-viewer button[onclick*="Recurring.delete"],
body.role-viewer button[onclick*="Users.openForm"],
body.role-viewer button[onclick*="Users.delete"],
body.role-viewer #btn-add-customer,
body.role-viewer #btn-add-supplier,
body.role-viewer #btn-add-partner,
body.role-viewer #btn-add-item,
body.role-viewer #btn-add-transaction,
body.role-viewer #btn-add-account,
body.role-viewer #add-expense-btn,
body.role-viewer #btn-add-recurring {
  display: none !important;
}

/* =========================================
   EMPTY STATE (BOŞ DURUM) TASARIMI
   ========================================= */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px dashed var(--outline);
  margin: 20px 0;
}
.empty-state-icon {
  font-size: 64px;
  color: var(--outline);
  margin-bottom: 16px;
  background: var(--surface-variant);
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.empty-state h3 {
  font-size: 18px;
  color: var(--on-surface);
  margin-bottom: 8px;
  font-weight: 600;
}
.empty-state p {
  font-size: 14px;
  color: var(--on-surface-variant);
  margin-bottom: 24px;
  max-width: 400px;
}

/* Tom Select Bug Fix for Single Select Inputs Wrapping */
.ts-wrapper.single.full .ts-control > input {
  display: none !important;
}
.ts-wrapper.single .ts-control {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center;
}
.ts-wrapper.single .ts-control .item {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
