* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 1180px;
  color: #1f2937;
  background: #edf2f7;
  font-family: Arial, Helvetica, sans-serif;
}

button, input, select { font: inherit; }
button { cursor: pointer; border: 0; }

.admin-login-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    linear-gradient(rgba(16, 25, 36, .82), rgba(16, 25, 36, .9)),
    url("assets/my-ringgit-bg.jpeg") center / cover;
}

.admin-locked .admin-login-screen {
  display: flex;
}

.admin-locked .sidebar,
.admin-locked .admin-main,
.admin-locked .window {
  display: none;
}

.admin-login-card {
  width: 380px;
  padding: 34px 34px 30px;
  background: white;
  border: 1px solid #d8e1e8;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .38);
}

.admin-login-mark {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  place-items: center;
  color: #111827;
  background: linear-gradient(135deg, #f6d778, #b88927);
  border-radius: 50%;
  font-weight: 800;
  letter-spacing: .04em;
}

.admin-login-card h1 {
  margin: 0;
  text-align: center;
  color: #1f2937;
  font-size: 24px;
}

.admin-login-card p {
  margin: 10px 0 22px;
  text-align: center;
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}

.admin-login-card label {
  display: block;
  margin-bottom: 14px;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.admin-login-card input {
  display: block;
  width: 100%;
  height: 40px;
  margin-top: 8px;
  padding: 0 12px;
  border: 1px solid #cfd7df;
  background: #f8fafc;
}

.admin-login-card input:focus {
  outline: 2px solid #93c5fd;
  border-color: #3b82f6;
  background: white;
}

.admin-login-card button {
  width: 100%;
  height: 42px;
  margin-top: 4px;
  color: white;
  background: #37405f;
  font-weight: 700;
}

.admin-login-card small {
  display: block;
  min-height: 18px;
  margin-top: 12px;
  color: #dc2626;
  text-align: center;
  font-size: 12px;
}

.admin-login-card em {
  display: block;
  margin-top: 8px;
  color: #94a3b8;
  text-align: center;
  font-size: 12px;
  font-style: normal;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 230px;
  color: #dbe4eb;
  background: linear-gradient(180deg, #1e3038 0%, #142128 100%);
  box-shadow: 8px 0 24px rgba(15, 23, 42, .08);
}

.sidebar h1 {
  margin: 18px 0 24px;
  text-align: center;
  color: white;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .02em;
}

.admin-user {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 10px;
  align-items: center;
  padding: 0 10px 20px;
}

.admin-user span {
  grid-row: span 2;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #f1f5f9 0 18%, #cbd5e1 19% 42%, #e5e7eb 43%);
}

.admin-user b { color: white; }
.admin-user small { color: #41d6b3; }

.search-menu {
  display: flex;
  height: 38px;
  margin: 0 10px 20px;
  background: #31434d;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 3px;
}

.search-menu input {
  min-width: 0;
  flex: 1;
  padding: 0 12px;
  color: white;
  border: 0;
  background: transparent;
}

.search-menu button {
  width: 38px;
  color: #95a7b2;
  background: transparent;
}

.sidebar nav button {
  position: relative;
  display: block;
  width: 100%;
  height: 52px;
  padding: 0 18px;
  color: #cbd5dc;
  text-align: left;
  background: transparent;
  transition: background .15s, color .15s, padding-left .15s;
}

.sidebar nav button:hover, .sidebar nav .active {
  color: white;
  background: linear-gradient(90deg, #4b74e8, #3c63cf);
  padding-left: 22px;
}

.sidebar nav .group.active {
  background: #15232a;
  box-shadow: inset 0 0 0 2px #1a9fe6;
}

.sidebar nav .sub {
  padding-left: 22px;
  background: #18272e;
}

.sidebar em {
  position: absolute;
  right: 14px;
  top: 16px;
  padding: 2px 6px;
  border-radius: 3px;
  background: #0b8df2;
  font-style: normal;
  font-size: 12px;
}

.admin-main {
  margin-left: 230px;
  min-height: 100vh;
}

.topbar {
  display: grid;
  grid-template-columns: 44px auto auto 1fr auto auto auto auto auto auto auto;
  align-items: center;
  gap: 18px;
  height: 52px;
  padding: 0 18px;
  background: white;
  border-bottom: 1px solid #d8e1e8;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.topbar button {
  background: transparent;
  color: #4b5563;
}

.group-badge {
  padding: 4px 8px;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 2px;
  font-size: 12px;
  font-weight: 700;
}

.avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e5e7eb;
}

.panel {
  display: none;
  margin: 16px;
  padding: 16px;
  background: white;
  border: 1px solid #dfe7ee;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
}

.panel.active { display: block; }

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.dashboard-grid article {
  min-height: 96px;
  padding: 14px 16px;
  background: white;
  border: 1px solid #dfe7ee;
  border-radius: 2px;
  box-shadow: none;
}

.dashboard-grid b {
  display: block;
  margin-top: 8px;
  color: #111827;
  font-size: 24px;
  letter-spacing: 0;
}

.dashboard-grid span {
  display: block;
  margin-top: 8px;
  color: #64748b;
  font-size: 13px;
}

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

.metric-card::after {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 42px;
  height: 42px;
  content: "";
  border-radius: 2px;
  opacity: .10;
}

.metric-card small {
  color: #64748b;
  font-weight: 700;
}

.metric-card.blue::after { background: #2563eb; }
.metric-card.amber::after { background: #f59e0b; }
.metric-card.green::after { background: #059669; }
.metric-card.slate::after { background: #334155; }

.metric-card.blue b { color: #1d4ed8; }
.metric-card.amber b { color: #b45309; }
.metric-card.green b { color: #047857; }
.metric-card.slate b { color: #334155; }

.console-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -16px -16px 14px;
  padding: 14px 18px;
  color: #263241;
  background: #f7fafc;
  border-bottom: 1px solid #dfe7ee;
  box-shadow: inset 4px 0 0 #4b74e8;
}

.console-hero p {
  margin: 0 0 4px;
  color: #70808c;
  font-weight: 700;
  letter-spacing: 0;
  font-size: 12px;
}

.console-hero h2 {
  margin: 0;
  font-size: 20px;
}

.console-hero span {
  display: block;
  margin-top: 5px;
  color: #70808c;
  font-size: 13px;
}

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

.console-actions button,
.section-head button {
  height: 32px;
  padding: 0 14px;
  color: white;
  background: #3a4260;
  border-radius: 2px;
  font-weight: 700;
}

.console-actions button:first-child {
  color: white;
  background: #42cdb6;
}

.console-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.console-layout.lower {
  grid-template-columns: 1.35fr 1fr;
}

.admin-card {
  padding: 0;
  background: white;
  border: 1px solid #dfe7ee;
  border-radius: 2px;
  box-shadow: none;
}

.admin-card h2 {
  margin: 0 0 16px;
  font-size: 16px;
}

.admin-card > h2 {
  margin: 0;
  padding: 12px 14px;
  background: #f7fafc;
  border-bottom: 1px solid #dfe7ee;
}

.admin-card p {
  margin: 0;
  color: #64748b;
}

.panel-note {
  padding: 12px 14px 0;
}

.section-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding: 12px 14px;
  background: #f7fafc;
  border-bottom: 1px solid #dfe7ee;
}

.section-head h2 {
  margin-bottom: 6px;
}

.section-head button {
  color: white;
  background: #334155;
}

.todo-list,
.recent-list {
  display: grid;
  gap: 0;
  padding: 0;
}

.todo-item,
.recent-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 10px 14px;
  background: white;
  border-bottom: 1px solid #edf0f3;
  border-radius: 0;
}

.todo-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: white;
  background: #4b74e8;
  border-radius: 2px;
  font-weight: 700;
  font-size: 12px;
}

.todo-item b,
.recent-item b {
  display: block;
  color: #111827;
}

.todo-item span,
.recent-item span {
  color: #64748b;
  font-size: 13px;
}

.status-pill {
  padding: 4px 8px;
  color: #b45309;
  background: #fef3c7;
  border-radius: 2px;
  font-size: 12px;
  font-weight: 700;
}

.permission-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  max-width: 520px;
  margin: 0 auto;
}

.permission-chip {
  padding: 3px 7px;
  color: #334155;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 2px;
  font-size: 12px;
}

.mini.neutral { background: #64748b; }
.mini.warn-btn { background: #f59e0b; }
button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.profile-summary dl {
  display: grid;
  margin: 0;
  padding: 0 14px;
}

.profile-summary dl div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid #eef2f7;
}

.profile-summary dt {
  color: #64748b;
}

.profile-summary dd {
  margin: 0;
  color: #111827;
  font-weight: 700;
}

.quick-admin {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 14px;
}

.quick-admin button {
  min-height: 42px;
  color: #334155;
  background: #f7f8fa;
  border: 1px solid #d9e0e6;
  border-radius: 2px;
  font-weight: 700;
}

.quick-admin button:hover {
  color: #1d4ed8;
  border-color: #bfdbfe;
  background: #eff6ff;
}

.quick-card h2 {
  margin: 0;
  padding: 12px 14px;
  background: #f7fafc;
  border-bottom: 1px solid #dfe7ee;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 16px;
  padding: 16px;
}

.form-grid label {
  display: block;
  color: #475569;
  font-weight: 700;
}

.form-grid input,
.form-grid select {
  display: block;
  width: 100%;
  height: 38px;
  margin-top: 8px;
  padding: 0 12px;
  border: 1px solid #cfd7df;
  background: white;
}

.save-btn {
  height: 36px;
  margin: 0 0 16px 16px;
  padding: 0 20px;
  color: white;
  background: #37405f;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.toolbar button {
  height: 34px;
  min-width: 38px;
  padding: 0 12px;
  color: #344054;
  background: #f7f8fa;
  border: 1px solid #d9e0e6;
}

.toolbar .dark { color: white; background: #3a4260; }
.toolbar .green { color: white; background: #42cdb6; }
.toolbar .red { color: white; background: #f36b72; }

.toolbar label {
  margin-left: auto;
}

.toolbar input {
  width: 195px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid #d9e0e6;
}

.tabs {
  height: 40px;
  margin: -16px -16px 16px;
  padding: 0 16px;
  background: #e6edf3;
}

.tabs button {
  height: 40px;
  padding: 0 20px;
  color: #8a95a0;
  background: #e9eef3;
}

.tabs .active {
  color: #4b5563;
  background: white;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid #e5e7eb;
  border-bottom: 0;
}

table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  background: white;
}

th, td {
  height: 46px;
  padding: 0 12px;
  text-align: center;
  border-right: 1px solid #edf0f3;
  border-bottom: 1px solid #edf0f3;
  white-space: nowrap;
}

th {
  color: #2d333d;
  font-weight: 700;
  background: #fafafa;
}

.ok, .warn {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 4px;
  border-radius: 50%;
  background: #27c3a5;
}

.warn { background: #f1a808; }

.mini {
  width: 26px;
  height: 26px;
  margin: 0 3px;
  color: white;
  border-radius: 2px;
}

.mini.edit { background: #28b99a; }
.mini.del { background: #ef4444; }

.table-note {
  color: #333;
  margin: 12px 0 0;
}

.window {
  position: fixed;
  left: 50%;
  top: 185px;
  z-index: 20;
  display: none;
  width: 800px;
  max-height: 610px;
  transform: translateX(-50%);
  background: white;
  border: 1px solid #cfd7df;
  box-shadow: 0 12px 40px rgba(15,23,42,.22);
}

.window.open { display: block; }

.window-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 46px;
  padding: 0 18px;
  color: white;
  background: #2d4158;
}

.window-head button {
  color: white;
  background: transparent;
  font-size: 20px;
}

.window-body {
  max-height: 500px;
  overflow-y: auto;
  padding: 16px 160px 20px 54px;
}

.window-body label {
  position: relative;
  display: grid;
  grid-template-columns: 90px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  color: #1f2937;
}

.window-body input, .window-body select {
  height: 33px;
  padding: 0 12px;
  border: 1px solid #cfd7df;
  background: white;
}

.callout {
  position: absolute;
  left: calc(100% + 10px);
  min-width: 110px;
  color: #1f8fa7;
  font-size: 12px;
  font-weight: 700;
}

.upload button {
  height: 32px;
  margin-right: 6px;
  padding: 0 14px;
  color: white;
  background: #ea4d4d;
}

.upload button:last-child {
  background: #334155;
}

.radio {
  color: #374151;
}

.window-foot {
  height: 54px;
  padding: 10px 0 0 144px;
  background: #eef3f5;
  border-top: 1px solid #dce4ea;
}

.window-foot button {
  height: 32px;
  margin-right: 6px;
  padding: 0 18px;
  border: 1px solid #cfd7df;
  background: white;
}

.window-foot .confirm {
  color: white;
  background: #37405f;
}

.compact-window {
  top: 220px;
  width: 560px;
}

.compact-window .window-body {
  padding-right: 60px;
}
