/* ===========================
   Design tokens (reusable)
   =========================== */
:root{
  --bg-page: #ffffff;
  --bg-muted: #F3F6FA;

  --text-strong: #111111;
  --text: #222222;
  --text-dim: #6B7280;

  --stroke: #D8DCE3;
  --stroke-focus: #8EA6FF;

  /--accent: #111111; /* primary button (black) */
  --accent: #003366;

  --radius-md: 12px;
  --radius-lg: 20px;

  --space-1: 6px;
  --space-2: 10px;
  --space-3: 14px;
  --space-4: 18px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 40px;

  --shadow-md: 0 8px 24px rgba(0,0,0,0.08);

  /--font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial,
  /         "Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";

  --font: 'Roboto', sans-serif;

}

/* ===========================
   Base
   =========================== */
* { box-sizing: border-box; }
html, body { height: 100%; }
body.page{
  margin: 0;
  padding-bottom: 60px;
  padding-right: 20px;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-page);
}

/* ===========================
   Top bar / brand
   =========================== */
.top-bar{
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  background: var(--bg-page);
}
.brand-logo{
  height: 48px;         /* adjust for your logo */
  width: auto;
  display: block;
}

/* ===========================
   Centered main section
   =========================== */

.nav-menu {
    display: flex;
    gap: 0;
    justify-content: center;
    flex: 1;
    padding: 0;
}

.nav-btn {
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    
    padding: 10px 20px;
    font-weight: 700;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
    position: relative;
    text-decoration: none;
    display: inline-block;
}

.nav-btn-active {
    background: var(--accent);
    color: #fff;
}

.nav-btn-active:hover {
    background: #00264d;
}

.nav-btn-inactive {
    background: white;
    color: var(--text);
}

.nav-btn-inactive:hover {
    background: var(--bg-muted);
}

.nav-btn-disabled {
    background: white;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

.nav-btn-disabled:hover::after {
    content: 'Load input files first';
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
}

/.nav-btn {
/    position: relative;
/}

.center-stack{
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: flex-start;   /* sits a bit lower like the reference */
  justify-content: center;
  padding: 8vh var(--space-6) 0;
  background: var(--bg-page);
}

/* Generic section wrapper */
.form-section{
  width: 100%;
  max-width: 520px;
}

/* Heading */
.heading-xl{
  font-size: 36px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--text-strong);
  text-align: center;
  margin: 0 0 var(--space-6) 0;
}

/* ===========================
   Form primitives
   =========================== */
