:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  --bg: #eef2f6;
  --surface: #ffffff;
  --surface-soft: #f3f6fa;
  --line: #d6dee8;
  --text: #172033;
  --muted: #65748a;
  --primary: #e63332;
  --primary-dark: #b91f28;
  --accent: #176f62;
  --warning: #a16207;
  --success: #15803d;
  --danger: #b91c1c;
  --gold: #ffd429;
  --ink: #111827;
  --shadow: 0 18px 42px rgba(27, 39, 59, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 212, 41, 0.16), transparent 28%),
    linear-gradient(180deg, #f7f9fc 0%, var(--bg) 34%, #e9eef5 100%);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(230, 51, 50, 0.20), transparent 35%),
    #101827;
  color: #f9fafb;
  padding: 22px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 10px 18px;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 19px;
  letter-spacing: 0.01em;
}

.brand span {
  color: #b8c3d2;
  font-size: 12px;
  margin-top: 3px;
  line-height: 1.35;
}

.brand-logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
  background: #ffffff;
  border-radius: 10px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.22);
}

.sidebar-status {
  margin: 0 8px 16px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.sidebar-status span,
.sidebar-status strong {
  display: block;
}

.sidebar-status span {
  color: #91a0b5;
  font-size: 11px;
  text-transform: uppercase;
}

.sidebar-status strong {
  margin-top: 4px;
  font-size: 13px;
  color: #f8fafc;
}

nav {
  display: grid;
  gap: 6px;
}

nav button {
  border: 0;
  color: #dbe3ef;
  background: transparent;
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  min-height: 44px;
  border-radius: 8px;
  text-align: left;
  padding: 8px 10px;
  font-weight: 700;
}

nav button:hover,
nav button.active {
  background: rgba(255, 255, 255, 0.08);
}

nav button.active {
  color: #ffffff;
  box-shadow: inset 4px 0 0 var(--gold), 0 10px 24px rgba(0, 0, 0, 0.12);
}

nav i {
  font-style: normal;
  width: 24px;
  text-align: center;
}

main {
  min-width: 0;
}

.topbar {
  min-height: 92px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 18px 30px;
  position: sticky;
  top: 0;
  z-index: 4;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 28px;
  letter-spacing: 0;
}

h2 {
  font-size: 19px;
}

h3 {
  font-size: 14px;
}

.topbar-search {
  flex: 1;
  max-width: 460px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.topbar-search span {
  color: var(--muted);
}

.topbar-search input {
  border: 0;
  background: transparent;
  min-height: 38px;
  padding: 0;
}

.topbar-search input:focus {
  outline: 0;
}

.role-switch {
  display: flex;
  gap: 10px;
  align-items: center;
}

.role-switch label {
  color: var(--muted);
  font-size: 13px;
}

.user-session {
  align-items: flex-end;
  flex-direction: column;
  gap: 3px;
  min-width: 320px;
}

.user-session strong,
.user-session span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-session span {
  color: var(--muted);
  font-size: 12px;
}

.user-session button {
  min-height: 30px;
  padding: 6px 10px;
}

.content {
  padding: 26px;
}

.hero-panel {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  margin-bottom: 18px;
  padding: 26px;
  border: 1px solid rgba(159, 29, 43, 0.18);
  border-radius: 10px;
  color: #ffffff;
  background: linear-gradient(100deg, #101827 0%, #1f2937 52%, #b91f28 100%);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 40%);
  pointer-events: none;
}

.hero-panel h2 {
  max-width: 760px;
  margin-bottom: 8px;
  font-size: 25px;
  line-height: 1.25;
}

.hero-panel span {
  color: #edf2f7;
}

.hero-panel .eyebrow {
  color: #ffe777;
}

.hero-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px;
}

.office-photo {
  width: min(36vw, 520px);
  align-self: stretch;
  min-height: 150px;
  margin: -26px -26px -26px 0;
  background:
    linear-gradient(90deg, rgba(16, 24, 39, 0.16), rgba(230, 51, 50, 0.10)),
    url("/src/office.jfif") center / cover no-repeat;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
  filter: contrast(1.08) saturate(1.12);
  position: relative;
  z-index: 1;
}

.hero-actions button:not(.primary) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.notif-bell {
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 999px;
  position: relative;
  display: grid;
  place-items: center;
  color: #7f1d1d;
  background: #fff7ed;
  border-color: #fed7aa;
}

.notif-bell span {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--gold);
  font-weight: 900;
}

.notif-bell b {
  position: absolute;
  right: -3px;
  top: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  font-size: 11px;
}

.notification-panel {
  display: none;
  margin-bottom: 18px;
  border: 1px solid #f8c7c7;
  border-radius: 10px;
  padding: 16px;
  background: #fffafa;
  box-shadow: var(--shadow);
}

.notification-panel.open,
.notification-panel:first-child {
  display: block;
}

.notification-list {
  display: grid;
  gap: 8px;
}

.notification-list article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
  display: grid;
  gap: 4px;
}

