:root {
  --bg-dark: #0f1a1a;
  --bg-surface: #162424;
  --bg-surface-2: #102020;
  --bg-surface-3: #1b2c2c;
  --primary: #2fb34a;
  --primary-soft: rgba(47, 179, 74, 0.14);
  --accent: #f57c00;
  --accent-soft: rgba(245, 124, 0, 0.12);
  --danger: #f87171;
  --warning: #facc15;
  --info: #60a5fa;
  --gold: #d9a441;
  --text-light: #edf6f4;
  --text-muted: #9fb3b3;
  --border-dark: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --shadow-soft: 0 12px 32px rgba(0, 0, 0, 0.22);
  --shadow-strong: 0 20px 48px rgba(0, 0, 0, 0.28);
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font-head: 'Ubuntu', sans-serif;
  --font-ui: 'Space Grotesk', sans-serif;
  --font-body: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --mod-dashboard: #2fb34a;
  --mod-system: #60a5fa;
  --mod-users: #d9a441;
  --mod-log: #a78bfa;
  --mod-approval: #f57c00;
  --mod-asset: #38bdf8;
  --mod-fund: #9d7cf4;
  --mod-expense: #f57c00;
  --mod-raw-material: #2dd4bf;
  --mod-sales: #2fb34a;
  --mod-petty-cash: #d9a441;
  --mod-hr: #f472b6;
  --mod-reports: #a78bfa;
}

* {
  box-sizing: border-box;
}

html, body {
  min-height: 100%;
}
html {
  scrollbar-width: thin;
  scrollbar-color: rgba(47, 179, 74, 0.45) transparent;
}
html::-webkit-scrollbar { width: 6px; height: 6px; }
html::-webkit-scrollbar-track { background: transparent; }
html::-webkit-scrollbar-thumb {
  background: rgba(47, 179, 74, 0.4);
  border-radius: 999px;
}
html::-webkit-scrollbar-thumb:hover {
  background: rgba(47, 179, 74, 0.65);
}

body {
  margin: 0;
  background:
    radial-gradient(950px 520px at 12% 0%, rgba(47, 179, 74, 0.11), transparent 60%),
    radial-gradient(850px 480px at 96% 0%, rgba(245, 124, 0, 0.11), transparent 54%),
    var(--bg-dark);
  color: var(--text-light);
  font-family: var(--font-body);
}

a {
  color: inherit;
}

.admin-wrapper {
  display: flex;
}

.admin-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 282px;
  min-height: 100vh;
  background: linear-gradient(180deg, #152525 0%, #0f1d1d 100%);
  border-right: 1px solid var(--border-dark);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease;
  z-index: 60;
}

.sidebar-head,
.sidebar-bottom {
  padding: 14px 16px;
}

.sidebar-head {
  border-bottom: 1px solid var(--border-dark);
}

.sidebar-brand {
  display: flex;
  gap: 11px;
  align-items: center;
}

.sidebar-brand-logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-title,
.page-title,
.section-title,
.module-card-title,
.panel-title {
  font-family: var(--font-head);
}

.sidebar-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--primary);
  font-weight: 700;
}

.sidebar-user-name {
  margin-top: 4px;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text-light);
}

.sidebar-user-role {
  margin-top: 1px;
  color: var(--text-muted);
  font-size: 11.5px;
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(47, 179, 74, 0.45) transparent;
}
.sidebar-scroll::-webkit-scrollbar { width: 6px; }
.sidebar-scroll::-webkit-scrollbar-track { background: transparent; }
.sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(47, 179, 74, 0.4);
  border-radius: 999px;
}
.sidebar-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(47, 179, 74, 0.65);
}

.sidebar-section-label {
  padding: 0 18px 10px;
  color: rgba(159, 179, 179, 0.54);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 10px;
}

.sidebar-section-label.section-gap {
  margin-top: 14px;
}

.sidebar-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-menu li a {
  margin: 0 10px 6px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  display: flex;
  gap: 11px;
  align-items: center;
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.sidebar-menu li a:hover,
.sidebar-menu li.active a {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-light);
  border-color: rgba(47, 179, 74, 0.12);
  border-left-color: var(--primary);
}

