@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --dian-blue: #3167ca;
  --dian-gold: #50A8E6;
  --dian-gold-two: #14baac;
  --dian-red: #C0392B;
  --bg: #F4F6F9;
  --surface: #FFFFFF;
  --border: #DDE2EC;
  --text: #1A2340;
  --muted: #6B7A99;
  --success: #1A7A4A;
  --success-bg: #E8F5EE;
  --error: #C0392B;
  --error-bg: #FDECEA;
  --dian-purple: #7f53cc;
  --dian-goldes: #FF759A;
  --shadow: 0 2px 12px rgba(0, 48, 135, 0.08);
  --radius: 8px;
}

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

body {
  font-family: 'IBM Plex Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
}

/* HEADER */
.header {
  background: var(--surface);
  color: white;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(122, 144, 185, 0.25);
}

.header-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 10px 24px;
  position: relative;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.header-info-bar {
  display: flex;
  align-items: center;
  gap: 0;
  font-size: 12px;
  color: rgba(29, 28, 28, 0.85);
  font-weight: 400;
}

.header-info-bar span {
  padding: 0 10px;
  border-right: 1px solid rgba(29, 28, 28, 0.3);
  white-space: nowrap;
}

.header-info-bar span:last-child {
  border-right: none;
  padding-right: 0;
}

.header-info-bar span:first-child {
  padding-left: 0;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: white;
  position: relative;
}

.logo-icon {
  height: 26px;
  width: auto;
  border-radius: 4px;
  flex-shrink: 0;
  object-fit: contain;
}

.logo-text {
  line-height: 1.1;
}

.logo-text .brand {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.5px;
}

.logo-text .sub {
  font-size: 11px;
  opacity: 0.7;
  font-weight: 400;
}

.header-nav {
  display: flex;
  gap: 8px;
}

.btn-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid rgba(29, 28, 28, 0.15);
  transition: all 0.15s ease;
  background: var(--surface);
  color: rgba(63, 62, 62, 0.85);
}

.btn-header:hover {
  background: var(--dian-gold);
  color: var(--surface);
  border-color: var(--dian-gold);
}

.btn-header.active,
.btn-header.active:hover {
  background: var(--dian-gold-two);
  color: #fff !important;
  border-color: var(--dian-gold-two);
  cursor: default;
  transform: none;
}

/* MAIN */
.main {
  max-width: 1600px;
  margin: 0 auto;
  padding: 28px 24px;
}

/* PAGE TITLE */
.page-header {
  margin-bottom: 24px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--dian-blue);
}

.page-subtitle {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

/* STAT CARDS */
.stats {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  flex: 1;
  min-width: 160px;
  box-shadow: var(--shadow);
}

.stat-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--dian-blue);
  font-family: 'IBM Plex Mono', monospace;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* FILTERS */
.filters {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
  box-shadow: var(--shadow);
}

.filters>.btn {
  height: 35px;
  align-self: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-group input,
.filter-group select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 0;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  min-width: 180px;
  transition: border-color 0.15s;
}

.filter-group input:focus,
.filter-group select:focus {
  outline: none;
  border-color: var(--dian-blue);
  box-shadow: 0 0 0 3px rgba(0, 48, 135, 0.08);
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 0px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 12px;
  min-width: 36px;
  min-height: 36px;
  justify-content: center;
}

.btn-primary {
  background: var(--dian-blue);
  color: white;
}

.btn-primary:hover {
  background: var(--dian-purple);
  box-shadow: 0 4px 12px rgba(0, 48, 135, 0.25);
}

.btn-gold {
  border: 1px solid #9e9e9e;
  color: var(--surface);
  font-weight: 600;
  filter: grayscale(100%);
  /* escala de grises */
  transition: all 0.3s ease;
  /* animación suave */
}

.btn-gold:hover {
  background: rgba(0, 48, 135, 0.05);
  border-color: var(--dian-blue);
  filter: grayscale(0%);
  /* vuelve al color original */
  color: var(--dian-blue);
  /* opcional: cambia el texto al azul */
}


.btn-goldes {
  background: var(--dian-gold);
  color: var(--surface);
  font-weight: 600;
}

.btn-goldes:hover {
  background: var(--dian-goldes);
}

.btn-outline {
  background: transparent;
  color: var(--dian-blue);
  border: 1px solid #9e9e9e;
  filter: grayscale(100%);
  /* escala de grises */
  transition: all 0.3s ease;
  /* animación suave */
}