.notification-list article.unread {
  border-color: #fca5a5;
  box-shadow: inset 4px 0 0 var(--primary);
}

.notification-list span,
.notification-list small {
  color: var(--muted);
}

.toast-message {
  margin-bottom: 14px;
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #166534;
  border-radius: 10px;
  padding: 12px 14px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(22, 101, 52, 0.08);
}

.toast-message.success {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.toast-message.error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
  box-shadow: 0 10px 24px rgba(153, 27, 27, 0.08);
}

.toast-message.loading,
.toast-message.warning {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
  box-shadow: 0 10px 24px rgba(146, 64, 14, 0.08);
}

.access-denied {
  max-width: 680px;
}

.access-denied p {
  color: var(--muted);
  line-height: 1.6;
}

.grid {
  display: grid;
  gap: 16px;
}

.metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.metric,
.panel,
.detail-card,
.list-panel,
.detail-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.metric {
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary), var(--gold));
}

.metric span,
.metric small {
  display: block;
  color: var(--muted);
}

.metric strong {
  display: block;
  font-size: 36px;
  margin: 8px 0 6px;
  letter-spacing: 0;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.8fr);
  gap: 18px;
}

.panel {
  padding: 20px;
}

.wide {
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.inline-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.panel-head h2 {
  margin-bottom: 0;
}

.section-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
  overflow: hidden;
}

th,
td {
  padding: 13px 11px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: #536176;
  font-size: 12px;
  text-transform: uppercase;
  background: #f8fafc;
}

tr[data-select] {
  cursor: pointer;
}

tr[data-select]:hover {
  background: #f8fafc;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.semakan-teknikal {
  background: #fef3c7;
  color: #92400e;
}

.menunggu-kelulusan {
  background: #dbeafe;
  color: #1d4ed8;
}

.permit-aktif,
.diluluskan {
  background: #dcfce7;
  color: #166534;
}

.ditolak {
  background: #fee2e2;
  color: #991b1b;
}

.task-list {
  display: grid;
  gap: 10px;
}

.task-list article,
.security-grid article,
.record-line {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 4px;
  background: linear-gradient(180deg, #ffffff, #fbfcfe);
}

.task-list article {
  grid-template-columns: 1fr auto;
}

.task-list strong,
.task-list span {
  grid-column: 1;
}

.task-list b {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(145deg, var(--primary), var(--primary-dark));
  border-radius: 999px;
}

.task-list span,
.record-line span {
  color: var(--muted);
}

.workflow-guide {
  margin-top: 18px;
}

.customer-share {
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: 1fr 120px auto;
  gap: 14px;
  align-items: center;
}

.customer-share p {
  color: var(--muted);
  margin-bottom: 10px;
}

.customer-share img {
  width: 112px;
  height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: #ffffff;
}

.public-portal {
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(127, 29, 29, 0.12) 0 10px, transparent 10px calc(100% - 10px), rgba(255, 212, 41, 0.26) calc(100% - 10px) 100%),
    linear-gradient(115deg, rgba(127, 29, 29, 0.08) 0 24%, transparent 24% 100%),
    linear-gradient(295deg, rgba(255, 212, 41, 0.12) 0 18%, transparent 18% 100%),
    linear-gradient(105deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.90) 54%, rgba(255, 250, 238, 0.88) 100%),
    linear-gradient(135deg, #edf4f8 0%, #f9fbff 46%, #fff6ea 100%);
  padding: 32px;
  position: relative;
  overflow-x: hidden;
}

.public-portal::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(127, 29, 29, 0.09) 0 1px, transparent 1px 100%),
    linear-gradient(rgba(15, 23, 42, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.032) 1px, transparent 1px);
  background-size: 100% 100%, 34px 34px, 34px 34px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.58), transparent 78%);
  pointer-events: none;
  z-index: 0;
}

.public-portal::after {
  content: "";
  position: fixed;
  right: -120px;
  bottom: -96px;
  width: min(58vw, 860px);
  height: min(46vw, 610px);
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.70), rgba(255, 255, 255, 0.28)),
    url("/src/office.jfif") center / cover no-repeat;
  opacity: 0.26;
  filter: saturate(1.12) contrast(1.04);
  border-radius: 44px 0 0 0;
  box-shadow:
    inset 14px 14px 0 rgba(230, 51, 50, 0.13),
    inset 0 0 0 1px rgba(127, 29, 29, 0.10);
  pointer-events: none;
  transform: rotate(-1.5deg);
  z-index: 0;
}

.public-topbar::before {
  content: "";
  position: absolute;
  left: -110px;
  top: 18px;
  width: 92px;
  height: calc(100% + 380px);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(127, 29, 29, 0.18), rgba(230, 51, 50, 0.12), rgba(255, 212, 41, 0.16), transparent);
  pointer-events: none;
}

.public-topbar,
.public-shell {
  max-width: 1500px;
  margin: 0 auto;
}

.public-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: stretch;
  margin-bottom: 22px;
  position: relative;
  z-index: 1;
}

