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

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

:root {
  --primary: #2563EB;
  --primary-hover: #1d4ed8;
  --green: #16a34a;
  --green-light: #f0fdf4;
  --red: #dc2626;
  --red-light: #fef2f2;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
}

/* LOGIN */
.login-container {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 1rem;
}
.login-box {
  background: #fff; padding: 2.5rem; border-radius: var(--radius);
  box-shadow: var(--shadow-md); width: 100%; max-width: 400px; text-align: center;
}
.login-box img { max-width: 180px; margin-bottom: 1.5rem; }
.login-box h1 { font-size: 1.5rem; margin-bottom: 0.5rem; color: var(--gray-900); }
.login-box p { color: var(--gray-500); margin-bottom: 1.5rem; font-size: 0.9rem; }

/* NAV */
nav {
  background: #fff; border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow); position: sticky; top: 0; z-index: 100;
}
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 1rem;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.nav-brand { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; }
.nav-brand img { height: 36px; }
.nav-brand span { font-weight: 700; font-size: 1.2rem; color: var(--gray-900); }
.nav-links { display: flex; gap: 0.25rem; align-items: center; }
.nav-links a {
  padding: 0.5rem 1rem; border-radius: var(--radius); text-decoration: none;
  color: var(--gray-600); font-size: 0.9rem; font-weight: 500; transition: all 0.15s;
}
.nav-links a:hover { background: var(--gray-100); color: var(--gray-900); }
.nav-links a.active { background: var(--primary); color: #fff; }
.nav-logout {
  background: none; border: 1px solid var(--gray-300); padding: 0.4rem 0.75rem;
  border-radius: var(--radius); color: var(--gray-600); cursor: pointer;
  font-size: 0.85rem; transition: all 0.15s;
}
.nav-logout:hover { border-color: var(--red); color: var(--red); }

/* HAMBURGER */
.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.hamburger span {
  display: block; width: 22px; height: 2px; background: var(--gray-700);
  margin: 5px 0; transition: all 0.3s;
}

/* MAIN */
.container { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1rem; }

/* CARDS */
.card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.5rem; margin-bottom: 1.5rem;
}
.card-title {
  font-size: 1.1rem; font-weight: 600; margin-bottom: 1rem;
  padding-bottom: 0.75rem; border-bottom: 1px solid var(--gray-200);
  color: var(--gray-900);
}