.sidebar-menu li.active a {
  background: rgba(47, 179, 74, 0.12);
  color: var(--primary);
}

.sidebar-bottom {
  border-top: 1px solid var(--border-dark);
}

.sidebar-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 14px;
  width: 100%;
  border-radius: var(--radius-sm);
  text-decoration: none;
  background: var(--accent-soft);
  border: 1px solid rgba(245, 124, 0, 0.22);
}

.sidebar-footer-note {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  color: rgba(159, 179, 179, 0.66);
  font-size: 11px;
}

.sidebar-footer-note a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.sidebar-footer-note a:hover {
  color: var(--text-light);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(47, 179, 74, 0.18);
}

.admin-main {
  width: 100%;
  min-height: 100vh;
  margin-left: 282px;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 72px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(16px);
  background: rgba(15, 26, 26, 0.86);
  border-bottom: 1px solid rgba(47, 179, 74, 0.1);
}

.topbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
  text-align: center;
}

.topbar-spacer {
  width: 40px;
  height: 40px;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-caption {
  font-size: 11px;
  color: rgba(159, 179, 179, 0.76);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.topbar-datetime,
.topbar-user-role-badge {
  color: var(--text-muted);
  font-size: 13px;
}

.topbar-datetime {
  color: var(--text-light);
  font-family: var(--font-ui);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.topbar-user-name {
  font-size: 13px;
  font-weight: 700;
}

.topbar-action-btn,
.topbar-notif-btn,
.sidebar-toggle,
.ghost-btn,
.filter-chip,
.status-action,
.approve-btn,
.reject-btn {
  border: 1px solid var(--border-dark);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-light);
}

.topbar-action-btn,
.topbar-notif-btn,
.ghost-btn,
.filter-chip,
.status-action,
.approve-btn,
.reject-btn {
  text-decoration: none;
}

.topbar-action-btn,
.ghost-btn,
.filter-chip,
.status-action,
.approve-btn,
.reject-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
}

.topbar-action-btn {
  background: var(--primary-soft);
  border-color: rgba(47, 179, 74, 0.22);
}

.topbar-notif-btn,
.sidebar-toggle {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
}

.topbar-notif-btn {
  position: relative;
}

.topbar-notif-dot {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.topbar-user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px 7px 7px;
  border-radius: 999px;
  border: 1px solid var(--border-dark);
  background: rgba(255, 255, 255, 0.03);
}

.topbar-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(47, 179, 74, 0.36), rgba(96, 165, 250, 0.25));
  font-family: var(--font-ui);
  font-weight: 700;
}

.admin-content {
  padding: 28px 24px 36px;
}

.admin-alert {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(47, 179, 74, 0.24);
  background: rgba(47, 179, 74, 0.12);
  color: var(--text-light);
}

.admin-alert.danger {
  border-color: rgba(248, 113, 113, 0.28);
  background: rgba(248, 113, 113, 0.12);
}

.page-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.page-meta {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.page-icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: rgba(47, 179, 74, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 20px;
}

.page-breadcrumb {
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.page-title {
  font-size: 31px;
  margin: 0;
}

.page-subtitle {
  margin-top: 6px;
  max-width: 760px;
  color: var(--text-muted);
}

.page-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.solid-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(47, 179, 74, 0.22), rgba(47, 179, 74, 0.1));
  border: 1px solid rgba(47, 179, 74, 0.28);
  color: var(--text-light);
  text-decoration: none;
}

.ghost-btn {
  color: var(--text-muted);
}

.period-switcher {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.filter-chip {
  padding: 10px 15px;
  font-family: var(--font-ui);
  font-size: 13px;
  cursor: pointer;
}

.filter-chip.active {
  background: rgba(47, 179, 74, 0.12);
  border-color: rgba(47, 179, 74, 0.28);
  color: var(--primary);
}

.summary-grid,
.module-grid,
.panel-grid,
.health-grid {
  display: grid;
  gap: 16px;
}

.summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 22px;
}

.module-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel-grid {
  grid-template-columns: 1.35fr 1fr;
  margin-top: 22px;
}

.health-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 18px;
}

