/* =====================================================
   Design Tokens — Green / Teal palette
===================================================== */
:root {
  --primary:        #0f766e;
  --primary-hover:  #0d6560;
  --primary-light:  #14b8a6;
  --primary-bg:     #f0fdfa;
  --primary-ring:   rgba(20, 184, 166, 0.22);

  --bg:     #f1f5f9;
  --card:   #ffffff;
  --dark:   #0f172a;
  --text:   #1e293b;
  --muted:  #64748b;
  --border: #e2e8f0;
  --row-hover: #f8fffd;

  --success:    #059669;
  --success-bg: #d1fae5;
  --danger:     #dc2626;
  --danger-bg:  #fee2e2;
  --warning:    #d97706;
  --warning-bg: #fef3c7;

  --radius:    14px;
  --radius-sm: 9px;
  --shadow:    0 1px 3px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.04);
  --shadow-md: 0 4px 24px rgba(0,0,0,.08);
}

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

body {
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* =====================================================
   Layout
===================================================== */
.page {
  max-width: 1100px;
  margin: 88px auto 48px;
  padding: 0 24px;
}

/* =====================================================
   Cards
===================================================== */
.admin-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.header-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark);
  letter-spacing: -0.2px;
}

.tenant-name {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

/* =====================================================
   Stat Boxes
===================================================== */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.stat-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: box-shadow .15s;
}

.stat-box:hover {
  box-shadow: 0 4px 16px rgba(15, 118, 110, .1);
  border-color: #b2e4df;
}

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon svg {
  width: 22px;
  height: 22px;
  stroke: var(--primary);
}

.stat-body { flex: 1; min-width: 0; }

.stat-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.stat-value {
  font-size: 30px;
  font-weight: 800;
  color: var(--dark);
  line-height: 1.15;
  margin-top: 4px;
}

/* =====================================================
   Section divider inside card
===================================================== */
.section-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
  margin-top: 24px;
}

/* =====================================================
   Forms
===================================================== */
label {
  font-weight: 600;
  font-size: 11.5px;
  color: var(--muted);
  display: block;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.field {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
}

.field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.field::placeholder { color: #a8b4c0; }

/* =====================================================
   Row / Grid helpers
===================================================== */
.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.col     { flex: 1; min-width: 130px; }
.col-auto { flex: none; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
}

/* =====================================================
   Buttons
===================================================== */
button, .btn {
  font-family: inherit;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.3);
  transform: translateY(-1px);
}

.btn-outline {
  background: #fff;
  color: var(--text);
  border: 1.5px solid var(--border);
}

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

.btn-danger {
  background: #fff;
  color: var(--danger);
  border: 1.5px solid #fecaca;
}

.btn-danger:hover {
  background: var(--danger-bg);
  border-color: #f87171;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: none;
  padding: 9px 12px;
}

.btn-ghost:hover {
  background: #f1f5f9;
  color: var(--text);
}

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

/* =====================================================
   Tables
===================================================== */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

thead { background: #f8fafc; }

th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 10px 14px;
  border-bottom: 2px solid var(--border);
}

td {
  padding: 13px 14px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

tbody tr { transition: background .1s; }

tbody tr:hover { background: var(--row-hover); }

tbody tr:last-child td { border-bottom: none; }

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

/* =====================================================
   Status / helper text
===================================================== */
.status {
  font-size: 13px;
  color: var(--muted);
  margin-top: 12px;
}

/* =====================================================
   Pills
===================================================== */
.pill {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  display: inline-block;
}

.pill.ok  { background: var(--success-bg); color: var(--success); }
.pill.bad { background: var(--danger-bg);  color: var(--danger);  }

/* =====================================================
   Utilities
===================================================== */
.muted { font-size: 13px; color: var(--muted); }

/* =====================================================
   App Header / Top Nav
===================================================== */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0; width: 100%;
  z-index: 100;
}

.app-header h1 { font-size: 18px; font-weight: 700; }

.app-header nav a {
  text-decoration: none;
  font-weight: 600;
  color: var(--primary);
  margin-left: 14px;
}

/* =====================================================
   Responsive
===================================================== */
@media (max-width: 640px) {
  .page { padding: 0 14px; }
  .admin-card { padding: 20px 16px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .row { flex-direction: column; }
  .col { min-width: 100%; }
}