.public-brand {
  min-height: 190px;
  border: 1px solid rgba(203, 213, 225, 0.95);
  border-radius: 22px;
  background:
    linear-gradient(115deg, #ffffff 0%, rgba(255,255,255,0.96) 46%, rgba(255, 247, 237, 0.94) 100%);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
  padding: 34px;
  display: flex;
  gap: 22px;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.public-brand::before {
  content: "";
  position: absolute;
  right: 70px;
  top: -70px;
  width: 230px;
  height: 230px;
  border-radius: 999px;
  background: rgba(255, 212, 41, 0.18);
}

.public-brand::after {
  content: "";
  position: absolute;
  inset: 0 0 0 auto;
  width: 10px;
  background: linear-gradient(180deg, var(--primary), var(--gold));
}

.public-brand img {
  width: 98px;
  height: 98px;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 10px;
  box-shadow: 0 16px 28px rgba(27, 39, 59, 0.14);
  position: relative;
  z-index: 1;
}

.public-brand h1 {
  margin: 4px 0 8px;
  max-width: 760px;
  font-size: clamp(30px, 3vw, 46px);
  line-height: 1.04;
  color: #111827;
  position: relative;
  z-index: 1;
}

.public-brand span {
  color: #475569;
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.public-office-thumb {
  margin: 0;
  min-height: 190px;
  border-radius: 22px;
  border: 1px solid rgba(203, 213, 225, 0.95);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(17,24,39,0.12)),
    url("/src/office.jfif") center / cover no-repeat;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.13);
  position: relative;
  overflow: hidden;
}

.public-office-thumb::after {
  content: "";
  position: absolute;
  inset: auto 18px 18px 18px;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--gold));
}

.public-shell {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  position: relative;
  z-index: 1;
}

.public-shell::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 18px;
  bottom: 28px;
  width: 7px;
  border-radius: 999px;
  background: linear-gradient(180deg, #7f1d1d 0%, #e63332 58%, #ffd429 100%);
  opacity: 0.62;
  pointer-events: none;
}

.public-info {
  position: sticky;
  top: 24px;
  border: 1px solid rgba(203, 213, 225, 0.95);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(17, 24, 39, 0.02), rgba(255, 255, 255, 0.98)),
    #ffffff;
  box-shadow: 0 24px 58px rgba(15, 23, 42, 0.10);
  padding: 24px;
  overflow: hidden;
}

.public-info::before {
  content: "";
  display: block;
  height: 190px;
  margin: -24px -24px 20px;
  background:
    linear-gradient(180deg, rgba(0,0,0,0), rgba(15,23,42,0.28)),
    url("/src/office.jfif") center / cover no-repeat;
}

.public-info-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: -76px;
  margin-bottom: 24px;
  position: relative;
}

.public-info-head img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 8px;
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.18);
}

.public-info-head span {
  border: 1px solid rgba(255, 255, 255, 0.60);
  background: rgba(255, 255, 255, 0.82);
  color: #7f1d1d;
  border-radius: 999px;
  padding: 9px 13px;
  font-weight: 900;
}

.public-info strong {
  display: block;
  font-size: 25px;
  margin-bottom: 8px;
}

.public-info p {
  color: var(--muted);
  line-height: 1.55;
}

.public-mini-grid {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.public-mini-grid span {
  border: 1px solid #fed7aa;
  border-radius: 14px;
  padding: 12px;
  color: #172033;
  background: linear-gradient(90deg, #fff7ed, #ffffff);
  font-weight: 800;
  font-size: 13px;
}

.public-mini-grid b {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-right: 8px;
  border-radius: 999px;
  background: #7f1d1d;
  color: #ffffff;
}

.public-contact-card {
  margin-top: 18px;
  padding: 18px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(127, 29, 29, 0.94), rgba(17, 24, 39, 0.92)),
    #111827;
  color: #ffffff;
}

.public-contact-card small {
  display: block;
  color: #fde68a;
  font-weight: 800;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.public-contact-card strong {
  font-size: 18px;
  margin: 0;
}

.public-card {
  min-width: 0;
}

.public-card .panel {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.98)),
    #ffffff;
  border: 1px solid rgba(203, 213, 225, 0.95);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.12);
  border-radius: 24px;
  padding: 30px;
}

.public-form-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.public-form-title h2 {
  margin: 0;
  font-size: 24px;
}

.public-form-title > span {
  padding: 9px 14px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-weight: 900;
  border: 1px solid #bbf7d0;
}

.public-progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 22px;
}

.public-progress button,
.public-progress span {
  min-height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #7f1d1d;
  background: linear-gradient(180deg, #fff7f7, #ffffff);
  border: 1px solid #fecaca;
  font-size: 12px;
  font-weight: 900;
}

.public-progress button {
  cursor: pointer;
}

.public-progress button.active,
.public-progress span.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-color: var(--primary);
  box-shadow: 0 12px 22px rgba(185, 31, 40, 0.18);
}