.summary-card,
.panel,
.module-card,
.health-card,
.approval-item,
.stat-band,
.empty-state {
  background: linear-gradient(180deg, rgba(22, 36, 36, 0.96), rgba(16, 32, 32, 0.98));
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.summary-card {
  padding: 18px;
  min-height: 152px;
  border-left: 4px solid var(--primary);
}

.summary-label,
.panel-kicker,
.module-card-meta,
.mini-label,
.empty-copy {
  color: var(--text-muted);
}

.summary-label,
.module-card-title,
.panel-title,
.filter-chip,
.solid-btn,
.ghost-btn {
  font-family: var(--font-ui);
}

.summary-value {
  margin-top: 10px;
  font-size: 30px;
  font-weight: 700;
}

.summary-note {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.panel,
.module-card,
.health-card,
.empty-state {
  padding: 18px;
}

.panel-title,
.module-card-title {
  font-size: 18px;
  margin: 0;
}

.panel-head,
.module-card-head,
.approval-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.panel-kicker {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 11px;
  margin-bottom: 6px;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.mini-stat {
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.mini-value {
  margin-top: 6px;
  font-size: 20px;
  font-weight: 700;
}

.approval-list,
.activity-list,
.status-stack {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.approval-item {
  padding: 16px;
}

.approval-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}

.approval-meta,
.approval-footer,
.activity-item,
.module-card-footer,
.health-footer,
.stat-band {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.approval-meta,
.activity-item,
.health-footer,
.module-card-footer,
.stat-band {
  color: var(--text-muted);
  font-size: 12px;
}

.approval-footer {
  margin-top: 14px;
  align-items: center;
}

.badge-soft,
.priority-badge,
.status-pill,
.permission-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.badge-soft,
.status-pill.pending {
  background: rgba(250, 204, 21, 0.12);
  color: var(--warning);
}

.status-pill.approved,
.status-pill.active,
.status-pill.present,
.status-pill.sync,
.permission-badge.admin {
  background: rgba(47, 179, 74, 0.12);
  color: var(--primary);
}

.status-pill.rejected,
.status-pill.absent,
.permission-badge.none {
  background: rgba(248, 113, 113, 0.12);
  color: var(--danger);
}

.status-pill.late,
.status-pill.deferred {
  background: rgba(245, 124, 0, 0.12);
  color: var(--accent);
}

.status-pill.on-leave,
.status-pill.planned,
.status-pill.access,
.status-pill.updated,
.status-pill.system,
.permission-badge.view {
  background: rgba(96, 165, 250, 0.12);
  color: var(--info);
}

.status-pill.pending-setup {
  background: rgba(250, 204, 21, 0.12);
  color: var(--warning);
}

.priority-badge.high {
  background: rgba(248, 113, 113, 0.12);
  color: var(--danger);
}

.priority-badge.medium {
  background: rgba(96, 165, 250, 0.12);
  color: var(--info);
}

.priority-badge.low {
  background: rgba(47, 179, 74, 0.12);
  color: var(--primary);
}

.status-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.approve-btn {
  background: rgba(47, 179, 74, 0.12);
  color: var(--primary);
  border-color: rgba(47, 179, 74, 0.22);
}

.reject-btn {
  background: rgba(248, 113, 113, 0.12);
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.22);
}

.activity-item {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.activity-item strong,
.health-card strong,
.approval-amount,
.module-card-value {
  color: var(--text-light);
}

.module-card-value {
  margin-top: 14px;
  font-size: 24px;
  font-weight: 700;
}

.module-card {
  position: relative;
  overflow: hidden;
}

.module-card::after {
  content: '';
  position: absolute;
  inset: auto -50px -60px auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
}

.health-card {
  min-height: 158px;
}

.system-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.system-card-link:hover {
  color: inherit;
  transform: translateY(-2px);
  border-color: rgba(47, 179, 74, 0.22);
}

.health-status.connected {
  color: var(--primary);
}

.health-status.planned {
  color: var(--warning);
}

.health-status.observe-only {
  color: var(--info);
}

.health-status.deferred {
  color: var(--accent);
}

.stat-band {
  margin-top: 16px;
  padding: 14px 16px;
}

.search-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.search-box,
.select-box {
  flex: 1 1 220px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--bg-surface-3);
  border: 1px solid var(--border-dark);
  color: var(--text-light);
}

.select-box {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--primary) 50%),
    linear-gradient(135deg, var(--primary) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 2px), calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

.select-box option {
  background: var(--bg-surface-2);
  color: var(--text-light);
}

.table-shell {
  margin-top: 18px;
  overflow: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-dark);
}

/* HR monthly month/year filters — keep on one compact row */
.hr-month-filters {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
}

.hr-month-filters .select-box {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  padding: 6px 28px 6px 10px;
  font-size: 12px;
  border-radius: 10px;
  line-height: 1.3;
}

.hr-month-filters .select-box[name="month"] {
  width: 118px;
}

.hr-month-filters .select-box[name="year"] {
  width: 84px;
}

/* Monthly attendance legend (ERP-style table uses Bootstrap .table-responsive) */
.hr-monthly-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.hr-leg {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: -1px;
}

.hr-leg-p { background: #34d399; }
.hr-leg-a { background: #f87171; }
.hr-leg-w { background: #64748b; }
.hr-leg-l { background: #60a5fa; }
.hr-leg-h { background: #a78bfa; }

.table-shell table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.02);
}

.table-shell th,
.table-shell td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  text-align: left;
  font-size: 13px;
}

.table-shell th {
  color: var(--text-muted);
  font-weight: 600;
}

.table-shell td strong {
  color: var(--text-light);
}

.data-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.detail-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-size: 13px;
}

.detail-row strong {
  color: var(--text-light);
  text-align: right;
}

.inline-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.system-module-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-dark);
  color: var(--text-muted);
  font-size: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.form-grid label {
  color: var(--text-muted);
  font-size: 12px;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-dark);
  color: var(--text-light);
}

.form-grid textarea {
  min-height: 92px;
  resize: vertical;
}

.form-grid.single {
  grid-template-columns: 1fr;
}

.form-grid .full-span {
  grid-column: 1 / -1;
}

.full-width {
  justify-content: center;
  width: 100%;
}

button.solid-btn,
button.approve-btn,
button.reject-btn,
button.status-action {
  cursor: pointer;
}

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mini-input {
  max-width: 160px;
  padding: 9px 11px;
  border-radius: 999px;
  border: 1px solid var(--border-dark);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-light);
  font-size: 12px;
}

