:root {
  --navy: #10243f;
  --navy-2: #17375e;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --line: #dbe4ef;
  --text: #172235;
  --muted: #6f7f94;
  --green: #159b68;
  --orange: #e38b29;
  --red: #d94444;
  --blue: #2f6fed;
  --shadow: 0 18px 45px rgba(26, 45, 72, .11);
}

* { box-sizing: border-box; }
html { font-family: Inter, Arial, sans-serif; color: var(--text); background: var(--bg); letter-spacing: 0; }
body { margin: 0; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
  color: var(--text);
}
textarea { resize: vertical; }
label { display: grid; gap: 7px; color: var(--text); font-weight: 700; font-size: 13px; }
label small { color: var(--muted); font-weight: 500; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 12px; color: var(--muted); text-transform: uppercase; background: #f8fafc; }
td small { display: block; color: var(--muted); margin-top: 4px; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 288px;
  background: var(--navy);
  color: #eaf1fb;
  padding: 22px 16px;
  position: fixed;
  inset: 0 auto 0 0;
  overflow-y: auto;
  z-index: 20;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 10px 8px 20px; }
.brand-mark, .logo-box, .user-chip span, .profile-card > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #2f6fed, #159b68);
  color: #fff;
  font-weight: 800;
}
.brand strong { display: block; color: #fff; }
.brand small, .sidebar-footer p { color: #9fb2ca; }
.side-nav { display: grid; gap: 4px; }
.side-nav a {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 11px 10px;
  border-radius: 8px;
  color: #d7e1ee;
  font-weight: 650;
  font-size: 14px;
}
.side-nav a span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(255,255,255,.08);
  font-size: 11px;
}
.side-nav a.active, .side-nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.sidebar-footer { margin-top: 20px; padding: 14px; border-radius: 8px; background: rgba(255,255,255,.08); }

.main-shell { margin-left: 288px; min-width: 0; flex: 1; display: flex; flex-direction: column; }
.topbar {
  min-height: 82px;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 26px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar h1 { margin: 0; font-size: 24px; line-height: 1.2; }
.eyebrow { margin: 0 0 4px; color: var(--blue); text-transform: uppercase; font-weight: 800; font-size: 11px; letter-spacing: 0; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-weight: 800;
}
.menu-toggle { display: none; }
.user-chip { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); padding: 7px 10px; border-radius: 8px; }
.user-chip strong { display: block; font-size: 13px; }
.user-chip small { color: var(--muted); }
.notification { position: relative; }
.notification-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 50px;
  width: 290px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.notification.open .notification-menu { display: block; }
.notification-menu a { display: grid; gap: 4px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.notification-menu span { color: var(--muted); font-size: 12px; }

.content { padding: 26px; display: grid; gap: 22px; flex: 1; }
.footer { margin-left: 288px; display: none; }
.main-shell .footer {
  margin: 0;
  padding: 16px 26px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}
.hero-band, .detail-hero {
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  color: #fff;
  border-radius: 8px;
  padding: 26px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  box-shadow: var(--shadow);
}
.hero-band h2, .detail-hero h2 { margin: 0 0 8px; font-size: 30px; max-width: 820px; }
.hero-band p, .detail-hero p { margin: 0; color: #c8d5e6; max-width: 760px; }
.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.metric-grid.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
  min-height: 128px;
}
.metric-card span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 16px;
}
.metric-card strong { display: block; font-size: 30px; line-height: 1; }
.metric-card p { margin: 7px 0 0; color: var(--muted); font-weight: 650; }
.metric-card.blue span, .metric-card.blue { border-top: 4px solid var(--blue); }
.metric-card.green span, .metric-card.green { border-top: 4px solid var(--green); }
.metric-card.orange span, .metric-card.orange { border-top: 4px solid var(--orange); }
.metric-card.red span, .metric-card.red { border-top: 4px solid var(--red); }
.metric-card.blue span { background: var(--blue); }
.metric-card.green span { background: var(--green); }
.metric-card.orange span { background: var(--orange); }
.metric-card.red span { background: var(--red); }

.grid { display: grid; gap: 22px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.two.uneven { grid-template-columns: minmax(340px, .85fr) minmax(0, 1.15fr); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-all { grid-column: 1 / -1; }
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 20px;
  min-width: 0;
}
.panel h3 { margin: 0 0 16px; font-size: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.panel-head h3 { margin: 0; }
.panel-head a, .panel-head span { color: var(--muted); font-weight: 700; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  padding: 12px 16px;
  font-weight: 800;
  cursor: pointer;
  min-height: 42px;
}
.button.primary { background: var(--blue); color: #fff; }
.button.secondary { background: #eaf1fb; color: var(--navy); }
.button.success { background: var(--green); color: #fff; }
.button.danger { background: var(--red); color: #fff; }
.button.small { min-height: 34px; padding: 8px 11px; font-size: 12px; }
.button.full { width: 100%; }
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.badge.success { color: #08784f; background: #e7f7f0; }
.badge.danger { color: #b82f2f; background: #fdecec; }
.badge.warning { color: #9b5a10; background: #fff3df; }
.badge.info { color: #255fce; background: #eaf1ff; }
.badge.muted { color: #6b7280; background: #f1f5f9; }
.alert { border-radius: 8px; padding: 12px 14px; font-weight: 750; }
.alert.success { background: #e7f7f0; color: #08784f; }
.alert.danger { background: #fdecec; color: #b82f2f; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.filters, .inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filters input, .filters select { min-width: 150px; }
.inline-form input, .inline-form select { width: auto; min-width: 96px; padding: 8px 9px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.stack-form { display: grid; gap: 14px; }
.check { display: flex; align-items: center; gap: 9px; }
.check input { width: auto; }

.bar-list { display: grid; gap: 14px; }
.bar-row { display: grid; grid-template-columns: 145px 1fr 36px; align-items: center; gap: 10px; }
.bar-row div { height: 10px; background: #edf2f7; border-radius: 999px; overflow: hidden; }
.bar-row i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--green)); border-radius: inherit; }
.donut-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.donut-item { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.donut-item > span {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: conic-gradient(var(--blue) calc(var(--p) * 1%), #e9eef5 0);
}
.donut-item small { display: block; color: var(--muted); }
.activity-list, .announcement-list, .settings-list { display: grid; gap: 10px; }
.activity-list a, .announcement-list article, .task-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: #fff;
}
.activity-list a { display: flex; gap: 10px; align-items: flex-start; }
.activity-list small, .line-item b { color: var(--muted); }
.dot { width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--blue); flex: 0 0 10px; }
.dot.danger { background: var(--red); }
.dot.warning { background: var(--orange); }
.site-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.site-card { border: 1px solid var(--line); border-radius: 8px; padding: 16px; background: #fff; display: grid; gap: 12px; }
.site-card:hover, .task-card:hover { border-color: var(--blue); }
.site-card-head, .site-foot, .mini-stats, .line-item { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.site-card p { margin: 0; color: var(--muted); }
.mini-stats span, .site-foot span, .module-grid span {
  background: #f5f8fc;
  border-radius: 8px;
  padding: 8px 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.module-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.kanban { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.kanban-column { background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: grid; gap: 10px; align-content: start; }
.kanban-column h4 { margin: 0; }
.task-card { display: grid; gap: 8px; }
.task-card span { color: var(--muted); font-size: 13px; }
.ticket-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.ticket-meta span { border: 1px solid var(--line); border-radius: 8px; padding: 11px; color: var(--muted); }
.ticket-meta b { display: block; color: var(--text); margin-bottom: 4px; }
.detail-text { color: var(--muted); line-height: 1.7; }
.photo-placeholder { margin-top: 16px; border: 1px dashed var(--line); border-radius: 8px; padding: 28px; text-align: center; color: var(--muted); background: #f8fafc; }
.timeline { display: grid; gap: 8px; }
.timeline p { margin: 0; padding: 10px; border-left: 3px solid var(--blue); background: #f8fafc; border-radius: 0 8px 8px 0; }
.timeline span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 3px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); gap: 10px; overflow-x: auto; }
.calendar-grid div { min-height: 145px; background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: grid; gap: 7px; align-content: start; }
.report-actions { display: flex; gap: 10px; justify-content: flex-end; }
.profile-card { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.profile-card > span { width: 62px; height: 62px; font-size: 24px; }
.profile-card h2 { margin: 0 0 5px; }
.profile-card p { margin: 0; color: var(--muted); }

.auth-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background: #edf3fa;
  padding: 24px;
}
.auth-panel {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: .95fr 1.05fr;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.register-panel { width: min(1140px, 100%); }
.auth-visual {
  background: linear-gradient(140deg, var(--navy), #214b7c);
  color: #fff;
  padding: 42px;
  display: grid;
  align-content: center;
  gap: 18px;
}
.auth-visual h1 { margin: 0; font-size: 36px; }
.auth-visual p { margin: 0; color: #d8e5f3; line-height: 1.7; }
.auth-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.auth-metrics span { background: rgba(255,255,255,.1); border-radius: 8px; padding: 12px; display: grid; gap: 4px; }
.auth-metrics strong { font-size: 24px; }
.auth-form { padding: 42px; display: grid; gap: 16px; align-content: center; }
.auth-form h2 { margin: 0; font-size: 28px; }
.demo-users { display: grid; gap: 5px; padding: 13px; border-radius: 8px; background: #f5f8fc; color: var(--muted); }
.demo-users strong { color: var(--text); }
.auth-link { text-align: center; color: var(--muted); }
.auth-link a { color: var(--blue); font-weight: 800; }

@media (max-width: 1180px) {
  .metric-grid, .site-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.three { grid-template-columns: 1fr; }
  .calendar-grid { grid-template-columns: repeat(4, minmax(130px, 1fr)); }
}
@media (max-width: 920px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.open { position: fixed; inset: 0; background: rgba(16,36,63,.38); z-index: 15; }
  .main-shell { margin-left: 0; }
  .menu-toggle { display: inline-grid; place-items: center; }
  .topbar { align-items: flex-start; gap: 14px; }
  .grid.two, .grid.two.uneven, .metric-grid.compact, .auth-panel { grid-template-columns: 1fr; }
  .hero-band, .detail-hero { align-items: flex-start; flex-direction: column; }
  .auth-visual { min-height: 300px; }
}
@media (max-width: 640px) {
  .content, .topbar, .main-shell .footer { padding: 16px; }
  .topbar { flex-wrap: wrap; }
  .topbar h1 { font-size: 20px; }
  .topbar-actions { width: 100%; justify-content: space-between; }
  .user-chip div { display: none; }
  .hero-band h2, .detail-hero h2 { font-size: 24px; }
  .metric-grid, .site-grid, .form-grid, .kanban, .ticket-meta, .donut-grid { grid-template-columns: 1fr; }
  .panel-head { align-items: stretch; flex-direction: column; }
  .bar-row { grid-template-columns: 1fr; }
  .auth-body { padding: 0; }
  .auth-panel { min-height: 100vh; border-radius: 0; }
  .auth-form, .auth-visual { padding: 24px; }
}

/* Final delivery theme */
:root {
  --orange: #f28c28;
  --orange-dark: #c96b13;
  --blue: #f28c28;
  --navy: #172033;
  --navy-2: #25334d;
  --shadow: 0 18px 45px rgba(242, 140, 40, .13);
}
.brand-logo,
.auth-logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: block;
  box-shadow: 0 12px 26px rgba(242, 140, 40, .28);
}
.auth-logo {
  width: 72px;
  height: 72px;
}
.brand-mark,
.logo-box,
.user-chip span,
.profile-card > span {
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
}
.sidebar {
  background: linear-gradient(180deg, #172033 0%, #202b40 100%);
}
.side-nav a.active,
.side-nav a:hover {
  background: rgba(242, 140, 40, .18);
  color: #fff;
}
.side-nav a.active .nav-icon,
.side-nav a:hover .nav-icon {
  background: var(--orange);
  color: #fff;
}
.nav-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255,255,255,.09);
  color: #ffd7ad;
  flex: 0 0 32px;
}
.nav-icon i { font-size: 14px; }
.button.primary {
  background: var(--orange);
  color: #fff;
}
.button.primary:hover { background: var(--orange-dark); }
.button.secondary { background: #fff3e7; color: #8a470b; }
.eyebrow { color: var(--orange); }
.hero-band,
.detail-hero,
.resident-hero {
  background: linear-gradient(135deg, #172033, #2a354d 58%, #5b3517);
}
.bar-row i { background: linear-gradient(90deg, var(--orange), #159b68); }
.donut-item > span { background: conic-gradient(var(--orange) calc(var(--p) * 1%), #e9eef5 0); }
.dot { background: var(--orange); }
.site-card:hover,
.task-card:hover,
.resident-action:hover { border-color: var(--orange); }
.timeline p { border-left-color: var(--orange); }
.auth-visual { background: linear-gradient(140deg, #172033, #583413); }
.auth-panel.clean-login { grid-template-columns: .9fr 1.1fr; }
.auth-metrics,
.demo-users,
.sidebar-footer { display: none; }
.auth-form h2 { color: #172033; }
.auth-link a { color: var(--orange); }
.resident-hero {
  color: #fff;
  border-radius: 8px;
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  box-shadow: var(--shadow);
}
.resident-hero h2 { margin: 0 0 8px; font-size: 30px; }
.resident-hero p { margin: 0; color: #f7dfc4; }
.resident-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.resident-action {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 20px;
  display: grid;
  gap: 10px;
}
.resident-action i {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #fff3e7;
  color: var(--orange-dark);
  font-size: 18px;
}
.resident-action strong { font-size: 18px; }
.resident-action span { color: var(--muted); line-height: 1.5; }
.empty-state { color: var(--muted); margin: 0; }
.compact-list article p { margin-bottom: 0; }
@media (max-width: 920px) {
  .resident-actions { grid-template-columns: 1fr; }
  .resident-hero { align-items: flex-start; flex-direction: column; }
}