/* ============================================================
   ARKADIA PORTAL — Formularios + Dashboard
   Marca: #1C2252 (primario) · #A0ABFF (suave) · #0C0C0C (fuerte)
   El layout de página (login, registro) se diseña con Elementor.
   Aquí solo viven los componentes: formularios, botones, mensajes.
   ============================================================ */

:root {
  --ark-primary: #1C2252;
  --ark-soft: #A0ABFF;
  --ark-strong: #0C0C0C;
}

.ark-portal *,
.ark-portal *::before,
.ark-portal *::after {
  box-sizing: border-box;
}

/* ---------- Base del componente ---------- */
.ark-portal {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #1f2937;
}

.ark-portal a {
  text-decoration: none;
}

.ark-portal h1,
.ark-portal h2,
.ark-portal p {
  margin: 0;
}

/* ---------- Botones ---------- */
.ark-portal .ark-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  text-align: center;
  color: inherit;
  background-color: transparent;
}

.ark-portal .ark-btn-primary {
  color: #fff;
  background-color: var(--ark-primary);
  border-color: var(--ark-primary);
}

.ark-portal .ark-btn-primary:hover,
.ark-portal .ark-btn-primary:focus,
.ark-portal .ark-btn-primary:focus-visible {
  background-color: #2a3273;
  border-color: #2a3273;
  color: #fff;
}

.ark-portal .ark-btn-outline {
  color: var(--ark-primary);
  background-color: #fff;
  border-color: var(--ark-primary);
}

.ark-portal .ark-btn-outline:hover {
  color: #fff;
  background-color: var(--ark-primary);
}

.ark-portal .ark-btn-block {
  width: 100%;
}

.ark-portal .ark-btn-logout {
  width: 100%;
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  color: #cbd2ff;
  background-color: rgba(160, 171, 255, 0.08);
  border-color: rgba(160, 171, 255, 0.25);
}

.ark-portal .ark-btn-logout:hover {
  color: #fff;
  background-color: var(--ark-soft);
  border-color: var(--ark-soft);
}

.ark-portal .ark-btn-profile {
  width: 100%;
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  color: #fff;
  background-color: rgba(160, 171, 255, 0.12);
  border-color: rgba(160, 171, 255, 0.25);
  margin-bottom: 0.6rem;
}

.ark-portal .ark-btn-profile:hover {
  color: #fff;
  background-color: var(--ark-soft);
  border-color: var(--ark-soft);
}

/* ---------- Formularios ---------- */
.ark-login-form,
.ark-register-form,
.ark-lost-form {
  width: 100%;
}

.ark-portal-form .ark-form-field {
  margin-bottom: 1.1rem;
}

.ark-portal-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.35rem;
}

.ark-portal-form input[type="text"],
.ark-portal-form input[type="email"],
.ark-portal-form input[type="password"],
.ark-portal-form select {
  width: 100%;
  padding: 0.75rem 0.9rem;
  font-size: 1rem;
  color: #111827;
  background-color: #fff;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ark-portal-form input:focus,
.ark-portal-form select:focus {
  border-color: var(--ark-soft);
  box-shadow: 0 0 0 3px rgba(160, 171, 255, 0.35);
}

.ark-portal-form input[readonly] {
  opacity: 0.75;
  cursor: not-allowed;
  background-color: #f3f4f6;
}

.ark-portal-form input[readonly]:focus {
  border-color: #d1d5db;
  box-shadow: none;
}

.ark-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}

.ark-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
  font-size: 0.9rem;
}

.ark-checkbox {
  display: inline-flex !important;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500 !important;
  cursor: pointer;
}

.ark-checkbox input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--ark-primary);
}

.ark-lost-link {
  color: var(--ark-primary);
  font-weight: 600;
}

.ark-lost-link:hover {
  color: var(--ark-soft);
}

/* ---------- Mensajes ---------- */
.ark-portal-error,
.ark-portal-success {
  padding: 0.85rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  margin-bottom: 1.2rem;
}

.ark-portal-error {
  color: #991b1b;
  background-color: #fef2f2;
  border: 1px solid #fecaca;
}

.ark-portal-success {
  color: #166534;
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
}

/* ============================================================
   DASHBOARD — sidebar fijo a la izquierda
   ============================================================ */
.ark-dashboard {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
  background-color: #f5f6fb;
}

.ark-dash-sidebar {
  width: 280px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  color: #fff;
  background-color: var(--ark-primary);
}

.ark-dash-brand {
  padding: 1.75rem 1.5rem;
  border-bottom: 1px solid rgba(160, 171, 255, 0.2);
}