.vertical-form{
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.field-block{
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.field-label{
  font-size: 14px;
  color: var(--text-dim);
}

/* Rounded input container (capsule style) */
.input-rounded{
  width: 100%;
  border: 1.5px solid var(--stroke);
  background: #fff;
  border-radius: 999px;
  min-height: 52px;
  display: flex;
  align-items: center;
  padding: 0 var(--space-3);
  transition: border-color .2s ease;
}
.input-rounded:focus-within{
  border-color: var(--stroke-focus);
}

/* For when we place an actual <input> inside the rounded container */
.input-basic{
  flex: 1;
  outline: none;
  border: none;
  background: transparent;
  font-size: 16px;
  padding: 10px 6px;
}

/* Rounded “info” container (read-only email + link) */
.info-rounded{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  border: 1.5px solid var(--stroke);
  background: #fff;
  border-radius: 999px;
  min-height: 52px;
  padding: 0 var(--space-4);
}

/* Input with trailing icon/button (e.g., eye) */
.input-with-button{
  gap: var(--space-2);
}
.icon-button{
  border: none;
  background: transparent;
  cursor: pointer;
  height: 36px;
  width: 36px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: .7;
}
.icon-button:hover{ opacity: 1; }

.icon-eye-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  filter: opacity(0.7); /* match previous style */
  transition: opacity .2s ease;
}

.icon-button:hover .icon-eye-img {
  filter: opacity(1);
}


/* Links inline (e.g., “Modifica”) */
.inline-link{
  color: #3B82F6;
  text-decoration: none;
  font-weight: 600;
}
.inline-link:hover{ text-decoration: underline; }

/* ===========================
   Buttons
   =========================== */
.btn-primary{
  background: var(--accent);
  color: #fff;
  border: none;
  font-weight: 700;
  font-size: 16px;
  padding: 14px 18px;
  cursor: pointer;
  transition: transform .02s ease, opacity .2s ease;
}
.btn-rounded{ border-radius: 999px; }
.btn-primary:hover{ opacity: .95; }
.btn-primary:active{ transform: translateY(1px); }

.btn-primary:hover {
  background: #00264d; /* darker navy */
  opacity: 1; /* remove fade since now we change color */
}


/* ===========================
   Flash messages (generic)
   =========================== */
.flash-stack{ margin-bottom: var(--space-3); }
.flash{
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: 14px;
}
.flash-success{ background: #e7f7ec; color: #166534; }
.flash-danger { background: #fde8e8; color: #991b1b; }
.flash-warning{ background: #fff6db; color: #854d0e; }

/* ===========================
   Responsive
   =========================== */
@media (max-width: 520px){
  .heading-xl{ font-size: 28px; }
  .center-stack{ padding-top: 6vh; }
}


/* ===========================
   File Upload Page
   =========================== */
.upload-container {
  display: flex;
  height: calc(100vh - 64px);
  background: var(--bg-page);
}

/* Left panel - drag & drop */
.upload-panel {
  width: 400px;
  border-right: 1.5px solid var(--stroke);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  gap: var(--space-5);
}

.drop-zone {
  width: 100%;
  max-width: 300px;
  height: 280px;
  border: 2px dashed var(--stroke);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--bg-muted);
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--stroke-focus);
  background: #f0f4ff;
}

.drop-icon {
  width: 80px;
  height: 80px;
  opacity: 0.6;
}

.drop-text {
  font-size: 16px;
  color: var(--text);
  font-weight: 600;
}

.drop-subtext {
  font-size: 14px;
  color: var(--text-dim);
}

.browse-btn {
  background: #3B82F6;
  color: white;
  border: none;
  padding: 12px 32px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.browse-btn:hover {
  background: #2563EB;
  transform: translateY(-1px);
}

/* Right panel - file list */
.files-panel {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.files-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1.5px solid var(--stroke);
}

.files-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-strong);
  margin: 0;
}

.files-list-container {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4);
}

.file-row {
  display: grid;
  grid-template-columns: 2fr 1.5fr 1fr 40px;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1.5px solid var(--stroke);
  background: white;
  margin-bottom: var(--space-3);
  transition: all 0.2s ease;
}

.file-row:hover {
  border-color: var(--stroke-focus);
  box-shadow: var(--shadow-md);
}

.file-name {
  font-weight: 600;
  color: var(--text-strong);
  font-size: 14px;
}

.file-type {
  font-size: 13px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.status-loaded {
  background: #e7f7ec;
  color: #166534;
}

.status-not-present {
  background: #f3f4f6;
  color: #6b7280;
}

.edit-icon-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  color: var(--text-dim);
}

.edit-icon-btn:hover {
  background: var(--bg-muted);
  color: var(--text);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
  padding: var(--space-5);
  border-bottom: 1.5px solid var(--stroke);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-dim);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: var(--bg-muted);
  color: var(--text);
}

.modal-body {
  padding: var(--space-5);
  max-height: 60vh;
  overflow-y: auto;
}

.csv-editor {
  width: 100%;
  min-height: 300px;
  padding: var(--space-3);
  border: 1.5px solid var(--stroke);
  border-radius: var(--radius-md);
  font-family: 'Courier New', monospace;
  font-size: 14px;
  resize: vertical;
}

.modal-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1.5px solid var(--stroke);
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
}

.btn-secondary {
  background: var(--bg-muted);
  color: var(--text);
  border: 1.5px solid var(--stroke);
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: #e5e7eb;
}


/* ===========================
   Navigation Menu
   =========================== */
.nav-menu {
  display: flex;
  gap: var(--space-2);
  margin-left: auto;
}

.nav-link {
  padding: 10px 20px;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
  border-radius: 999px;
  transition: all 0.2s ease;
}

.nav-link:hover {
  background: var(--bg-muted);
}

.nav-link.active {
  background: var(--accent);
  color: white;
}