.btn-outline:hover {
  background: rgba(0, 48, 135, 0.05);
  border-color: var(--dian-blue);
  filter: grayscale(0%);
  /* vuelve al color original */
}


.btn-danger {
  background: transparent;
  color: var(--dian-blue);
  border: 1px solid #9e9e9e;
  filter: grayscale(100%);
  /* escala de grises */
  transition: all 0.3s ease;
  /* animación suave */
}

.btn-danger:hover {
  background: rgba(0, 48, 135, 0.05);
  border-color: var(--dian-blue);
  filter: grayscale(0%);
  /* vuelve al color original */
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-sm-te {
  padding: 5px 10px;
  font-size: 12px;
  height: 30px;
  width: 70px;
  background-color: #eeeeee;
  color: #808080;
  border-radius: 25px;
}

.btn-sm-te2 {
  padding: 5px 10px;
  font-size: 12px;
  height: 30px;
  width: 130px;
  background-color: #eeeeee;
  color: #808080;
  border: solid 1px #aaaaaa;
}

.btn-sm-te:hover,
.btn-sm-te2:hover {
  color: #000000;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  height: 34px;
}

.bted,
.btde {
  opacity: 0;
  transition: opacity 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.bted:hover {
  background-color: rgb(197, 227, 241);
}

.btde:hover {
  background-color: rgb(250, 197, 197);
}

/* Row actions toggle */
.td-actions-cell {
  text-align: right;
  white-space: nowrap;
  vertical-align: middle;
}

.row-actions-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
}

.row-action-btns {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  position: absolute;
  right: 34px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  white-space: nowrap;
}

.row-actions-wrapper.open .row-action-btns {
  pointer-events: all;
  opacity: 1;
}

.row-actions-wrapper.open .bted,
.row-actions-wrapper.open .btde {
  opacity: 1;
}

.btn-row-toggle {
  color: rgb(155, 155, 155);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid #ccc;
  background: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
  flex-shrink: 0;
}

.btn-row-toggle:hover {
  background-color: #e8f4fb;
}

.row-actions-wrapper.open .btn-row-toggle {
  visibility: hidden;
  pointer-events: none;
}

.active-sort {
  background-color: var(--dian-blue) !important;
  color: #fff !important;
  border-color: var(--dian-blue) !important;
}


.btn-ghost:hover {
  background: var(--bg);
  color: var(--text);
}

.sort-btn {
  padding: 6px 14px;
  font-size: 12px;
  height: 32px;
  min-width: 130px;
  background-color: #eeeeee;
  color: #808080;
  border: 1px solid #aaaaaa;
  border-radius: 999px;
  /* ← aquí */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.sort-btn:hover {
  color: #2c2c2c;
  background: #e2e2e2;
}

/* TABLE */
.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.table-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FAFBFE;
}

.table-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--dian-blue);
}

.table-count {
  font-size: 12px;
  color: var(--muted);
  background: var(--bg);
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #FAFBFE;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

/* SORTABLE HEADERS */
.th-sortable {
  position: relative;
  cursor: default;
}

.th-sortable .th-sort-label {
  display: inline;
}

.th-sort-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  margin-left: 4px;
  padding: 0;
  vertical-align: middle;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.th-sortable:hover .th-sort-btn {
  opacity: 1;
}

.th-sort-btn:hover {
  background: rgba(49, 103, 202, 0.1);
  border-color: var(--dian-blue);
  color: var(--dian-blue);
}

.th-sort-btn.sort-active {
  opacity: 1;
  background: var(--dian-blue);
  color: #fff;
  border-color: var(--dian-blue);
}

.th-sort-btn.sort-active:hover {
  background: var(--dian-purple);
  border-color: var(--dian-purple);
}

.sort-arrow {
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

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

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

tbody tr:hover {
  background: #F8F9FD;
}

tbody tr:hover .bted,
tbody tr:hover .btde {
  opacity: 1;
}

tbody tr:hover .btn-row-toggle {
  opacity: 1;
}

tbody tr:hover .row-action-btns {
  pointer-events: all;
}

td {
  padding: 12px 14px;
  vertical-align: middle;
}

.td-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  font-weight: 500;
}

.td-main {
  font-weight: 600;
  color: var(--text);
}

.copy-nombre {
  cursor: pointer;
  position: relative;
}

.copy-nombre::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(107, 107, 107, 0.72);
  color: #fff;
  font-size: 11px;
  font-weight: 400;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease 0.1s;
}

