/* ============================================
   HesapBende.Net — KIRACI Modülü Design System
   ============================================ */

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

:root {
  --primary: #0f172a;
  --primary-hover: #1e293b;
  --primary-light: rgba(15, 23, 42, 0.15);
  --accent: #10b981;
  --bg: #f8fafc;
  --sidebar-bg: #0f172a;
  --sidebar-width: 260px;
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-700: #334155;
  --gray-900: #1e293b;
  --success: #10b981;
  --success-light: rgba(16,185,129,0.1);
  --danger: #ef4444;
  --danger-light: rgba(239,68,68,0.1);
  --warning: #f59e0b;
  --warning-light: rgba(245,158,11,0.1);
  --info: #3b82f6;
  --info-light: rgba(59,130,246,0.1);
  --shadow-sm: 0 1px 3px rgba(15,23,42,0.05), 0 10px 15px -3px rgba(15,23,42,0.03);
  --shadow: 0 4px 12px rgba(15,23,42,0.08);
  --shadow-lg: 0 20px 25px -5px rgba(15,23,42,0.08);
  --radius: 16px;
  --radius-sm: 8px;
  --radius-lg: 24px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--gray-900); display: flex; height: 100vh; overflow: hidden; }

/* ─── SIDEBAR ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 4px 0 20px rgba(0,0,0,0.15);
}
.sidebar-logo {
  padding: 24px 20px 16px;
  display: flex; flex-direction: column; align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo img { max-width: 120px; filter: brightness(0) invert(1); margin-bottom: 8px; }
.sidebar-logo-name { color: #fff; font-size: 14px; font-weight: 700; }
.sidebar-module-badge {
  margin-top: 6px; padding: 3px 12px;
  background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.3);
  color: #10b981; border-radius: 100px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
}
.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.nav-section-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  color: rgba(255,255,255,0.3); padding: 12px 8px 6px; text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px; color: rgba(255,255,255,0.6);
  text-decoration: none; font-size: 14px; font-weight: 500; cursor: pointer;
  transition: all 0.15s; margin-bottom: 2px;
}
.nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-item.active { background: rgba(16,185,129,0.2); color: #10b981; }
.nav-item .nav-icon { font-size: 20px; }
.sidebar-footer {
  padding: 16px; border-top: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.15);
}
.sidebar-user { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 38px; height: 38px; border-radius: 10px;
  background: rgba(15, 23, 42, 0.3); color: #e2e8f0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
  border: 1px solid rgba(15, 23, 42, 0.4);
}
.user-name { color: #fff; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-company { color: rgba(255,255,255,0.4); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trial-info {
  margin-top: 12px; font-size: 11px; color: rgba(255,255,255,0.35);
  text-align: center; border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 10px; line-height: 1.4;
}
.trial-info strong { color: rgba(255,255,255,0.55); font-weight: 600; }
.logout-btn {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
  padding: 8px 12px; border-radius: 8px; cursor: pointer;
  color: rgba(252,165,165,0.8); font-size: 13px; font-weight: 500;
  background: rgba(239,68,68,0.08); border: none; width: 100%;
  transition: all 0.15s;
}
.logout-btn:hover { background: rgba(239,68,68,0.15); color: #fca5a5; }

/* ─── MAIN CONTENT ────────────────────────────────────────── */
.main-wrapper { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  height: 64px; background: #fff; border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; padding: 0 28px; gap: 16px;
  flex-shrink: 0; box-shadow: var(--shadow-sm);
}
.topbar-title { font-size: 18px; font-weight: 700; color: var(--gray-900); }
.topbar-sub { font-size: 13px; color: var(--gray-500); margin-top: 1px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.page-content { flex: 1; overflow-y: auto; padding: 28px; }

/* ─── PAGE ────────────────────────────────────────────────── */
.page { display: none; }
.page.active { display: block; }
.page-header { margin-bottom: 24px; display: flex; align-items: flex-end; justify-content: space-between; }
.page-header h1 { font-size: 22px; font-weight: 700; }
.page-header p { color: var(--gray-500); font-size: 14px; margin-top: 2px; }

/* ─── CARDS ───────────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: #fff; border-radius: var(--radius); padding: 20px 24px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--gray-100);
  display: flex; align-items: center; gap: 16px;
}
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.stat-value { font-size: 26px; font-weight: 700; line-height: 1; }
.stat-label { font-size: 12px; color: var(--gray-500); margin-top: 4px; }

/* ─── TABLES ──────────────────────────────────────────────── */
.table-wrap {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100); overflow: hidden;
}
.table-header {
  padding: 16px 20px; border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between;
}
.table-header h2 { font-size: 15px; font-weight: 700; }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px 16px; background: var(--gray-50); font-size: 11px; color: var(--gray-500); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; text-align: left; }
td { padding: 14px 16px; border-top: 1px solid var(--gray-100); font-size: 14px; }
tr:hover td { background: var(--gray-50); }

/* ─── BADGES ──────────────────────────────────────────────── */
.badge {
  padding: 4px 10px; border-radius: 100px; font-size: 11px; font-weight: 600;
  display: inline-block; white-space: nowrap;
}
.badge-green  { background: var(--success-light); color: var(--success); }
.badge-red    { background: var(--danger-light); color: var(--danger); }
.badge-yellow { background: var(--warning-light); color: var(--warning); }
.badge-blue   { background: var(--info-light); color: var(--info); }
.badge-purple { background: var(--primary-light); color: var(--primary); }
.badge-gray   { background: var(--gray-100); color: var(--gray-500); }

