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

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #64748b;
  --success: #16a34a;
  --danger: #dc2626;
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.1);
}

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; }

/* Navbar */
.navbar { display: flex; align-items: center; justify-content: space-between; background: var(--primary); color: white; padding: 0 1.5rem; height: 56px; }
.navbar-brand { font-weight: 700; font-size: 1.1rem; }
.navbar-links { display: flex; list-style: none; gap: 1.5rem; }
.navbar-links a { color: rgba(255,255,255,.85); text-decoration: none; font-size: .9rem; }
.navbar-links a:hover { color: white; }

/* Container */
.container { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem; }

/* Login */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); }
.login-container { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 2.5rem; width: 100%; max-width: 400px; }
.login-title { font-size: 1.75rem; font-weight: 700; color: var(--primary); text-align: center; margin-bottom: .25rem; }
.login-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 1.5rem; }
.login-form { display: flex; flex-direction: column; gap: 1rem; }

/* Forms */
.form-group { display: flex; flex-direction: column; gap: .35rem; }
.form-group label { font-size: .875rem; font-weight: 500; color: var(--text); }
.form-group input, .form-group textarea, .form-group select { border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem .75rem; font-size: .9rem; width: 100%; transition: border-color .15s; }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: .5rem 1rem; border-radius: var(--radius); font-size: .875rem; font-weight: 500; cursor: pointer; text-decoration: none; border: none; transition: background .15s; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg); }
.btn-sm { padding: .25rem .625rem; font-size: .8rem; }
.btn-full { width: 100%; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; text-align: center; box-shadow: var(--shadow); }
.stat-number { font-size: 2.25rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: .8rem; color: var(--text-muted); margin-top: .25rem; text-transform: uppercase; letter-spacing: .05em; }

/* Page header */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.page-title { font-size: 1.5rem; font-weight: 700; }

/* Section */
.section { margin-top: 2rem; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.section h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: 1rem; }

/* Table */
.table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.table th, .table td { padding: .75rem 1rem; text-align: left; border-bottom: 1px solid var(--border); font-size: .875rem; }
.table th { background: var(--bg); font-weight: 600; color: var(--text-muted); }
.table tbody tr:hover { background: var(--bg); }
.table tbody tr:last-child td { border-bottom: none; }

/* Badges */
.badge { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 500; background: #dbeafe; color: #1d4ed8; }
.badge-active { background: #dcfce7; color: #15803d; }
.badge-inactive { background: #fee2e2; color: #b91c1c; }

/* Alerts */
.alert { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: .875rem; }
.alert-error { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }

/* Detail list */
.detail-list { display: grid; grid-template-columns: 130px 1fr; gap: .5rem .75rem; }
.detail-list dt { font-weight: 600; color: var(--text-muted); font-size: .875rem; }
.detail-list dd { font-size: .875rem; }

/* Activity list */
.activity-list { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.activity-item { display: flex; align-items: center; gap: .75rem; padding: .625rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); font-size: .875rem; }
.activity-desc { flex: 1; }
.activity-date { color: var(--text-muted); font-size: .8rem; white-space: nowrap; }

/* Error page */
.error-page { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; gap: 1rem; text-align: center; }
.error-code { font-size: 6rem; font-weight: 700; color: var(--primary); }
.error-message { color: var(--text-muted); font-size: 1.1rem; }

/* Empty state */
.empty-state { color: var(--text-muted); text-align: center; padding: 2rem; }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 1rem 1.5rem; text-align: center; font-size: .8rem; color: var(--text-muted); margin-top: 2rem; }

/* Responsive */
@media (max-width: 768px) {
  .navbar-links { gap: .75rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; gap: .75rem; }
  .table { font-size: .8rem; }
  .table th, .table td { padding: .5rem .75rem; }
}
