:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --nav-bg: #1e293b;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
.navbar { background: var(--nav-bg); padding: 0 1.5rem; display: flex; align-items: center; justify-content: space-between; height: 56px; }
.navbar-brand a { color: #fff; text-decoration: none; font-size: 1.1rem; font-weight: 700; }
.nav-links { display: flex; gap: 1rem; align-items: center; }
.nav-links a { color: #cbd5e1; text-decoration: none; font-size: 0.9rem; transition: color 0.2s; }
.nav-links a:hover { color: #fff; }
.btn-logout { background: #dc2626; color: #fff !important; padding: 0.3rem 0.8rem; border-radius: 4px; }
.container { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.5rem; }
.breadcrumb { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1rem; }
.breadcrumb a { color: var(--primary); text-decoration: none; }
.btn { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.5rem 1rem; border-radius: 6px; border: none; cursor: pointer; font-size: 0.9rem; text-decoration: none; transition: background 0.2s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: #e2e8f0; color: var(--text); }
.btn-secondary:hover { background: #cbd5e1; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.8rem; }
.btn-block { width: 100%; justify-content: center; }
.table { width: 100%; border-collapse: collapse; background: var(--card-bg); border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.1); margin-bottom: 1.5rem; }
.table th { background: #f1f5f9; padding: 0.75rem 1rem; text-align: left; font-weight: 600; font-size: 0.85rem; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.table td { padding: 0.65rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover { background: #f8fafc; }
.row-red { background: #fef2f2 !important; }
.row-orange { background: #fff7ed !important; }
.row-yellow { background: #fefce8 !important; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--card-bg); border-radius: 8px; padding: 1.2rem; box-shadow: 0 1px 3px rgba(0,0,0,.1); text-align: center; }
.stat-card.red { border-top: 3px solid var(--danger); }
.stat-card.orange { border-top: 3px solid var(--warning); }
.stat-card.yellow { border-top: 3px solid #eab308; }
.stat-card.blue { border-top: 3px solid var(--primary); }
.stat-num { font-size: 1.8rem; font-weight: 700; color: var(--text); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.3rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.card { background: var(--card-bg); border-radius: 8px; padding: 1.2rem; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.card-title { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; }
.card-title a { color: var(--text); text-decoration: none; }
.card-title a:hover { color: var(--primary); }
.card-meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.card-desc { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.card-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.form-card { background: var(--card-bg); border-radius: 8px; padding: 1.5rem; box-shadow: 0 1px 3px rgba(0,0,0,.1); max-width: 700px; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 500; margin-bottom: 0.4rem; font-size: 0.9rem; }
.form-control { width: 100%; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 6px; font-size: 0.9rem; transition: border 0.2s; }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.form-control-sm { padding: 0.3rem 0.6rem; border: 1px solid var(--border); border-radius: 4px; font-size: 0.85rem; }
.form-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; }
.help-text { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }
.field-error { font-size: 0.8rem; color: var(--danger); margin-top: 0.25rem; }
.alert { padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-size: 0.9rem; }
.alert-success { background: #f0fdf4; border: 1px solid #86efac; color: #15803d; }
.alert-error, .alert-danger { background: #fef2f2; border: 1px solid #fca5a5; color: #b91c1c; }
.alert-warning { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; }
.info-table { background: var(--card-bg); border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.1); margin-bottom: 1.5rem; overflow: hidden; }
.info-row { display: grid; grid-template-columns: 180px 1fr; gap: 1rem; padding: 0.65rem 1rem; border-bottom: 1px solid var(--border); }
.info-row:last-child { border-bottom: none; }
.info-row > span:first-child { font-weight: 600; color: var(--text-muted); font-size: 0.85rem; }
.tag { display: inline-block; background: #dbeafe; color: #1d4ed8; padding: 0.15rem 0.5rem; border-radius: 4px; font-size: 0.75rem; margin: 0.1rem; }
.status { display: inline-block; padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.8rem; font-weight: 500; }
.status-active { background: #f0fdf4; color: var(--success); }
.status-payment_due { background: #fffbeb; color: var(--warning); }
.status-pending_delete { background: #fef2f2; color: var(--danger); }
.status-deleted { background: #f1f5f9; color: var(--text-muted); }
.filters { background: var(--card-bg); padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1rem; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.filter-form { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.empty-state { text-align: center; padding: 3rem; color: var(--text-muted); }
.danger-zone { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.link-small { font-size: 0.8rem; color: var(--primary); }
.text-muted { color: var(--text-muted); font-size: 0.85rem; }
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box { background: var(--card-bg); padding: 2.5rem; border-radius: 12px; box-shadow: 0 4px 24px rgba(0,0,0,.1); width: 360px; }
.login-box h2 { text-align: center; font-size: 1.5rem; margin-bottom: 0.5rem; }
.login-sub { text-align: center; color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }
select.form-control { appearance: auto; }
