@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700&family=DM+Serif+Display&display=swap');

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --navy: #0f1f3d;
  --navy-light: #1a3260;
  --gold: #c9a84c;
  --gold-light: #e8c97e;
  --cream: #faf7f2;
  --white: #ffffff;
  --g50: #f8f9fa;
  --g100: #f1f3f5;
  --g200: #e9ecef;
  --g300: #dee2e6;
  --g400: #ced4da;
  --g500: #adb5bd;
  --g600: #6c757d;
  --g700: #495057;
  --g800: #343a40;
  --ok: #2d6a4f;
  --ok-bg: #d8f3dc;
  --err: #c1121f;
  --err-bg: #ffccd5;
  --warn: #856404;
  --warn-bg: #fff3cd;
  --info: #084298;
  --info-bg: #cfe2ff;
  --r: 10px;
  --rl: 16px;
  --sh: 0 4px 16px rgba(15, 31, 61, .10);
  --font: 'DM Sans', sans-serif;
  --font-d: 'DM Serif Display', serif;
}

html,
body {
  font-family: var(--font);
  background: var(--cream);
  color: var(--g800);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── helpers ── */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* ── AUTH LAYOUT ── */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 768px) {
  .auth-wrap {
    grid-template-columns: 1fr;
  }

  .auth-hero {
    display: none;
  }
}

.auth-hero {
  background: var(--navy);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px 48px;
  position: relative;
  overflow: hidden;
}

.auth-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 70%, rgba(201, 168, 76, .15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(201, 168, 76, .08) 0%, transparent 50%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  color: var(--white);
}

.hero-logo {
  font-family: var(--font-d);
  font-size: 2.8rem;
  color: var(--gold-light);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.hero-tag {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255, 255, 255, .55);
  margin-bottom: 48px;
}

.hero-list {
  list-style: none;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hero-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .9rem;
  color: rgba(255, 255, 255, .8);
}

.hero-list li .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px 48px;
  background: var(--white);
}

.auth-box {
  width: 100%;
  max-width: 400px;
}

.auth-title {
  font-family: var(--font-d);
  font-size: 2rem;
  color: var(--navy);
  margin-bottom: 6px;
}

.auth-sub {
  color: var(--g500);
  font-size: .875rem;
  margin-bottom: 32px;
}

.auth-switch {
  margin-top: 24px;
  text-align: center;
  font-size: .875rem;
  color: var(--g500);
}

.auth-switch a {
  color: var(--navy);
  font-weight: 600;
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* ── FORMS ── */
.fg {
  margin-bottom: 18px;
}

.fg label {
  display: block;
  font-size: .75rem;
  font-weight: 700;
  color: var(--g700);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.fg input,
.fg select,
.fg textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--g200);
  border-radius: var(--r);
  font-family: var(--font);
  font-size: .95rem;
  color: var(--g800);
  background: var(--g50);
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}

.fg input:focus,
.fg select:focus,
.fg textarea:focus {
  border-color: var(--navy);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(15, 31, 61, .07);
}

/* make the embedded address field bigger */
#profileFieldAddress {
  min-width: 440px;
  max-width: 100%;
  resize: vertical;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--r);
  font-family: var(--font);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .2s;
  text-decoration: none;
}

.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--navy);
  color: var(--white);
  width: 100%;
  padding: 13px;
  font-size: 1rem;
}

.btn-primary:hover {
  background: var(--navy-light);
  transform: translateY(-1px);
  box-shadow: var(--sh);
}

.btn-navy {
  background: var(--navy);
  color: var(--white);
}

.btn-navy:hover:not(:disabled) {
  background: var(--navy-light);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--g300);
}

.btn-outline:hover {
  border-color: var(--navy);
  background: var(--g50);
}

.btn-ok {
  background: var(--ok);
  color: var(--white);
}

.btn-ok:hover:not(:disabled) {
  opacity: .88;
}

.btn-sm {
  padding: 7px 14px;
  font-size: .82rem;
}

.btn-full {
  width: 100%;
}

