:root {
  --md-primary: #3154d5;
  --md-primary-dark: #233faa;
  --md-primary-soft: #e8edff;
  --md-surface: #ffffff;
  --md-surface-alt: #f6f7fb;
  --md-surface-tint: #f0f2f8;
  --md-text: #202330;
  --md-muted: #6f7484;
  --md-border: #e3e6ef;
  --md-success: #17865b;
  --md-warning: #a96700;
  --md-danger: #c63d4b;
  --md-sidebar: 256px;
  --md-radius: 16px;
  --md-shadow: 0 1px 2px rgba(20, 27, 52, .06), 0 8px 26px rgba(20, 27, 52, .07);
}

html { font-size: 15px; min-height: 100%; }
* { box-sizing: border-box; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--md-text);
  background: var(--md-surface-alt);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--md-primary); }

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1040;
  display: flex;
  width: var(--md-sidebar);
  flex-direction: column;
  padding: 26px 18px 20px;
  color: #fff;
  background: #172044;
  box-shadow: 5px 0 22px rgba(19, 26, 57, .12);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px 30px;
  color: #fff;
  text-decoration: none;
}
.brand:hover { color: #fff; }
.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(145deg, #6d86ff, #3f5de0);
  box-shadow: 0 8px 20px rgba(71, 98, 232, .35);
  font-size: 1.2rem;
  font-weight: 700;
}
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1.05; }
.brand strong { font-size: 1.2rem; letter-spacing: -.03em; }
.brand small { margin-top: 5px; color: #aeb9e5; font-size: .58rem; font-weight: 600; letter-spacing: .24em; }

.side-nav { display: flex; flex: 1; flex-direction: column; gap: 5px; }
.nav-label { padding: 0 13px 7px; color: #7683b4; font-size: .67rem; font-weight: 700; letter-spacing: .13em; }
.nav-label-spaced { margin-top: 23px; }
.side-nav a {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 13px;
  padding: 10px 13px;
  border-radius: 12px;
  color: #bfc7e3;
  font-size: .91rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color .18s, color .18s, transform .18s;
}
.side-nav a:hover { color: #fff; background: rgba(255, 255, 255, .07); transform: translateX(2px); }
.side-nav a.active { color: #fff; background: linear-gradient(100deg, #3e59d5, #4a65df); box-shadow: 0 7px 20px rgba(27, 48, 146, .35); }
.side-nav svg, .icon-button svg { width: 21px; height: 21px; flex: 0 0 auto; fill: currentColor; }
.nav-pill { margin-left: auto; padding: 3px 7px; border-radius: 20px; color: #dbe2ff; background: rgba(255,255,255,.13); font-size: .6rem; font-weight: 700; text-transform: uppercase; }
.sidebar-account { display: flex; align-items: center; gap: 10px; padding: 16px 7px 0; border-top: 1px solid rgba(255,255,255,.09); }
.account-profile { display: flex; min-width: 0; flex: 1; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.account-profile:hover strong { color: #fff; }
.avatar { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #253ea4; background: #dbe2ff; font-weight: 700; }
.account-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.account-copy strong { overflow: hidden; font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.account-copy small { color: #8793bf; font-size: .67rem; }
.icon-button { display: grid; width: 35px; height: 35px; place-items: center; border: 0; border-radius: 50%; color: #aab4db; background: transparent; }
.icon-button:hover { color: #fff; background: rgba(255,255,255,.08); }

.app-topbar {
  position: fixed;
  inset: 0 0 auto var(--md-sidebar);
  z-index: 1020;
  display: flex;
  height: 72px;
  align-items: center;
  gap: 12px;
  padding: 0 34px;
  border-bottom: 1px solid var(--md-border);
  background: rgba(255,255,255,.93);
  backdrop-filter: blur(12px);
}
.app-topbar > div { display: flex; flex-direction: column; line-height: 1.2; }
.app-topbar strong { font-size: .95rem; }
.topbar-label { color: var(--md-muted); font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.topbar-action { margin-left: auto; }
.mobile-menu { display: none; width: 42px; height: 42px; padding: 10px; border: 0; border-radius: 50%; background: transparent; }
.mobile-menu span { display: block; height: 2px; margin: 4px 0; border-radius: 2px; background: var(--md-text); }
.sidebar-backdrop { display: none; }
.app-content { min-height: 100vh; margin-left: var(--md-sidebar); padding-top: 72px; }
.page-container { width: 100%; max-width: 1500px; margin: 0 auto; padding: 34px; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 27px; }
.page-heading h1, h1 { margin: 4px 0 6px; font-size: clamp(1.65rem, 2vw, 2.15rem); font-weight: 700; letter-spacing: -.045em; }
.page-heading p { max-width: 680px; margin: 0; color: var(--md-muted); }
.eyebrow, .info-kicker { color: var(--md-primary); font-size: .67rem; font-weight: 700; letter-spacing: .13em; }
h2, h3, h4, h5 { letter-spacing: -.025em; }

.material-card, .card {
  border: 1px solid var(--md-border);
  border-radius: var(--md-radius);
  background: var(--md-surface);
  box-shadow: var(--md-shadow);
}
.card { overflow: hidden; }
.card-body { padding: 24px; }
.payment-form { padding: 28px; }
.info-panel { position: sticky; top: 105px; padding: 28px; overflow: hidden; }
.info-panel::after { position: absolute; top: -85px; right: -85px; width: 190px; height: 190px; border-radius: 50%; background: var(--md-primary-soft); content: ""; }
.info-panel h2 { position: relative; z-index: 1; margin: 8px 0 27px; font-size: 1.4rem; font-weight: 700; }

.form-section { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 21px; }
.form-section-divided { margin-top: 8px; padding-top: 25px; border-top: 1px solid var(--md-border); }
.section-icon { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; border-radius: 12px; color: var(--md-primary); background: var(--md-primary-soft); font-size: .8rem; font-weight: 700; }
.section-copy h2 { margin: 1px 0 3px; font-size: 1.05rem; font-weight: 700; }
.section-copy p { margin: 0; color: var(--md-muted); font-size: .82rem; }

.form-label { margin-bottom: 7px; color: #4a4f5e; font-size: .78rem; font-weight: 600; }
.form-control, .form-select, .input-group-text {
  min-height: 48px;
  border-color: #d8dce7;
  border-radius: 10px;
  color: var(--md-text);
  background-color: #fff;
}
.form-control { padding: .72rem .9rem; }
textarea.form-control { min-height: auto; }
.form-control:hover, .form-select:hover { border-color: #abb1c2; }
.form-control:focus, .form-select:focus {
  border-color: var(--md-primary);
  box-shadow: 0 0 0 3px rgba(49, 84, 213, .13);
}
.input-group > .input-group-text { border-radius: 10px 0 0 10px; color: var(--md-primary); background: var(--md-primary-soft); font-weight: 700; }
.input-group > .form-control { border-radius: 0 10px 10px 0; }
.text-danger { font-size: .76rem; }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 30px -28px -28px; padding: 20px 28px; border-radius: 0 0 var(--md-radius) var(--md-radius); background: #fafbfe; }
.secure-note { display: flex; align-items: center; gap: 9px; color: var(--md-muted); font-size: .77rem; }
.secure-dot { width: 9px; height: 9px; border: 2px solid #fff; border-radius: 50%; background: var(--md-success); box-shadow: 0 0 0 2px rgba(23,134,91,.18); }

.btn { min-height: 42px; padding: .58rem 1rem; border-radius: 10px; font-size: .84rem; font-weight: 600; letter-spacing: -.01em; }
.btn-sm { min-height: 34px; padding: .38rem .7rem; border-radius: 8px; }
.btn-lg { min-height: 50px; padding: .72rem 1.25rem; }
.btn-primary { border-color: var(--md-primary); background: var(--md-primary); box-shadow: 0 4px 12px rgba(49,84,213,.18); }
.btn-primary:hover, .btn-primary:focus { border-color: var(--md-primary-dark); background: var(--md-primary-dark); }
.btn-tonal { color: var(--md-primary); border-color: transparent; background: var(--md-primary-soft); }
.btn-tonal:hover { color: var(--md-primary-dark); background: #dbe3ff; }
.btn-outline-secondary { color: #5e6474; border-color: #cbd0dc; }

.step-list { display: flex; flex-direction: column; gap: 24px; margin: 0; padding: 0; list-style: none; }
.step-list li { position: relative; display: flex; gap: 13px; }
.step-list li:not(:last-child)::after { position: absolute; top: 31px; bottom: -18px; left: 14px; width: 1px; background: #dfe3ef; content: ""; }
.step-list li > span { z-index: 1; display: grid; width: 29px; height: 29px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: var(--md-primary); background: var(--md-primary-soft); font-size: .72rem; font-weight: 700; }
.step-list div { display: flex; flex-direction: column; gap: 3px; }
.step-list strong { font-size: .85rem; }
.step-list small { color: var(--md-muted); line-height: 1.45; }

.stat-card { position: relative; min-height: 138px; padding: 22px; overflow: hidden; }
.stat-card::after { position: absolute; right: -32px; bottom: -45px; width: 110px; height: 110px; border-radius: 50%; background: currentColor; content: ""; opacity: .055; }
.stat-label { display: flex; align-items: center; gap: 8px; color: var(--md-muted); font-size: .78rem; font-weight: 600; }
.stat-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.stat-value { margin-top: 16px; font-size: 1.85rem; font-weight: 700; letter-spacing: -.05em; }
.stat-pending { color: var(--md-warning); }
.stat-success { color: var(--md-success); }
.stat-neutral { color: #6d7180; }
.stat-primary { color: var(--md-primary); }
.stat-card .stat-value { color: var(--md-text); }

.quick-action-card { display: flex; min-height: 140px; align-items: center; gap: 20px; padding: 24px; text-decoration: none; transition: transform .18s, box-shadow .18s; }
.quick-action-card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(20,27,52,.12); }
.quick-action-icon { display: grid; width: 56px; height: 56px; flex: 0 0 auto; place-items: center; border-radius: 17px; color: #fff; background: linear-gradient(145deg, #5471ed, #3154d5); font-size: 1.4rem; font-weight: 700; box-shadow: 0 8px 20px rgba(49,84,213,.26); }
.quick-action-card h2 { margin: 0 0 4px; color: var(--md-text); font-size: 1.05rem; font-weight: 700; }
.quick-action-card p { margin: 0; color: var(--md-muted); font-size: .8rem; }
.quick-action-arrow { margin-left: auto; color: var(--md-primary); font-size: 1.35rem; }
.quick-action-secondary .quick-action-icon { color: var(--md-primary); background: var(--md-primary-soft); box-shadow: none; }

.table-shell { overflow: hidden; border: 1px solid var(--md-border); border-radius: var(--md-radius); background: var(--md-surface); box-shadow: var(--md-shadow); }
.table { margin: 0; color: var(--md-text); }
.table > :not(caption) > * > * { padding: .9rem 1rem; border-bottom-color: #eceef4; }
.table thead th { color: var(--md-muted); background: #f8f9fc; font-size: .69rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.table tbody td { font-size: .82rem; vertical-align: middle; }
.table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-accent-bg: transparent; }
.table tbody tr:hover > * { background: #fafbff; }
.page-container > table.table,
.page-container > .row > [class*="col-"] > table.table {
  overflow: hidden;
  border: 1px solid var(--md-border);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--md-radius);
  background: var(--md-surface);
  box-shadow: var(--md-shadow);
}
.page-container > .row > [class*="col-"] > form {
  padding: 26px;
  border: 1px solid var(--md-border);
  border-radius: var(--md-radius);
  background: var(--md-surface);
  box-shadow: var(--md-shadow);
}
.badge { padding: .42rem .62rem; border-radius: 20px; font-size: .68rem; font-weight: 600; }
.bg-warning { color: #805000 !important; background: #fff0cc !important; }
.bg-success { color: #0d714a !important; background: #dff6ec !important; }
.bg-danger { color: #a22d39 !important; background: #ffe3e5 !important; }
.bg-secondary, .bg-dark { color: #5f6472 !important; background: #e9ebf1 !important; }
.bg-primary { color: #2949bd !important; background: #e1e7ff !important; }

.material-alert, .alert { border: 0; border-radius: 11px; font-size: .83rem; }
.alert-danger { color: #8c2430; background: #ffe8ea; }
.alert-success { color: #116744; background: #e1f6ed; }

.guest-shell { display: grid; place-items: center; padding: 28px; background: radial-gradient(circle at 20% 10%, #e6ebff, transparent 38%), var(--md-surface-alt); }
.guest-content { width: 100%; max-width: 520px; }
.guest-content .page-container { padding: 0; }

.login-shell { width: 100%; }
.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}
.login-brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(145deg, #6d86ff, #3154d5);
  box-shadow: 0 10px 24px rgba(49, 84, 213, .28);
  font-size: 1.3rem;
  font-weight: 700;
}
.login-brand-copy { display: flex; flex-direction: column; line-height: 1; }
.login-brand-copy strong { font-size: 1.35rem; letter-spacing: -.04em; }
.login-brand-copy small { margin-top: 6px; color: var(--md-muted); font-size: .58rem; font-weight: 700; letter-spacing: .25em; }
.login-card { position: relative; padding: 38px 40px 36px; overflow: hidden; }
.login-card-accent { position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, #3154d5, #7187ef); }
.login-card::before {
  position: absolute;
  top: -85px;
  right: -95px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: var(--md-primary-soft);
  content: "";
  opacity: .72;
}
.login-header { position: relative; margin-bottom: 28px; }
.login-header h1 { margin: 7px 0 9px; font-size: 1.75rem; }
.login-header p { max-width: 390px; margin: 0; color: var(--md-muted); font-size: .86rem; line-height: 1.6; }
.login-form { position: relative; display: flex; flex-direction: column; gap: 19px; }
.login-input-wrap { position: relative; }
.login-input-wrap svg {
  position: absolute;
  top: 50%;
  left: 15px;
  z-index: 1;
  width: 20px;
  height: 20px;
  fill: #8a91a3;
  transform: translateY(-50%);
  pointer-events: none;
}
.login-input-wrap .form-control { padding-left: 46px; }
.login-input-wrap:focus-within svg { fill: var(--md-primary); }
.login-validation:empty { display: none; }
.login-validation:not(:empty) {
  padding: 12px 14px;
  border-radius: 10px;
  color: #922f3a;
  background: #ffe8ea;
  font-size: .79rem;
}
.login-validation ul { margin: 0; padding-left: 18px; }
.login-options { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.form-check-input { width: 1.1em; height: 1.1em; border-color: #b8becc; }
.form-check-input:checked { border-color: var(--md-primary); background-color: var(--md-primary); }
.form-check-input:focus { border-color: var(--md-primary); box-shadow: 0 0 0 3px rgba(49,84,213,.13); }
.form-check-label { color: #555b6a; font-size: .78rem; }
.secure-login { display: flex; align-items: center; gap: 7px; color: var(--md-muted); font-size: .72rem; }
.secure-login > span { width: 7px; height: 7px; border-radius: 50%; background: var(--md-success); box-shadow: 0 0 0 3px rgba(23,134,91,.12); }
.login-submit { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 2px; }
.login-submit span { font-size: 1.15rem; transition: transform .18s; }
.login-submit:hover span { transform: translateX(3px); }
.login-footer { margin: 20px 0 0; color: #8a90a0; font-size: .7rem; text-align: center; }

.pay-shell { min-height: 100vh; padding: 32px 18px; background: radial-gradient(circle at 50% 0, #e5ebff, transparent 42%), var(--md-surface-alt); }
.pay-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 24px; color: var(--md-text); text-decoration: none; font-weight: 700; }
.pay-container { width: 100%; max-width: 560px; margin: 0 auto; }

@media (max-width: 991.98px) {
  .app-sidebar { transform: translateX(-100%); transition: transform .24s ease; }
  .nav-open .app-sidebar { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 1030; border: 0; background: rgba(9,14,35,.45); }
  .nav-open .sidebar-backdrop { display: block; }
  .app-topbar { left: 0; padding: 0 20px; }
  .app-content { margin-left: 0; }
  .mobile-menu { display: block; }
  .page-container { padding: 26px 20px; }
  .info-panel { position: static; }
}

@media (max-width: 767.98px) {
  html { font-size: 14px; }
  .app-topbar { height: 64px; }
  .app-content { padding-top: 64px; }
  .topbar-action { min-height: 38px; padding: .45rem .7rem; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .payment-form { padding: 20px; }
  .form-actions { align-items: stretch; flex-direction: column; margin: 26px -20px -20px; padding: 18px 20px; }
  .form-actions .btn { width: 100%; }
  .table-shell { overflow-x: auto; }
  .table { min-width: 780px; }
  .guest-shell { padding: 22px 16px; }
  .login-brand { margin-bottom: 18px; }
  .login-card { padding: 31px 23px 27px; border-radius: 15px; }
  .login-header { margin-bottom: 24px; }
  .login-header h1 { font-size: 1.55rem; }
}
