* {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
      font-family: Arial, sans-serif;
    }

    :root {
      --bg: #050a12;
      --panel: #0c1422;
      --panel2: #101b2d;
      --border: #24344d;
      --text: #ffffff;
      --muted: #8fa5c5;
      --yellow: #ffc107;
      --green: #20c979;
      --red: #ef4c57;
      --blue: #2196f3;
      --purple: #9c27b0;
    }

    body {
      background: var(--bg);
      color: var(--text);
      min-height: 100vh;
    }

    button,
    input,
    textarea,
    select {
      font: inherit;
    }

    button {
      cursor: pointer;
    }

    .hidden {
      display: none !important;
    }

    /* LOGIN */

    #loginPage {
      min-height: 100vh;
      display: flex;
      justify-content: center;
      align-items: center;
      padding: 20px;
    }

    .login-card {
      width: 100%;
      max-width: 420px;
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 20px;
      padding: 32px;
    }

    .login-logo {
      width: 70px;
      height: 70px;
      margin: 0 auto 18px;
      border-radius: 18px;
      display: flex;
      justify-content: center;
      align-items: center;
      background: var(--yellow);
      color: #000;
      font-size: 30px;
      font-weight: 900;
    }

    .login-card h1 {
      text-align: center;
      font-size: 29px;
    }

    .login-subtitle {
      text-align: center;
      color: var(--muted);
      margin: 8px 0 28px;
    }

    .field {
      margin-bottom: 18px;
    }

    .field label {
      display: block;
      margin-bottom: 8px;
      color: #d8e4f5;
    }

    .input {
      width: 100%;
      padding: 14px 15px;
      background: #07101d;
      color: white;
      border: 1px solid var(--border);
      border-radius: 10px;
      outline: none;
    }

    .input:focus {
      border-color: var(--yellow);
    }

    textarea.input {
      resize: vertical;
      min-height: 130px;
    }

    .primary-btn {
      width: 100%;
      padding: 14px;
      border: none;
      border-radius: 10px;
      background: var(--yellow);
      color: #090909;
      font-weight: 800;
    }

    .message {
      min-height: 22px;
      margin-top: 15px;
      text-align: center;
    }

    .success {
      color: var(--green);
    }

    .error {
      color: var(--red);
    }

    /* ADMIN */

    #adminPage {
      min-height: 100vh;
      display: flex;
    }

    .sidebar {
      width: 292px;
      background:
        linear-gradient(180deg, rgba(255,193,7,.035), transparent 180px),
        #09111e;
      border-right: 1px solid var(--border);
      position: fixed;
      left: 0;
      top: 0;
      bottom: 0;
      padding: 20px 14px 16px;
      z-index: 20;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 5px 8px 20px;
      flex-shrink: 0;
    }

    .brand-logo {
      width: 46px;
      height: 46px;
      border-radius: 12px;
      background: var(--yellow);
      color: #000;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 22px;
      font-weight: 900;
    }

    .brand h2 {
      font-size: 21px;
    }

    .brand small {
      color: var(--muted);
      letter-spacing: 1.3px;
      font-size: 10px;
      font-weight: 700;
    }

    .sidebar-scroll {
      flex: 1;
      overflow-y: auto;
      padding-right: 4px;
      scrollbar-width: thin;
      scrollbar-color: #2f4360 transparent;
    }

    .sidebar-scroll::-webkit-scrollbar {
      width: 5px;
    }

    .sidebar-scroll::-webkit-scrollbar-thumb {
      background: #2f4360;
      border-radius: 20px;
    }

    .nav-group {
      margin-bottom: 17px;
    }

    .nav-section-label {
      padding: 0 12px;
      margin: 0 0 7px;
      color: #5f7698;
      font-size: 10px;
      font-weight: 800;
      letter-spacing: 1.4px;
      text-transform: uppercase;
    }

    .nav-item {
      width: 100%;
      border: none;
      background: transparent;
      color: #b7c5d9;
      padding: 10px 11px;
      margin-bottom: 4px;
      text-align: left;
      border-radius: 10px;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 10px;
      transition: background .18s ease, color .18s ease, transform .18s ease;
    }

    .nav-item:hover,
    .nav-item.active {
      background: #172439;
      color: var(--yellow);
    }

    .nav-item:hover {
      transform: translateX(2px);
    }

    .nav-item.active {
      box-shadow: inset 3px 0 0 var(--yellow);
    }

    .nav-icon {
      width: 30px;
      height: 30px;
      flex: 0 0 30px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border: 1px solid #2c3d58;
      border-radius: 8px;
      background: #0e1929;
      color: #8fa5c5;
      font-size: 9px;
      font-weight: 900;
      letter-spacing: .3px;
    }

    .nav-item:hover .nav-icon,
    .nav-item.active .nav-icon {
      border-color: rgba(255,193,7,.42);
      background: rgba(255,193,7,.09);
      color: var(--yellow);
    }

    .nav-text {
      min-width: 0;
      line-height: 1.25;
      font-size: 13px;
    }

    .logout-nav {
      flex-shrink: 0;
      margin-top: 8px;
      color: #ff7b83;
      border: 1px solid rgba(239,76,87,.15);
    }

    .logout-nav:hover {
      background: rgba(239,76,87,.09);
      color: #ff9299;
    }

    .logout-nav .nav-icon {
      color: #ff7b83;
      border-color: rgba(239,76,87,.22);
      background: rgba(239,76,87,.06);
    }

    .main {
      width: calc(100% - 292px);
      margin-left: 292px;
    }

    .topbar {
      height: 74px;
      border-bottom: 1px solid var(--border);
      background: #08111e;
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 0 28px;
      position: sticky;
      top: 0;
      z-index: 15;
    }

    .topbar h2 {
      font-size: 21px;
    }

    .admin-badge {
      background: #172439;
      border: 1px solid var(--border);
      border-radius: 20px;
      padding: 8px 14px;
      color: var(--yellow);
    }

    .content {
      padding: 28px;
      max-width: 1500px;
      margin: auto;
    }

    .page {
      display: none;
    }

    .page.active {
      display: block;
    }

    .page-title {
      margin-bottom: 25px;
    }

    .page-title h1 {
      font-size: 28px;
      margin-bottom: 6px;
    }

    .page-title p {
      color: var(--muted);
    }

    /* DASHBOARD */

    .stats {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 18px;
      margin-bottom: 28px;
    }

    .stat-card {
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 22px;
    }

    .stat-card span {
      color: var(--muted);
      font-size: 14px;
    }

    .stat-card strong {
      display: block;
      font-size: 31px;
      margin-top: 12px;
    }

    /* TABLE */

    .card {
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 14px;
      overflow: hidden;
      margin-bottom: 24px;
    }

    .card-header {
      padding: 20px;
      border-bottom: 1px solid var(--border);
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .card-header h3 {
      font-size: 18px;
    }

    .refresh-btn {
      border: 1px solid var(--border);
      background: #172439;
      color: white;
      padding: 9px 15px;
      border-radius: 8px;
    }

    .table-wrap {
      overflow-x: auto;
    }

    table {
      width: 100%;
      min-width: 1000px;
      border-collapse: collapse;
    }

    th {
      color: var(--muted);
      font-size: 12px;
      text-align: left;
      padding: 15px;
      border-bottom: 1px solid var(--border);
    }

    td {
      padding: 15px;
      border-bottom: 1px solid #19263a;
      font-size: 14px;
    }

    .amount {
      color: var(--yellow);
      font-weight: bold;
    }

    .status {
      display: inline-block;
      padding: 6px 10px;
      border-radius: 20px;
      font-size: 11px;
      font-weight: 800;
      text-transform: uppercase;
    }

    .pending {
      background: rgba(255,193,7,.13);
      color: var(--yellow);
    }

    .approved {
      background: rgba(32,201,121,.14);
      color: var(--green);
    }

    .rejected {
      background: rgba(239,76,87,.14);
      color: var(--red);
    }

    .action-btn {
      border: none;
      color: white;
      padding: 8px 11px;
      border-radius: 7px;
      margin-right: 5px;
      font-weight: 700;
    }

    .approve-btn {
      background: var(--green);
    }

    .reject-btn {
      background: var(--red);
    }

    .empty {
      padding: 45px;
      text-align: center;
      color: var(--muted);
    }

    /* FORMS */

    .form-card {
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 24px;
      max-width: 800px;
      margin-bottom: 25px;
    }

    .form-card h3 {
      margin-bottom: 22px;
    }

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

    .send-btn {
      border: none;
      padding: 13px 20px;
      background: var(--yellow);
      border-radius: 9px;
      font-weight: 800;
      min-width: 180px;
    }

    .info-box {
      padding: 18px;
      background: #0e1a2b;
      border: 1px dashed #324868;
      border-radius: 10px;
      color: var(--muted);
    }

    /* WITHDRAWAL HISTORY */

    .history-card-header {
      gap: 18px;
    }

    .history-card-header p {
      margin-top: 6px;
      color: var(--muted);
      font-size: 13px;
    }

    .history-count {
      flex: 0 0 auto;
      padding: 7px 11px;
      border: 1px solid rgba(33,150,243,.25);
      border-radius: 20px;
      background: rgba(33,150,243,.08);
      color: #7ec2ff;
      font-size: 11px;
      font-weight: 800;
    }

    .withdrawal-history-toolbar {
      display: grid;
      grid-template-columns: 190px minmax(240px, 1fr) auto;
      gap: 14px;
      align-items: end;
      padding: 18px 20px;
      border-bottom: 1px solid var(--border);
      background: #0a1422;
    }

    .history-filter label {
      display: block;
      margin-bottom: 7px;
      color: var(--muted);
      font-size: 11px;
      font-weight: 800;
      letter-spacing: .5px;
      text-transform: uppercase;
    }

    .history-filter .input {
      padding: 11px 12px;
    }

    .history-refresh-btn {
      min-height: 42px;
      padding-left: 18px;
      padding-right: 18px;
    }

    .withdrawal-history-table {
      min-width: 1450px;
    }

    .history-reference {
      color: #d7e5f8;
      font-weight: 700;
    }

    /* PLACEHOLDER MODULES */

    .page-title-row {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 20px;
    }

    .module-status {
      flex: 0 0 auto;
      display: inline-flex;
      align-items: center;
      gap: 7px;
      padding: 7px 11px;
      border: 1px solid rgba(33,150,243,.3);
      border-radius: 20px;
      background: rgba(33,150,243,.08);
      color: #7ec2ff;
      font-size: 11px;
      font-weight: 800;
      letter-spacing: .5px;
      text-transform: uppercase;
    }

    .module-status::before {
      content: "";
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: var(--blue);
      box-shadow: 0 0 0 4px rgba(33,150,243,.12);
    }

    .placeholder-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 18px;
    }

    .placeholder-card {
      min-height: 180px;
      padding: 22px;
      border: 1px solid var(--border);
      border-radius: 14px;
      background:
        linear-gradient(145deg, rgba(255,255,255,.018), transparent 60%),
        var(--panel);
    }

    .placeholder-card-icon {
      width: 42px;
      height: 42px;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 18px;
      border: 1px solid rgba(255,193,7,.3);
      border-radius: 11px;
      background: rgba(255,193,7,.08);
      color: var(--yellow);
      font-size: 11px;
      font-weight: 900;
      letter-spacing: .7px;
    }

    .placeholder-card h3 {
      margin-bottom: 9px;
      font-size: 17px;
    }

    .placeholder-card p {
      color: var(--muted);
      font-size: 13px;
      line-height: 1.6;
    }

    .placeholder-note {
      margin-top: 18px;
      padding: 16px 18px;
      border: 1px dashed #324868;
      border-radius: 11px;
      background: #0a1422;
      color: var(--muted);
      font-size: 13px;
      line-height: 1.55;
    }

    /* PRODUCTION MODULE STRUCTURE */

    .dashboard-stats {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .stat-card {
      position: relative;
      min-height: 132px;
      background:
        linear-gradient(145deg, rgba(255,255,255,.018), transparent 62%),
        var(--panel);
    }

    .stat-card::after {
      content: "";
      position: absolute;
      left: 22px;
      right: 22px;
      bottom: 0;
      height: 2px;
      border-radius: 2px 2px 0 0;
      background: rgba(255,193,7,.32);
    }

    .stat-meta {
      display: block;
      margin-top: 9px;
      color: #617798;
      font-size: 11px;
      line-height: 1.4;
    }

    .module-toolbar {
      display: flex;
      align-items: flex-end;
      gap: 14px;
      flex-wrap: wrap;
      padding: 18px 20px;
      margin-bottom: 20px;
      border: 1px solid var(--border);
      border-radius: 14px;
      background: var(--panel);
    }

    .module-toolbar .field {
      flex: 1 1 210px;
      min-width: 180px;
      margin: 0;
    }

    .module-toolbar .field.small-field {
      flex: 0 1 180px;
    }

    .toolbar-actions {
      display: flex;
      gap: 10px;
      flex: 0 0 auto;
    }

    .secondary-btn,
    .outline-btn {
      min-height: 44px;
      padding: 10px 16px;
      border-radius: 9px;
      font-weight: 800;
    }

    .secondary-btn {
      border: 1px solid var(--yellow);
      background: var(--yellow);
      color: #080808;
    }

    .outline-btn {
      border: 1px solid var(--border);
      background: #101c2e;
      color: #dce7f7;
    }

    .secondary-btn:disabled,
    .outline-btn:disabled {
      cursor: not-allowed;
      opacity: .48;
    }

    .section-stack {
      display: grid;
      gap: 20px;
    }

    .data-section {
      overflow: hidden;
      border: 1px solid var(--border);
      border-radius: 14px;
      background: var(--panel);
    }

    .data-section-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      padding: 17px 19px;
      border-bottom: 1px solid var(--border);
      background: rgba(255,255,255,.012);
    }

    .data-section-header h3 {
      font-size: 16px;
    }

    .data-section-header p {
      margin-top: 5px;
      color: var(--muted);
      font-size: 12px;
    }

    .read-only-badge {
      flex: 0 0 auto;
      padding: 6px 10px;
      border: 1px solid rgba(33,150,243,.27);
      border-radius: 20px;
      background: rgba(33,150,243,.08);
      color: #7ec2ff;
      font-size: 10px;
      font-weight: 900;
      letter-spacing: .5px;
      text-transform: uppercase;
    }

    .compact-table {
      min-width: 880px;
    }

    .audit-table {
      min-width: 1900px;
    }

    .state-panel {
      padding: 34px 22px;
      text-align: center;
      color: var(--muted);
      background: #0a1422;
    }

    .state-panel strong {
      display: block;
      margin-bottom: 7px;
      color: #dce7f7;
      font-size: 14px;
    }

    .state-panel span {
      display: block;
      max-width: 650px;
      margin: auto;
      font-size: 12px;
      line-height: 1.55;
    }

    .state-panel.loading strong { color: var(--yellow); }
    .state-panel.success strong { color: var(--green); }
    .state-panel.error strong { color: var(--red); }

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

    .summary-card {
      min-height: 110px;
      padding: 18px;
      border: 1px solid var(--border);
      border-radius: 13px;
      background: var(--panel);
    }

    .summary-card span {
      color: var(--muted);
      font-size: 12px;
    }

    .summary-card strong {
      display: block;
      margin-top: 10px;
      color: var(--yellow);
      font-size: 24px;
    }

    .identity-panel {
      display: grid;
      grid-template-columns: minmax(260px, 1.2fr) minmax(300px, 2fr);
      gap: 18px;
      margin-bottom: 20px;
    }

    .identity-card {
      padding: 20px;
      border: 1px solid var(--border);
      border-radius: 14px;
      background: var(--panel);
    }

    .identity-card h3 {
      margin-bottom: 15px;
    }

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

    .detail-line {
      display: flex;
      justify-content: space-between;
      gap: 20px;
      padding-bottom: 9px;
      border-bottom: 1px solid #17243a;
      color: var(--muted);
      font-size: 12px;
    }

    .detail-line strong {
      color: #dce7f7;
      text-align: right;
    }

    .role-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 14px;
      margin-bottom: 20px;
    }

    .role-card {
      padding: 19px;
      border: 1px solid var(--border);
      border-radius: 14px;
      background: var(--panel);
    }

    .role-card h3 {
      margin-bottom: 8px;
      font-size: 16px;
    }

    .role-card p {
      min-height: 58px;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.5;
    }

    .permission-tags {
      display: flex;
      gap: 7px;
      flex-wrap: wrap;
      margin-top: 14px;
    }

    .permission-tag {
      padding: 5px 8px;
      border: 1px solid #2d415e;
      border-radius: 16px;
      color: #aebed4;
      font-size: 9px;
      font-weight: 800;
      text-transform: uppercase;
    }

    .safety-note {
      padding: 15px 17px;
      border: 1px solid rgba(32,201,121,.22);
      border-radius: 11px;
      background: rgba(32,201,121,.055);
      color: #9cb4a9;
      font-size: 12px;
      line-height: 1.55;
    }

    .status-dot {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      color: var(--muted);
      font-size: 11px;
      font-weight: 800;
      text-transform: uppercase;
    }

    .status-dot::before {
      content: "";
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: #617798;
    }

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

      .sidebar {
        width: 210px;
      }

      .main {
        width: calc(100% - 210px);
        margin-left: 210px;
      }

      .placeholder-grid,
      .dashboard-stats,
      .summary-grid,
      .role-grid {
        grid-template-columns: 1fr 1fr;
      }

      .withdrawal-history-toolbar {
        grid-template-columns: 1fr 1fr;
      }
    }

    @media (max-width: 750px) {
      .sidebar {
        position: static;
        width: 100%;
        height: auto;
        max-height: none;
        overflow: visible;
      }

      .sidebar-scroll {
        overflow: visible;
      }

      #adminPage {
        display: block;
      }

      .logout-nav {
        position: static;
        width: 100%;
      }

      .main {
        width: 100%;
        margin-left: 0;
      }

      .stats,
      .row,
      .placeholder-grid,
      .dashboard-stats,
      .summary-grid,
      .role-grid,
      .identity-panel,
      .withdrawal-history-toolbar {
        grid-template-columns: 1fr;
      }

      .module-toolbar,
      .data-section-header {
        align-items: stretch;
        flex-direction: column;
      }

      .toolbar-actions {
        width: 100%;
      }

      .toolbar-actions button {
        flex: 1;
      }

      .page-title-row {
        flex-direction: column;
      }
    }
/* CSP-safe layout utilities replacing former inline style attributes. */
.u-mt-14 { margin-top: 14px; }
.u-mt-16 { margin-top: 16px; }
.u-mt-18 { margin-top: 18px; }
.u-mt-20 { margin-top: 20px; }
.u-mt-24 { margin-top: 24px; }
.u-mt-32 { margin-top: 32px; }
.u-mb-0 { margin-bottom: 0; }
.u-mb-18 { margin-bottom: 18px; }
.u-mb-20 { margin-bottom: 20px; }
.u-pad-18 { padding: 18px; }
.u-flex-gap-10 { display: flex; gap: 10px; }
.u-inset-18 { margin: 18px; }
.u-muted { color: var(--muted); }
.u-font-21 { font-size: 21px; }
.u-hidden { display: none; }
