/* Shared modern interface for MySurat, MyMinit, MyKertasKerja, MyCartaOrganisasi, MyMemo and MyPermission. */
:root {
  --ink: #17132f;
  --purple: #5b21b6;
  --purple2: #7c3aed;
  --gold: #fbbf24;
  --muted: #6f6b82;
  --line: #e9e6f1;
  --soft: #f8f7fc;
  --cyan: #22d3ee;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 8%, #8b5cf655 0, transparent 28%),
    radial-gradient(circle at 92% 18%, #22d3ee2e 0, transparent 24%),
    linear-gradient(145deg, #170a38 0%, #2d1064 48%, #4c1d95 100%);
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: .12;
  background-image: linear-gradient(#fff 1px, transparent 1px), linear-gradient(90deg, #fff 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, #000, transparent 72%);
}
.shell { width: min(1460px, calc(100% - 34px)); margin: 0 auto 32px; }
.hero {
  min-height: 286px;
  display: grid;
  grid-template-columns: minmax(440px, 1fr) minmax(330px, .85fr) 240px;
  align-items: center;
  gap: 26px;
  padding: 36px 52px 30px;
  text-align: left;
  position: relative;
}
.hero-copy { position: relative; z-index: 2; min-width: 0; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 13px;
  background: #ffffff12;
  border: 1px solid #ffffff2b;
  box-shadow: inset 0 1px #ffffff21;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .03em;
  backdrop-filter: blur(12px);
}
.badge i, .preview-head .step i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #67e8f9;
  box-shadow: 0 0 0 5px #22d3ee24, 0 0 18px #22d3ee;
}
.hero h1 {
  margin: 18px 0 7px;
  font-size: clamp(44px, 6vw, 78px);
  letter-spacing: -.055em;
  text-shadow: 0 12px 38px #13052c70;
}
.hero p { margin: 0; color: #ddd6fe; font-size: 16px; max-width: 760px; }
.hero-features { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; }
.hero-features span {
  padding: 7px 11px;
  border: 1px solid #ffffff1f;
  border-radius: 999px;
  color: #f5f3ff;
  background: #0f082b4d;
  font-size: 12px;
  font-weight: 700;
}
.usage-pulse {
  min-width: 0;
  padding: 16px 18px 13px;
  border: 1px solid #ffffff2e;
  border-radius: 20px;
  background: linear-gradient(145deg, #ffffff14, #ffffff08);
  box-shadow: inset 0 1px #ffffff20, 0 18px 45px #14052f2b;
  color: #fff;
  backdrop-filter: blur(12px);
}
.pulse-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pulse-head > div { display: flex; flex-direction: column; }
.pulse-head span { color: #c4b5fd; font-size: 9px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.pulse-head strong { margin-top: 2px; font-size: 14px; }
.pulse-head > b { max-width: 115px; overflow: hidden; text-overflow: ellipsis; padding: 5px 8px; border: 1px solid #ffffff20; border-radius: 999px; background: #ffffff12; color: #fff; font-size: 10px; white-space: nowrap; }
.pulse-chart { display: block; width: 100%; height: 92px; margin-top: 3px; overflow: visible; }
.pulse-chart > line { stroke: #ffffff1c; stroke-width: 1; stroke-dasharray: 4 5; }
.pulse-area { fill: url(#suite-pulse-area); }
.pulse-line { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; filter: url(#suite-pulse-glow); }
.pulse-chart circle { fill: #fff; stroke: #7c3aed; stroke-width: 3; filter: url(#suite-pulse-glow); }
.pulse-labels { display: grid; grid-template-columns: repeat(7, 1fr); margin-top: -4px; }
.pulse-labels span { display: flex; flex-direction: column; align-items: center; color: #ddd6fe; font-size: 9px; }
.pulse-labels b { font-size: 9px; }
.pulse-labels small { min-width: 20px; margin-top: 3px; padding: 2px 5px; border-radius: 999px; background: #ffffff11; color: #fff; text-align: center; font-size: 9px; }
.suite-visual { position: relative; height: 220px; display: grid; place-items: center; }
.suite-ring { position: absolute; border: 1px solid #a78bfa5c; border-radius: 50%; }
.suite-ring.ring-one { width: 216px; height: 216px; animation: suiteSpin 18s linear infinite; }
.suite-ring.ring-two { width: 160px; height: 160px; border-style: dashed; animation: suiteSpin 13s linear infinite reverse; }
.suite-ring::before, .suite-ring::after { content: ""; position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 16px var(--cyan); }
.suite-ring::before { left: 20px; top: 29px; }
.suite-ring::after { right: 4px; bottom: 72px; background: var(--gold); box-shadow: 0 0 16px var(--gold); }
.suite-document {
  width: 128px;
  height: 164px;
  position: relative;
  z-index: 2;
  padding: 50px 19px 18px;
  border: 1px solid #ffffff42;
  border-radius: 18px;
  background: linear-gradient(160deg, #ffffffef, #ede9feee);
  box-shadow: 0 24px 65px #0f062d99, inset 0 1px #fff;
  transform: rotate(4deg);
}
.suite-symbol { position: absolute; top: 10px; left: 16px; font-size: 27px; line-height: 1; }
.suite-document > span { display: block; height: 7px; margin: 10px 0; border-radius: 10px; background: #c4b5fd; }
.suite-document > span:nth-of-type(3) { width: 70%; }
.suite-document strong { position: absolute; right: 11px; bottom: 12px; color: var(--purple); font-size: 9px; letter-spacing: .12em; }
.suite-chip { position: absolute; z-index: 3; max-width: 116px; overflow: hidden; text-overflow: ellipsis; padding: 8px 10px; border-radius: 12px; text-align: center; white-space: nowrap; font-size: 9px; font-weight: 900; letter-spacing: .06em; box-shadow: 0 12px 30px #13052c66; }
.chip-top { top: 18px; right: 44px; background: var(--gold); color: #3c1b05; transform: rotate(7deg); }
.chip-bottom { left: 49px; bottom: 20px; background: #312e81; border: 1px solid #ffffff32; color: #fff; transform: rotate(-8deg); }
@keyframes suiteSpin { to { transform: rotate(360deg); } }

.app-card { border: 1px solid #ffffff2b; border-radius: 28px; box-shadow: 0 32px 90px #0e062b80; background: #f8f7fc; }
.module-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  gap: 7px;
  padding: 12px 20px;
  background: #fbbf24f2;
  border-bottom-color: #e4a90d;
  backdrop-filter: blur(16px);
  scrollbar-width: none;
}
.module-nav::-webkit-scrollbar { display: none; }
.module-nav a { color: #66511a; border: 1px solid transparent; padding: 10px 14px; }
.module-nav a:hover { background: #ffffff85; color: #3b1974; }
.module-nav a.active { background: #fff; color: var(--purple); border-color: #fff; box-shadow: 0 8px 20px #7c3a171f; }
.module-nav .account-link { max-width: 180px; overflow: hidden; margin-left: auto; border-color: #6b4b081f; background: #2e1065; color: #fff; text-overflow: ellipsis; }
.module-nav .account-link:hover { background: #42168c; color: #fff; }
.module-nav .account-link.signed-in { background: #166534; }
.module-nav .account-link { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px 5px 5px; }
.module-nav .account-link:not(.signed-in) { padding-left: 10px; }
.nav-avatar { flex: 0 0 auto; width: 30px; height: 30px; display: grid; place-items: center; overflow: hidden; border: 3px solid #fff; border-radius: 50%; background: #fff; color: var(--purple); font-size: 11px; font-weight: 900; box-shadow: 0 2px 8px #1d0a3b30; }
.nav-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.account-name { min-width: 0; max-width: 112px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.document-overview-grid {
  display: grid;
  grid-template-columns: minmax(280px, .72fr) minmax(0, 1.6fr);
  gap: 16px;
  padding: 20px;
  background: #f3f1f8;
}
.document-summary {
  min-height: 218px;
  display: grid;
  grid-template-columns: 46px 1fr;
  grid-template-rows: auto 1fr auto;
  gap: 13px 14px;
  padding: 26px 24px 20px;
  overflow: hidden;
  position: relative;
  color: #fff;
  border: 1px solid #ffffff24;
  border-radius: 20px;
  background: radial-gradient(circle at 88% 8%, #22d3ee42, transparent 30%), linear-gradient(145deg, #3b1680, #5b21b6);
  box-shadow: 0 15px 40px #4c1d9528;
}
.document-summary::after {
  content: "";
  width: 150px;
  height: 150px;
  position: absolute;
  right: -58px;
  bottom: -76px;
  border: 1px solid #ffffff1f;
  border-radius: 50%;
}
.document-summary-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  grid-row: 1 / span 2;
  border: 1px solid #ffffff2d;
  border-radius: 14px;
  color: #67e8f9;
  background: #ffffff12;
  font-size: 20px;
  font-weight: 900;
}
.document-summary-copy span {
  display: block;
  color: #c4b5fd;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.document-summary-copy strong { display: block; margin-top: 4px; font-size: 16px; }
.document-summary-count { grid-column: 2; align-self: center; display: flex; align-items: baseline; gap: 8px; }
.document-summary-count strong { color: var(--gold); font-size: clamp(42px, 5vw, 58px); line-height: 1; }
.document-summary-count span { color: #ede9fe; font-size: 12px; font-weight: 850; text-transform: uppercase; }
.document-summary-foot {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  position: relative;
  z-index: 1;
  border-top: 1px solid #ffffff1a;
  color: #ddd6fe;
  font-size: 10px;
}
.document-summary-foot span { display: flex; align-items: center; gap: 7px; }
.document-summary-foot i { width: 6px; height: 6px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px #22c55e20, 0 0 10px #22c55e; }
.document-summary-foot strong { color: #fff; }

.module-overview {
  margin: 0;
  padding: 23px 25px;
  border: 1px solid #e7e2ef;
  border-radius: 20px;
  color: var(--ink);
  background: radial-gradient(circle at 90% 8%, #c4b5fd42, transparent 32%), #fff;
  box-shadow: 0 15px 40px #24113f0e;
}
.module-overview h2 { margin: 4px 0; color: var(--ink); font-size: clamp(20px, 2.3vw, 28px); }
.module-overview p { color: var(--muted); }
.module-overview .eyebrow { color: var(--purple2); }
.overview-cta { display: inline-block; padding: 10px 14px; border-radius: 11px; color: #fff; background: linear-gradient(135deg, var(--purple), var(--purple2)); font-weight: 850; text-decoration: none; box-shadow: 0 10px 22px #5b21b62e; }
.overview-stat { min-width: 168px; border-color: #ffffff2e; background: #ffffff12; backdrop-filter: blur(10px); }
.overview-stat strong { color: var(--gold); font-size: 38px; line-height: 1.1; }
.overview-stat span { color: #ede9fe; }
.overview-stat a { color: #fff; }

.header-profile, .profile-area.header-profile { padding: 0 20px 20px; background: #f8f7fc; }
.header-profile details, .profile-area.header-profile details, .profile-area details { border-color: #e4dfef; border-radius: 16px; background: #fff; }
.header-profile summary, .profile-area summary { padding: 16px 18px; }
.flash, .profile-warning { border-radius: 14px; }
.workspace { background: #e8e5f0; }
.form-panel { padding: 30px 32px 40px; background: #fff; }
.form-head { padding-bottom: 17px; border-bottom: 1px solid #eeeaf4; }
.form-head h2, .preview-head h2, .editor-head h3 { color: var(--ink); }
.step { color: var(--purple2); font-size: 10px; letter-spacing: .11em; }
.autosave { border: 1px solid #e9e5f0; background: #faf9fd; }
.field input, .field select, .field textarea, .focus-card textarea, .purpose-card textarea, .dynamic-row input, .dynamic-row select {
  border-color: #ded9e8;
  border-radius: 12px;
  background: #fdfcff;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.field input:hover, .field select:hover, .field textarea:hover, .focus-card textarea:hover, .purpose-card textarea:hover { border-color: #c4b5fd; }
.field input:focus, .field select:focus, .field textarea:focus, .focus-card textarea:focus, .purpose-card textarea:focus { background: #fff; box-shadow: 0 0 0 4px #7c3aed16; }
.section-label > span { color: #fff; background: linear-gradient(135deg, var(--purple), var(--purple2)); box-shadow: 0 8px 18px #6d28d930; }
.section-label h3, .dynamic-head h3 { color: var(--ink); }
.purpose-card, .focus-card { border-color: #ddd6fe; border-radius: 18px; background: linear-gradient(145deg, #faf8ff, #fff); box-shadow: 0 12px 28px #4c1d950a; }
.dynamic-row, .advanced, .inline-details { border-color: #e7e2ee; border-radius: 13px; background: #faf9fd; }
.dynamic-head button, .template-bar button { border: 1px solid #ddd6fe; background: #f5f3ff; }
.template-bar { border-radius: 15px; }
.generate-button { border-radius: 14px; box-shadow: 0 15px 30px #5b21b63b; transition: transform .15s ease, box-shadow .15s ease; }
.generate-button:hover { transform: translateY(-2px); box-shadow: 0 18px 35px #5b21b64f; }
.editor-section { border-color: #ddd6fe; border-radius: 17px; }

.preview-panel { padding: 30px; background: linear-gradient(160deg, #f0edfa, #e9e6f3); }
.preview-head { margin-bottom: 14px; }
.preview-head .step { display: flex; align-items: center; gap: 9px; }
.preview-head .step i { width: 6px; height: 6px; background: #22c55e; box-shadow: 0 0 0 4px #22c55e20, 0 0 14px #22c55e; }
.preview-status { padding: 6px 9px; border: 1px solid #d8d1e8; border-radius: 999px; color: var(--muted); background: #ffffff8f; font-size: 10px; font-weight: 750; }
.letter-paper, .document-paper { border: 1px solid #ddd6ea; border-radius: 4px; box-shadow: 0 24px 55px #24113f24; }

.my-letters, .records { padding: 28px; background: #fff; }
.list-head { padding-bottom: 14px; border-bottom: 1px solid #eeeaf4; }
.list-head h2 { color: var(--ink); }
.list-head > a { padding: 9px 12px; border-radius: 10px; background: #f3effb; text-decoration: none; }
.letter-table-wrap { border-color: #e8e3ef; border-radius: 16px; }
.record-grid article { border-color: #e8e3ef; border-radius: 16px; background: #faf9fd; transition: transform .16s ease, box-shadow .16s ease; }
.record-grid article:hover { transform: translateY(-2px); box-shadow: 0 12px 25px #38117312; }
.row-actions a, .row-actions button { border-radius: 8px; }
.profile-area.signatory-area { padding: 0 28px 28px; background: #fff; }
.footer { color: #cfc7e6; }

html[data-module="minutes"] .suite-symbol { color: #5b21b6; }
html[data-module="paper"] .suite-symbol { color: #b45309; }
html[data-module="orgchart"] .suite-symbol { color: #0f766e; }
html[data-module="letter"] .suite-symbol { color: #be123c; }
html[data-module="orgchart"] .hero h1 { font-size: clamp(42px, 4.2vw, 60px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
@media (max-width: 1050px) {
  .hero { grid-template-columns: minmax(390px, 1fr) minmax(340px, .85fr); }
  .suite-visual { display: none; }
  .document-overview-grid { grid-template-columns: 1fr; }
  .workspace { grid-template-columns: 1fr; }
  .form-panel { border-right: 0; }
}
@media (max-width: 760px) {
  .shell { width: min(100% - 18px, 1460px); }
  .hero { min-height: auto; grid-template-columns: 1fr; padding: 28px 20px 24px; text-align: center; }
  .hero h1 { font-size: clamp(43px, 13vw, 64px); }
  .hero p { margin-inline: auto; }
  .hero-features { justify-content: center; }
  .suite-visual { display: none; }
  .usage-pulse { width: min(100%, 540px); margin: 12px auto 0; text-align: left; }
  .document-overview-grid { gap: 12px; padding: 12px; }
  .document-overview-grid .module-overview { margin: 0; padding: 20px; }
  .form-panel, .preview-panel, .my-letters, .records { padding: 22px 18px 30px; }
  .header-profile, .profile-area.header-profile { padding: 0 12px 12px; }
}
@media (max-width: 520px) {
  .shell { width: 100%; margin-bottom: 0; }
  .app-card { border-radius: 24px 24px 0 0; }
  .module-nav { padding-inline: 11px; }
  .module-nav a { padding: 9px 11px; font-size: 12px; }
  .module-nav .account-link { position: sticky; right: 0; z-index: 3; margin-left: 10px; box-shadow: -10px 0 16px #fbbf24; }
  .hero { padding-inline: 14px; }
  .hero-features { gap: 6px; }
  .hero-features span { font-size: 11px; }
  .document-summary { min-height: 204px; padding: 22px 18px 18px; }
  .document-summary-count strong { font-size: 46px; }
  .module-overview { grid-template-columns: 1fr; }
  .overview-stat { width: 100%; grid-template-columns: auto 1fr auto; }
  .preview-status { display: none; }
  .profile-area.signatory-area { padding-inline: 16px; }
  html[data-module="orgchart"] .hero h1 { font-size: clamp(31px, 8.2vw, 42px); letter-spacing: -.07em; }
}
@media print {
  body { background: #fff; }
  body::before, .hero, .module-nav, .document-overview-grid, .module-overview, .flash, .profile-warning, .form-panel, .preview-head, .my-letters, .records, .header-profile, .profile-area, .footer { display: none !important; }
  .shell, .app-card, .workspace, .preview-panel { width: 100%; margin: 0; padding: 0; background: #fff; border: 0; box-shadow: none; }
  .workspace { display: block; }
  .letter-paper, .document-paper { border: 0; box-shadow: none; }
}

.memo-template-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.memo-template-actions button { width: auto; white-space: nowrap; }
html[data-module="memo"] .focus-card { border-color: #fbbf24; background: linear-gradient(145deg, #fffbeb, #fff); }
html[data-module="memo"] .generated-content h2 { color: #4c1d95; letter-spacing: .06em; }
html[data-module="memo"] .generated-content table th { width: 18%; color: #4c1d95; }
@media (max-width: 760px) {
  .memo-template-actions { width: 100%; justify-content: stretch; }
  .memo-template-actions button { flex: 1 1 30%; }
}
@media (max-width: 460px) {
  .memo-template-actions button { flex-basis: 100%; }
}

.permission-template-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.permission-template-actions button { width: auto; white-space: nowrap; }
html[data-module="permission"] .suite-symbol { color: #15803d; }
html[data-module="permission"] .hero h1 { font-size: clamp(42px, 4.4vw, 62px); }
html[data-module="permission"] .permission-focus { border-color: #86efac; background: linear-gradient(145deg, #f0fdf4, #fff); }
html[data-module="permission"] .generated-content h2 { color: #4c1d95; font-size: 16px; line-height: 1.35; letter-spacing: .025em; }
html[data-module="permission"] .generated-content h3 { break-after: avoid; }
html[data-module="permission"] .generated-content table th { width: 18%; color: #4c1d95; }
html[data-module="permission"] .permission-meta { display: flex; justify-content: flex-end; text-align: left; }
html[data-module="permission"] .permission-meta p { min-width: 180px; }
@media (max-width: 760px) {
  .permission-template-actions { width: 100%; justify-content: stretch; }
  .permission-template-actions button { flex: 1 1 30%; }
}
@media (max-width: 520px) {
  html[data-module="permission"] .hero h1 { font-size: clamp(35px, 10.2vw, 48px); letter-spacing: -.06em; }
}
@media (max-width: 460px) {
  .permission-template-actions button { flex-basis: 100%; }
}
