:root {
  --bg: #080d1a;
  --card-bg: rgba(19, 27, 46, 0.75);
  --card-border: rgba(255, 255, 255, 0.1);
  --card-hover-border: rgba(99, 102, 241, 0.45);
  --text: #f8fafc;
  --muted: #94a3b8;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --danger: #f43f5e;
  --success: #10b981;
  --warning: #f59e0b;
  --glow: rgba(99, 102, 241, 0.25);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: system-ui, -apple-system, sans-serif; }

body {
  background-color: var(--bg);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.2) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(244, 63, 94, 0.15) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text);
  padding: 24px 16px;
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 1140px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: fadeIn 0.35s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseAlert {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.35); }
  50% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--card-border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.header h2 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff 40%, var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-actions { display: flex; gap: 10px; }

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  color: var(--text);
  border: 1px solid var(--card-border);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  border-color: var(--card-hover-border);
  box-shadow: 0 14px 40px -10px rgba(0,0,0,0.6), 0 0 20px -5px var(--glow);
}

.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.card h3 {
  font-size: 17px;
  font-weight: 700;
  color: #e2e8f0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  align-items: flex-end;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.combo-input {
  display: flex;
  gap: 6px;
}

input, select {
  background: rgba(10, 15, 28, 0.85);
  border: 1px solid var(--card-border);
  color: #fff;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  width: 100%;
  transition: all 0.2s ease;
}

select {
  cursor: pointer;
  min-width: 95px;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
  background: rgba(15, 23, 42, 0.95);
}

.form-buttons {
  display: flex;
  gap: 8px;
}

button.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  height: 45px;
  flex: 1;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

button.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

button.btn-cancel {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid var(--card-border);
  padding: 12px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  height: 45px;
  transition: all 0.2s ease;
}

button.btn-cancel:hover {
  background: rgba(255, 255, 255, 0.2);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
  margin-top: 6px;
}

th {
  text-align: left;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}

tbody tr {
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s ease;
  animation: fadeIn 0.3s ease forwards;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: scale(1.004);
}

td {
  padding: 14px;
  font-size: 14px;
  border-top: 1px solid var(--card-border);
  border-bottom: 1px solid var(--card-border);
}

td:first-child { border-left: 1px solid var(--card-border); border-top-left-radius: 8px; border-bottom-left-radius: 8px; }
td:last-child { border-right: 1px solid var(--card-border); border-top-right-radius: 8px; border-bottom-right-radius: 8px; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

.badge-alert {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
  animation: pulseAlert 2s infinite;
}

.badge-clean {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-paid {
  background: rgba(148, 163, 184, 0.12);
  color: var(--muted);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.action-btn {
  padding: 6px 10px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  margin-right: 4px;
  transition: all 0.2s ease;
}

.btn-edit {
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.35);
}

.btn-edit:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-1px);
}

.btn-pay {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-pay:hover {
  background: var(--success);
  color: #fff;
  transform: translateY(-1px);
}

.btn-del {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.btn-del:hover {
  background: var(--danger);
  color: #fff;
  transform: translateY(-1px);
}

.empty { color: var(--muted); text-align: center; padding: 36px; font-size: 14px; }
.small-text { font-size: 11px; color: var(--muted); display: block; margin-top: 2px; }
.product-tag { color: #cbd5e1; font-style: italic; }

.login-container { display: flex; justify-content: center; align-items: center; width: 100%; height: 75vh; }
.login-box {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  padding: 36px 30px;
  border-radius: 16px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
  animation: fadeIn 0.3s ease;
}

.login-box h2 {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 6px;
  background: linear-gradient(135deg, #fff 40%, var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-box p { color: var(--muted); font-size: 14px; margin-bottom: 24px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.error-msg { color: var(--danger); font-size: 13px; display: none; }
