/* ============================================
   KeremKartTakip – Main Stylesheet
   Dark Glassmorphism Finance Theme
   ============================================ */

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

/* ── Variables ── */
:root {
  --bg-primary: #070B14;
  --bg-secondary: #0D1220;
  --bg-card: rgba(15, 22, 42, 0.85);
  --bg-card-hover: rgba(20, 30, 55, 0.9);
  --glass-border: rgba(0, 212, 255, 0.12);
  --glass-border-hover: rgba(0, 212, 255, 0.28);

  --cyan: #00D4FF;
  --cyan-dim: rgba(0, 212, 255, 0.15);
  --purple: #7B61FF;
  --purple-dim: rgba(123, 97, 255, 0.15);
  --green: #00FF9D;
  --green-dim: rgba(0, 255, 157, 0.12);
  --red: #FF4D6D;
  --red-dim: rgba(255, 77, 109, 0.12);
  --gold: #FFB347;
  --gold-dim: rgba(255, 179, 71, 0.12);
  --white: #E8EEFF;
  --white-dim: rgba(232, 238, 255, 0.6);
  --muted: rgba(232, 238, 255, 0.35);

  --font-display: 'Sora', sans-serif;
  --font-body: 'Inter', sans-serif;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-card: 0 8px 32px rgba(0,0,0,0.45), 0 0 0 1px var(--glass-border);
  --shadow-glow-cyan: 0 0 24px rgba(0,212,255,0.2);
  --shadow-glow-green: 0 0 24px rgba(0,255,157,0.2);
  --shadow-glow-red: 0 0 24px rgba(255,77,109,0.2);

  --transition: 0.22s cubic-bezier(0.4,0,0.2,1);
  --sidebar-w: 260px;
  --topbar-h: 66px;
}

[data-theme="light"] {
  --bg-primary: #F0F4FF;
  --bg-secondary: #E4ECFF;
  --bg-card: rgba(255,255,255,0.85);
  --bg-card-hover: rgba(255,255,255,0.97);
  --glass-border: rgba(100,130,255,0.18);
  --glass-border-hover: rgba(100,130,255,0.35);
  --white: #1A2040;
  --white-dim: rgba(26,32,64,0.65);
  --muted: rgba(26,32,64,0.4);
  --shadow-card: 0 8px 32px rgba(80,100,200,0.12), 0 0 0 1px var(--glass-border);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--white);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--cyan); }

/* ── Glass Card ── */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

/* ── Login Page ── */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  position: relative;
}

.bg-canvas {
  position: fixed; inset: 0; z-index: 0;
}
.bg-canvas canvas { width: 100%; height: 100%; }

.bg-orbs {
  position: fixed; inset: 0; overflow: hidden; pointer-events: none;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.2;
  animation: orbFloat 8s ease-in-out infinite;
}
.orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, var(--cyan), transparent);
  top: -200px; left: -100px;
  animation-delay: 0s;
}
.orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, var(--purple), transparent);
  bottom: -150px; right: -100px;
  animation-delay: 3s;
}
.orb-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, var(--green), transparent);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: 6s;
}
@keyframes orbFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-30px) scale(1.05); }
}

.login-wrapper {
  position: relative; z-index: 10;
  width: 100%; max-width: 420px;
  padding: 20px;
}

.login-card {
  padding: 44px 40px;
  text-align: center;
}

.login-logo { margin-bottom: 36px; }
.logo-icon {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: white;
  margin: 0 auto 14px;
  box-shadow: 0 8px 24px rgba(0,212,255,0.3);
}
.logo-text {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 700;
  letter-spacing: -0.5px;
}
.logo-main { color: var(--white); }
.logo-accent { color: var(--cyan); }
.logo-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  letter-spacing: 0.5px;
}