.admin-login-body {
  min-height: 100vh;
  margin: 0;
}
.admin-login-bg {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 520px at 18% 0%, rgba(47,179,74,.10), transparent 65%),
    radial-gradient(900px 520px at 90% 8%, rgba(245,124,0,.08), transparent 60%),
    var(--bg-dark);
}
.admin-login-card {
  width: min(440px, 100%);
  padding: 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-dark);
  background: var(--bg-surface);
  box-shadow: var(--shadow-strong);
  overflow: hidden;
}
.admin-login-header { padding: 24px 24px 8px; }
.admin-login-brand { display: flex; gap: 14px; align-items: center; }
.admin-login-logo { width: 56px; height: 56px; object-fit: contain; }
.admin-login-app-name {
  font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--primary); font-weight: 700;
}
.admin-login-title {
  margin: 4px 0 0; font-family: var(--font-head); font-size: 1.6rem; font-weight: 700;
}
.admin-login-body-inner { padding: 16px 24px 24px; }
.admin-login-field { margin-bottom: 16px; }
.admin-login-field label {
  display: block; font-size: 12px; font-weight: 600; margin-bottom: 6px;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em;
}
.admin-input-wrap { position: relative; }
.admin-input-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted);
}
.admin-input-wrap input {
  width: 100%; box-sizing: border-box;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm); color: var(--text-light);
  padding: 10px 12px 10px 38px; font-size: 14px;
}
.admin-pwd-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px;
}
.admin-toast-wrap {
  position: fixed; right: 16px; bottom: 16px; z-index: 1080;
  display: flex; flex-direction: column; gap: 8px;
}
.admin-toast {
  min-width: 240px; max-width: 360px; padding: 12px 16px;
  border-radius: var(--radius-sm); background: var(--bg-surface);
  border: 1px solid var(--border-dark); color: var(--text-light);
  box-shadow: var(--shadow-strong); font-size: 13.5px;
  display: flex; align-items: center; gap: 10px;
}
.admin-toast.success {
  border-color: rgba(47,179,74,0.45);
  background: rgba(47,179,74,0.12);
  color: var(--primary);
}
.admin-toast.danger {
  border-color: rgba(248,113,113,0.4);
  background: rgba(248,113,113,0.12);
  color: var(--danger);
}
.admin-confirm-modal {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-dark) !important;
  color: var(--text-light);
  border-radius: var(--radius-md) !important;
}
.admin-confirm-modal .modal-header,
.admin-confirm-modal .modal-footer { border-color: var(--border-dark); }
.admin-confirm-modal .modal-title { font-size: 1.05rem; font-weight: 700; color: var(--text-light); }
.admin-confirm-message { color: var(--text-muted); margin: 0; line-height: 1.45; }
.admin-confirm-input-wrap { margin-top: 12px; display: none; }
.admin-confirm-input-wrap.show { display: block; }
.admin-confirm-input-label {
  display: block; font-size: 12px; font-weight: 600; margin-bottom: 6px; color: var(--text-muted);
}
.admin-confirm-input { width: 100%; box-sizing: border-box; }