.form-section-card {
  border: 1px solid #d7e0eb;
  border-radius: 18px;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.94), rgba(248,250,252,0.88)),
    #fbfcfe;
  position: relative;
  overflow: hidden;
  display: none;
}

.form-section-card.active {
  display: block;
}

.form-section-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, var(--primary), var(--gold));
}

.form-section-card h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  color: #172033;
  font-size: 16px;
}

.form-section-card h3 span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #fff7ed;
  color: #7f1d1d;
  border: 1px solid #fed7aa;
  font-size: 12px;
  font-weight: 900;
}

.public-card .form-preview-grid {
  grid-template-columns: 1fr;
}

.public-card .manual-sheet {
  display: none;
}

.workflow-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.workflow-steps article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
  display: grid;
  gap: 5px;
}

.workflow-steps b {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--primary);
  border-radius: 999px;
}

.workflow-steps span {
  color: var(--primary-dark);
  font-weight: 800;
}

.workflow-steps p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin: 0;
}

.module-warning {
  grid-column: 1 / -1;
  border: 1px solid #fde68a;
  background: #fffbeb;
  color: #92400e;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0;
  font-size: 12px;
  font-weight: 800;
}

.form-layout {
  max-width: 1180px;
}

.form-preview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  gap: 18px;
  align-items: start;
}

.form-section {
  display: grid;
  gap: 15px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.scan-form .field-grid {
  grid-template-columns: minmax(0, 1fr);
}

label {
  display: grid;
  gap: 7px;
}

label span {
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  max-width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  min-height: 46px;
  padding: 10px 12px;
}

select {
  cursor: pointer;
  white-space: normal;
  text-overflow: ellipsis;
}

select option {
  white-space: normal;
  padding: 8px 10px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(159, 29, 43, 0.12);
  border-color: rgba(159, 29, 43, 0.55);
}

input[readonly],
textarea[readonly] {
  background: #f8fafc;
  color: #475569;
  cursor: default;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

.upload-zone {
  border: 1px dashed #94a3b8;
  background: linear-gradient(180deg, #f8fafc, #eef3f7);
  border-radius: 8px;
  padding: 18px;
}

.document-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.document-upload {
  padding: 14px;
}

.document-upload > span {
  margin: 0 0 8px;
}

.document-upload strong {
  color: #7f1d1d;
  font-size: 12px;
}

.step-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.upload-zone input {
  min-height: auto;
  padding: 0;
  border: 0;
}

.upload-zone strong,
.upload-zone span {
  display: block;
  margin-top: 6px;
}

.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.form-feedback {
  display: none;
  border-radius: 10px;
  padding: 12px 14px;
  font-weight: 800;
  border: 1px solid transparent;
}

.form-feedback.loading,
.form-feedback.success,
.form-feedback.error {
  display: block;
}

.form-feedback.loading {
  color: #92400e;
  background: #fffbeb;
  border-color: #fde68a;
}

.form-feedback.success {
  color: #166534;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.form-feedback.error {
  color: #991b1b;
  background: #fef2f2;
  border-color: #fecaca;
}

button,
.primary {
  border: 1px solid var(--line);
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-weight: 700;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(27, 39, 59, 0.09);
}

.primary {
  border-color: var(--primary);
  background: linear-gradient(145deg, var(--primary), var(--primary-dark));
  color: #ffffff;
}

.primary:hover {
  background: var(--primary-dark);
}

.split {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(0, 1.55fr);
  gap: 18px;
  min-height: calc(100vh - 138px);
}

.list-panel,
.detail-panel {
  padding: 14px;
}

.list-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search {
  max-width: 260px;
}

.list-item {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #ffffff;
  text-align: left;
  padding: 13px;
  display: grid;
  gap: 5px;
}

.list-item.selected {
  border-color: #fca5a5;
  background: linear-gradient(90deg, #fff1f2, #ffffff);
  box-shadow: inset 4px 0 0 var(--primary);
}

.list-item span,
.list-item em {
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
}

.detail-panel {
  overflow: auto;
}

.detail-card {
  padding: 20px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.detail-grid div,
.docket-book div {
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}

.detail-grid span,
.docket-book span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.detail-grid strong,
.docket-book strong {
  display: block;
  margin-top: 3px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.mini {
  box-shadow: none;
}

.mini p {
  margin: 0 0 8px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.mini em {
  color: var(--muted);
}

.workbench,
.document-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.7fr);
  gap: 18px;
}

.docket-book {
  margin: 16px 0;
}

.notice {
  color: var(--muted);
  line-height: 1.6;
}

.approval-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
}

.decision-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #ffffff;
  height: max-content;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.approve,
.reject {
  min-height: 74px;
  color: #ffffff;
  border: 0;
}

.approve {
  background: var(--success);
}

.reject {
  background: var(--danger);
}

.approval-workspace {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.approval-list {
  min-height: calc(100vh - 150px);
}

.approval-review {
  display: grid;
  gap: 16px;
}

.approval-hero,
.approval-decision-panel,
.approval-card {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
}

.approval-hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(255, 251, 235, 0.95), rgba(255, 255, 255, 0.98) 42%, rgba(239, 246, 255, 0.96)),
    linear-gradient(90deg, #7f1d1d 0 4px, transparent 4px);
}

.approval-hero h2 {
  margin: 4px 0 8px;
  font-size: 22px;
  letter-spacing: 0;
}

.approval-hero p,
.approval-decision-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.approval-decision-panel {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 18px;
}

.approval-decision-panel h3 {
  margin: 4px 0 6px;
  font-size: 18px;
}

.approval-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.approval-actions .approve,
.approval-actions .reject {
  min-height: 48px;
  min-width: 120px;
  font-size: 14px;
  font-weight: 800;
  border-radius: 8px;
}

.approval-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.approval-card {
  padding: 18px;
}

.approval-card .panel-head {
  margin-bottom: 12px;
}

.approval-fact {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid #e2e8f0;
}

.approval-fact:last-child {
  border-bottom: 0;
}

.approval-fact span {
  color: #64748b;
  font-size: 12px;
}

.approval-fact strong {
  color: #111827;
  line-height: 1.45;
}

.approval-technical {
  background:
    linear-gradient(180deg, rgba(255, 251, 235, 0.55), rgba(255, 255, 255, 0.98)),
    #ffffff;
}

.permit-card {
  border: 2px solid #0f172a;
  background:
    linear-gradient(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.9)),
    repeating-linear-gradient(135deg, rgba(230, 51, 50, 0.035) 0 2px, transparent 2px 10px);
  padding: 18px 18px 22px;
  max-width: 690px;
  margin-top: 16px;
  box-shadow: 0 18px 36px rgba(17, 24, 39, 0.12);
  position: relative;
  overflow: hidden;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 44px 28px;
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 212, 41, 0.20), transparent 28%),
    radial-gradient(circle at 88% 12%, rgba(220, 38, 38, 0.12), transparent 24%),
    linear-gradient(135deg, #fffdf7 0%, #f8fafc 46%, #eef4fa 100%);
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(148, 163, 184, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.09) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.75), transparent 88%);
  pointer-events: none;
  z-index: 1;
}

