/* ab-upload-panel.css — GRUPA AB Upload Panel v1.2.2 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ===== SCOPE: All styles scoped to #ab-upload-app ===== */
#ab-upload-app {
  --abu-primary: #2563eb;
  --abu-primary-light: #dbeafe;
  --abu-primary-fg: #ffffff;
  --abu-bg: #f8fafc;
  --abu-fg: #0f172a;
  --abu-card: #ffffff;
  --abu-border: #e2e8f0;
  --abu-muted: #f1f5f9;
  --abu-muted-fg: #64748b;
  --abu-destructive: #ef4444;
  --abu-success: #22c55e;
  --abu-radius: 0.75rem;

  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--abu-fg);
  line-height: 1.5;
  background: transparent;

  width: 100%;
  max-width: 46rem;
  margin: 1.5rem auto;
  padding: 0 1rem;
}

#ab-upload-app *,
#ab-upload-app *::before,
#ab-upload-app *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ===== PASSWORD GATE ===== */
.abu-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: var(--abu-card);
  border: 1px solid var(--abu-border);
  border-radius: 1rem;
}
.abu-gate-box {
  width: 100%;
  max-width: 24rem;
  text-align: center;
}
.abu-gate-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1rem;
  background: var(--abu-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}
.abu-gate-icon svg {
  width: 1.75rem;
  height: 1.75rem;
  color: var(--abu-primary-fg);
}
.abu-gate h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--abu-fg);
  margin-bottom: 0.25rem;
  font-family: inherit;
}
.abu-gate .abu-subtitle {
  font-size: 0.875rem;
  color: var(--abu-muted-fg);
  margin-bottom: 1.5rem;
}
.abu-gate-lock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--abu-muted-fg);
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}
.abu-gate-lock svg {
  width: 1rem;
  height: 1rem;
}
.abu-gate-input {
  width: 100%;
  padding: 0.625rem 1rem;
  border-radius: var(--abu-radius);
  border: 1px solid var(--abu-border);
  background: var(--abu-card);
  font-size: 1.125rem;
  text-align: center;
  letter-spacing: 0.25em;
  color: var(--abu-fg);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}
.abu-gate-input:focus {
  border-color: var(--abu-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.abu-gate-input.error {
  border-color: var(--abu-destructive);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}
.abu-gate-error {
  font-size: 0.75rem;
  color: var(--abu-destructive);
  margin-top: 0.5rem;
}
.abu-gate-note {
  font-size: 0.75rem;
  color: var(--abu-muted-fg);
  opacity: 0.6;
  margin-top: 1.5rem;
}

/* ===== BUTTONS ===== */
.abu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  border-radius: var(--abu-radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  white-space: nowrap;
  text-decoration: none;
  font-family: inherit;
  line-height: 1.5;
}
.abu-btn svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}
.abu-btn-primary {
  background: var(--abu-primary);
  color: var(--abu-primary-fg);
}
.abu-btn-primary:hover {
  opacity: 0.9;
}
.abu-btn-primary:disabled {
  opacity: 0.5;
  pointer-events: none;
}
.abu-btn-outline {
  background: var(--abu-card);
  color: var(--abu-fg);
  border: 1px solid var(--abu-border);
}
.abu-btn-outline:hover {
  background: var(--abu-muted);
}
.abu-btn-sm {
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
}
.abu-btn-icon {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border-radius: var(--abu-radius);
  background: transparent;
  border: none;
  color: var(--abu-muted-fg);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.abu-btn-icon:hover {
  background: var(--abu-muted);
  color: var(--abu-fg);
}

/* ===== HEADER ===== */
.abu-header {
  border: 1px solid var(--abu-border);
  border-bottom: none;
  border-radius: 1rem 1rem 0 0;
  background: var(--abu-card);
}
.abu-header-inner {
  width: 100%;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.abu-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.abu-header-logo {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: var(--abu-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.abu-header-logo svg {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--abu-primary-fg);
}
.abu-header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--abu-fg);
  letter-spacing: -0.025em;
  font-family: inherit;
  margin: 0;
  line-height: 1.3;
}
.abu-header .abu-subtitle {
  font-size: 0.75rem;
  color: var(--abu-muted-fg);
  margin: 0;
}

/* ===== MAIN ===== */
.abu-main {
  width: 100%;
  margin: 0 auto;
  padding: 2rem 2rem;
  background: var(--abu-card);
  border-left: 1px solid var(--abu-border);
  border-right: 1px solid var(--abu-border);
}
.abu-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}
.abu-section {
  margin-bottom: 2rem;
}
.abu-section h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--abu-fg);
  margin: 0;
}
.abu-section p {
  color: var(--abu-muted-fg);
  margin-top: 0.375rem;
  font-size: 1rem;
}

/* ===== COMPANY INPUT ===== */
.abu-field {
  margin-bottom: 2rem;
}
.abu-field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--abu-fg);
  margin-bottom: 0.5rem;
}
.abu-field label .abu-required {
  color: var(--abu-destructive);
}
.abu-field input[type="text"] {
  width: 100%;
  padding: 0.675rem 0.85rem;
  border-radius: var(--abu-radius);
  border: 1px solid var(--abu-border);
  background: var(--abu-card);
  font-size: 0.95rem;
  color: var(--abu-fg);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}
