@charset "utf-8";

/* Form Panel */
.form-panel {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  box-shadow: var(--elevation-1);
  margin-bottom: var(--space-5);
}

.form-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.form-row:last-child {
  margin-bottom: 0;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.form-group.inline {
  flex-direction: row;
  align-items: center;
  gap: var(--space-2);
}

.form-group.inline label {
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  white-space: nowrap;
}

.form-link {
  font-size: var(--font-size-xs);
  color: var(--primary);
  text-decoration: none;
}

.form-link:hover {
  text-decoration: underline;
}

.back-link {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.back-link:hover {
  color: var(--text-primary);
}

.form-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Inputs, Selects, Buttons */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
select,
textarea {
  height: 36px;
  padding: 0 var(--space-3);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: var(--font-size-sm);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input[type="date"] {
  font-family: var(--font-mono);
}

textarea {
  height: auto;
  min-height: 80px;
  padding: var(--space-2) var(--space-3);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

input:disabled,
select:disabled,
textarea:disabled {
  background-color: var(--bg-surface-sunken);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* Password Field with Disclosure Eye */
.pwd-field {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.pwd-field input {
  width: 100%;
  padding-right: 38px;
}

.pwd-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: color 150ms ease;
  user-select: none;
}

.pwd-toggle:hover {
  color: var(--text-primary);
}

.pwd-toggle .material-symbols-outlined {
  font-size: 20px;
}

/* Buttons */
.btn {
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0 var(--space-4);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--primary-text);
}

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

.btn-primary:active {
  background-color: var(--primary-active);
}

.btn-outline {
  background-color: transparent;
  border-color: var(--border-default);
  color: var(--text-primary);
}

.btn-outline:hover {
  background-color: var(--bg-hover);
  border-color: var(--border-strong);
}

.btn-danger {
  background-color: var(--color-debit);
  color: #ffffff;
}

.btn-danger:hover {
  background-color: #b91c1c;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn .icon {
  font-size: 18px;
}

.btn-sm {
  height: 26px;
  padding: 2px var(--space-2);
  font-size: var(--font-size-xs);
}

.action-btn-group {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.is-hidden {
  display: none !important;
}

/* Login Card Center Layout */
.login-container {
  max-width: 400px;
  margin: 80px auto;
  padding: var(--space-6);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--elevation-2);
}

.login-header {
  text-align: center;
  margin-bottom: var(--space-5);
}

.login-header h2 {
  margin: 0;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

.login-header p {
  margin: var(--space-1) 0 0 0;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.message,
.message-error {
  display: none;
  margin-top: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background-color: var(--color-debit-bg);
  border: 1px solid var(--color-debit-border);
  border-radius: var(--radius-sm);
  color: var(--color-debit);
  font-size: var(--font-size-xs);
}

.message:not(.error),
.message.info {
  background-color: var(--color-credit-bg);
  border-color: var(--color-credit-border);
  color: var(--color-credit);
}

/* Tag Container & Pills */
.tag-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  min-height: 38px;
  padding: 4px var(--space-2);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  position: relative;
}

.tag-container:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: var(--bg-surface-sunken);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  padding: 2px 8px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
}

.tag-pill .tag-remove {
  background: none;
  border: none;
  padding: 0 2px;
  margin: 0;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  color: var(--text-muted);
  border-radius: 50%;
}

.tag-pill .tag-remove:hover {
  color: var(--color-debit);
}

.tag-input {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  height: 28px !important;
  padding: 0 4px !important;
  flex: 1;
  min-width: 140px;
  background: transparent !important;
  font-size: var(--font-size-sm);
}

/* Autocomplete Dropdown */
.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  box-shadow: var(--elevation-2);
  max-height: 200px;
  overflow-y: auto;
  margin-top: 2px;
}

.autocomplete-item {
  padding: 8px 12px;
  font-size: var(--font-size-sm);
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
}

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

.autocomplete-item:hover,
.autocomplete-item.active {
  background-color: var(--bg-hover);
  color: var(--primary);
}

/* Padron Autocomplete */
.padron-autocomplete {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 100%;
  width: max-content;
  max-width: 520px;
  z-index: 1000;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  box-shadow: var(--elevation-3);
  max-height: 280px;
  overflow-y: auto;
  margin-top: 2px;
}

.padron-autocomplete-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  font-size: var(--font-size-sm);
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 1px solid var(--border-subtle);
  user-select: none;
}

.padron-autocomplete-item:last-child {
  border-bottom: none;
}

.padron-autocomplete-item .padron-cuit {
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  letter-spacing: 0.02em;
  opacity: 0.9;
}

.padron-autocomplete-item .padron-nombre {
  font-weight: var(--font-weight-medium);
}

.padron-autocomplete-item:hover,
.padron-autocomplete-item.active {
  background-color: var(--primary);
  color: #ffffff;
}

.padron-autocomplete-item:hover .padron-cuit,
.padron-autocomplete-item.active .padron-cuit {
  color: #ffffff;
  opacity: 1;
}

/* Cuenta Propia Badges */
.badge-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: var(--bg-surface-sunken);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  font-size: var(--font-size-xs);
  font-family: var(--font-mono);
  color: var(--text-primary);
  margin: 2px;
}

/* Table Simulador input styling */
#table-simulador input[type="date"],
#table-simulador input[type="number"] {
  height: 30px;
  padding: 0 var(--space-2);
  font-size: var(--font-size-xs);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
}

#table-simulador input[type="date"]:focus,
#table-simulador input[type="number"]:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

#table-simulador tr:hover input[type="date"],
#table-simulador tr:hover input[type="number"] {
  border-color: var(--border-hover, #94a3b8);
}

/* Cartera Reusable Filter Styles */
.filter-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  padding: 4px 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
}

.flt-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--text-secondary);
  min-width: 130px;
}

.flt-date-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.btn-remove-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
}

.btn-remove-filter:hover {
  background: var(--color-debit-bg);
  color: var(--color-debit);
}

.btn-remove-filter .material-symbols-outlined {
  font-size: 16px;
}

/* Check Entry Tables (Compra & Emision) */
table.check-detail-table {
  width: 100%;
  border-collapse: collapse;
}

table.check-detail-table tr.first td {
  border-bottom: none;
  padding-bottom: 2px;
}

table.check-detail-table tr.last td {
  border-top: none;
  padding-top: 2px;
  background: var(--bg-surface-sunken);
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
}

table.check-detail-table td.stacked {
  vertical-align: middle;
}

table.check-detail-table textarea {
  width: 100%;
  min-width: 140px;
  height: 52px;
  resize: none;
  font-size: var(--font-size-xs);
}

.check-detail-table input[type="text"],
.check-detail-table input[type="date"],
.check-detail-table input[type="number"] {
  height: 28px;
  padding: 0 6px;
  font-size: var(--font-size-xs);
}

tr.rech td {
  background-color: rgba(239, 68, 68, 0.08) !important;
}

.btn-del-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--color-debit);
  cursor: pointer;
}

.btn-del-check:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.btn-del-check:not(:disabled):hover {
  background: var(--color-debit);
  color: #fff;
  border-color: var(--color-debit);
}