.login-page::after {
  content: "";
  position: fixed;
  inset: auto -9vw -18vh auto;
  width: 48vw;
  height: 48vw;
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(220, 38, 38, 0.10), rgba(255, 212, 41, 0.18)),
    #fff7ed;
  box-shadow: 0 0 0 44px rgba(255, 255, 255, 0.36);
  pointer-events: none;
  z-index: 0;
}

.login-shell {
  width: min(1120px, 100%);
  position: relative;
  z-index: 2;
}

.login-identity {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 18px;
}

.login-identity img {
  width: 58px;
  height: 58px;
  padding: 8px;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.10);
}

.login-identity h1 {
  margin: 3px 0 2px;
  font-size: 34px;
  letter-spacing: 0;
  color: #111827;
}

.login-identity span {
  color: #64748b;
  font-weight: 800;
}

.login-card {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(340px, 0.82fr);
  gap: 0;
  padding: 0;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96)),
    #ffffff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.16);
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 5px solid #b91c1c;
  border-right: 5px solid #facc15;
  pointer-events: none;
}

.login-brand {
  min-height: 500px;
  display: grid;
  align-content: end;
  gap: 24px;
  padding: 46px;
  color: #111827;
  background:
    linear-gradient(135deg, rgba(255, 251, 235, 0.94), rgba(255, 255, 255, 0.88) 48%, rgba(254, 242, 242, 0.92)),
    url("/src/office.jfif") center / cover no-repeat;
  position: relative;
  overflow: hidden;
}

.login-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.84) 56%, rgba(255, 255, 255, 0.55) 100%),
    linear-gradient(135deg, rgba(185, 28, 28, 0.08), transparent 55%);
}

.login-brand > * {
  position: relative;
  z-index: 1;
}

.login-brand-mark {
  display: flex;
  gap: 10px;
}

.login-brand-mark img {
  width: 62px;
  height: 62px;
  object-fit: contain;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 14px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.10);
}

.login-brand span {
  color: #b91c1c;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-brand h2 {
  max-width: 620px;
  margin: 10px 0 12px;
  font-size: 34px;
  line-height: 1.12;
  letter-spacing: 0;
}

.login-brand p {
  max-width: 560px;
  color: #475569;
  line-height: 1.6;
}

.login-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 600px;
}

.login-status-grid small {
  display: grid;
  gap: 4px;
  padding: 13px;
  border: 1px solid rgba(203, 213, 225, 0.85);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  color: #64748b;
  font-weight: 800;
}

.login-status-grid b {
  font-size: 24px;
  color: #111827;
}

.login-form,
.login-note {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 44px 38px;
  border: 0;
  border-left: 1px solid rgba(203, 213, 225, 0.8);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: none;
  position: relative;
  z-index: 1;
}

.login-form h2 {
  margin: 4px 0 2px;
  font-size: 26px;
}