/* ── ALERTS ── */
.alert {
  padding: 11px 14px;
  border-radius: var(--r);
  font-size: .875rem;
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.alert-err {
  background: var(--err-bg);
  color: var(--err);
  border: 1px solid rgba(193, 18, 31, .2);
}

.alert-ok {
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid rgba(45, 106, 79, .2);
}

.alert-warn {
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid rgba(133, 100, 4, .2);
}

.alert-info {
  background: var(--info-bg);
  color: var(--info);
  border: 1px solid rgba(8, 66, 152, .2);
}

/* ── NAVBAR ── */
.navbar {
  background: var(--navy);
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}

.navbar-logo {
  font-family: var(--font-d);
  font-size: 1.45rem;
  color: var(--gold-light);
  display: flex;
  align-items: center;
  gap: 10px;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, .8);
  font-size: .875rem;
}

.avatar {
  width: 32px;
  height: 32px;
  background: var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .8rem;
  color: var(--navy);
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, .1);
  color: rgba(255, 255, 255, .85);
  border: none;
  padding: 7px 13px;
  border-radius: var(--r);
  font-family: var(--font);
  font-size: .82rem;
  cursor: pointer;
  transition: background .2s;
}

.btn-logout:hover {
  background: rgba(255, 255, 255, .2);
}

/* ── DASHBOARD ── */
.dash-header {
  background: var(--white);
  border-bottom: 1px solid var(--g200);
  padding: 26px 40px 0;
}

.dash-title {
  font-family: var(--font-d);
  font-size: 1.65rem;
  color: var(--navy);
  margin-bottom: 4px;
}

.dash-sub {
  color: var(--g500);
  font-size: .85rem;
  margin-bottom: 22px;
}

.tabs {
  display: flex;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-family: var(--font);
  font-size: .875rem;
  font-weight: 500;
  color: var(--g500);
  cursor: pointer;
  transition: all .2s;
}

.tab-btn:hover {
  color: var(--navy);
}

.tab-btn.active {
  color: var(--navy);
  border-bottom-color: var(--navy);
  font-weight: 600;
}

.dash-body {
  padding: 34px 40px;
  max-width: 1400px;
  margin: 0 auto;
}

/* ── CARDS ── */
.card {
  background: var(--white);
  border-radius: var(--rl);
  border: 1px solid var(--g200);
  box-shadow: 0 1px 4px rgba(15, 31, 61, .06);
}

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

.card-title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body {
  padding: 22px;
}

.badge-count {
  background: var(--navy);
  color: var(--white);
  font-size: .7rem;
  padding: 1px 8px;
  border-radius: 99px;
  font-weight: 700;
}

/* ── TABLES ── */
.tbl-wrap {
  overflow-x: auto;
  border-radius: var(--r);
  border: 1px solid var(--g200);
}

.tbl-wrap.no-border {
  border: none;
  border-radius: 0 0 var(--rl) var(--rl);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

thead tr {
  background: var(--g50);
}

thead th {
  padding: 11px 15px;
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  color: var(--g500);
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--g200);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--g100);
  transition: background .15s;
}

tbody tr:last-child {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--g50);
}

tbody td {
  padding: 12px 15px;
  color: var(--g700);
  vertical-align: middle;
  word-break: break-all;
}

.pan-code {
  background: var(--g100);
  padding: 3px 9px;
  border-radius: 6px;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .06em;
  font-family: monospace;
}

/* ── STATUS BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 600;
}

.s-pending {
  background: var(--warn-bg);
  color: var(--warn);
}

.s-processing {
  background: var(--info-bg);
  color: var(--info);
}

.s-completed {
  background: var(--ok-bg);
  color: var(--ok);
}

.s-failed {
  background: var(--err-bg);
  color: var(--err);
}

/* ── SEARCH ── */
.search-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}

.search-wrap {
  position: relative;
  flex: 1;
}

.search-wrap input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  border: 1.5px solid var(--g200);
  border-radius: var(--r);
  font-family: var(--font);
  font-size: .875rem;
  background: var(--white);
  outline: none;
  transition: border-color .2s;
}

.search-wrap input:focus {
  border-color: var(--navy);
}

.search-ico {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--g400);
  pointer-events: none;
}

/* ── UPLOAD ZONE ── */
.upload-zone {
  border: 2px dashed var(--g300);
  border-radius: var(--rl);
  padding: 44px 28px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: var(--g50);
  user-select: none;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--navy);
  background: rgba(15, 31, 61, .03);
}

.upload-ico {
  width: 52px;
  height: 52px;
  background: var(--navy);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  color: var(--white);
}