.ark-dash-brand img {
  max-width: 190px;
  width: 100%;
  height: auto;
}

.ark-dash-menu {
  flex: 1;
  padding: 1.25rem 0.75rem;
}

.ark-dash-menu .ark-dash-menu-item + .ark-dash-menu-item {
  margin-top: 0.5rem;
}

.ark-dash-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #cbd2ff;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.ark-dash-menu-item:hover {
  color: #fff;
  background-color: rgba(160, 171, 255, 0.12);
}

.ark-dash-menu-item.active {
  color: #fff;
  background-color: rgba(160, 171, 255, 0.18);
}

.ark-dash-sidebar-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid rgba(160, 171, 255, 0.2);
}

.ark-dash-user {
  margin-bottom: 1rem;
}

.ark-dash-user-name {
  font-size: 0.95rem;
  font-weight: 600;
  word-break: break-word;
}

.ark-dash-user-mail {
  font-size: 0.8rem;
  color: var(--ark-soft);
  word-break: break-all;
  margin-top: 0.15rem;
}

.ark-dash-main {
  flex: 1;
  padding: 2rem;
  min-width: 0;
}

.ark-dash-section {
  max-width: 980px;
  margin: 0 auto;
}

.ark-dash-section + .ark-dash-section {
  margin-top: 2.5rem;
}

/* ---------- Sección Ingresar Solicitud ---------- */
.ark-solicitud-wrap {
  width: 100%;
}

.ark-section-head {
  margin-bottom: 1.5rem;
}

.ark-section-head h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ark-strong);
  margin-bottom: 0.35rem;
}

.ark-section-head p {
  color: #6b7280;
  font-size: 0.95rem;
}

.ark-solicitud-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.ark-solicitud-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.75rem;
  background-color: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  box-shadow: 0 10px 30px -18px rgba(12, 12, 12, 0.18);
}

.ark-solicitud-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 0.75rem;
  color: var(--ark-primary);
  background-color: rgba(160, 171, 255, 0.18);
  flex-shrink: 0;
}

.ark-solicitud-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ark-strong);
}

.ark-solicitud-card p {
  flex: 1;
  font-size: 0.9rem;
  color: #6b7280;
}

.ark-solicitud-card .ark-btn[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
}

/* Reutiliza el formulario de Mesa de Partes dentro del dashboard */
.ark-dash-main .ark-desk-wrapper {
  background-image: linear-gradient(to bottom right, #eff6ff, #fff, #eef2ff);
}

/* ---------- Resumen de cuenta en el formulario ---------- */
.ark-account-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem 1.25rem;
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.25rem;
  background-color: #f5f6fb;
  border: 1px solid #e5e7eb;
  border-left: 4px solid var(--ark-primary);
  border-radius: 0.5rem;
  font-size: 0.9rem;
}

.ark-account-summary strong {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  margin-bottom: 0.15rem;
}

.ark-account-summary span {
  color: #111827;
  font-weight: 600;
  word-break: break-word;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .ark-dashboard {
    flex-direction: column;
  }

  .ark-dash-sidebar {
    width: 100%;
    height: auto;
    position: static;
  }

  .ark-dash-brand {
    display: none;
  }

  .ark-dash-menu {
    padding: 0.75rem;
  }

  .ark-dash-sidebar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }

  .ark-dash-user {
    margin-bottom: 0;
  }

  .ark-dash-main {
    padding: 1.25rem;
  }

  .ark-form-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

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

  .ark-solicitud-grid {
    grid-template-columns: 1fr;
  }
}

/* HISTORIAL */
.ark-modal[id^="ark-historial-desk-"] .ark-modal-container,
.ark-modal[id^="ark-historial-solicitud-"] .ark-modal-container,
.ark-modal[id^="ark-historial-file-"] .ark-modal-container {
  max-width: 63%;
}
.ark-tabs {
  display: flex;
  flex-direction: column;
  background-color: #fff;
  border: 1px solid #e4e4e7;
  border-radius: 0.75rem;
}

.ark-tabs-nav {
  display: flex;
  gap: 0;
  padding: 0 0.75rem;
  border-bottom: 1px solid #e4e4e7;
  background-color: #fff;
  border-radius: 0.75rem 0.75rem 0 0;
  overflow-x: auto;
}

button.ark-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  padding: 0.85rem 1.1rem;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #6b7280;
  background-color: transparent;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

button.ark-tab-btn:hover {
  color: var(--ark-primary);
  background-color: #f4f4f5;
}