.login-form label {
  gap: 8px;
}

.login-form input {
  min-height: 48px;
  font-size: 16px;
}

.login-form button.primary {
  min-height: 48px;
  margin-top: 2px;
}

.login-note {
  grid-column: 2;
  background:
    linear-gradient(135deg, #fffbeb, #fff7ed),
    #fffbeb;
  border-color: #fde68a;
  box-shadow: 0 14px 34px rgba(146, 64, 14, 0.08);
}

.login-note a {
  color: var(--primary-dark);
  font-weight: 900;
}

.login-customer-qr {
  width: 108px;
  height: 108px;
  padding: 8px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #ffffff;
}

.login-samples {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid rgba(203, 213, 225, 0.8);
}

.login-samples strong {
  color: #334155;
  font-size: 13px;
}

.login-samples span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}

.login-samples small {
  color: #64748b;
  font-weight: 800;
}

.doc-header {
  text-align: center;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.doc-header span,
.doc-header strong {
  display: block;
}

.doc-header strong {
  font-size: 27px;
}

.permit-head {
  display: grid;
  grid-template-columns: 72px 1fr 72px;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.permit-head img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.permit-watermark {
  position: absolute;
  width: 390px;
  max-width: 82%;
  opacity: 0.08;
  left: 50%;
  top: 190px;
  transform: translateX(-50%);
  pointer-events: none;
}

.permit-green {
  border: 3px solid #111827;
  background: rgba(223, 241, 205, 0.92);
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.permit-action-label {
  text-align: center;
  padding: 7px;
  background: rgba(255, 255, 255, 0.32);
  border-bottom: 3px solid #111827;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 900;
}

.permit-entry {
  border: 1px solid var(--line);
  background: #fbfcfe;
  border-radius: 8px;
  padding: 14px;
  margin: 12px 0 16px;
}

.permit-mode-note {
  border: 1px solid #fde68a;
  background: #fffbeb;
  color: #92400e;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 800;
}

.serial-row {
  display: grid;
  grid-template-columns: 170px 1fr;
  min-height: 54px;
  border-bottom: 3px solid #111827;
}

.serial-row:last-child {
  border-bottom: 0;
}

.serial-row span,
.serial-row strong {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 8px;
  text-transform: uppercase;
}

.serial-row span {
  border-right: 3px solid #111827;
  color: #111827;
  font-size: 12px;
  font-weight: 800;
}

.serial-row strong {
  color: #b91f28;
  font-size: 18px;
}

.serial-row.compact {
  grid-template-columns: 1fr;
}

.serial-row.compact span {
  display: none;
}

.serial-row.compact strong {
  color: #111827;
  font-size: 13px;
}

.permit-info-table {
  border: 2px solid #334155;
  position: relative;
  z-index: 1;
}

.permit-info-table p {
  display: grid;
  grid-template-columns: 190px 1fr;
  margin: 0;
  border-bottom: 2px solid #94a3b8;
}

.permit-info-table p:last-child {
  border-bottom: 0;
}

.permit-info-table span,
.permit-info-table strong {
  padding: 8px 10px;
  font-size: 13px;
}

.permit-info-table span {
  background: rgba(241, 245, 249, 0.82);
  border-right: 2px solid #94a3b8;
  color: #111827;
}

.permit-info-table strong {
  color: #111827;
}

.permit-card h3 {
  margin: 12px 0 4px;
  text-transform: uppercase;
  font-size: 22px;
  line-height: 1;
}

.qr {
  margin-top: 16px;
  display: inline-grid;
  gap: 8px;
}

.permit-qr-row {
  min-height: 178px;
}

.permit-qr-row strong {
  display: grid;
  place-items: center;
  gap: 6px;
  text-align: center;
}

.permit-qr-row img,
.permit-qr-row .qr-placeholder {
  width: 164px;
  height: 164px;
  display: grid;
  grid-template-columns: repeat(21, 1fr);
  grid-template-rows: repeat(21, 1fr);
  border: 8px solid #ffffff;
  outline: 1px solid #111827;
  background: #ffffff;
}

.permit-qr-row .qr-placeholder span {
  background: #ffffff;
}

.permit-qr-row .qr-placeholder span.on {
  background: #111827;
}

.permit-qr-row small {
  color: #475569;
  font-size: 11px;
  font-weight: 800;
}

.qr > div {
  width: 164px;
  height: 164px;
  display: grid;
  grid-template-columns: repeat(21, 1fr);
  grid-template-rows: repeat(21, 1fr);
  border: 8px solid #ffffff;
  outline: 1px solid #111827;
  background: #ffffff;
}

.qr span {
  background: #ffffff;
}

.qr span.on {
  background: #111827;
}

.inspection-list {
  display: grid;
  gap: 10px;
}

.inspection-list article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.inspection-list span,
.inspection-list small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.inspection-list p {
  margin: 8px 0 0;
}

.camera-capture {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px dashed #94a3b8;
  border-radius: 8px;
  background: #f8fafc;
}

.camera-capture input {
  padding: 10px;
  background: #ffffff;
}

.camera-capture strong {
  color: var(--primary-dark);
}

.camera-capture small {
  color: var(--muted);
}

.scan-summary {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfe;
}

.scan-summary h3 {
  margin-bottom: 10px;
}

.map-preview {
  height: 220px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  background:
    linear-gradient(135deg, transparent 0 46%, rgba(34, 197, 94, 0.18) 46% 100%),
    repeating-linear-gradient(90deg, #eef2f7 0 42px, #ffffff 42px 46px),
    repeating-linear-gradient(0deg, transparent 0 34px, rgba(148, 163, 184, 0.34) 34px 38px);
}

.map-preview::before,
.map-preview::after {
  content: "";
  position: absolute;
  background: #cbd5e1;
  border-radius: 999px;
}

.map-preview::before {
  width: 260px;
  height: 14px;
  left: 34px;
  top: 116px;
  transform: rotate(-22deg);
}

.map-preview::after {
  width: 180px;
  height: 12px;
  right: 28px;
  top: 76px;
  transform: rotate(72deg);
}

.map-preview i {
  position: absolute;
  width: 18px;
  height: 18px;
  left: 54%;
  top: 46%;
  background: var(--primary);
  border: 3px solid #ffffff;
  border-radius: 999px 999px 999px 2px;
  transform: rotate(-45deg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
}

.map-preview b {
  position: absolute;
  right: 18px;
  top: 24px;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.9);
  color: #475569;
  font-size: 12px;
}

.map-preview.pending {
  background:
    linear-gradient(135deg, rgba(248, 250, 252, 0.95), rgba(226, 232, 240, 0.95)),
    repeating-linear-gradient(90deg, #eef2f7 0 42px, #ffffff 42px 46px);
}

.map-preview.pending i {
  background: #94a3b8;
}

.map-preview.located {
  border-color: rgba(21, 128, 61, 0.45);
}

.map-preview.satellite {
  background:
    linear-gradient(135deg, transparent 0 46%, rgba(22, 101, 52, 0.28) 46% 100%),
    repeating-linear-gradient(90deg, #64748b 0 42px, #334155 42px 46px),
    repeating-linear-gradient(0deg, transparent 0 34px, rgba(226, 232, 240, 0.18) 34px 38px);
}

.map-preview a {
  position: absolute;
  left: 12px;
  bottom: 12px;
  color: #b91f28;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.map-tabs {
  position: absolute;
  z-index: 2;
  top: 8px;
  left: 8px;
  display: flex;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  overflow: hidden;
  background: #ffffff;
}

.map-tabs button {
  border: 0;
  background: #ffffff;
  padding: 6px 10px;
  font-size: 12px;
  color: #334155;
  cursor: pointer;
}

.map-tabs button.active {
  background: #f8fafc;
  font-weight: 800;
  color: #991b1b;
}

.manual-sheet {
  background:
    linear-gradient(rgba(255,255,255,0.95), rgba(255,255,255,0.95)),
    url("/src/logo-ptjtm.png") center 58% / 250px no-repeat;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
  color: #111827;
  min-height: 520px;
}

.manual-title {
  text-align: center;
  text-decoration: underline;
  margin-bottom: 18px;
  display: grid;
  gap: 3px;
}

.manual-title span {
  font-size: 11px;
}

.official-sheet {
  background:
    linear-gradient(rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.95)),
    url("/src/logo-ptjtm.png") center 58% / 260px auto no-repeat;
}

.official-doc-header {
  display: grid;
  grid-template-columns: 66px 1fr 66px;
  gap: 14px;
  align-items: center;
  text-align: center;
  border-bottom: 2px solid #111827;
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.official-doc-header img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.official-doc-header span,
.official-doc-header strong,
.official-doc-header small {
  display: block;
}

.official-doc-header span {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 800;
  color: #475569;
}

.official-doc-header strong {
  margin-top: 4px;
  font-size: 18px;
  text-transform: uppercase;
  color: #111827;
}

.official-doc-header small {
  margin-top: 4px;
  color: #64748b;
  font-weight: 700;
}

.manual-checks,
.manual-checkbox-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  font-size: 12px;
  margin-bottom: 14px;
}

.manual-checks i,
.manual-checkbox-row i {
  width: 22px;
  height: 22px;
  display: inline-block;
  border: 2px solid #111827;
}

.manual-checks i.checked,
.manual-checkbox-row i.checked {
  background:
    linear-gradient(45deg, transparent 42%, #111827 42% 56%, transparent 56%),
    linear-gradient(-45deg, transparent 42%, #111827 42% 56%, transparent 56%);
}

.manual-sheet h3 {
  margin: 14px 0 8px;
  font-size: 13px;
  text-decoration: underline;
}

.manual-declaration {
  margin: 18px 0;
  font-weight: 700;
  line-height: 1.45;
}

.manual-signature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 28px;
}

.office-use-box {
  margin-top: 18px;
  border: 2px solid #111827;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 10px;
}

.office-use-box strong {
  grid-column: 1 / -1;
  margin-bottom: 8px;
}

.office-use-box > span {
  border-left: 1px solid #111827;
  padding-left: 16px;
  font-weight: 800;
}

.manual-line {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 8px;
  margin: 7px 0;
  font-size: 12px;
}

.manual-line b {
  min-height: 18px;
  border-bottom: 1px dotted #111827;
  font-weight: 600;
  padding-left: 5px;
}

.technical-sheet {
  margin-top: 16px;
}

.template-note {
  border: 1px solid #fde68a;
  background: #fffbeb;
  color: #92400e;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 12px;
  font-weight: 800;
}

.security-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.security-grid article {
  grid-template-columns: 24px 1fr;
  align-items: start;
}

.security-grid strong {
  color: var(--success);
}

.database-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}

.file-action {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  font-weight: 900;
  cursor: pointer;
}

.file-action input {
  display: none;
}

button.danger {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.database-panel .metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.database-panel .metric strong {
  font-size: 28px;
}

.user-admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(360px, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}

.user-admin-form {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98)),
    #ffffff;
}

.user-admin-form h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.form-hint {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.45;
}

.user-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
}

.user-form-grid label:first-child {
  grid-column: 1 / -1;
}

.user-form-grid input,
.user-form-grid select {
  min-width: 0;
}

.user-admin-form button[type="submit"] {
  margin-top: 16px;
}

.account-settings-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.35fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.account-summary-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(255, 251, 235, 0.92), rgba(255, 255, 255, 0.98)),
    #ffffff;
  display: grid;
  gap: 14px;
}

.account-avatar {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  font-weight: 900;
  font-size: 20px;
  box-shadow: 0 16px 28px rgba(185, 31, 40, 0.18);
}

.account-summary-card strong {
  display: block;
  font-size: 18px;
  line-height: 1.25;
}

.account-summary-card p {
  margin: 6px 0 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.account-form {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  background: #ffffff;
}

.user-table {
  overflow-x: auto;
}

.pill.active {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.pill.rejected {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metrics,
  .dashboard-grid,
  .workflow-steps,
  .customer-share,
  .split,
  .workbench,
  .document-grid,
  .approval-layout,
  .approval-workspace,
  .approval-grid,
  .form-preview-grid {
    grid-template-columns: 1fr;
  }

  .approval-decision-panel,
  .approval-hero {
    flex-direction: column;
  }

  .approval-actions {
    width: 100%;
  }

  .approval-actions .approve,
  .approval-actions .reject {
    flex: 1;
  }

  .approval-fact {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .topbar-search {
    display: none;
  }

  .database-panel .metric-grid {
    grid-template-columns: 1fr;
  }

  .user-admin-grid {
    grid-template-columns: 1fr;
  }

  .account-settings-grid {
    grid-template-columns: 1fr;
  }

  .user-form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-panel,
  .hero-actions,
  .inline-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .office-photo {
    width: auto;
    min-height: 180px;
    margin: 8px -26px -26px;
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
  }

  .public-portal {
    padding: 14px;
  }

  .public-portal::after {
    right: -80px;
    bottom: -60px;
    width: 105vw;
    height: 48vh;
    opacity: 0.14;
  }

  .public-topbar,
  .public-shell {
    grid-template-columns: 1fr;
  }

  .public-shell::before,
  .public-topbar::before {
    display: none;
  }

  .public-brand {
    align-items: flex-start;
  }

  .public-progress {
    grid-template-columns: 1fr;
  }

  .document-upload-grid {
    grid-template-columns: 1fr;
  }

  .public-office-thumb {
    min-height: 170px;
  }

  .public-info {
    position: static;
  }

  .login-page {
    padding: 14px;
  }

  .login-card {
    grid-template-columns: 1fr;
  }

  .login-brand {
    min-height: 340px;
    align-items: flex-end;
  }

  .login-brand h1 {
    font-size: 32px;
  }

  .login-note {
    grid-column: auto;
  }

  .content {
    padding: 14px;
  }

  .field-grid,
  .detail-grid,
  .related-grid,
  .security-grid,
  nav {
    grid-template-columns: 1fr;
  }

  .permit-head {
    grid-template-columns: 44px 1fr 44px;
    gap: 8px;
  }

  .permit-head img {
    width: 40px;
    height: 40px;
  }

  .serial-row,
  .permit-info-table p,
  .manual-line {
    grid-template-columns: 1fr;
  }

  .serial-row span,
  .permit-info-table span {
    border-right: 0;
    border-bottom: 1px solid #94a3b8;
  }

  .permit-qr {
    margin-left: 0;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

@media print {
  .sidebar,
  .topbar,
  .panel-head button,
  .form-actions,
  select,
  button {
    display: none !important;
  }

  .app-shell,
  .document-grid {
    display: block;
  }

  .content {
    padding: 0;
  }

  .panel,
  .permit-card,
  .manual-sheet {
    box-shadow: none;
    border-color: #111827;
  }
}
