/* Luxzan agent portal, styled after luxzan.co.tz (Palatio theme, default scheme). */
:root {
  --portal-ink: #12232e;
  --portal-ivory: #f6f3ec;
  --portal-sand: #efe7d0;
  --portal-sand-line: #e3d9c0;
  --portal-text: #635756;
  --portal-muted: #8a8070;
  --portal-turquoise: #62c3c9;
  --portal-button: #48b0b3;
  --portal-button-hover: #12232e;
  --portal-gold: #d8a01d;
  --portal-white: #fffdf8;
  --portal-line: #e6ddc6;
  --portal-error: #9a382f;
  --portal-success: #2f6b4f;
  --portal-shadow: 0 12px 45px rgb(0 0 0 / 5%);
  --font-display: ivypresto-display, "Playfair Display", Georgia, serif;
  --font-body: "Open Sans", "Segoe UI", sans-serif;
}

body { background: var(--portal-ivory); color: var(--portal-text); font-family: var(--font-body); line-height: 1.7; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, summary, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--portal-button); outline-offset: 3px; }
h1, h2, h3 { color: var(--portal-ink); }

.portal-frame { min-height: 100svh; display: flex; flex-direction: column; }

/* Header: ivory with the turquoise logo, like the main site. */
.topbar { width: 100%; min-height: 6.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem max(1rem, calc((100% - 80rem) / 2)); background: var(--portal-ivory); border-bottom: 1px solid var(--portal-line); color: var(--portal-ink); }
.brand { display: flex; align-items: center; gap: 1.1rem; color: inherit; text-decoration: none; }
.brand img { display: block; width: 5.4rem; height: auto; }
.brand span { padding-left: 1.1rem; border-left: 1px solid var(--portal-sand-line); color: var(--portal-ink); font-size: .7rem; font-weight: 700; letter-spacing: .18em; }
.account-menu { display: flex; align-items: center; gap: 1.4rem; }
.account-name { text-align: right; color: var(--portal-ink); font-family: var(--font-display); font-size: 1.05rem; font-weight: 400; line-height: 1.3; }
.account-name small { display: block; margin-top: .1rem; color: var(--portal-muted); font-family: var(--font-body); font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.account-menu form { margin: 0; }

/* Buttons: square turquoise with white IvyPresto text, as on "Let's Talk". */
.button { display: inline-flex; min-height: 3.35rem; align-items: center; justify-content: center; gap: .8rem; border: 0; border-radius: 0; padding: .8rem 1.9rem; background: var(--portal-button); color: #fff; font-family: var(--font-display); font-size: 1.06rem; font-weight: 400; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer; transition: background-color .2s ease; }
.button:hover { background: var(--portal-button-hover); }
.button-primary, .button-outline, .button-quiet { background: var(--portal-button); color: #fff; }
.button-quiet { min-height: 2.9rem; padding: .6rem 1.4rem; font-size: 1rem; }
.notice { width: min(100% - 2rem, 78rem); margin: 1.25rem auto 0; border-left: 3px solid currentColor; padding: .85rem 1.1rem; font-size: .93rem; }
.notice-success { color: var(--portal-success); background: #e9f1e9; }
.notice-error { color: var(--portal-error); background: #f8ebe6; }

/* Shared type. */
.eyebrow { margin: 0 0 .9rem; color: var(--portal-ink); font-size: .72rem; font-weight: 700; letter-spacing: .18em; line-height: 1.4; text-transform: uppercase; }
.auth-copy h1, .page-heading h1, .panel-heading h1 { margin: 0; font-family: var(--font-display); font-size: clamp(2.9rem, 5.4vw, 4.8rem); font-weight: 300; letter-spacing: -.01em; line-height: 1.02; }
.back-link { display: inline-flex; align-items: center; gap: .5rem; margin-top: 1.4rem; color: var(--portal-ink); font-family: var(--font-display); font-size: 1.05rem; text-decoration: underline; text-decoration-color: var(--portal-sand-line); text-underline-offset: .3em; }
.back-link:hover { text-decoration-color: var(--portal-button); }

/* Sign-in layout. */
.auth-layout { width: min(100% - 2rem, 76rem); min-height: min(46rem, calc(100svh - 10rem)); display: grid; grid-template-columns: minmax(0, 1fr) minmax(22rem, 29rem); align-items: center; gap: clamp(2rem, 8vw, 7rem); margin: auto; padding: 3rem 0; }
.auth-copy { max-width: 37rem; }
.auth-copy h1 .accent { color: #9fdfe1; }
.auth-copy > p:not(.eyebrow) { max-width: 34rem; margin: 1.4rem 0 2rem; font-size: 1.08rem; line-height: 1.75; }
.auth-panel, .narrow-panel { border: 0; border-radius: 0; background: var(--portal-white); box-shadow: var(--portal-shadow); }
.auth-panel { padding: clamp(1.5rem, 4vw, 2.4rem); }
.panel-heading { margin-bottom: 1.7rem; }
.panel-heading h2 { margin: 0; font-family: var(--font-display); font-size: 2.1rem; font-weight: 300; line-height: 1.1; }
.panel-heading h1 { font-size: clamp(2.3rem, 5vw, 3.2rem); }
.panel-heading > p:last-child { margin: .7rem 0 0; color: var(--portal-text); }
.auth-section { padding: 1.25rem 0 1.5rem; border-top: 1px solid var(--portal-line); }
.auth-section h3 { margin: 0; font-size: 1.05rem; }
.auth-section > p { margin: .35rem 0 1.1rem; color: var(--portal-muted); font-size: .9rem; }

/* Forms: square fields on white with sand borders. */
.form-stack { display: grid; gap: 1.05rem; }
.form-stack label { display: grid; gap: .45rem; color: var(--portal-ink); font-size: .86rem; font-weight: 600; }
.form-stack input:not([type=checkbox]):not([type=file]), .form-stack select, .form-stack textarea, .inline-reset input, .search-form input[type="search"] { width: 100%; min-height: 3.1rem; border: 1px solid #d9cfb5; border-radius: 0; background: #fff; color: var(--portal-ink); padding: .75rem .9rem; }
.form-stack textarea { resize: vertical; }
.form-stack input[type=file] { width: 100%; border: 1px dashed #cfc49e; border-radius: 0; background: var(--portal-ivory); padding: .8rem; color: var(--portal-ink); font-size: .84rem; }
.form-stack input:focus, .form-stack select:focus, .form-stack textarea:focus, .inline-reset input:focus, .search-form input:focus { border-color: var(--portal-button); outline: 2px solid rgb(72 176 179 / 25%); outline-offset: 0; }
.form-stack small { color: var(--portal-muted); font-size: .8rem; font-weight: 400; line-height: 1.5; }
.select-label { margin-top: -.25rem; }
.password-access { padding-top: 1.2rem; border-top: 1px solid var(--portal-line); }
.password-access summary { cursor: pointer; color: var(--portal-ink); font-size: .9rem; font-weight: 600; }
.password-access[open] .form-stack { margin-top: 1rem; }
.narrow-panel { width: min(100% - 2rem, 32rem); margin: auto; padding: clamp(1.6rem, 5vw, 2.7rem); }
.narrow-panel .back-link { margin-top: 1.3rem; }
.spam-hint { margin: 1rem 0 0; border-left: 3px solid var(--portal-button); background: var(--portal-sand); padding: .75rem .95rem; color: var(--portal-ink); font-size: .88rem; line-height: 1.55; }
.code-input { font-size: 1.6rem !important; font-weight: 700; letter-spacing: .3em; text-align: center; }

/* Sign-in pages: Zanzibar photo behind the content, navy shade keeps text legible. */
.photo-stage { position: relative; flex: 1; display: flex; isolation: isolate; background-color: var(--portal-ink); background-position: center; background-size: cover; }
.photo-stage::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgb(18 35 46 / 42%); }
.photo-agent::before { background: linear-gradient(90deg, rgb(18 35 46 / 80%) 0%, rgb(18 35 46 / 50%) 50%, rgb(18 35 46 / 18%) 100%); }
.photo-agent { background-image: url("img/login-agent-1920.jpg"); background-image: image-set(url("img/login-agent-1920.webp") type("image/webp"), url("img/login-agent-1920.jpg") type("image/jpeg")); background-position: 40% center; }
.photo-verify { background-image: url("img/login-verify-1920.jpg"); background-image: image-set(url("img/login-verify-1920.webp") type("image/webp"), url("img/login-verify-1920.jpg") type("image/jpeg")); background-position: 25% center; }
.photo-admin { background-image: url("img/login-admin-1920.jpg"); background-image: image-set(url("img/login-admin-1920.webp") type("image/webp"), url("img/login-admin-1920.jpg") type("image/jpeg")); background-position: 55% center; }
.photo-stage .narrow-panel { margin: clamp(2rem, 8vh, 5rem) auto; align-self: center; }
.photo-stage .auth-copy { color: var(--portal-ivory); text-shadow: 0 1px 18px rgb(18 35 46 / 45%); }
.photo-stage .auth-copy h1 { color: #fffdf8; }
.photo-stage .auth-copy .eyebrow { color: #fffdf8; }
.photo-stage .auth-copy > p:not(.eyebrow) { color: rgb(246 243 236 / 92%); }
@media (max-width: 960px) {
  .photo-agent { background-image: url("img/login-agent-960.jpg"); background-image: image-set(url("img/login-agent-960.webp") type("image/webp"), url("img/login-agent-960.jpg") type("image/jpeg")); }
  .photo-verify { background-image: url("img/login-verify-960.jpg"); background-image: image-set(url("img/login-verify-960.webp") type("image/webp"), url("img/login-verify-960.jpg") type("image/jpeg")); }
  .photo-admin { background-image: url("img/login-admin-960.jpg"); background-image: image-set(url("img/login-admin-960.webp") type("image/webp"), url("img/login-admin-960.jpg") type("image/jpeg")); }
}
@media (max-width: 850px) {
  .photo-agent::before { background: linear-gradient(180deg, rgb(18 35 46 / 78%) 0%, rgb(18 35 46 / 55%) 100%); }
}

/* Agent dashboard. */
.content-area { width: min(100% - 2rem, 80rem); margin: 0 auto; padding: clamp(2.5rem, 6vw, 5rem) 0; flex: 1; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 2.4rem; }
.page-heading h1 { font-size: clamp(2.6rem, 4.6vw, 4rem); }
.page-heading > div > p:last-child { max-width: 42rem; margin: .8rem 0 0; }
.kit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 23rem), 1fr)); gap: 1.4rem; }
.kit-card { display: grid; grid-template-columns: 4.6rem minmax(0, 1fr); gap: 1.3rem; background: var(--portal-white); box-shadow: var(--portal-shadow); padding: 1.6rem; }
/* Soft sand "blob" like the icons on the main site's services section. */
.kit-mark { width: 4.4rem; height: 4.4rem; display: grid; place-items: center; align-self: start; border-radius: 58% 42% 55% 45% / 48% 58% 42% 52%; background: var(--portal-sand); color: var(--portal-button); font-size: .74rem; font-weight: 700; letter-spacing: .1em; }
.kit-content .eyebrow { margin-bottom: .4rem; color: var(--portal-muted); font-size: .66rem; }
.kit-content h2 { margin: 0; font-family: var(--font-display); font-size: 1.7rem; font-weight: 300; line-height: 1.15; overflow-wrap: anywhere; }
.kit-content > p:not(.eyebrow) { margin: .6rem 0; font-size: .93rem; line-height: 1.6; }
.kit-meta { display: flex; flex-wrap: wrap; gap: .45rem 1.1rem; margin: 1rem 0 1.15rem; color: var(--portal-muted); font-size: .78rem; }
.kit-content .button { width: 100%; }
.empty-state { max-width: 36rem; margin: 4rem auto; text-align: center; }
.empty-mark { width: 4.6rem; height: 4.6rem; display: grid; place-items: center; margin: 0 auto 1.2rem; border-radius: 58% 42% 55% 45% / 48% 58% 42% 52%; background: var(--portal-sand); color: var(--portal-button); font-family: var(--font-display); font-size: 1.9rem; }
.empty-state h2 { margin: 0; font-family: var(--font-display); font-size: 2rem; font-weight: 300; }

/* Admin area. */
.admin-area { width: min(100% - 2rem, 80rem); }
.admin-nav { display: flex; gap: 1.6rem; overflow-x: auto; border-bottom: 1px solid var(--portal-line); margin: 0 0 2rem; scrollbar-width: thin; }
.admin-nav a { flex: 0 0 auto; padding: .7rem 0 .8rem; border-bottom: 2px solid transparent; color: var(--portal-ink); font-family: var(--font-display); font-size: 1.12rem; text-decoration: none; }
.admin-nav a:hover { color: var(--portal-button); }
.admin-nav a.active { border-color: var(--portal-ink); }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; }
.stat { display: flex; min-height: 7.6rem; flex-direction: column; justify-content: space-between; background: var(--portal-white); box-shadow: var(--portal-shadow); padding: 1.3rem; }
.stat span { color: var(--portal-muted); font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.stat strong { color: var(--portal-ink); font-family: var(--font-display); font-size: 2.8rem; font-weight: 300; line-height: 1; }
.section-block { margin-top: 2.8rem; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
.section-heading .eyebrow { margin-bottom: .3rem; color: var(--portal-muted); }
.section-heading h2 { margin: 0; font-family: var(--font-display); font-size: 1.85rem; font-weight: 300; line-height: 1.15; }
.section-heading > a:not(.button) { color: var(--portal-ink); font-family: var(--font-display); font-size: 1.02rem; text-decoration: underline; text-decoration-color: var(--portal-sand-line); text-underline-offset: .3em; }
.admin-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 1.3rem; }
.admin-panel { min-width: 0; background: var(--portal-white); box-shadow: var(--portal-shadow); padding: clamp(1.2rem, 3vw, 1.8rem); }
.admin-panel .section-heading { align-items: start; }
.admin-panel .form-stack { margin-top: 1.15rem; }
.admin-panel fieldset { display: flex; flex-wrap: wrap; gap: .8rem 1.2rem; margin: 0; border: 1px solid var(--portal-line); border-radius: 0; padding: .85rem; }
.admin-panel legend { padding: 0 .3rem; color: var(--portal-ink); font-size: .85rem; font-weight: 700; }
.check-row { display: flex !important; align-items: center; gap: .45rem !important; font-weight: 500 !important; }
.check-row input { width: 1.05rem; height: 1.05rem; accent-color: var(--portal-button); }
.optional { color: var(--portal-muted); font-weight: 400; }
.search-form { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; margin-bottom: 1rem; }
.search-form input[type="search"] { flex: 1 1 16rem; min-width: 0; }
.muted-copy { color: var(--portal-muted); font-size: .88rem; line-height: 1.6; }
.import-steps { margin: 0 0 1.1rem; padding-left: 1.2rem; font-size: .88rem; line-height: 1.6; }
.import-steps li + li { margin-top: .3rem; }
.template-download { margin-bottom: .5rem; }
.record-list { display: grid; }
.record { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--portal-line); padding: 1.05rem 0; }
.record h3 { margin: 0; font-family: var(--font-display); font-size: 1.25rem; font-weight: 400; line-height: 1.3; }
.kit-record-main { min-width: 0; flex: 1; }
.kit-record-actions { display: flex; flex-direction: column; align-items: end; gap: .45rem; }
.edit-kit { margin-top: .55rem; color: var(--portal-ink); font-size: .82rem; }
.edit-kit summary { cursor: pointer; font-weight: 600; text-decoration: underline; text-decoration-color: var(--portal-sand-line); text-underline-offset: .25em; }
.edit-kit .form-stack { width: min(100%, 27rem); margin-top: .8rem; }
.record p { margin: .2rem 0 0; color: var(--portal-muted); font-size: .8rem; }
.record > form { display: flex; align-items: center; gap: .65rem; }
.record-account { align-items: start; }
.record-actions { display: flex; flex-direction: column; align-items: end; gap: .55rem; }
.inline-form { margin: 0; }
.text-button { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 0; background: var(--portal-button); color: #fff; padding: .45rem .9rem; font-family: var(--font-display); font-size: .95rem; font-weight: 400; line-height: 1.25; text-decoration: none; cursor: pointer; transition: background-color .2s ease; }
.text-button:hover { background: var(--portal-button-hover); }
.form-stack input[type=file]::file-selector-button { margin-right: .8rem; border: 0; border-radius: 0; background: var(--portal-button); color: #fff; padding: .5rem .95rem; font-family: var(--font-display); font-size: .95rem; cursor: pointer; }
.form-stack input[type=file]::file-selector-button:hover { background: var(--portal-button-hover); }
.status-pill, .role-tag { display: inline-flex; align-items: center; border-radius: 0; padding: .22rem .6rem; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.status-pill.is-active { background: #e4f2f2; color: #2f7f82; }
.status-pill.is-inactive { background: #f5e9e3; color: #923b32; }
.role-tag { margin-left: .4rem; background: var(--portal-sand); color: var(--portal-ink); vertical-align: middle; }
.reset-details { color: var(--portal-ink); font-size: .82rem; }
.reset-details summary { cursor: pointer; font-weight: 600; text-decoration: underline; text-decoration-color: var(--portal-sand-line); text-underline-offset: .25em; }
.inline-reset { display: flex; align-items: center; gap: .4rem; margin-top: .45rem; }
.inline-reset input { width: 10rem; min-height: 2.4rem; padding: .45rem .6rem; font-size: .8rem; }
.table-wrap { width: 100%; overflow-x: auto; background: var(--portal-white); box-shadow: var(--portal-shadow); }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.1rem; color: var(--portal-muted); font-size: .85rem; }
.pagination a { color: var(--portal-ink); font-family: var(--font-display); font-size: 1.02rem; text-decoration: underline; text-decoration-color: var(--portal-sand-line); text-underline-offset: .3em; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: .85rem 1rem; border-bottom: 1px solid var(--portal-line); font-size: .85rem; white-space: nowrap; }
td { color: var(--portal-text); }
th { background: var(--portal-sand); color: var(--portal-ink); font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
td form { margin: 0; }

/* Footer: navy, like the main site's. */
.portal-footer { background: var(--portal-ink); color: #c6c2be; font-size: .9rem; }
.footer-columns { width: min(100% - 2rem, 80rem); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; margin: 0 auto; padding: 3rem 0 2.2rem; }
.footer-columns h2 { margin: 0 0 .9rem; color: #fffdf8; font-family: var(--font-display); font-size: 1.3rem; font-weight: 400; }
.footer-columns p { margin: 0; line-height: 1.9; }
.footer-columns a { color: #fffdf8; text-decoration: none; }
.footer-columns a:hover { color: var(--portal-turquoise); }
.footer-bottom { width: min(100% - 2rem, 80rem); display: flex; justify-content: space-between; gap: 1rem; margin: 0 auto; border-top: 1px solid rgb(255 255 255 / 12%); padding: 1.2rem 0 1.6rem; color: #8f969a; font-size: .8rem; }
.footer-bottom a { color: #fffdf8; text-decoration: none; }
.footer-bottom a:hover { color: var(--portal-turquoise); }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

@media (max-width: 850px) {
  .auth-layout { grid-template-columns: 1fr; gap: 1.5rem; max-width: 34rem; }
  .auth-copy h1 { font-size: clamp(2.7rem, 10vw, 3.7rem); }
  .auth-copy > p:not(.eyebrow) { margin-bottom: .8rem; }
  .stat-grid { grid-template-columns: 1fr; }
  .footer-columns { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .topbar { min-height: 5rem; padding-inline: 1rem; }
  .brand { gap: .7rem; }
  .brand img { width: 3.9rem; }
  .brand span { padding-left: .7rem; font-size: .6rem; }
  .account-menu { gap: .7rem; }
  .account-name { max-width: 9rem; overflow-wrap: anywhere; font-size: .9rem; }
  .button-quiet { min-height: 2.5rem; padding: .5rem .85rem; font-size: .92rem; }
  .auth-layout { width: min(100% - 1.25rem, 34rem); padding: 1.8rem 0; }
  .auth-copy h1 { font-size: clamp(2.4rem, 11vw, 3.1rem); }
  .auth-copy > p:not(.eyebrow) { font-size: .98rem; }
  .auth-panel { padding: 1.3rem; }
  .content-area, .admin-area { width: min(100% - 1.25rem, 80rem); padding-top: 2rem; }
  .page-heading { margin-bottom: 1.5rem; }
  .admin-nav { gap: 1.2rem; margin-inline: -.625rem; padding-inline: .625rem; }
  .admin-columns { grid-template-columns: 1fr; }
  .record { align-items: start; }
  .record > form { flex-wrap: wrap; justify-content: end; }
  .record-account { flex-direction: column; }
  .record-actions { align-items: start; }
  .kit-card { grid-template-columns: 3.4rem minmax(0, 1fr); gap: .9rem; padding: 1.15rem; }
  .kit-mark { width: 3.3rem; height: 3.3rem; font-size: .66rem; }
  .kit-content h2 { font-size: 1.4rem; }
  .section-heading { align-items: start; }
  .footer-columns { grid-template-columns: 1fr; gap: 1.5rem; padding-top: 2.4rem; }
  .footer-bottom { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
