* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: #f3f6f5;
  color: #1d2a2a;
}
a { text-decoration: none; color: inherit; }

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px; background: #123333; color: #fff; padding: 20px 16px;
  display: flex; flex-direction: column; flex-shrink: 0;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; background: #3a6b6b; color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px;
}
.sidebar nav { margin-top: 24px; display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a {
  padding: 9px 10px; border-radius: 8px; font-size: 13.5px; color: #c7d6d6;
}
.sidebar nav a.active, .sidebar nav a:hover { background: #1f4e4e; color: #fff; font-weight: 600; }
.sidebar-footer { margin-top: auto; border-top: 1px solid #234848; padding-top: 14px; }
.user-badge { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: #3a6b6b; color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12.5px; flex-shrink: 0;
}
.u-name { font-weight: 600; font-size: 13.5px; }
.u-role { font-size: 11px; color: #8fa3a3; }
.logout-btn {
  display: block; text-align: center; border: 1px solid #2c5555; color: #c7d6d6;
  padding: 7px 10px; border-radius: 7px; font-size: 12.5px;
}
.logout-btn:hover { background: #1f4e4e; }

.main { flex: 1; padding: 26px 30px; }

.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 10px; flex-wrap: wrap; }
.page-title { font-size: 20px; font-weight: 700; margin: 0 0 2px; }
.page-sub { color: #7c8e8e; font-size: 13px; margin: 0 0 18px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; background: #1f4e4e; color: #fff; border: none;
  padding: 9px 14px; border-radius: 8px; font-weight: 600; font-size: 13px; cursor: pointer;
}
.btn:hover { background: #163a3a; }
.btn.secondary { background: #fff; color: #3a4a4a; border: 1px solid #dde6e5; }
.btn.danger { background: #fbe7e7; color: #c0392b; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.card {
  background: #fff; border: 1px solid #e3ebea; border-radius: 12px; padding: 16px; cursor: pointer;
}
.card:hover { border-color: #b8c6c6; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; }
.card-avatar {
  width: 34px; height: 34px; border-radius: 9px; background: #e3f3ee; color: #1f7a5c;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px;
}
.card-name { font-weight: 700; font-size: 15px; margin-top: 10px; }
.card-sub { font-size: 12.5px; color: #7c8e8e; margin-top: 2px; }

.pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.pill.active { background: #e3f3ee; color: #1f7a5c; }
.pill.on_hold { background: #fdf2e0; color: #b8791a; }
.pill.churned { background: #fbe7e7; color: #c0392b; }
.pill.paid { background: #e3f3ee; color: #1f7a5c; }
.pill.pending { background: #fdf2e0; color: #b8791a; }
.pill.overdue { background: #fbe7e7; color: #c0392b; }

.section-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.section-card { background: #fff; border: 1px solid #e3ebea; border-radius: 12px; overflow: hidden; }
.section-head {
  display: flex; justify-content: space-between; align-items: center; padding: 12px 14px;
  border-bottom: 1px solid #eef3f2; background: #fafcfb; font-weight: 700; font-size: 13.5px;
}
.section-body { padding: 14px; }
.field-label { font-size: 11px; color: #8fa3a3; font-weight: 600; margin-bottom: 3px; }
.field-value { font-size: 13.5px; margin-bottom: 10px; }
.field-value.empty { color: #c3cfcf; }
.lock { color: #c3cfcf; font-size: 11px; }

.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 11.5px; color: #7c8e8e; margin-bottom: 4px; font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=date], select, textarea {
  border: 1px solid #dde6e5; border-radius: 8px; padding: 8px 10px; font-size: 13px; width: 100%;
  font-family: inherit; background: #fff; color: #1d2a2a;
}
textarea { min-height: 64px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #3a6b6b; outline-offset: 1px; }

table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #e3ebea; border-radius: 12px; overflow: hidden; }
th, td { text-align: left; padding: 10px 14px; font-size: 13px; border-bottom: 1px solid #eef3f2; }
th { background: #fafcfb; font-size: 11.5px; color: #7c8e8e; text-transform: uppercase; letter-spacing: .02em; }

.panel { background: #fff; border: 1px solid #e3ebea; border-radius: 12px; padding: 16px; margin-bottom: 18px; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.inline-form .form-group { margin-bottom: 0; min-width: 150px; }

.alert { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.alert.success { background: #e3f3ee; color: #1f7a5c; }
.alert.error { background: #fbe7e7; color: #c0392b; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #f3f6f5; }
.login-card {
  background: #fff; border: 1px solid #e3ebea; border-radius: 16px; padding: 28px; width: 340px;
  text-align: center; box-shadow: 0 8px 30px rgba(20,40,40,0.06);
}
.login-card .brand-mark { margin: 0 auto 12px; }
.login-title { font-weight: 700; font-size: 19px; }
.login-sub { font-size: 13px; color: #7c8e8e; margin-bottom: 20px; }
.login-card form { text-align: left; }

/* ---- Reports / notifications / activity log additions ---- */
.nav-badge {
  background: #d9534f; color: #fff; font-size: 10.5px; font-weight: 700;
  padding: 1px 6px; border-radius: 10px; margin-left: 4px;
}
.report-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.report-card {
  background: #fff; border: 1px solid #e3ebea; border-radius: 12px; padding: 16px; text-align: center;
}
.report-num { font-size: 24px; font-weight: 800; color: #1f4e4e; }
.report-label { font-size: 12px; color: #6b7d7d; margin-top: 4px; }
.notif {
  padding: 8px 10px; border-radius: 8px; font-size: 13px; margin-bottom: 6px; border-left: 3px solid #ccc;
}
.notif.high { background: #fdecea; border-left-color: #d9534f; }
.notif.medium { background: #fff8e6; border-left-color: #e0a800; }