.login-form { text-align: left; }
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 12px; font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 8px;
}
.input-wrap {
  position: relative;
  display: flex; align-items: center;
}
.input-wrap > i:first-child {
  position: absolute; left: 14px;
  color: var(--muted); font-size: 14px;
  pointer-events: none;
}
.input-wrap input,
.input-wrap select {
  width: 100%;
  padding: 13px 14px 13px 40px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: var(--transition);
}
.input-wrap input::placeholder { color: var(--muted); }
.input-wrap input:focus,
.input-wrap select:focus {
  border-color: var(--cyan);
  background: rgba(0,212,255,0.05);
  box-shadow: 0 0 0 3px rgba(0,212,255,0.1);
}
.input-wrap select { cursor: pointer; }
.input-wrap select option { background: #0D1220; color: var(--white); }

.toggle-pw {
  position: absolute; right: 12px;
  background: none; border: none;
  color: var(--muted); cursor: pointer;
  padding: 4px; font-size: 13px;
  transition: color var(--transition);
}
.toggle-pw:hover { color: var(--cyan); }

.login-error {
  background: var(--red-dim);
  border: 1px solid rgba(255,77,109,0.3);
  border-radius: var(--radius-sm);
  color: var(--red);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.hidden { display: none !important; }

.btn-login {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: white;
  border: none; border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 15px; font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: var(--transition);
  box-shadow: 0 6px 20px rgba(0,212,255,0.3);
}
.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0,212,255,0.45);
}
.btn-login:active { transform: translateY(0); }

.login-footer {
  margin-top: 28px;
  font-size: 11px;
  color: var(--muted);
  opacity: 0.6;
}

/* ── Sidebar ── */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: rgba(7,11,20,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--glass-border);
  display: flex; flex-direction: column;
  z-index: 200;
  transition: transform var(--transition);
}

.sidebar-header {
  padding: 20px 20px 16px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--glass-border);
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-size: 18px; font-weight: 700;
  color: var(--white);
}
.logo-icon-sm {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: white;
  flex-shrink: 0;
}
.c-cyan { color: var(--cyan); }
.sidebar-close { display: none; background: none; border: none; color: var(--muted); cursor: pointer; font-size: 16px; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px;
}
.nav-section-label {
  font-size: 10px; font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 8px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--white-dim);
  text-decoration: none;
  font-size: 14px; font-weight: 500;
  transition: var(--transition);
  position: relative;
  margin-bottom: 2px;
}
.nav-item:hover {
  background: var(--cyan-dim);
  color: var(--cyan);
}
.nav-item.active {
  background: var(--cyan-dim);
  color: var(--cyan);
  border-left: 3px solid var(--cyan);
}
.nav-item > i:first-child { width: 18px; text-align: center; font-size: 15px; }
.nav-item span { flex: 1; }
.nav-badge {
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: white;
  font-size: 9px; font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}
.nav-logout:hover { background: var(--red-dim); color: var(--red); }

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--glass-border);
}
.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04);
}
.user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: white;
}
.user-info { display: flex; flex-direction: column; }
.user-name { font-size: 14px; font-weight: 600; color: var(--white); }
.user-role { font-size: 11px; color: var(--muted); }

/* ── App Layout ── */
.app-body { display: flex; }
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 199;
}
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex; flex-direction: column;
  transition: margin-left var(--transition);
}

/* ── Topbar ── */
.topbar {
  height: var(--topbar-h);
  background: rgba(7,11,20,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 100;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.menu-toggle {
  display: none;
  background: none; border: none;
  color: var(--white-dim); font-size: 18px; cursor: pointer;
  transition: color var(--transition);
}
.menu-toggle:hover { color: var(--cyan); }
.page-title h1 {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 700;
  color: var(--white);
  line-height: 1.2;
}
.page-title span {
  font-size: 12px; color: var(--muted);
}
.topbar-right { display: flex; align-items: center; gap: 12px; }

.month-selector {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 30px;
  padding: 6px 14px;
}
.month-selector button {
  background: none; border: none;
  color: var(--muted); cursor: pointer;
  font-size: 12px; padding: 0 2px;
  transition: color var(--transition);
}
.month-selector button:hover { color: var(--cyan); }
.month-selector span {
  font-size: 13px; font-weight: 600;
  color: var(--white); white-space: nowrap;
}

.btn-quick-add {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 18px;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: white;
  border: none; border-radius: 30px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 14px rgba(0,212,255,0.3);
}
.btn-quick-add:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,212,255,0.45);
}
.theme-toggle, .notif-btn {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  color: var(--white-dim);
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
  position: relative;
}
.theme-toggle:hover, .notif-btn:hover {
  background: var(--cyan-dim);
  color: var(--cyan);
  border-color: var(--cyan);
}
.notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--red);
  border-radius: 50%;
  border: 2px solid var(--bg-primary);
}

/* ── Page Content ── */
.page-content {
  flex: 1;
  padding: 28px;
  overflow-y: auto;
}