.copy-nombre:hover::after {
  opacity: 1;
  transition: opacity 0.2s ease 0.7s;
}

.td-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 1px;
}

/* BADGES */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-auth {
  background: #E8F0FE;
  color: #1A3A8F;
}

.badge-hab {
  background: #E8F5EE;
  color: #1A7A4A;
}

.badge-inhab {
  background: #FDECEA;
  color: #C0392B;
}

.badge-modal {
  background: #F3F0FF;
  color: #5B21B6;
  font-size: 10px;
}

/* ACTIONS TOGGLE */
.actions-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-toggle-actions {
  background: var(--surface);
  color: #8b8b8b;
  border: 1px solid #9e9e9e;
  font-size: 18px;
  font-weight: 700;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  flex-shrink: 0;
  line-height: 1;
  border-radius: 4px;
  z-index: 2;
  opacity: 0.35;
}

tbody tr:hover .btn-toggle-actions,
.actions-wrapper.open .btn-toggle-actions {
  opacity: 1;
}

.btn-toggle-actions:hover {
  color: var(--dian-blue);
  border-color: var(--dian-blue);
  background: rgba(0, 48, 135, 0.05);
}

.toggle-icon {
  display: inline-block;
  transition: transform 0.25s ease;
}

.actions-wrapper.open .toggle-icon {
  transform: rotate(45deg);
}

.actions-panel {
  position: absolute;
  right: 100%;
  margin-right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 6px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  white-space: nowrap;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) translateX(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.actions-wrapper.open .actions-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}

/* CHECK TOGGLE */
.btn-check-toggle {
  background: transparent;
  border: 1px solid #9e9e9e;
  color: #9e9e9e;
  font-size: 16px;
  transition: all 0.25s ease;
  cursor: pointer;
}

.btn-check-toggle:hover {
  border-color: #27ae60;
  color: #27ae60;
  background: rgba(39, 174, 96, 0.06);
}

.btn-check-toggle.checked {
  border-color: #27ae60;
  color: #27ae60;
  background: rgba(39, 174, 96, 0.10);
  filter: none;
}

/* ALERTS */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 4px solid;
  animation: slideIn 0.3s ease;
}

.alert-success {
  background: var(--success-bg);
  color: var(--success);
  border-color: var(--success);
}

.alert-error {
  background: var(--error-bg);
  color: var(--error);
  border-color: var(--error);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

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

/* FORM */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  max-width: 960px;
  margin: 0 auto;
}

.form-section-header {
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--dian-blue) 0%, #004AC8 100%);
  color: white;
}

.form-section-title {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.3px;
}

.form-section-subtitle {
  font-size: 12px;
  opacity: 0.75;
  margin-top: 2px;
}

.form-body {
  padding: 24px;
}

.form-section {
  margin-bottom: 28px;
}

.form-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--dian-blue);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--dian-gold);
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.form-group label .req {
  color: var(--dian-red);
  margin-left: 2px;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 0;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  transition: all 0.15s ease;
  width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--dian-blue);
  box-shadow: 0 0 0 3px rgba(0, 48, 135, 0.08);
  background: white;
}

.form-group .hint {
  font-size: 11px;
  color: var(--muted);
}

.form-actions {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  gap: 10px;
  align-items: center;
}

/* SUCURSAL / DIRECCIONES */
.sucursal-wrapper {
  display: flex;
  gap: 6px;
  align-items: center;
}

.sucursal-wrapper select {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 0;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  transition: all 0.15s ease;
}

.sucursal-wrapper select:focus {
  outline: none;
  border-color: var(--dian-blue);
  box-shadow: 0 0 0 3px rgba(0, 48, 135, 0.08);
  background: white;
}

.btn-add-dir {
  width: 34px;
  height: 34px;
  border: 1px solid var(--dian-blue);
  background: var(--dian-blue);
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
  line-height: 1;
}

.btn-add-dir:hover {
  background: var(--dian-purple);
  border-color: var(--dian-purple);
}

.sucursal-panel {
  margin-top: 8px;
  background: #FAFBFE;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
}

.dir-add-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.dir-add-row input {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: #fff;
}

.dir-add-row input:focus {
  outline: none;
  border-color: var(--dian-blue);
  box-shadow: 0 0 0 3px rgba(0, 48, 135, 0.08);
}

.dir-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 4px;
  font-size: 13px;
}

.dir-list-item:last-child {
  margin-bottom: 0;
}