button.ark-tab-btn.is-active {
  color: var(--ark-primary);
  background-color: transparent;
  border-bottom-color: var(--ark-primary);
}

.ark-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.4rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #4f46e5;
  background-color: #e0e7ff;
}

button.ark-tab-btn.is-active .ark-tab-count {
  color: #fff;
  background-color: var(--ark-primary);
}

.ark-tabs-panel {
  padding: 1.5rem;
}

.ark-historial-table-wrap {
  overflow-x: auto;
  background-color: #fff;
}

.ark-historial-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.ark-historial-table th {
  text-align: left;
  padding: 0.55rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #6b7280;
  background-color: #f9fafb;
  border-bottom: 1px solid #e4e4e7;
  white-space: nowrap;
}

.ark-historial-table td {
  padding: 0.55rem 0.7rem;
  color: #374151;
  border-bottom: 1px solid #f0f0f1;
  vertical-align: middle;
}

.ark-historial-table tbody tr:hover {
  background-color: #f9fafb;
}

.ark-historial-table tbody tr:last-child td {
  border-bottom: none;
}

.ark-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 12rem;
  border: 1px dashed #d1d5db;
  border-radius: 0.75rem;
  background-color: #f9fafb;
}

.ark-empty-state p {
  font-size: 0.95rem;
  color: #6b7280;
}

.ark-historial-table .round-color {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.ark-historial-table .col-time,
.ark-historial-table .col-doctype {
  display: block;
  font-size: 0.75rem;
  color: #6b7280;
}

.ark-historial-table .col-subject {
  display: block;
  max-width: 15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ark-historial-actions {
  display: flex;
  gap: 0.4rem;
}

button.ark-historial-actions .ark-button,
.ark-historial-actions button.ark-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #374151;
  background-color: #fff;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.ark-historial-actions button.ark-button:hover {
  color: var(--ark-primary);
  border-color: var(--ark-primary);
  background-color: #f4f4f5;
}

.ark-historial-table .desk-status.pending {
  color: #b45309;
  background-color: #fef3c7;
}

.ark-historial-table .desk-status.attended {
  color: #047857;
  background-color: #d1fae5;
}

.ark-historial-table .solicitud-type.arbitraje {
  color: #1d4ed8;
  background-color: #dbeafe;
}

.ark-historial-table .solicitud-type.junta {
  color: #6d28d9;
  background-color: #ede9fe;
}

.ark-historial-table .file-stage {
  color: #0f766e;
  background-color: #ccfbf1;
  white-space: nowrap;
}

.ark-file-detail * {
  box-sizing: border-box;
}

.ark-file-detail p {
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: #71717a;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.ark-file-detail h1 {
  font-size: 1.5rem;
  line-height: 2rem;
  margin: 0;
}

.ark-file-detail h2 {
  font-size: 1.5rem;
  line-height: 2rem;
  margin: 0;
}

.ark-file-detail h3 {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  line-height: 1.25rem;
  font-weight: 600;
}

.ark-file-detail .details-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-bottom: 1.5rem;
}

.ark-file-detail .details-header p {
  margin-top: 4px !important;
  margin-bottom: 0 !important;
}

.ark-file-detail .details-review-header,
.ark-file-detail .details-tab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ark-file-detail .details-tab-header {
  margin-bottom: 1.5rem;
}

.ark-file-detail .details-tab-header p {
  margin-bottom: 0;
}

.ark-file-detail .details-review-header .stage {
  padding: 0.5rem 1rem;
}

.ark-file-detail .details-review .stage,
.ark-file-detail .details-review .amount {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.75rem;
}

.ark-file-detail .details-review span {
  font-weight: 500;
}

.ark-file-detail .card-details {
  padding: 1.5rem;
  border: 1px solid #e4e4e7;
  border-radius: 0.5rem;
  background-color: #fff;
}

.ark-file-detail .round-color {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  background-color: #f4f4f5;
  border: 1px solid #f4f4f5;
}

.ark-file-detail .stage {
  color: #0f766e;
  background-color: #ccfbf1;
  border-color: #ccfbf1;
}

.ark-file-detail .tabs-wrapper {
  padding-top: 1.5rem;
  margin-top: 1.5rem;
  border-top: 1px solid #e4e4e7;
}