/* FORMS */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--gray-700); margin-bottom: 0.35rem; }
.form-control {
  width: 100%; padding: 0.6rem 0.75rem; border: 1px solid var(--gray-300);
  border-radius: var(--radius); font-size: 0.9rem; font-family: inherit;
  transition: border-color 0.15s; background: #fff; color: var(--gray-800);
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
select.form-control { appearance: auto; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

/* RADIO GROUP */
.radio-group { display: flex; gap: 0.5rem; }
.radio-option {
  flex: 1; position: relative;
}
.radio-option input { position: absolute; opacity: 0; }
.radio-option label {
  display: block; text-align: center; padding: 0.6rem 1rem;
  border: 2px solid var(--gray-300); border-radius: var(--radius);
  cursor: pointer; font-weight: 500; font-size: 0.9rem; transition: all 0.15s;
}
.radio-option input:checked + label.gelir-label {
  border-color: var(--green); background: var(--green-light); color: var(--green);
}
.radio-option input:checked + label.gider-label {
  border-color: var(--red); background: var(--red-light); color: var(--red);
}

/* BUTTONS */
.btn {
  padding: 0.6rem 1.25rem; border: none; border-radius: var(--radius);
  font-size: 0.9rem; font-weight: 500; cursor: pointer; font-family: inherit;
  transition: all 0.15s; display: inline-flex; align-items: center; gap: 0.4rem;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-outline {
  background: #fff; color: var(--gray-700); border: 1px solid var(--gray-300);
}
.btn-outline:hover { background: var(--gray-50); border-color: var(--gray-400); }
.btn-sm { padding: 0.35rem 0.65rem; font-size: 0.8rem; }
.btn-block { width: 100%; justify-content: center; }

/* TABLE */
.table-wrap { overflow-x: auto; }
table {
  width: 100%; border-collapse: collapse; font-size: 0.88rem;
}
th {
  background: var(--gray-100); padding: 0.65rem 0.75rem; text-align: left;
  font-weight: 600; color: var(--gray-600); font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.03em;
  border-bottom: 2px solid var(--gray-200);
}
td {
  padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--gray-100);
}
tr:nth-child(even) { background: var(--gray-50); }
tr:hover { background: var(--gray-100); }
.type-gelir { color: var(--green); font-weight: 600; }
.type-gider { color: var(--red); font-weight: 600; }
.amount-cell { font-weight: 600; text-align: right; white-space: nowrap; }
.actions-cell { white-space: nowrap; }
.actions-cell button {
  background: none; border: none; cursor: pointer; padding: 0.25rem 0.4rem;
  font-size: 1rem; border-radius: 4px; transition: background 0.15s;
}
.actions-cell button:hover { background: var(--gray-200); }

/* SUMMARY */
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.summary-card {
  padding: 1rem 1.25rem; border-radius: var(--radius); border: 1px solid var(--gray-200);
  text-align: center;
}
.summary-card .label { font-size: 0.8rem; color: var(--gray-500); margin-bottom: 0.25rem; }
.summary-card .value { font-size: 1.4rem; font-weight: 700; }
.summary-card.gelir { border-color: var(--green); background: var(--green-light); }
.summary-card.gelir .value { color: var(--green); }
.summary-card.gider { border-color: var(--red); background: var(--red-light); }
.summary-card.gider .value { color: var(--red); }
.summary-card.net .value.positive { color: var(--green); }
.summary-card.net .value.negative { color: var(--red); }

/* MONTH PICKER */
.month-picker {
  display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: 1rem; flex-wrap: wrap;
}
.month-picker select, .month-picker input {
  padding: 0.5rem 0.75rem; border: 1px solid var(--gray-300);
  border-radius: var(--radius); font-family: inherit; font-size: 0.9rem;
}

/* BADGE */
.badge {
  display: inline-block; padding: 0.15rem 0.5rem; border-radius: 999px;
  font-size: 0.75rem; font-weight: 500;
}
.badge-active { background: var(--green-light); color: var(--green); }
.badge-inactive { background: var(--gray-100); color: var(--gray-500); }
.badge-auto { background: #eff6ff; color: var(--primary); }

/* ALERT */
.alert {
  padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert-success { background: var(--green-light); color: var(--green); border: 1px solid #bbf7d0; }
.alert-error { background: var(--red-light); color: var(--red); border: 1px solid #fecaca; }

/* MODAL */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 1rem;
}
.modal {
  background: #fff; border-radius: var(--radius); padding: 1.5rem;
  max-width: 440px; width: 100%; box-shadow: var(--shadow-md);
}
.modal h3 { margin-bottom: 0.75rem; }
.modal p { margin-bottom: 1rem; color: var(--gray-600); }
.modal-actions { display: flex; gap: 0.5rem; justify-content: flex-end; }

/* EMPTY STATE */
.empty-state {
  text-align: center; padding: 3rem 1rem; color: var(--gray-400);
}
.empty-state svg { width: 48px; height: 48px; margin-bottom: 0.75rem; }

/* RESPONSIVE */
@media (max-width: 768px) {
  .nav-links {
    display: none; flex-direction: column; position: absolute;
    top: 60px; left: 0; right: 0; background: #fff;
    border-bottom: 1px solid var(--gray-200); padding: 0.5rem;
    box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
  .hamburger { display: block; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: 1fr; }
  table { font-size: 0.8rem; }
  th, td { padding: 0.4rem 0.5rem; }
}

/* Hide sections */
.page { display: none; }
.page.active { display: block; }

.hidden { display: none !important; }