/* ─── BUTTONS ─────────────────────────────────────────────── */
.btn { padding: 10px 18px; border: none; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.15s; display: inline-flex; align-items: center; gap: 6px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-danger { background: var(--danger-light); color: var(--danger); }
.btn-danger:hover { background: rgba(239,68,68,0.2); }
.btn-success { background: var(--success-light); color: var(--success); }
.btn-success:hover { background: rgba(16,185,129,0.2); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn-icon-sm { width: 32px; height: 32px; padding: 0; border-radius: 8px; justify-content: center; }

/* ─── FORMS ───────────────────────────────────────────────── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); backdrop-filter: blur(4px); z-index: 1000; align-items: center; justify-content: center; }
.modal-overlay.active { display: flex; }
.modal { background: #fff; border-radius: var(--radius-lg); padding: 32px; width: 100%; max-width: 600px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-lg { max-width: 800px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.modal-header h2 { font-size: 18px; font-weight: 700; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--gray-400); font-size: 24px; line-height: 1; }
.modal-close:hover { color: var(--gray-700); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
label { font-size: 13px; font-weight: 500; color: var(--gray-700); }
input[type="text"], input[type="email"], input[type="number"], input[type="date"], input[type="tel"], select, textarea {
  padding: 10px 14px; border: 1.5px solid var(--gray-200); border-radius: 8px;
  font-size: 14px; outline: none; transition: border 0.15s; font-family: inherit;
  background: #fff; color: var(--gray-900);
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
textarea { min-height: 80px; resize: vertical; }
input[type="file"] { padding: 8px; border: 1.5px dashed var(--gray-200); border-radius: 8px; font-size: 13px; }
.section-divider { grid-column: 1 / -1; border: none; border-top: 1px solid var(--gray-100); margin: 4px 0; }
.section-label { grid-column: 1 / -1; font-size: 11px; font-weight: 700; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 4px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--gray-100); }

/* ─── EMPTY STATE ─────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--gray-400); }
.empty-state .material-icons { font-size: 48px; display: block; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ─── ALERTS ──────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.alert-warning { background: var(--warning-light); color: #92400e; border: 1px solid rgba(245,158,11,0.3); }
.alert-danger { background: var(--danger-light); color: #991b1b; border: 1px solid rgba(239,68,68,0.3); }

/* ─── LEDGER ──────────────────────────────────────────────── */
.ledger-balance { font-size: 28px; font-weight: 800; }
.ledger-balance.positive { color: var(--success); }
.ledger-balance.negative { color: var(--danger); }
.ledger-balance.zero { color: var(--gray-500); }

/* ─── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { display: none; }
}

/* ─── NEW STITCH UI ───────────────────────────────────────── */
.text-headline-md { font-size: 24px; line-height: 32px; font-weight: 600; }
.text-headline-lg { font-size: 32px; line-height: 40px; font-weight: 700; letter-spacing: -0.01em; }
.text-label-md { font-size: 14px; line-height: 20px; font-weight: 600; letter-spacing: 0.01em; }
.text-label-sm { font-size: 12px; line-height: 16px; font-weight: 600; }
.text-body-sm { font-size: 14px; line-height: 20px; font-weight: 400; }

.modern-stat-card {
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15,23,42,0.05), 0 10px 15px -3px rgba(15,23,42,0.03);
  border: 1px solid var(--gray-200);
  transition: transform 0.2s;
}
.modern-stat-card:hover { transform: translateY(-2px); }

.modern-icon-bg {
  padding: 8px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
}
.modern-pill {
  padding: 4px 8px; border-radius: 100px; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px;
}

.modern-section {
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  border: 1px solid var(--gray-200);
  box-shadow: 0 1px 3px rgba(15,23,42,0.05);
}

.modern-task-item {
  display: flex; gap: 16px; padding: 12px; border-radius: 8px; transition: background 0.2s;
  border: 1px solid transparent;
}
.modern-task-item:hover { background: var(--gray-50); border-color: var(--gray-200); }

.modern-table { width: 100%; border-collapse: collapse; }
.modern-table th { padding: 14px 16px; font-size: 14px; font-weight: 600; color: var(--gray-500); text-align: left; border-bottom: 1px solid var(--gray-200); background: var(--gray-50); }
.modern-table td { padding: 14px 16px; border-bottom: 1px solid var(--gray-100); }
.modern-table tr:last-child td { border-bottom: none; }
.modern-table tr:hover td { background: transparent; } /* row hover handled in td content or keep clean */

.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }

.search-input {
  width: 100%; background: var(--gray-100); border: none; border-radius: 100px; padding: 8px 16px 8px 40px; font-size: 14px; outline: none; transition: box-shadow 0.2s;
}
.search-input:focus { box-shadow: 0 0 0 2px rgba(16,185,129,0.2); }

.sidebar-new-nav { padding: 24px 16px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.nav-item-new {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 8px;
  color: var(--gray-500); font-weight: 600; font-size: 14px; text-decoration: none; transition: all 0.2s; cursor: pointer;
}
.nav-item-new:hover { background: var(--gray-100); color: var(--gray-900); }
.nav-item-new.active { background: rgba(16,185,129,0.15); color: var(--success); transform: scale(0.98); }

.topbar-new {
  height: 64px; background: #fff; border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px; position: sticky; top: 0; z-index: 40;
}