/* ── Modals ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-box {
  width: 100%; max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.25s ease;
}
.modal-sm { max-width: 400px; }
.modal-lg { max-width: 700px; }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--glass-border);
}
.modal-header h2 {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 700;
  display: flex; align-items: center; gap: 10px;
  color: var(--white);
}
.modal-header > button {
  background: none; border: none;
  color: var(--muted); font-size: 16px; cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: var(--transition);
}
.modal-header > button:hover { background: var(--red-dim); color: var(--red); }
.modal-body { padding: 24px; }
.modal-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--glass-border);
}

/* ── Form Grid ── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.full-width { grid-column: 1 / -1; }

/* ── Tab Group ── */
.tab-group {
  display: flex; gap: 4px;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 20px;
}
.tab-btn {
  flex: 1;
  padding: 8px;
  background: none; border: none;
  color: var(--white-dim);
  font-size: 13px; font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}
.tab-btn.active {
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: white;
  box-shadow: 0 2px 10px rgba(0,212,255,0.3);
}
.tab-btn:hover:not(.active) { background: rgba(255,255,255,0.07); color: var(--white); }

/* ── Buttons ── */
.btn-primary {
  padding: 10px 22px;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: white;
  border: none; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  transition: var(--transition);
  box-shadow: 0 4px 14px rgba(0,212,255,0.25);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,212,255,0.4); }

.btn-secondary {
  padding: 10px 22px;
  background: rgba(255,255,255,0.06);
  color: var(--white-dim);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.btn-secondary:hover { background: rgba(255,255,255,0.1); color: var(--white); }

.btn-danger {
  padding: 10px 22px;
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(255,77,109,0.3);
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-danger:hover { background: var(--red); color: white; }

.btn-icon {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: rgba(255,255,255,0.04);
  cursor: pointer;
  font-size: 13px;
  transition: var(--transition);
}
.btn-icon:hover { border-color: var(--cyan); color: var(--cyan); background: var(--cyan-dim); }
.btn-icon.btn-edit:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-dim); }
.btn-icon.btn-delete:hover { border-color: var(--red); color: var(--red); background: var(--red-dim); }

/* ── File Upload ── */
.file-upload-area {
  border: 2px dashed var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  color: var(--muted);
  font-size: 13px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.file-upload-area > i { font-size: 24px; }
.file-upload-area:hover { border-color: var(--cyan); color: var(--cyan); background: var(--cyan-dim); }
.receipt-preview {
  margin-top: 10px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.receipt-preview img { width: 100%; border-radius: var(--radius-sm); }
.optional { font-size: 11px; color: var(--muted); font-weight: 400; }

/* ── Toast ── */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  min-width: 260px; max-width: 380px;
  animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
  pointer-events: all;
  font-size: 14px;
  color: var(--white);
}
.toast-success { border-color: rgba(0,255,157,0.3); }
.toast-success .toast-icon { color: var(--green); }
.toast-error { border-color: rgba(255,77,109,0.3); }
.toast-error .toast-icon { color: var(--red); }
.toast-info { border-color: rgba(0,212,255,0.3); }
.toast-info .toast-icon { color: var(--cyan); }
.toast-icon { font-size: 18px; flex-shrink: 0; }

@keyframes slideInRight { from { transform: translateX(80px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; transform: translateX(30px); } }

/* ── Badge / Tag ── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.badge-green { background: var(--green-dim); color: var(--green); border: 1px solid rgba(0,255,157,0.2); }
.badge-red { background: var(--red-dim); color: var(--red); border: 1px solid rgba(255,77,109,0.2); }
.badge-cyan { background: var(--cyan-dim); color: var(--cyan); border: 1px solid rgba(0,212,255,0.2); }
.badge-gold { background: var(--gold-dim); color: var(--gold); border: 1px solid rgba(255,179,71,0.2); }
.badge-purple { background: var(--purple-dim); color: var(--purple); border: 1px solid rgba(123,97,255,0.2); }

/* ── Color Utilities ── */
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-cyan { color: var(--cyan); }
.text-gold { color: var(--gold); }
.text-purple { color: var(--purple); }
.text-muted { color: var(--muted); }

/* ── Responsive ── */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-close { display: flex; }
  .sidebar-overlay.show { display: block; }
  .main-wrapper { margin-left: 0 !important; }
  .menu-toggle { display: flex; }
  .topbar { padding: 0 16px; }
  .topbar-right .btn-quick-add span { display: none; }
  .page-content { padding: 16px; }
}
@media (max-width: 600px) {
  .month-selector { display: none; }
  .login-card { padding: 32px 22px; }
  .form-grid { grid-template-columns: 1fr; }
}