.user-name-cell strong {
  display: block;
  font-size: 15px;
}

.user-meta-line {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.user-system-list {
  max-width: 320px;
}

.system-module-chip.is-all {
  background: rgba(47, 179, 74, 0.12);
  color: var(--primary);
}

.system-module-chip.is-muted {
  opacity: 0.7;
}

.user-row-actions,
.approval-row-actions {
  align-items: center;
}

.icon-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border-dark);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-light);
  text-decoration: none;
}

.icon-action-btn.is-primary {
  background: rgba(217, 164, 65, 0.18);
  border-color: rgba(217, 164, 65, 0.28);
  color: var(--gold);
}

.status-action.is-locked {
  opacity: 0.72;
}

.active-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--text-light);
}

.form-footer-actions {
  margin-top: 18px;
}

.access-system-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.access-system-card {
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.16s ease, background 0.16s ease;
}

.access-system-card.is-on {
  border-color: rgba(47, 179, 74, 0.28);
  background: rgba(47, 179, 74, 0.06);
}

.access-system-card-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
}

.access-system-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(47, 179, 74, 0.1);
  font-size: 18px;
}

.access-system-name {
  margin: 4px 0 0;
  font-size: 17px;
}

.access-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.access-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.access-toggle-track {
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--border-dark);
  position: relative;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.access-toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.16s ease;
}

.access-toggle input:checked + .access-toggle-track {
  background: rgba(47, 179, 74, 0.28);
  border-color: rgba(47, 179, 74, 0.42);
}

.access-toggle input:checked + .access-toggle-track::after {
  transform: translateX(20px);
}

.access-toggle input:disabled + .access-toggle-track {
  opacity: 0.55;
  cursor: not-allowed;
}

.access-modules-wrap {
  margin-top: 18px;
  display: grid;
  gap: 18px;
}

.access-modules-panel {
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  padding: 16px;
}

.access-modules-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--primary);
  font-family: var(--font-head);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.access-module-icon {
  color: var(--primary);
  margin-right: 8px;
}

.permission-picker {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.permission-option {
  position: relative;
  cursor: pointer;
}

.permission-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.permission-option .permission-badge {
  opacity: 0.45;
  border: 1px solid transparent;
  transition: opacity 0.16s ease, transform 0.16s ease, border-color 0.16s ease;
}

.permission-option input:checked + .permission-badge {
  opacity: 1;
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.12);
}

.permission-option input:disabled + .permission-badge {
  cursor: not-allowed;
}

.access-modules-empty {
  padding: 18px;
  border: 1px dashed var(--border-dark);
  border-radius: var(--radius-md);
  text-align: center;
  color: var(--text-muted);
}

.admin-modal[hidden] {
  display: none;
}

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
}

.admin-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
}

.admin-modal-dialog {
  position: relative;
  width: min(720px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-dark);
  background: linear-gradient(180deg, #172727 0%, #101d1d 100%);
  box-shadow: var(--shadow-strong);
  padding: 22px;
}

.admin-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-modal-close {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-dark);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-light);
  cursor: pointer;
}

.approval-modal-actions {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border-dark);
}