.abu-field input[type="text"]:focus {
  border-color: var(--abu-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.abu-field .abu-hint {
  font-size: 0.75rem;
  color: var(--abu-muted-fg);
  margin-top: 0.5rem;
  line-height: 1.5;
}

/* ===== UPLOAD ZONE ===== */
.abu-upload-zone {
  border: 2px dashed #93c5fd;
  border-radius: 1rem;
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background: var(--abu-primary-light);
  margin: 1rem 0 2rem;
}
.abu-upload-zone:hover,
.abu-upload-zone.drag-over {
  border-color: var(--abu-primary);
  background: rgba(37, 99, 235, 0.06);
  transform: scale(1.01);
}
.abu-upload-zone.drag-over {
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}
.abu-upload-zone.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.abu-upload-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1rem;
  background: rgba(37, 99, 235, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
.abu-upload-icon svg {
  width: 1.75rem;
  height: 1.75rem;
  color: var(--abu-primary);
}
.abu-upload-zone h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--abu-fg);
  margin-bottom: 0.25rem;
}
.abu-upload-zone .abu-upload-sub {
  font-size: 0.875rem;
  color: var(--abu-muted-fg);
}
.abu-upload-types {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--abu-muted-fg);
}
.abu-upload-types span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.abu-upload-formats {
  font-size: 0.75rem;
  color: var(--abu-muted-fg);
  opacity: 0.75;
  margin-top: 0.75rem;
}

/* ===== FILE LIST ===== */
.abu-file-count {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--abu-muted-fg);
  margin-bottom: 0.5rem;
}
.abu-file-list {
  max-height: 20rem;
  overflow-y: auto;
  padding-right: 0.25rem;
}
.abu-file-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  background: var(--abu-muted);
  margin-bottom: 0.375rem;
}
.abu-file-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  background: rgba(37, 99, 235, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.abu-file-icon svg {
  width: 1rem;
  height: 1rem;
  color: var(--abu-primary);
}
.abu-file-info {
  flex: 1;
  min-width: 0;
}
.abu-file-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--abu-fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.abu-file-size {
  font-size: 0.75rem;
  color: var(--abu-muted-fg);
}
.abu-file-error {
  font-size: 0.75rem;
  color: var(--abu-destructive);
  margin-top: 0.125rem;
}
.abu-progress-bar {
  width: 100%;
  height: 0.25rem;
  border-radius: 9999px;
  background: var(--abu-border);
  margin-top: 0.25rem;
  overflow: hidden;
}
.abu-progress-fill {
  height: 100%;
  border-radius: 9999px;
  background: var(--abu-primary);
}
.abu-status-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* ===== FILE ACTIONS ===== */
.abu-file-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--abu-border);
}

/* ===== FOOTER ===== */
.abu-footer {
  border: 1px solid var(--abu-border);
  border-top: none;
  border-radius: 0 0 1rem 1rem;
  padding: 1rem 1.25rem;
  background: var(--abu-card);
}
.abu-footer-inner {
  width: 100%;
  margin: 0 auto;
  text-align: center;
}
.abu-footer p {
  font-size: 0.75rem;
  color: var(--abu-muted-fg);
}
.abu-footer .abu-footer-links {
  font-size: 0.6875rem;
  color: var(--abu-muted-fg);
  opacity: 0.7;
  margin-top: 0.25rem;
}
.abu-footer a {
  color: var(--abu-muted-fg);
  text-decoration: underline;
}

/* ===== SUCCESS DIALOG ===== */
.abu-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.abu-overlay-bg {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
}
.abu-dialog {
  position: relative;
  width: 100%;
  max-width: 28rem;
  background: var(--abu-card);
  border: 1px solid var(--abu-border);
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
}
.abu-dialog-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
.abu-dialog-icon svg {
  width: 2rem;
  height: 2rem;
  color: var(--abu-success);
}
.abu-dialog h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--abu-fg);
  margin-bottom: 0.75rem;
}
.abu-dialog .abu-dialog-text {
  font-size: 0.875rem;
  color: var(--abu-muted-fg);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}
.abu-dialog .abu-dialog-small {
  font-size: 0.75rem;
  color: var(--abu-muted-fg);
  opacity: 0.6;
  margin-bottom: 1.25rem;
}
.abu-dialog .abu-btn {
  width: 100%;
}

@keyframes abu-spin { to { transform: rotate(360deg); } }
.abu-spin { animation: abu-spin 1s linear infinite; }

.abu-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--abu-fg);
  color: var(--abu-card);
  padding: 0.75rem 1.25rem;
  border-radius: var(--abu-radius);
  font-size: 0.875rem;
  z-index: 100000;
}

@media (max-width: 640px) {
  #ab-upload-app { margin: 1rem auto; padding: 0 0.75rem; }
  .abu-header-inner { padding: 0.875rem 1rem; }
  .abu-main { padding: 1rem; }
  .abu-upload-zone { padding: 1.5rem 0.75rem; }
  .abu-upload-zone h3 { font-size: 1.25rem; }
  .abu-btn-sm span.abu-btn-label { display: none; }
  .abu-file-actions { flex-direction: column; }
  .abu-file-actions .abu-btn { width: 100%; }
}