.upload-zone h3 {
  font-size: .95rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 5px;
}

.upload-zone p {
  font-size: .82rem;
  color: var(--g500);
}

.progress-wrap {
  height: 5px;
  background: var(--g200);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 14px;
}

.progress-bar {
  height: 100%;
  background: var(--navy);
  border-radius: 99px;
  transition: width .3s;
  width: 0;
}

/* ── EXPORT ── */
.export-wrap {
  max-width: 580px;
  margin: 0 auto;
}

.file-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--ok-bg);
  border: 1px solid rgba(45, 106, 79, .2);
  border-radius: var(--r);
  padding: 14px 18px;
  margin-bottom: 14px;
}

.file-preview h4 {
  font-size: .875rem;
  font-weight: 600;
  color: var(--ok);
}

.file-preview p {
  font-size: .78rem;
  color: rgba(45, 106, 79, .7);
  margin-top: 2px;
}

/* ── EMPTY STATE ── */
.empty {
  text-align: center;
  padding: 52px 20px;
}

.empty-ico {
  width: 56px;
  height: 56px;
  background: var(--g100);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  color: var(--g400);
}

.empty h3 {
  font-size: .95rem;
  font-weight: 600;
  color: var(--g700);
  margin-bottom: 5px;
}

.empty p {
  font-size: .85rem;
  color: var(--g500);
}

/* ── MODAL ── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 31, 61, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fi .18s;
}

.modal {
  background: var(--white);
  border-radius: var(--rl);
  padding: 30px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 8px 32px rgba(15, 31, 61, .2);
  animation: su .18s;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.modal-head h2 {
  font-family: var(--font-d);
  font-size: 1.25rem;
  color: var(--navy);
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--g400);
  padding: 4px;
  border-radius: 6px;
  transition: color .2s;
  font-size: 1.2rem;
  line-height: 1;
}

.modal-close:hover {
  color: var(--g700);
}

.modal-foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 22px;
}

/* ── SPINNER ── */
.spin {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: white;
  border-radius: 50%;
  animation: ro .7s linear infinite;
}

.spin-dark {
  border-color: rgba(15, 31, 61, .2);
  border-top-color: var(--navy);
}

@keyframes ro {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fi {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes su {
  from {
    transform: translateY(16px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ── UTILITIES ── */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.gap-8 {
  gap: 8px;
}

.gap-12 {
  gap: 12px;
}

.gap-20 {
  gap: 20px;
}

.items-center {
  align-items: center;
}

.justify-end {
  justify-content: flex-end;
}

.justify-between {
  justify-content: space-between;
}

.mt-12 {
  margin-top: 12px;
}

.mt-16 {
  margin-top: 16px;
}

.mt-20 {
  margin-top: 20px;
}

.mb-0 {
  margin-bottom: 0;
}

.text-center {
  text-align: center;
}

.text-sm {
  font-size: .82rem;
}

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

.text-right {
  text-align: right;
}

.w-full {
  width: 100%;
}

.note {
  margin-top: 12px;
  text-align: center;
  font-size: .78rem;
  color: var(--g400);
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--g300);
  border-radius: 3px;
}

/* ══════════════════════════════════════════════
   USER PROFILE TAB — additional styles
══════════════════════════════════════════════ */

/* Profile header card */
.profile-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: center;
  padding: 20px 0 24px;
  border-bottom: 1.5px solid var(--g200);
  margin-bottom: 24px;
}

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

.profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  font-family: var(--font-d);
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-name {
  font-family: var(--font-d);
  font-size: 1.4rem;
  color: var(--navy);
  margin-bottom: 6px;
}

/* Meta grid (email, since, doc counts) */
.profile-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 700px) {
  .profile-meta-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.profile-meta-item {
  background: var(--g50);
  border: 1.5px solid var(--g200);
  border-radius: var(--r);
  padding: 14px 16px;
}

.profile-meta-label {
  display: block;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--g500);
  margin-bottom: 6px;
}

.profile-meta-value {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
  word-break: break-all;
}

/* Profile sections */
.profile-section {
  margin-bottom: 24px;
}

.profile-section-title {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--g600);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
}

/* Document type tags */
.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.doc-type-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  background: rgba(15, 31, 61, .07);
  color: var(--navy);
  border: 1.5px solid rgba(15, 31, 61, .15);
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
}