/* ShieldedLandlord Admin — hand-written CSS, no external dependencies */

:root {
  --primary: #004080;       /* Sapphire Blue */
  --primary-light: #005aad;
  --primary-dark: #002d5c;
  --secondary: #a9a9a9;     /* Silver Grey */
  --green: #4caf50;
  --amber: #ff9800;
  --red: #f44336;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --border: #dde1e7;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --radius: 6px;
  --shadow: 0 1px 4px rgba(0,0,0,0.10);
}

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

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

/* ---- Nav ---- */
.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0 1.5rem;
  height: 56px;
  background: var(--primary);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.nav-brand { display: flex; align-items: center; gap: 0.6rem; flex-shrink: 0; }

.nav-logo {
  width: 32px; height: 32px;
  background: rgba(255,255,255,0.2);
  border-radius: 6px;
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px;
  letter-spacing: -0.5px;
}

.nav-title { font-weight: 600; font-size: 16px; }

.nav-badge {
  display: inline-block;
  background: rgba(255,255,255,0.25);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 600;
  vertical-align: middle;
  margin-left: 4px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 0.25rem;
  flex: 1;
}

.nav-links a {
  display: block;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius);
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 14px;
  transition: background 0.15s, color 0.15s;
}

.nav-links a:hover,
.nav-links a.active {
  background: rgba(255,255,255,0.18);
  color: #fff;
}

.nav-logout { margin-left: auto; }

/* ---- Main layout ---- */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* ---- Flash messages ---- */
.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  font-size: 14px;
}
.flash-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.flash-error   { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }
.flash-info    { background: #e3f2fd; color: #1565c0; border: 1px solid #90caf9; }

/* ---- Page heading ---- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.page-header h1 { font-size: 22px; font-weight: 600; }

/* ---- Cards / surfaces ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

/* ---- Stat tiles (dashboard) ---- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}
.stat-tile .stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-tile .stat-value { font-size: 32px; font-weight: 700; color: var(--primary); margin-top: 0.25rem; }
.stat-tile .stat-sub   { font-size: 12px; color: var(--text-muted); margin-top: 0.25rem; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
thead th {
  text-align: left;
  padding: 0.6rem 0.85rem;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  background: #fafbfc;
}
tbody td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f7f9fc; }

/* ---- Badges / chips ---- */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}
.badge-green  { background: #e8f5e9; color: #2e7d32; }
.badge-amber  { background: #fff8e1; color: #e65100; }
.badge-red    { background: #ffebee; color: #c62828; }
.badge-grey   { background: #f3f4f6; color: #4b5563; }
.badge-blue   { background: #e3f2fd; color: #1565c0; }

/* ---- Forms ---- */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 0.35rem;
  color: var(--text);
}
.form-control {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.15s;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,64,128,0.12);
}
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 0.25rem; }

/* ---- Search bar ---- */
.search-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  align-items: center;
}
.search-bar .form-control { max-width: 360px; }

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  padding: 0.45rem 1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  line-height: 1.4;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-light); border-color: var(--primary-light); }

.btn-danger {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.btn-danger:hover { background: #c62828; border-color: #c62828; }
.btn-danger:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }

.btn-ghost {
  background: transparent;
  color: rgba(255,255,255,0.9);
  border-color: rgba(255,255,255,0.4);
}
.btn-ghost:hover { background: rgba(255,255,255,0.15); color: #fff; }

.btn-sm { padding: 0.3rem 0.65rem; font-size: 13px; }

/* ---- Two-column detail layout ---- */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 768px) {
  .detail-grid { grid-template-columns: 1fr; }
}

/* ---- Certificate image ---- */
.cert-image {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  object-fit: contain;
  max-height: 600px;
}

/* ---- Tab pills ---- */
.tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}
.tab-link {
  display: block;
  padding: 0.45rem 1rem;
  border-radius: var(--radius) var(--radius) 0 0;
  text-decoration: none;
  font-size: 14px;
  color: var(--text-muted);
  border: 1px solid transparent;
  border-bottom: none;
  position: relative;
  bottom: -2px;
}
.tab-link.active {
  color: var(--primary);
  background: var(--surface);
  border-color: var(--border);
  border-bottom-color: var(--surface);
}
.tab-link:hover:not(.active) { color: var(--text); }

/* ---- Utility ---- */
.text-muted  { color: var(--text-muted); }
.text-sm     { font-size: 13px; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.gap-1 { gap: 0.5rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: 15px;
}

/* ---- Login page ---- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--bg);
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.10);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
}
.login-logo {
  width: 48px; height: 48px;
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 18px;
  font-weight: 700;
  margin: 0 auto 1rem;
}
.login-title {
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.login-sub {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

/* ---- Danger zone ---- */
.danger-zone {
  border: 1px solid #fca5a5;
  border-radius: var(--radius);
  padding: 1.25rem;
  background: #fff5f5;
  margin-top: 1.5rem;
}
.danger-zone h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--red);
  margin-bottom: 0.75rem;
}