.filter-chip[aria-disabled='true'] {
  cursor: not-allowed;
  opacity: 0.58;
}

.empty-state {
  margin-top: 18px;
  text-align: center;
}

.empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 50;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 1199.98px) {
  .summary-grid,
  .health-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 991.98px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }

  .admin-sidebar.active {
    transform: translateX(0);
  }

  .admin-main {
    margin-left: 0;
  }

  .admin-topbar,
  .admin-content {
    padding-left: 18px;
    padding-right: 18px;
  }

  .topbar-action-btn span,
  .topbar-user-role-badge {
    display: none;
  }
}

@media (min-width: 992px) {
  .sidebar-toggle,
  .sidebar-overlay {
    display: none;
  }
}

@media (max-width: 767.98px) {
  .summary-grid,
  .health-grid,
  .module-grid,
  .data-grid,
  .form-grid,
  .metric-row,
  .access-system-grid {
    grid-template-columns: 1fr;
  }

  .page-header,
  .page-meta,
  .topbar-right,
  .approval-footer,
  .approval-meta,
  .activity-item,
  .module-card-footer,
  .health-footer,
  .stat-band,
  .detail-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .detail-row strong {
    text-align: left;
  }

  .admin-topbar {
    height: auto;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .page-title {
    font-size: 26px;
  }
}

@media (max-width: 575.98px) {
  .admin-content {
    padding-top: 22px;
  }

  .summary-card,
  .panel,
  .module-card,
  .health-card,
  .approval-item,
  .empty-state {
    padding: 16px;
  }
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border-dark);
  flex-wrap: wrap;
}

.pagination-pages {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination-page {
  min-width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--border-dark);
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.pagination-page:hover,
.pagination-page.is-active {
  color: #fff;
  border-color: rgba(47, 179, 74, 0.42);
  background: rgba(47, 179, 74, 0.18);
}

.ghost-btn.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.account-status-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--border-dark);
  background: rgba(255, 255, 255, 0.02);
}

.account-status-label-wrap {
  display: block;
}

.account-status-label {
  display: block;
  margin-bottom: 10px;
  color: var(--text-muted);
  font-size: 13px;
}

.account-status-toggle {
  gap: 12px;
}

.access-toggle-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.approval-modal-loading {
  padding: 18px 4px;
  color: var(--text-muted);
}

.approval-detail-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-dark);
}

.dashboard-lifetime-row {
  margin-bottom: 22px;
}

.dashboard-summary-card {
  height: 100%;
  margin-bottom: 0;
}

.dashboard-filter-panel {
  margin-top: 22px;
}

.dashboard-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.dashboard-period-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dashboard-filter-selects {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.dashboard-select-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 13px;
}

.dashboard-select-wrap .select-box {
  min-width: 140px;
  flex: 0 0 auto;
  background-color: var(--bg-surface-3);
  border-color: rgba(47, 179, 74, 0.22);
}

.dashboard-select-wrap .select-box:focus {
  outline: none;
  border-color: rgba(47, 179, 74, 0.55);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.dashboard-chart-panel {
  margin-top: 22px;
}

.dashboard-chart-row {
  margin-top: 4px;
}

.dashboard-chart-row > [class*='col-'] {
  display: flex;
}

.dashboard-chart-shell {
  position: relative;
  width: 100%;
  height: 300px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--border-dark);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.dashboard-chart-shell-wide {
  height: 340px;
}

.dashboard-breakdown-shell {
  display: flex;
  flex-direction: column;
}

.dashboard-breakdown-title {
  flex: 0 0 auto;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.dashboard-chart-canvas-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-height: 100%;
}

.dashboard-breakdown-canvas-wrap {
  height: 220px;
  max-height: 220px;
}

.dashboard-chart-canvas-wrap-wide {
  height: 300px;
  max-height: 300px;
}

.dashboard-chart-canvas-wrap canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-height: 100%;
}

@media (max-width: 991.98px) {
  .dashboard-chart-shell,
  .dashboard-chart-shell-wide {
    height: 280px;
  }

  .dashboard-breakdown-canvas-wrap,
  .dashboard-chart-canvas-wrap-wide {
    height: 220px;
    max-height: 220px;
  }
}