.btn-del-dir {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s;
}

.btn-del-dir:hover {
  color: var(--error);
  background: var(--error-bg);
}

.dir-actions {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}

.btn-edit-dir {
  background: none;
  border: none;
  font-size: 13px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s;
}

.btn-edit-dir:hover {
  background: #E8F0FE;
}

.btn-save-dir {
  background: none;
  border: none;
  color: var(--success);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s;
}

.btn-save-dir:hover {
  background: var(--success-bg);
}

.btn-cancel-dir {
  background: none;
  border: none;
  color: var(--error);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s;
}

.btn-cancel-dir:hover {
  background: var(--error-bg);
}

.dir-text {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

/* DETAIL VIEW */
.detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  max-width: 900px;
}

.detail-header {
  padding: 24px;
  background: linear-gradient(135deg, var(--dian-blue) 0%, #004AC8 100%);
  color: white;
}

.detail-id {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  opacity: 0.7;
  margin-bottom: 4px;
}

.detail-main-title {
  font-size: 20px;
  font-weight: 700;
}

.detail-nit {
  font-size: 13px;
  opacity: 0.8;
  margin-top: 4px;
}

.detail-badges {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.detail-body {
  padding: 24px;
}

.detail-section {
  margin-bottom: 24px;
}

.detail-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--dian-blue);
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 2px solid var(--dian-gold);
  padding-bottom: 6px;
  margin-bottom: 16px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.detail-field label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-field .value {
  font-size: 14px;
  color: var(--text);
  margin-top: 2px;
  font-weight: 500;
}

.detail-field .value.mono {
  font-family: 'IBM Plex Mono', monospace;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.empty-state .icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 15px;
  font-weight: 500;
}

.empty-state span {
  font-size: 13px;
  display: block;
  margin-top: 4px;
}

/* FOOTER */
.footer {
  margin-top: 48px;
  padding: 20px 24px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}


/* DROPZONE */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg);
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--dian-gold);
  background: rgba(80, 168, 230, 0.06);
}

.dropzone-icon {
  font-size: 36px;
  margin-bottom: 8px;
}

.dropzone-text {
  font-size: 14px;
  color: var(--text);
}

.dropzone-sub {
  font-size: 12px;
  color: var(--muted);
  margin: 6px 0;
}

/* PDF UPLOAD SECTION */
.pdf-upload-section {
  margin: 0;
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding: 20px 24px;
}

.pdf-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.pdf-section-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.pdf-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--dian-blue);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pdf-section-subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.pdf-drop-zone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  background: var(--surface);
  position: relative;
}

.pdf-drop-zone:hover {
  border-color: var(--dian-blue);
  background: #F5F8FF;
}

.pdf-drop-zone.pdf-drag-over {
  border-color: var(--dian-gold);
  background: rgba(80, 168, 230, 0.08);
  box-shadow: 0 0 0 4px rgba(80, 168, 230, 0.12);
  transform: scale(1.01);
}

.pdf-drop-icon {
  margin-bottom: 10px;
}

.pdf-drop-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.pdf-drop-or {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0;
}

.pdf-select-btn {
  padding: 8px 20px;
  font-size: 13px;
  border-radius: 6px;
}

.pdf-drop-hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 12px;
}

/* PDF Progress */
.pdf-progress {
  margin-top: 16px;
  animation: slideIn 0.3s ease;
}

.pdf-progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.pdf-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--dian-blue), var(--dian-gold));
  border-radius: 3px;
  transition: width 0.6s ease;
  width: 0%;
}

.pdf-progress-text {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  text-align: center;
}

/* PDF Result */
.pdf-result {
  margin-top: 16px;
  border-radius: 8px;
  padding: 16px 20px;
  animation: slideIn 0.3s ease;
  font-size: 13px;
}

.pdf-result-success {
  background: var(--success-bg);
  border: 1px solid #b7e4c7;
  color: var(--text);
}

.pdf-result-error {
  background: var(--error-bg);
  border: 1px solid #f5c6c2;
  color: var(--text);
}

.pdf-result-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 10px;
}

.pdf-result-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 6px 16px;
}

.pdf-field-item {
  padding: 4px 0;
  font-size: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.pdf-field-item:last-child {
  border-bottom: none;
}

.pdf-result-hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 10px;
  font-style: italic;
}

@media (max-width: 768px) {

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }

  .filters {
    flex-direction: column;
  }

  .stats {
    flex-direction: column;
  }
}