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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f5f7fa;
  color: #1a1a2e;
  font-size: 16px;
}

/* ─── Navigation ─────────────────────────────────────────── */

.navbar {
  background: #1565C0;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  color: white;
  font-size: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.navbar-nav {
  display: flex;
  gap: 8px;
  list-style: none;
}

.navbar-nav a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 15px;
  transition: background 0.2s;
}

.navbar-nav a:hover,
.navbar-nav a.active {
  background: rgba(255,255,255,0.15);
  color: white;
}

.navbar-user {
  color: rgba(255,255,255,0.85);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-logout {
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

.btn-logout:hover {
  background: rgba(255,255,255,0.25);
}

/* ─── Layout ──────────────────────────────────────────────── */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}

.page-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 24px;
  color: #1a1a2e;
}

/* ─── Cards ───────────────────────────────────────────────── */

.card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid #e8ecf0;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  color: #1565C0;
}

/* ─── Forms ───────────────────────────────────────────────── */

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: #555;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #dde2e8;
  border-radius: 8px;
  font-size: 15px;
  color: #1a1a2e;
  background: white;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: #1565C0;
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

/* ─── Buttons ─────────────────────────────────────────────── */

.btn {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn:hover { opacity: 0.9; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: #1565C0;
  color: white;
}

.btn-success {
  background: #2e7d32;
  color: white;
}

.btn-danger {
  background: #c62828;
  color: white;
}

.btn-secondary {
  background: #f0f0f0;
  color: #333;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

/* ─── Tables ──────────────────────────────────────────────── */

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th {
  background: #f5f7fa;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: #555;
  border-bottom: 2px solid #e8ecf0;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}

tr:hover td {
  background: #fafbfc;
}

/* ─── Badges ──────────────────────────────────────────────── */

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-open { background: #fff3e0; color: #e65100; }
.badge-in-progress { background: #e3f2fd; color: #1565C0; }
.badge-resolved { background: #e8f5e9; color: #2e7d32; }
.badge-paid { background: #e8f5e9; color: #2e7d32; }
.badge-pending { background: #fff3e0; color: #e65100; }
.badge-ec { background: #e3f2fd; color: #1565C0; }
.badge-owner { background: #f3e5f5; color: #6a1b9a; }
.badge-tenant { background: #fce4ec; color: #880e4f; }
.badge-manager { background: #e0f2f1; color: #004d40; }
.badge-guard { background: #fff8e1; color: #f57f17; }

/* ─── Alerts ──────────────────────────────────────────────── */

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}

.alert-success { background: #e8f5e9; color: #2e7d32; }
.alert-error { background: #ffebee; color: #c62828; }
.alert-info { background: #e3f2fd; color: #1565C0; }

/* ─── Stats cards ─────────────────────────────────────────── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #e8ecf0;
  text-align: center;
}

.stat-number {
  font-size: 32px;
  font-weight: 700;
  color: #1565C0;
}

.stat-label {
  font-size: 13px;
  color: #888;
  margin-top: 4px;
}

/* ─── Login page ──────────────────────────────────────────── */

.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f7fa;
}

.login-card {
  background: white;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  border: 1px solid #e8ecf0;
}

.login-logo {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo h1 {
  font-size: 22px;
  color: #1565C0;
  margin-top: 12px;
}

.login-logo p {
  font-size: 14px;
  color: #888;
  margin-top: 4px;
}

/* ─── Checkbox ────────────────────────────────────────────── */

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* ─── Loading ─────────────────────────────────────────────── */

.loading {
  text-align: center;
  padding: 40px;
  color: #888;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e8ecf0;
  border-top-color: #1565C0;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── Empty state ─────────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 48px;
  color: #888;
}

.empty-state p {
  margin-top: 8px;
  font-size: 14px;
}