* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: #f4f6f9;
  color: #1f2933;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px;
  background: #111827;
  color: #fff;
  padding: 20px 0;
  flex-shrink: 0;
}
.sidebar .brand { font-size: 18px; font-weight: 700; padding: 0 20px 20px; }
.sidebar nav { display: flex; flex-direction: column; }
.sidebar nav a {
  color: #cbd5e1;
  padding: 12px 20px;
  border-left: 3px solid transparent;
}
.sidebar nav a:hover, .sidebar nav a.active {
  background: #1f2937;
  color: #fff;
  border-left-color: #2563eb;
  text-decoration: none;
}
.sidebar nav a.logout { margin-top: auto; color: #f87171; }

.content { flex: 1; padding: 30px 40px; }

h1 { margin-top: 0; }

.cards { display: flex; gap: 20px; margin-bottom: 30px; flex-wrap: wrap; }
.card {
  background: #fff;
  border-radius: 10px;
  padding: 20px 24px;
  min-width: 160px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  display: flex; flex-direction: column;
}
.card-num { font-size: 28px; font-weight: 700; }
.card-label { color: #6b7280; font-size: 13px; margin-top: 4px; }

.panel {
  background: #fff;
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-bottom: 30px;
}
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.panel-head h2 { margin: 0; font-size: 18px; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
  font-size: 14px;
}
.table th { color: #6b7280; font-weight: 600; font-size: 13px; text-transform: uppercase; }
.table .actions a { margin-right: 10px; font-size: 13px; }

.btn {
  display: inline-block;
  background: #2563eb;
  color: #fff !important;
  padding: 9px 16px;
  border-radius: 6px;
  font-size: 14px;
  border: none;
  cursor: pointer;
}
.btn:hover { background: #1d4ed8; text-decoration: none; }
.btn-danger { background: #dc2626; }
.btn-danger:hover { background: #b91c1c; }
.btn-secondary { background: #6b7280; }
.btn-secondary:hover { background: #4b5563; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; max-width: 900px; }
.form-grid.full { grid-template-columns: 1fr; }
.form-group { display: flex; flex-direction: column; }
.form-group label { font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #374151; }
.form-group input, .form-group select, .form-group textarea {
  padding: 9px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
}
.form-actions { margin-top: 24px; display: flex; gap: 10px; }

.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 20px; font-size: 14px; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-danger { background: #fee2e2; color: #991b1b; }
.alert-info { background: #dbeafe; color: #1e40af; }

.badge { padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-draft { background: #fef3c7; color: #92400e; }
.badge-sent { background: #dbeafe; color: #1e40af; }
.badge-paid { background: #dcfce7; color: #166534; }

.items-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.items-table th, .items-table td { padding: 8px; border: 1px solid #e5e7eb; }
.items-table input { width: 100%; border: 1px solid #d1d5db; border-radius: 4px; padding: 6px; }
.items-table .remove-row { color: #dc2626; cursor: pointer; font-weight: bold; }
.totals-row td { text-align: right; font-weight: 700; }

.login-body {
  display: flex; align-items: center; justify-content: center;
  height: 100vh; margin: 0; background: #111827;
}
.login-box {
  background: #fff; padding: 40px; border-radius: 12px; width: 320px;
  display: flex; flex-direction: column; gap: 12px;
}
.login-box h2 { margin: 0 0 10px; text-align: center; }
.login-box input { padding: 10px; border: 1px solid #d1d5db; border-radius: 6px; }
.login-box button {
  background: #2563eb; color: #fff; border: none; padding: 10px;
  border-radius: 6px; font-size: 15px; cursor: pointer; margin-top: 8px;
}
.login-box .hint { text-align: center; font-size: 12px; color: #9ca3af; margin: 0; }

.invoice-preview { background: #fff; padding: 30px; border-radius: 10px; max-width: 800px; }
.invoice-preview table { width: 100%; border-collapse: collapse; margin: 20px 0; }
.invoice-preview th, .invoice-preview td { border: 1px solid #ddd; padding: 8px; font-size: 14px; }