.ark-file-detail .tabs-header {
  width: 100%;
  display: grid;
  align-items: center;
  justify-content: center;
  height: 2.5rem;
  padding: 0.25rem;
  color: #71717a;
  background-color: #f4f4f5;
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ark-file-detail .tabs-header > label {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  border-radius: calc(0.5rem - 6px);
  padding: 0.375rem 0.75rem;
  margin: 0;
}

.ark-file-detail .tabs-header > label.active {
  color: #09090b;
  background-color: #fff;
}

.ark-file-detail .tab-item {
  display: none;
}

.ark-file-detail .tab-item.active {
  display: block !important;
}

.ark-file-detail .tabs-content {
  margin-top: 1rem;
}

.ark-file-detail .wp-list-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #e4e4e7;
  font-size: 0.85rem;
}

.ark-file-detail .wp-list-table th {
  text-align: left;
  padding: 0.55rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #6b7280;
  background-color: #f9fafb;
  border-bottom: 1px solid #e4e4e7;
  white-space: nowrap;
}

.ark-file-detail .wp-list-table td {
  padding: 0.55rem 0.7rem;
  color: #374151;
  border-bottom: 1px solid #f0f0f1;
  vertical-align: middle;
}

.ark-file-detail .wp-list-table tbody tr:hover {
  background-color: #f9fafb;
}

.ark-file-detail .wp-list-table tbody tr:last-child td {
  border-bottom: none;
}

.ark-file-detail .table-empty-message {
  font-size: 0.875rem;
  line-height: 1.25rem;
  text-align: center;
  padding: 1.5rem 0;
  color: #71717a;
}

.ark-file-detail .file-log-item {
  border-radius: 0.5rem;
  border: 1px solid #e4e4e7;
}

.ark-file-detail .file-log-item + .file-log-item {
  margin-top: 1rem;
}

.ark-file-detail .file-log-item .log-item-header {
  padding: 0.75rem 1rem;
  background-color: #eff6ff;
}

.ark-file-detail .file-log-item .log-item-header i,
.ark-file-detail .file-log-item .log-item-header h4 {
  color: #1d4ed8;
}

.ark-file-detail .file-log-item .log-item-header h4 {
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0;
}

.ark-file-detail .file-log-item .log-item-body {
  padding: 1rem;
}

.ark-file-detail .file-log-item .log-item-body > div + div {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e4e4e7;
}

.ark-file-detail .file-log-item .log-item-body h4 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #4b5563;
  font-size: 0.875rem;
  font-weight: 400;
  margin: 0;
  margin-bottom: 0.25rem;
}

.ark-file-detail .file-log-item strong {
  color: #09090b;
}

.ark-file-detail .file-log-item a:not(:hover) {
  text-decoration: none;
}

.ark-file-detail .file-log-item .log-date {
  color: #2563eb;
  font-weight: 600;
  font-size: 1rem;
}

.ark-file-detail .file-log-item .log-obs {
  font-size: 0.875rem;
}

.ark-file-detail .file-log-item .log-file {
  display: block;
  margin-top: 0.25rem;
}

.ark-file-detail .file-log-item .log-file i,
.ark-file-detail .file-log-item .log-file a {
  color: #6b7280;
}

.ark-file-detail .file-log-item .log-file a {
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.ark-file-detail .file-log-item .log-file.main i,
.ark-file-detail .file-log-item .log-file.main a {
  color: #dc2626;
}

.ark-file-detail .file-document-item {
  border-radius: 0.5rem;
  padding: 1rem;
  border: 1px solid #e4e4e7;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ark-file-detail .file-document-item + .file-document-item {
  margin-top: 1rem;
}

.ark-file-detail .file-document-item > div {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ark-file-detail .file-document-item h3 {
  margin: 0;
  padding-bottom: 0.25rem;
}

.ark-file-detail .file-document-item p {
  margin-bottom: 0;
}

.ark-file-detail .file-document-item .doc-extension {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fafafa;
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.125rem 0.625rem;
  background-color: #009dff;
  border-radius: 9999px;
  text-transform: uppercase;
}

.ark-file-detail .file-document-item[data-ext='doc'] .doc-extension,
.ark-file-detail .file-document-item[data-ext='docx'] .doc-extension {
  background-color: #18181b;
}

.ark-file-detail .file-document-item[data-ext='pdf'] .doc-extension {
  background-color: #ef4444;
}

.ark-file-detail .file-document-item[data-ext='doc'] .icon-document,
.ark-file-detail .file-document-item[data-ext='docx'] .icon-document {
  color: #3b82f6;
}

.ark-file-detail .file-document-item[data-ext='pdf'] .icon-document-alt {
  color: #ef4444;
}

@media (max-width: 640px) {
  .ark-file-detail .tabs-header {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    height: auto;
  }

  .ark-file-detail .details-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .ark-file-detail .details-review-header,
  .ark-file-detail .details-tab-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}
