.auth-body {
  background: #eef2ff;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background: #f5f5f5;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  
  .container {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
  }

  @media (max-width: 768px) {
    .container {
      padding: 16px;
    }
  }

.page-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.main-content {
  flex: 1 1 65%;
}

.sidebar {
  flex: 0 0 260px;
}
  
  h1, h2 {
    margin-top: 0;
  }

  h1 {
    font-size: 1.75rem;
  }

  @media (max-width: 768px) {
    h1 {
      font-size: 1.5rem;
    }

    h2 {
      font-size: 1.25rem;
    }
  }
  
.form-toggle {
  margin-bottom: 16px;
}

.form-section {
  display: none;
  margin-bottom: 24px;
  padding: 16px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.form-section.is-visible {
  display: block;
}

form label {
    display: block;
    margin-bottom: 12px;
    font-weight: 500;
    color: #1e293b;
  }

  form label small {
    font-weight: 400;
    font-size: 0.85rem;
  }
  
  form input, form select, form textarea {
    width: 100%;
    padding: 10px;
    margin-top: 4px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
  }

  form input:focus, form select:focus, form textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  }

  form textarea {
    min-height: 80px;
    resize: vertical;
  }
  
  button {
    padding: 8px 16px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    min-height: 44px; /* Touch-friendly on mobile */
  }
  
  button:hover {
    background: #1d4ed8;
  }

  @media (max-width: 768px) {
    button {
      width: 100%;
      font-size: 0.95rem;
    }
  }
  
.button-link {
  display: inline-block;
  padding: 8px 16px;
  background: #dc2626;
  color: white;
  border-radius: 4px;
  text-decoration: none;
}

.button-link:hover {
  background: #b91c1c;
}

.button-secondary {
  display: inline-block;
  padding: 8px 16px;
  background: #2563eb;
  color: white;
  border-radius: 4px;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.button-secondary:hover {
  background: #1d4ed8;
}

.button-danger {
  background: #dc2626;
}

.button-danger:hover {
  background: #b91c1c;
}

.inline-form {
  display: inline;
}

.actions-cell {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.actions-cell form {
  margin: 0;
}

@media (max-width: 768px) {
  .actions-cell {
    flex-direction: column;
    gap: 4px;
  }

  .actions-cell button,
  .actions-cell .button-secondary {
    width: 100%;
    padding: 6px 12px;
    font-size: 0.85rem;
  }
}

.rates-widget {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

.rates-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}

.rates-header h2 {
  margin: 0;
  font-size: 18px;
}

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

.rates-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rate-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
}

.rate-info {
  display: flex;
  flex-direction: column;
}

.rate-symbol {
  font-weight: 600;
  color: #1e293b;
}

.rate-name {
  font-size: 12px;
  color: #64748b;
}

.rate-values {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rate-price {
  font-weight: 600;
  color: #0f172a;
}

.rate-change {
  font-size: 12px;
  font-weight: 600;
}

.rate-up {
  color: #15803d;
}

.rate-down {
  color: #b91c1c;
}

.tag {
  display: inline-block;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.tag-alacak {
  background: #dcfce7;
  color: #166534;
}

.tag-verecek, .tag-borc {
  background: #fee2e2;
  color: #9f1239;
}

.currency-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 9999px;
  background: #e2e8f0;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.chip-small {
  font-size: 10px;
  padding: 2px 6px;
}

.amount-positive {
  color: #166534;
  font-weight: 600;
}

.amount-negative {
  color: #b91c1c;
  font-weight: 600;
}

.bold-net {
  font-size: 1.05rem;
  font-weight: 700;
}

.overall-net {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 12px;
}

.overall-net span {
  display: inline-block;
  margin-left: 6px;
}

.overall-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  margin-bottom: 12px;
}

.overall-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.overall-label {
  font-weight: 600;
  color: #1e293b;
  font-size: 0.9rem;
}

.overall-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.overall-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.overall-label {
  font-weight: 600;
  color: #1e293b;
  font-size: 0.9rem;
}

  table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
    font-size: 0.95rem;
  }
  
  table th, table td {
    border: 1px solid #e5e7eb;
    padding: 8px;
    text-align: left;
  }
  
  table thead {
    background: #f3f4f6;
  }

  @media (max-width: 768px) {
    table {
      font-size: 0.85rem;
      display: block;
      overflow-x: auto;
      white-space: nowrap;
      -webkit-overflow-scrolling: touch;
    }

    table th, table td {
      padding: 6px;
      font-size: 0.8rem;
    }
  }
  
  .alerts .alert {
    padding: 8px;
    margin-bottom: 10px;
    border-radius: 4px;
  }
  
  .alert.success { background: #dcfce7; color: #166534; }
  .alert.error { background: #fee2e2; color: #991b1b; }
  
  .positive { color: #166534; }
  .negative { color: #b91c1c; }

.auth-container {
  max-width: 420px;
  margin: 48px auto;
  padding: 32px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 35px rgba(15, 23, 42, 0.15);
}

.auth-container h1 {
  text-align: center;
  margin-bottom: 24px;
}

.auth-form label {
  display: block;
  margin-bottom: 16px;
}

.auth-form input {
  width: 100%;
  padding: 10px;
  margin-top: 6px;
  border: 1px solid #cbd5f5;
  border-radius: 6px;
}

.user-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.user-bar span {
  font-weight: 600;
  color: #1e3a8a;
}

@media (max-width: 768px) {
  .user-bar {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .user-bar span {
    font-size: 0.9rem;
  }

  .user-bar > div {
    flex-direction: column;
    width: 100%;
  }

  .user-bar a {
    width: 100%;
    text-align: center;
  }
}

.form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
  flex-wrap: wrap;
}

.form-actions button {
  flex: 1;
  min-width: 120px;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.is-open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.modal-dialog {
  position: relative;
  z-index: 1001;
  width: min(520px, calc(100% - 32px));
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
  padding: 24px;
  max-height: 90vh;
  overflow-y: auto;
}

@media (max-width: 768px) {
  .modal-dialog {
    padding: 16px;
    width: calc(100% - 24px);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #64748b;
  line-height: 1;
}

.modal-close:hover {
  color: #0f172a;
}

/* Responsive Design - Mobile First */
@media (max-width: 900px) {
  .page-layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    flex: 1 1 auto;
  }
}

@media (max-width: 768px) {
  .page-layout {
    gap: 16px;
  }

  .sidebar {
    order: -1; /* Show market rates at top on mobile */
  }

  .form-section {
    padding: 12px;
  }

  form label {
    margin-bottom: 16px;
  }

  form input, form select, form textarea {
    padding: 12px;
    font-size: 16px; /* Prevent zoom on iOS */
  }

  form input[type="number"],
  form input[type="datetime-local"] {
    -webkit-appearance: none;
    appearance: none;
  }

  form textarea {
    min-height: 100px;
  }

  button {
    padding: 12px 16px;
    font-size: 1rem;
  }

  .form-actions {
    flex-direction: column;
    gap: 8px;
  }

  .form-actions button {
    width: 100%;
  }

  .tag {
    font-size: 11px;
    padding: 3px 8px;
  }

  .currency-chip {
    font-size: 10px;
    padding: 2px 6px;
  }

  .overall-summary {
    gap: 8px;
  }

  .overall-item {
    padding: 4px 8px;
    font-size: 0.85rem;
  }

  .auth-container {
    margin: 24px auto;
    padding: 20px;
  }

  /* Modal responsive adjustments */
  .modal-dialog {
    max-height: 85vh;
  }

  .modal-dialog form label {
    margin-bottom: 14px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 12px;
  }

  h1 {
    font-size: 1.35rem;
  }

  h2 {
    font-size: 1.1rem;
  }

  .form-section {
    padding: 10px;
  }

  form label {
    margin-bottom: 14px;
    font-size: 0.95rem;
  }

  form input, form select, form textarea {
    padding: 11px;
    font-size: 16px;
  }

  button {
    padding: 13px 16px;
    font-size: 0.95rem;
  }

  .modal-dialog {
    padding: 12px;
    max-height: 90vh;
  }

  .modal-header h2 {
    font-size: 1.15rem;
  }

  .rate-item {
    padding: 8px 10px;
  }

  .rate-symbol {
    font-size: 0.9rem;
  }

  .rate-name {
    font-size: 11px;
  }

  .rate-price {
    font-size: 0.9rem;
  }
}