:root {
  --ink: #102d25;
  --forest: #174c38;
  --forest-2: #276b4f;
  --cream: #fcfbf8;
  --canvas: #f8f7f4;
  --line: #e7e7e1;
  --muted: #6d716d;
  --soft: #edebe2;
  --orange: #d76600;
  --success-bg: #d5f8e8;
  --success: #00633e;
  --light-green: #10b981;
  --danger: #b63b30;
  --operator-blue: #164b82;
  --operator-bg: #eaf2fc;
  font-family: "DM Sans", sans-serif;
  color: var(--ink);
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--canvas);
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.5;
}

* { box-sizing: border-box; }
body { min-width: 320px; }
button, input, select { font: inherit; }
button { cursor: pointer; }

#app {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; border-top: 2px solid #454545; width: 100%; max-width: 100%; }
.login-brand { min-height: 100%; padding: 44px 40px; background: var(--forest); color: #fff; display: flex; flex-direction: column; }
.brand { display: flex; gap: 10px; align-items: center; }
.brand-mark { height: 38px; width: 38px; border: 2px solid currentColor; border-radius: 12px 12px 12px 4px; display: grid; place-items: center; font-family: Manrope, sans-serif; font-size: 20px; font-weight: 800; transform: rotate(-8deg); }
.brand-mark span { transform: rotate(8deg); }
.brand-copy strong { font: 700 16px/1 Manrope, sans-serif; letter-spacing: -.5px; }
.brand-copy small, .eyebrow { display: block; margin-top: 4px; color: #b8b19a; font-size: 11px; letter-spacing: 1.5px; font-weight: 700; }
.login-pitch { margin: auto 0; max-width: 520px; }
.login-pitch h1 { margin: 18px 0 16px; max-width: 480px; font: 700 clamp(30px, 3.2vw, 44px)/1.1 Manrope, sans-serif; letter-spacing: -1.5px; }
.login-pitch p { color: #d2cfb9; font-size: 15px; line-height: 1.55; max-width: 460px; }
.login-tagline { margin: 0; color: #b8b19a; font-size: 12px; font-weight: 600; letter-spacing: 1.8px; }
.login-form-wrap { display: grid; place-items: center; padding: 36px 32px; background: var(--cream); }
.login-form { width: min(100%, 460px); }
.login-form h2 { margin: 0; font: 700 28px/1.2 Manrope, sans-serif; letter-spacing: -1px; }
.login-form > p { margin: 8px 0 24px; color: #4e5258; font-size: 14.5px; }
label { color: #1b2e29; font-weight: 600; font-size: 13.5px; display: block; margin: 0 0 7px; }
.field { position: relative; margin-bottom: 18px; width: 100%; max-width: 100%; }
.field-icon { position: absolute; left: 14px; top: 35px; color: #9a9d9e; font-size: 16px; pointer-events: none; }
.input { width: 100%; height: 44px; border: 1px solid #dedfdc; border-radius: 12px; color: var(--ink); outline: none; padding: 0 14px 0 44px; background: #fffefa; font-size: 14px; transition: border .2s, box-shadow .2s; box-sizing: border-box; }
.input:focus { border-color: var(--forest); box-shadow: 0 0 0 3px #164b3720; }
.password-input { padding-right: 44px; }
.toggle-pass { position: absolute; right: 10px; top: 33px; width: 32px; height: 32px; border: 0; background: transparent; color: #949a99; display: grid; place-items: center; font-size: 15px; cursor: pointer; }
.btn { border: 0; border-radius: 12px; min-height: 42px; padding: 0 18px; background: var(--forest); color: #fff; font-weight: 700; font-size: 13.5px; display: inline-flex; gap: 8px; align-items: center; justify-content: center; transition: transform .15s, background .15s; }
.btn:hover { background: #0d3928; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-block { width: 100%; height: 44px; font-size: 14.5px; }
.form-note { margin: 14px 0 0; color: var(--muted); text-align: center; font-size: 12px; }
.portal-choice { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; padding: 4px; margin: -6px 0 20px; background: #efeee8; border-radius: 11px; }
.portal-choice button { border: 0; border-radius: 8px; padding: 9px 8px; color: #5f6663; background: transparent; font-weight: 700; font-size: 13px; transition: background .15s, color .15s; }
.portal-choice button.selected { color: #fff; background: var(--forest); box-shadow: 0 2px 5px #102d2526; }

/* Portal Layout Modes */
.portal { min-height: 100vh; width: 100%; max-width: 100%; overflow-x: hidden; background: var(--cream); }
.portal.drawer-portal { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.portal.drawer-portal .main { width: 100%; max-width: 100%; min-width: 0; overflow-x: hidden; }
.portal.drawer-portal .sidebar { width: 260px; height: 100vh; position: sticky; top: 0; display: flex; flex-direction: column; background: #fcfbf8; border-right: 1px solid var(--line); z-index: 100; transform: none; box-shadow: none; }
.portal.drawer-portal .sidebar.is-open { transform: none; box-shadow: none; }

/* Backdrop */
.drawer-backdrop { display: none; }

/* Navigation Toggle Button */
.nav-toggle-btn { display: none; }
.drawer-close-btn { display: none; }

.side-brand { height: 64px; padding: 0 22px; display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.side-brand .brand-mark { width: 34px; height: 34px; font-size: 18px; color: var(--forest); }
.side-brand .brand-copy strong { font-size: 15px; }
.side-brand .brand-copy small { color: #858583; font-size: 9.5px; margin-top: 2px; }
.nav { padding: 14px 12px; display: grid; gap: 4px; }
.nav button { border: 0; background: transparent; color: #626765; border-radius: 11px; height: 44px; padding: 0 14px; display: flex; align-items: center; gap: 12px; font-size: 13.5px; text-align: left; transition: background .15s, color .15s; }
.nav button:hover { background: #f1f2ed; }
.nav button.active { background: var(--forest); color: #fff; font-weight: 600; }
.nav button.active.operator-active { background: var(--operator-blue); }
.nav-icon { width: 16px; text-align: center; font-size: 17px; color: currentColor; }
.nav-badge { margin-left: auto; background: var(--orange); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; }

/* Sidebar Nav Dropdown & Submenu */
.nav-dropdown { display: flex; flex-direction: column; width: 100%; }
.nav-item-wrap { display: flex; align-items: center; width: 100%; position: relative; }
.nav-item-wrap > button:first-child { width: 100%; padding-right: 44px; }
.nav-arrow-btn { position: absolute; right: 8px; width: 30px; height: 30px; display: grid; place-items: center; border: 0; background: transparent; color: #626765; cursor: pointer; border-radius: 7px; font-size: 13px; transition: transform 0.22s ease, background 0.15s, color 0.15s; }
.nav-arrow-btn:hover { background: rgba(0, 0, 0, 0.08); color: var(--ink); }
.nav-item-wrap > button.active + .nav-arrow-btn { color: rgba(255, 255, 255, 0.85); }
.nav-item-wrap > button.active + .nav-arrow-btn:hover { background: rgba(255, 255, 255, 0.25); color: #fff; }
.nav-arrow-btn.expanded { transform: rotate(180deg); }
.nav-submenu { display: none; flex-direction: column; gap: 3px; padding: 4px 0 4px 12px; border-left: 2px solid #dfded5; margin: 3px 0 4px 20px; animation: slideDown .2s ease-out; }
.nav-submenu.is-open { display: flex; }
.nav-subitem { border: 0; background: transparent; color: #626765; border-radius: 9px; height: 38px; padding: 0 10px; display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; text-align: left; transition: background .15s, color .15s; cursor: pointer; white-space: nowrap; }
.nav-subitem:hover { background: #f1f2ed; color: var(--ink); }
.nav-subitem.active { background: var(--forest); color: #fff; font-weight: 700; }
.nav-sub-icon { width: 14px; text-align: center; font-size: 14px; color: currentColor; flex-shrink: 0; }

.sidebar-footer { border-top: 1px solid var(--line); margin-top: auto; padding: 14px 20px 18px; }
.profile { display: flex; gap: 10px; align-items: center; min-width: 0; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; background: #e9e6d8; color: var(--forest); font: 700 15px Manrope, sans-serif; }
.avatar.operator-avatar { background: var(--operator-bg); color: var(--operator-blue); }
.profile-text { min-width: 0; }
.profile-text strong, .profile-text span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-text strong { font-size: 13px; }
.profile-text span { color: #858583; font-size: 11.5px; margin-top: 2px; }
.sign-out { color: #606560; border: 0; background: transparent; margin-top: 16px; padding: 0 2px; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.sign-out:hover { color: var(--forest); }

.main { min-width: 0; }
.topbar { min-height: 58px; padding: 8px 22px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); background: #fffefa; box-sizing: border-box; }
.topbar-brand-zone { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 auto; }
.topbar-headings { display: flex; flex-direction: column; justify-content: center; min-width: 0; overflow: hidden; }
.console-title { font-size: 14px; font-weight: 800; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.console-label { color: #69706e; letter-spacing: 0.1px; font-size: 11px; font-weight: 500; text-transform: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; margin-top: 1px; }
.role-badge { display: inline-flex; align-items: center; border-radius: 999px; font-weight: 700; padding: 4px 11px; font-size: 11.5px; flex: 0 0 auto; white-space: nowrap; }
.role-badge.admin { background: #e0f0e8; color: var(--forest); }
.role-badge.operator { background: var(--operator-bg); color: var(--operator-blue); }
.role-badge.agent { background: #fef0db; color: #9c5800; }
.content { padding: 22px 28px; max-width: 1440px; margin: 0 auto; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 24px; }
.page-heading h1 { margin: 0; font: 700 24px/1.2 Manrope, sans-serif; letter-spacing: -0.6px; }
.page-heading p { color: #4f5656; margin: 4px 0 0; font-size: 13.5px; }
.page-heading .btn { margin-bottom: 2px; }

.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.metrics.metrics-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.metrics.metrics-5 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.metric { min-height: 98px; padding: 18px 20px; border: 1px solid var(--line); background: #fffefa; border-radius: 16px; box-shadow: 0 8px 18px rgba(29, 53, 44, .03); }
.metric h3 { color: #73777a; margin: 0; font-size: 11.5px; letter-spacing: 1.2px; font-weight: 700; }
.metric p { margin: 10px 0 0; font: 600 24px/1 Manrope, sans-serif; letter-spacing: -0.5px; }
.metric.earnings p { color: var(--orange); }
.metric.highlight p { color: var(--operator-blue); }
.metric.commission p { color: var(--forest); font-weight: 800; }
.metric .metric-sub { font-size: 11.5px; color: var(--muted); margin-top: 6px; font-weight: 600; }

/* Dashboard Commission Filter Bar */
.dashboard-filter-bar { padding: 12px 18px; margin-bottom: 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; background: #fffefa; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 4px 14px rgba(16, 45, 37, 0.035); }
.filter-controls-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-heading-label { font-size: 12px; font-weight: 800; color: var(--forest); text-transform: uppercase; letter-spacing: 0.5px; }
.filter-pills { display: inline-flex; gap: 4px; background: #eeede6; padding: 3px; border-radius: 12px; flex-wrap: wrap; }
.pill-btn { border: 0; background: transparent; color: #5f6663; border-radius: 8px; padding: 6px 12px; font-size: 12.5px; font-weight: 700; cursor: pointer; transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease; }
.pill-btn:hover { background: #e0ded5; color: var(--ink); }
.pill-btn.active { background: var(--forest); color: #fff; box-shadow: 0 2px 5px rgba(16, 45, 37, 0.18); }
.filter-inputs-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-input-wrap { display: flex; align-items: center; gap: 6px; }
.filter-input-wrap label { font-size: 12px; margin: 0; font-weight: 600; color: var(--ink); }
.filter-date-input { height: 34px; padding: 0 10px; width: auto; font-size: 12.5px; border-radius: 8px; border: 1px solid #dedfdc; background: #fff; }
.active-filter-badge { font-size: 11.5px; font-weight: 700; color: var(--forest); background: #e0f0e8; padding: 5px 11px; border-radius: 8px; border: 1px solid #c2e2d2; display: inline-flex; align-items: center; gap: 5px; }

/* Company Settlement & Financial Tracking Dashboard */
.consolidated-total-card { background: linear-gradient(135deg, #102d25 0%, #081e18 100%); color: #fff; border-radius: 18px; padding: 20px 24px; margin-bottom: 20px; box-shadow: 0 10px 24px rgba(16, 45, 37, 0.16); border: 1px solid rgba(255,255,255,0.12); }
.consolidated-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; border-bottom: 1px solid rgba(255,255,255,0.15); padding-bottom: 10px; flex-wrap: wrap; gap: 8px; }
.consolidated-title { font-size: 13px; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; color: #a4ddc3; display: flex; align-items: center; gap: 6px; }
.consolidated-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.consolidated-stat { background: rgba(255, 255, 255, 0.06); padding: 12px 14px; border-radius: 11px; border: 1px solid rgba(255,255,255,0.09); }
.consolidated-stat .stat-label { font-size: 10.5px; color: #b2c9be; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 700; display: block; margin-bottom: 4px; }
.consolidated-stat .stat-val { font-size: 18px; font-weight: 800; font-family: Manrope, sans-serif; color: #fff; line-height: 1.15; }
.consolidated-stat .stat-val.highlight { color: #52e1a3; }
.consolidated-stat .stat-val.gold { color: #f9cb5d; }
.consolidated-stat .stat-sub { font-size: 10px; color: #9bb7aa; margin-top: 4px; font-weight: 500; }

.company-tracking-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; margin-bottom: 20px; }
.company-fin-card { background: #fffefa; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: 0 8px 20px rgba(31, 51, 43, 0.035); display: flex; flex-direction: column; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.company-fin-card:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(31, 51, 43, 0.06); }
.comp-fin-header { padding: 16px 20px 12px; border-bottom: 1px solid var(--line); background: #faf9f4; display: flex; justify-content: space-between; align-items: flex-start; }
.comp-fin-title-wrap h3 { margin: 4px 0 2px; font-size: 16px; font-weight: 800; color: var(--ink); }
.comp-fin-tagline { font-size: 11.5px; color: var(--muted); margin: 0; }
.comp-fin-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.comp-fin-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 11px; border-radius: 10px; background: #fdfdfb; border: 1px solid #f0efe8; }
.comp-fin-row.highlight-row { background: #eef8f3; border-color: #c9e8d8; }
.comp-fin-label { font-size: 12px; color: #5b625f; font-weight: 600; display: flex; align-items: center; gap: 5px; }
.comp-fin-value { font-size: 13.5px; font-weight: 800; color: var(--ink); text-align: right; }
.comp-fin-value.green { color: var(--forest); }
.comp-fin-value.orange { color: #c86300; }
.comp-fin-footer { padding: 11px 20px; background: #f7f6f0; border-top: 1px solid var(--line); font-size: 11px; color: #626966; display: flex; flex-direction: column; gap: 3px; line-height: 1.35; }

.card { background: #fffefa; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 8px 20px rgba(31, 51, 43, .03); max-width: 100%; box-sizing: border-box; }
.card:not(.table-wrap) { overflow: hidden; }
.table-wrap { width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; min-width: 780px; border-collapse: collapse; }
.data-table th { color: #727679; font-size: 12px; letter-spacing: .3px; font-weight: 700; text-align: left; padding: 12px 16px; white-space: nowrap; }
.data-table td { border-top: 1px solid var(--line); padding: 12px 16px; font-size: 13.5px; vertical-align: middle; }
.data-table tr:hover td { background: #fdfdfb; }
.agent-name { max-width: 180px; line-height: 1.35; }
.money { white-space: nowrap; }
.total { font-weight: 700; }
.status { display: inline-flex; align-items: center; border-radius: 999px; font-weight: 600; padding: 4px 10px; font-size: 12px; }
.status.approved, .status.completed, .status.active { background: var(--success-bg); color: var(--success); }
.status.pending { background: #fff0cc; color: #8a5600; }
.status.frozen, .status.rejected { background: #f6dcda; color: #9c2f26; }
.actions { display: flex; gap: 8px; align-items: center; }

/* Table Actions Dropdown Menu */
.actions-dropdown { position: relative; display: inline-block; text-align: left; z-index: 10; }
.actions-dropdown:has(.action-dropdown-menu.is-open) { z-index: 1050; }
.action-dropdown-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; font-size: 12.5px; font-weight: 700; border-radius: 8px; border: 1.5px solid #2d3748; background: #fffefa; color: var(--ink); cursor: pointer; white-space: nowrap; transition: all .15s ease; }
.action-dropdown-toggle:hover, .action-dropdown-toggle.is-open { background: #eef6f1; border-color: var(--forest); color: var(--forest); }
.action-dropdown-menu { display: none; position: absolute; right: 0; top: calc(100% + 5px); width: 210px; background: #ffffff; border: 1px solid #d0dbd4; border-radius: 12px; box-shadow: 0 14px 32px rgba(16, 45, 37, 0.2); padding: 6px; z-index: 1100; animation: menuFadeIn .14s ease-out; }
.action-dropdown-menu.is-open { display: flex; flex-direction: column; gap: 2px; }
@keyframes menuFadeIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }
.action-menu-item { width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 12px; font-size: 12.5px; font-weight: 600; color: var(--ink); border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: background .12s, color .12s; white-space: nowrap; }
.action-menu-item:hover { background: #f2f7f4; color: var(--forest); }
.action-menu-item.credit-item { color: #0d8a54; }
.action-menu-item.credit-item:hover { background: #e8f8f0; color: #097043; }
.action-menu-item.debit-item { color: #b63b30; }
.action-menu-item.debit-item:hover { background: #fdf2f1; color: #9c2f26; }
.action-menu-item.freeze-item { color: #c0392b; }
.action-menu-item.freeze-item:hover { background: #fdf0ee; }
.action-menu-item.unfreeze-item { color: var(--success); }
.action-menu-item.unfreeze-item:hover { background: #e8f8f0; }
.action-menu-divider { height: 1px; background: #e7ede9; margin: 3px 0; }
.outline-btn { border: 1.5px solid #d0d9d3; border-radius: 10px; height: 38px; padding: 0 14px; background: #fffefa; color: var(--ink); font-size: 13px; font-weight: 700; transition: border-color .15s, background .15s, color .15s; }
.outline-btn:hover { border-color: var(--forest); background: #f6faf7; }
.outline-btn.active { background: var(--forest); color: #fff; border-color: var(--forest); }
.outline-btn.success { color: var(--success); border-color: #a4ddc3; }
.outline-btn.success:hover { background: #eafaf1; border-color: var(--success); }
.outline-btn.danger { color: var(--danger); border-color: #efc5c1; }
.outline-btn.danger:hover { background: #fdf2f1; border-color: var(--danger); }
.activity-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.date-filter { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.date-filter label { font-size: 12px; margin-bottom: 4px; color: var(--muted); }
.date-filter input { height: 38px; border-radius: 10px; border: 1px solid #dedfdc; padding: 0 10px; font-size: 13px; outline: none; background: #fffefa; }
.text-button { border: 0; background: transparent; color: var(--muted); font-size: 13px; text-decoration: underline; padding: 8px; cursor: pointer; }
.text-button:hover { color: var(--ink); }
.activity-kind { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 7px; }
.recharge-kind { background: #e6f7ff; color: #0050b3; }
.bill-kind { background: #fff7e6; color: #d46b08; }

.empty { padding: 50px 24px; text-align: center; color: var(--muted); }
.empty .empty-icon { display: grid; place-items: center; height: 44px; width: 44px; margin: 0 auto 12px; border-radius: 50%; background: var(--soft); font-size: 20px; }
.empty h3 { color: var(--ink); margin: 0 0 4px; font-size: 16px; }
.empty p { margin: 0; font-size: 13px; }
.table-empty { min-height: 120px; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 24px; }

.two-column { display: grid; grid-template-columns: minmax(0, 760px) 340px; align-items: start; gap: 20px; }
.form-card { padding: 24px; }
.form-card .field { margin-bottom: 18px; }
.form-card .field-icon { top: 35px; }
.password-input { padding-right: 42px; }
.toggle-pass { position: absolute; right: 12px; top: 41px; width: 34px; height: 34px; border: 0; background: transparent; color: #949a99; display: grid; place-items: center; font-size: 16px; cursor: pointer; }
.account-card { min-height: 415px; border-radius: 19px; padding: 39px 37px; color: #fff; background: var(--forest); }
.account-card.operator-theme { background: var(--operator-blue); }
.account-card .eyebrow { margin: 0; color: #f1dda0; }
.account-card h3 { margin: 19px 0 1px; font: 500 19px Manrope, sans-serif; }
.account-card .email { margin: 0; font-size: 15px; }
.account-card .role-badge { margin-top: 15px; color: #fff; background: #4b8068; padding: 5px 13px; font-size: 12px; }
.account-card.operator-theme .role-badge { background: #3b6ea8; }
.rules { list-style: none; padding: 23px 0 0; margin: 7px 0 0; }
.rules li { margin: 17px 0; font-size: 15px; }
.rules li::before { content: "✓"; display: inline-grid; place-items: center; width: 16px; height: 16px; margin-right: 10px; border: 1px solid #f1dda0; border-radius: 50%; color: #f1dda0; font-size: 10px; font-weight: 700; }

.modal-backdrop { position: fixed; z-index: 10; inset: 0; display: grid; place-items: center; padding: 20px; background: #102d2573; }
.modal { width: min(100%, 520px); border-radius: 21px; padding: 30px; background: #fffefa; box-shadow: 0 20px 80px #0a211680; }
.modal-top { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 26px; }
.modal h2 { margin: 0; font: 700 26px Manrope, sans-serif; letter-spacing: -1px; }
.modal p { margin: 6px 0 0; color: var(--muted); }
.icon-btn { border: 0; border-radius: 10px; height: 35px; width: 35px; background: var(--soft); color: var(--ink); font-size: 21px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 25px; }
.secondary-btn { border: 1px solid #cfd8d2; border-radius: 13px; min-height: 47px; padding: 0 19px; background: transparent; color: var(--ink); font-weight: 700; }

.toast { position: fixed; right: 28px; bottom: 27px; z-index: 20; max-width: min(420px, calc(100vw - 40px)); padding: 15px 18px; border-radius: 13px; color: #fff; background: var(--forest); box-shadow: 0 12px 35px #102d2540; animation: slidein .25s ease-out; }
.toast.error { background: var(--danger); }
@keyframes slidein { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: none; } }

/* Agent workspace */
.agent-heading { margin-bottom: 35px; }
.agent-balance-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(290px, .75fr); gap: 22px; }
.wallet-hero { position: relative; min-height: 188px; overflow: hidden; padding: 36px; color: #fff; border-radius: 21px; background: var(--forest); }
.wallet-hero::after { content: ""; position: absolute; right: -28px; top: 25px; width: 165px; height: 165px; border: 18px solid #6e9a8838; border-radius: 28px; transform: rotate(45deg); }
.wallet-hero .eyebrow { margin: 0; color: #f1dda0; }
.wallet-hero p { position: relative; z-index: 1; margin: 19px 0 0; font: 500 52px/1 Manrope, sans-serif; letter-spacing: -2px; }
.wallet-glyph { position: absolute; right: 34px; bottom: 17px; z-index: 1; color: #8ab19e54; font: 800 105px/1 Manrope, sans-serif; }
.today-card { min-height: 188px; padding: 30px; border: 1px solid var(--line); border-radius: 21px; background: #fffefa; box-shadow: 0 10px 24px rgba(31, 51, 43, .035); }
.today-card .eyebrow { margin: 0; color: #777c80; }
.today-card h2 { margin: 20px 0 4px; font: 500 31px/1.1 Manrope, sans-serif; letter-spacing: -1.2px; }
.today-card p { margin: 0; font-size: 15px; }
.today-card small { display: block; margin-top: 19px; color: #808583; font-size: 13px; }
.quick-actions { display: grid; gap: 13px; margin: 21px 0 37px; }
.quick-actions button { min-height: 53px; border-radius: 14px; font-size: 15px; font-weight: 700; }
.quick-recharge { border: 0; color: #fff; background: var(--orange); }
.quick-recharge:hover { background: #b74f00; }
.quick-outline { border: 2px solid var(--forest); color: var(--forest); background: transparent; }
.quick-outline:hover { background: #f2f8f5; }
.ledger-preview { padding: 20px 27px 0; }
.card-title { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.card-title h2, .upi-card h2, .recharge-form h2, .request-table h2 { margin: 0; font: 700 18px Manrope, sans-serif; letter-spacing: -.6px; }
.link-button { border: 0; background: transparent; color: var(--forest); font-size: 14px; }
.link-button:hover { text-decoration: underline; }
.ledger-empty { min-height: 118px; }
.compact-table { min-width: 760px; }
.recharge-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 27px; }
.upi-card { min-height: 540px; padding: 30px 24px; text-align: center; }
.upi-card > h2 { text-align: left; }
.qr-shell { display: grid; place-items: center; height: 263px; margin: 15px 0 14px; }
.fake-qr { position: relative; width: 204px; height: 204px; padding: 0; display: grid; place-items: center; border: 10px solid #e7e5db; border-radius: 16px; background-color: #fff; background-image: linear-gradient(90deg, #102d25 10%, transparent 10%, transparent 29%, #102d25 29%, #102d25 39%, transparent 39%, transparent 58%, #102d25 58%, #102d25 69%, transparent 69%), linear-gradient(#102d25 11%, transparent 11%, transparent 25%, #102d25 25%, #102d25 37%, transparent 37%, transparent 51%, #102d25 51%, #102d25 63%, transparent 63%, transparent 78%, #102d25 78%, #102d25 88%, transparent 88%); background-size: 31px 31px, 27px 27px; box-shadow: inset 0 0 0 10px #fff; }
.fake-qr::before, .fake-qr::after { content: ""; position: absolute; width: 45px; height: 45px; border: 9px solid #102d25; background: #fff; }
.fake-qr::before { top: 9px; left: 9px; }
.fake-qr::after { right: 9px; bottom: 9px; }
.fake-qr span { z-index: 1; padding: 6px 8px; color: #fff; background: var(--forest); font: 800 17px Manrope, sans-serif; }
.upi-card h3 { margin: 0 0 6px; font: 700 17px Manrope, sans-serif; }
.upi-card p { margin: 6px 0; color: #707773; font-size: 14px; }
.recharge-form { padding: 30px 23px 23px; }
.recharge-form h2 { margin-bottom: 18px; }
.plain-input { padding-left: 17px; }
.upload-box { height: 126px; border: 2px dashed #d6d7d0; border-radius: 16px; color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; margin: 2px 0 14px; cursor: pointer; }
.upload-box:hover { border-color: var(--forest); background: #f8fbf9; }
.upload-box > span { color: #737a78; font-size: 26px; line-height: 1; }
.upload-box small { color: #777d7d; font-size: 13px; }
.upload-box input { position: absolute; height: 1px; width: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.request-table { margin-top: 35px; padding-top: 25px; }
.request-table h2 { padding: 0 26px 11px; }
.bill-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .75fr); align-items: start; gap: 27px; }
.bill-form { padding: 30px 27px 27px; }
.form-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.bill-btn { color: #fff; background: var(--orange); }
.bill-btn:hover { background: #b74f00; }
.bill-summary { min-height: 384px; padding: 31px 28px; }
.bill-summary .eyebrow { margin: 0; color: #71777a; }
.bill-summary h2 { margin: 19px 0 3px; font: 500 41px/1 Manrope, sans-serif; letter-spacing: -1px; }
.bill-summary p { margin: 0; color: #747b7c; font-size: 14px; }
.bill-summary hr { margin: 29px 0; border: 0; border-top: 1px solid var(--line); }
.charge-list { margin-top: 18px; padding: 2px 18px; border: 1px solid #dfdfd7; border-radius: 14px; background: #f6f5ef; }
.charge-list div { display: flex; justify-content: space-between; padding: 14px 0; font-size: 14px; }
.charge-list strong { color: var(--forest); }
.credit { color: var(--success); }
.debit { color: var(--danger); }

/* 3-Company Cards Grid & Interactive Image Security */
.company-cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 20px; margin-bottom: 30px; align-items: start; }
.company-cards-grid.cards-count-1 { grid-template-columns: minmax(310px, 480px); justify-content: center; }
.company-cards-grid.cards-count-2 { grid-template-columns: repeat(auto-fit, minmax(310px, 480px)); justify-content: center; }
.company-card { background: #fffefa; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: 0 8px 20px rgba(23, 76, 56, 0.04); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.company-card:hover { box-shadow: 0 12px 26px rgba(23, 76, 56, 0.07); border-color: #ccd7d0; }
.company-card.is-expanded { border-color: var(--forest); box-shadow: 0 14px 32px rgba(23, 76, 56, 0.1); }
.comp-header { padding: 18px 20px 14px; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; border-bottom: 1px solid #f0f0eb; }
.comp-badge { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 8px; letter-spacing: 0.5px; text-transform: uppercase; }
.comp-badge.comp-1 { background: #e0f0e8; color: var(--forest); }
.comp-badge.comp-2 { background: #e2ecfa; color: #164b82; }
.comp-badge.comp-3 { background: #fef0db; color: #9c5800; }
.comp-title { font: 700 18px/1.2 Manrope, sans-serif; margin: 0; color: var(--ink); }
.comp-tagline { color: var(--muted); font-size: 12.5px; margin: 3px 0 0; }
.comp-balance-row { padding: 14px 20px; background: #faf9f5; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #f0f0eb; }
.comp-balance-label { font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: 0.8px; }
.comp-balance-val { font: 700 22px/1 Manrope, sans-serif; color: var(--forest); margin: 3px 0 0; }

/* Blurred Image Preview Container (1:1 Aspect Ratio) */
.card-image-box { position: relative; width: 100%; aspect-ratio: 1 / 1; overflow: hidden; background: #1a221f; display: flex; align-items: center; justify-content: center; }
.card-image-element { width: 100%; height: 100%; aspect-ratio: 1 / 1; object-fit: cover; transition: filter 0.35s ease, transform 0.35s ease; }
.card-image-box.is-blurred .card-image-element { filter: blur(16px) brightness(0.65); transform: scale(1.08); }
.card-image-box.is-revealed .card-image-element { filter: blur(0px) brightness(1); transform: scale(1); }
.image-blur-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: rgba(16, 45, 37, 0.45); padding: 16px; text-align: center; color: #fff; z-index: 2; transition: opacity 0.25s ease; }
.image-blur-overlay.hidden { opacity: 0; pointer-events: none; }
.reveal-btn { background: #f1dda0; color: #174c38; border: 0; border-radius: 10px; padding: 9px 16px; font-weight: 800; font-size: 12.5px; display: inline-flex; align-items: center; gap: 7px; box-shadow: 0 4px 15px rgba(0,0,0,0.3); transition: transform 0.15s, background 0.15s; }
.reveal-btn:hover { background: #fff; transform: translateY(-2px); }
.timer-banner { position: absolute; top: 10px; right: 10px; z-index: 3; display: flex; gap: 6px; align-items: center; }
.timer-pill { background: rgba(0, 0, 0, 0.75); color: #fff; font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 20px; backdrop-filter: blur(8px); display: inline-flex; align-items: center; gap: 5px; border: 1px solid rgba(255,255,255,0.2); }
.timer-pill.urgent { background: rgba(182, 59, 48, 0.9); color: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.6; } 100% { opacity: 1; } }
.stamp-badge { position: absolute; bottom: 10px; left: 10px; z-index: 3; background: rgba(0, 0, 0, 0.7); color: #a8e6cf; font-size: 9.5px; font-weight: 700; padding: 3px 7px; border-radius: 6px; }

/* Expansion Drawer */
.card-expansion { display: none; padding: 18px 20px; border-top: 1px solid var(--line); background: #fffefa; animation: slideDown .25s ease-out; }
.card-expansion.is-open { display: block; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.comp-tabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid #edebe2; padding-bottom: 8px; flex-wrap: wrap; }
.comp-tab-btn { border: 0; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 700; padding: 5px 11px; border-radius: 8px; }
.comp-tab-btn.active { background: var(--forest); color: #fff; }
.comp-tab-btn.active.operator-tab { background: var(--operator-blue); }

/* Admin Company & Image Studio (1:1 Aspect Ratio) */
.admin-company-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.admin-company-card { background: #fffefa; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; padding: 26px; box-shadow: 0 10px 24px rgba(31, 51, 43, .035); }
.admin-image-preview { width: 100%; aspect-ratio: 1 / 1; border-radius: 14px; overflow: hidden; margin: 16px 0; border: 1px solid #dedfdc; background: #111; display: flex; align-items: center; justify-content: center; }
.admin-image-preview img { width: 100%; height: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.upload-btn-label { display: block; text-align: center; border: 2px dashed #cfd8d2; border-radius: 12px; padding: 12px; font-size: 13px; font-weight: 700; color: var(--forest); cursor: pointer; background: #f6faf7; transition: background .15s, border-color .15s; }
.upload-btn-label:hover { background: #eaf3ee; border-color: var(--forest); }
.upload-btn-label input { display: none; }
.preset-selector { display: flex; gap: 6px; margin: 10px 0 16px; flex-wrap: wrap; }
.preset-chip { border: 1px solid #d0d9d3; border-radius: 8px; padding: 6px 12px; font-size: 12px; font-weight: 600; background: #fff; cursor: pointer; transition: all .15s ease; }
.preset-chip:hover { border-color: var(--forest); color: var(--forest); }
.preset-chip.active-chip { background: var(--forest); color: #fff; border-color: var(--forest); }

/* Toggle Switch Component for Manage Relation */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #d1d5db;
  transition: .22s ease;
  border-radius: 999px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.12);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .22s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0,0,0,0.22);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--forest);
}

.toggle-switch input:focus + .toggle-slider {
  box-shadow: 0 0 0 3px rgba(23, 76, 56, 0.2);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

.toggle-status-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  transition: color .2s ease;
}

.toggle-status-label.is-on {
  color: var(--success);
}

.toggle-status-label.is-off {
  color: var(--muted);
}

.relation-table {
  border-collapse: collapse;
}

.relation-table thead tr.relation-top-header th {
  padding: 16px 20px;
}

.relation-table thead tr.relation-sub-header th {
  border-top: 1px solid var(--line);
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  gap: 24px;
}

@media (max-width: 1200px) {
  .company-cards-grid, .admin-company-grid { grid-template-columns: 1fr; }
  .company-cards-grid.cards-count-1, .company-cards-grid.cards-count-2 { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .profile-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 760px) {
  .login { grid-template-columns: 1fr; }
  .login-brand { min-height: 320px; padding: 35px 22px; }
  .login-pitch { margin: auto 0; }
  .login-pitch h1 { font-size: 32px; letter-spacing: -0.8px; line-height: 1.15; }
  .login-pitch p { font-size: 15.5px; line-height: 1.5; }
  .login-form-wrap { padding: 36px 20px; }
  .portal-choice { grid-template-columns: 1fr; }

  /* Drawer Navigation on Mobile */
  .portal.drawer-portal .sidebar { position: fixed; inset: 0 auto 0 0; width: 290px; max-width: 85vw; height: 100vh; transform: translateX(-100%); z-index: 100; }
  .portal.drawer-portal .sidebar.is-open { transform: translateX(0); box-shadow: 0 0 60px rgba(16, 45, 37, 0.4); }
  .portal.drawer-portal .nav { padding: 16px 14px; grid-template-columns: 1fr; gap: 6px; }
  .portal.drawer-portal .nav button { height: 50px; padding: 0 14px; font-size: 15px; gap: 12px; }
  
  .main { display: block; }
  
  /* Mobile Sticky Header */
  .topbar { min-height: 56px; height: auto; padding: 8px 14px; gap: 10px; position: sticky; top: 0; z-index: 90; background: #fffefa; border-bottom: 1px solid var(--line); }
  .topbar-brand-zone { gap: 10px; align-items: center; }
  .nav-toggle-btn { height: 38px; padding: 0 12px; gap: 6px; font-size: 13px; border-radius: 10px; flex-shrink: 0; font-weight: 700; }
  .nav-toggle-btn .hamburger-icon { font-size: 17px; }
  .console-label { display: none; }
  .console-title { font-size: 15px; font-weight: 800; color: var(--forest); margin: 0; }
  .role-badge { padding: 5px 10px; font-size: 11.5px; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  
  .content { padding: 18px 14px 40px; }
  
  /* Mobile Drawer Sidebar */
  .portal.drawer-portal { display: block; }
  .portal.drawer-portal .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; max-width: 85vw; height: 100vh; transform: translateX(-100%); transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1); z-index: 100; }
  .portal.drawer-portal .sidebar.is-open { transform: translateX(0); box-shadow: 0 0 60px rgba(16, 45, 37, 0.4); }
  .drawer-close-btn { display: grid; }
  .nav-toggle-btn { display: inline-flex; }
  .drawer-backdrop { position: fixed; inset: 0; background: rgba(16, 45, 37, 0.45); backdrop-filter: blur(2px); z-index: 90; opacity: 0; pointer-events: none; transition: opacity 0.25s ease; display: block; }
  .drawer-backdrop.is-visible { opacity: 1; pointer-events: auto; }
  
  /* Heading typography fix for squished letters */
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 20px; gap: 12px; }
  .page-heading h1 { font-size: 24px; letter-spacing: -0.3px; line-height: 1.2; word-break: break-word; }
  .page-heading p { font-size: 13.5px; line-height: 1.45; }
  
  .card:not(.table-wrap) { padding: 22px 18px; border-radius: 18px; }
  
  .profile-grid { grid-template-columns: 1fr; gap: 18px; }
  
  .metrics, .metrics.metrics-3, .metrics.metrics-5 { grid-template-columns: 1fr; gap: 12px; }
  .metric { min-height: 95px; padding: 16px; border-radius: 16px; }
  .metric h3 { font-size: 12px; }
  .metric p { margin-top: 6px; font-size: 24px; }
  
  .dashboard-filter-bar { padding: 16px 14px; border-radius: 18px; }
  .filter-controls-group { gap: 8px; }
  .filter-pills { flex-wrap: wrap; gap: 6px; }
  .pill-btn { font-size: 12px; padding: 6px 11px; height: 34px; }
  .filter-inputs-group { flex-wrap: wrap; gap: 8px; }
  .filter-input-wrap input { height: 38px; font-size: 13px; }
  
  .form-card { padding: 20px 16px; border-radius: 18px; }
  .two-column { grid-template-columns: 1fr; gap: 18px; }
  .account-card { padding: 24px 16px; border-radius: 18px; }
  .actions { flex-wrap: wrap; }
  
  .data-table th, .data-table td { padding: 12px 10px; font-size: 13px; }
  .table-wrap { -webkit-overflow-scrolling: touch; border-radius: 18px; }
  
  .consolidated-grid { grid-template-columns: 1fr; gap: 10px; }
  .consolidated-total-card { padding: 18px 16px; border-radius: 18px; }
  .consolidated-stat { padding: 12px; }
  .consolidated-stat .stat-val { font-size: 18px; }
  
  .company-tracking-grid { grid-template-columns: 1fr; gap: 16px; }
  .agent-balance-grid, .recharge-grid, .bill-grid, .form-pair { grid-template-columns: 1fr; gap: 14px; }
  
  .wallet-hero { min-height: 140px; padding: 18px; border-radius: 18px; }
  .wallet-hero p { font-size: 30px; }
  .wallet-glyph { right: 14px; font-size: 60px; }
  
  .today-card { padding: 18px; border-radius: 18px; }
  .ledger-preview { padding-left: 14px; padding-right: 14px; }
  .upi-card { min-height: auto; padding: 18px; border-radius: 18px; }
  .recharge-form, .bill-form { padding: 18px 14px; border-radius: 18px; }
  .request-table h2 { padding-left: 14px; }
  .bill-summary { min-height: auto; padding: 18px; border-radius: 18px; }
  .comp-header { padding: 16px 14px 12px; }
  .comp-balance-row { padding: 14px; }
  .comp-balance-val { font-size: 20px; }
  .card-expansion { padding: 16px 14px; }
  .comp-tabs { flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
  .comp-tab-btn { font-size: 12px; padding: 7px 11px; }
  
  /* Mobile Dialogs & Modals */
  .modal-backdrop { padding: 12px; align-items: flex-end; }
  .modal { width: 100%; max-height: 88vh; overflow-y: auto; border-radius: 22px 22px 16px 16px; padding: 22px 16px; }
  .modal-top { margin-bottom: 18px; }
  .modal h2 { font-size: 20px; letter-spacing: -0.3px; }
}

/* Startup Splash Loading */
.auth-loading-splash {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--canvas);
  padding: 24px;
}
.auth-loading-card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 10px 25px rgba(0,0,0,0.04);
}
.auth-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(23, 76, 56, 0.15);
  border-top-color: var(--forest);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 24px 0 16px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.auth-loading-card p {
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  margin: 0;
}
