@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600&family=Cormorant+Garamond:wght@500;600&display=swap');

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

:root {
  --navy: #0f172a;
  --navy-mid: #1e293b;
  --accent: #0ea5e9;
  --accent-dark: #0284c7;
  --green: #10b981;
  --green-dark: #059669;
  --surface: #f8fafc;
  --surface2: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --white: #ffffff;
  --red: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.12), 0 4px 16px rgba(0,0,0,0.06);
}

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

/* ---- TOP NAV ---- */
.topbar {
  background: var(--navy);
  padding: 0 2rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.topbar-brand .dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
}

.topbar-tag {
  background: rgba(14,165,233,0.15);
  color: var(--accent);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid rgba(14,165,233,0.25);
}

/* ---- MAIN LAYOUT ---- */
.main-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* ---- PAGE TITLE ---- */
.page-title {
  margin-bottom: 2rem;
}

.page-title h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--navy);
  line-height: 1.15;
}

.page-title p {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 6px;
}

/* ---- STEP LAYOUT ---- */
.steps {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.step-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}

.step-card:hover {
  box-shadow: var(--shadow);
}

.step-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.step-num {
  width: 32px;
  height: 32px;
  background: var(--navy);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.step-num.done {
  background: var(--green);
}

.step-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--navy);
}

.step-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.step-body {
  padding: 1.5rem;
}

/* ---- FORM FIELDS ---- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-grid.full {
  grid-template-columns: 1fr;
}

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

.field.span2 {
  grid-column: span 2;
}

label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

input[type="text"], textarea, select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

input[type="text"]:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14,165,233,0.1);
}

textarea {
  resize: vertical;
  min-height: 68px;
}

/* ---- LOGO UPLOAD ---- */
.logo-upload-wrap {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.logo-preview {
  width: 80px;
  height: 80px;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--surface2);
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}

.logo-preview:hover {
  border-color: var(--accent);
  background: rgba(14,165,233,0.04);
}

.logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
}

.logo-preview .logo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-light);
  text-align: center;
}

.logo-placeholder svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}

.logo-placeholder span {
  font-size: 10px;
  line-height: 1.3;
}

input#logoInput {
  display: none;
}

.logo-info {
  flex: 1;
}

.logo-info p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* ---- UPLOAD ZONE ---- */
.upload-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}

.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent);
  background: rgba(14,165,233,0.03);
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-icon-wrap {
  width: 52px;
  height: 52px;
  background: var(--surface2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  border: 1px solid var(--border);
}

.upload-icon-wrap svg {
  width: 22px;
  height: 22px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 1.5;
}

.upload-zone h3 {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
}

.upload-zone p {
  font-size: 12px;
  color: var(--text-muted);
}

.upload-zone .accepted {
  margin-top: 10px;
  display: inline-flex;
  gap: 6px;
}

.file-badge {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.file-selected {
  display: none;
  align-items: center;
  gap: 10px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-top: 12px;
}

.file-selected.show {
  display: flex;
}

.file-selected svg {
  width: 18px;
  height: 18px;
  stroke: var(--green);
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
}

.file-selected span {
  font-size: 13px;
  color: #166534;
  font-weight: 500;
}

/* ---- TEMPLATE DOWNLOAD ---- */
.template-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 8px;
}

.template-bar p {
  font-size: 13px;
  color: var(--text-muted);
}

.template-bar strong {
  color: var(--text);
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border-strong);
  background: var(--white);
  color: var(--text);
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  text-decoration: none;
}

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

.btn:active {
  transform: scale(0.98);
}

.btn svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
  padding: 11px 24px;
  font-size: 14px;
}

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

.btn-success {
  background: var(--green);
  color: var(--white);
  border-color: var(--green);
  padding: 11px 24px;
  font-size: 14px;
}

.btn-success:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
}

.btn-outline-accent {
  border-color: var(--accent);
  color: var(--accent-dark);
  background: rgba(14,165,233,0.04);
}

.btn-outline-accent:hover {
  background: rgba(14,165,233,0.1);
}

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

/* ---- GENERATE SECTION ---- */
.generate-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ---- PROGRESS ---- */
.progress-wrap {
  display: none;
  margin-top: 1rem;
}

.progress-wrap.show {
  display: block;
}

.progress-bar-bg {
  height: 4px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--green));
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-text {
  font-size: 12px;
  color: var(--text-muted);
}

/* ---- STATUS MESSAGES ---- */
.status-msg {
  display: none;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-top: 1rem;
}

.status-msg.show { display: flex; align-items: center; gap: 8px; }
.status-error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.status-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.status-info { background: #f0f9ff; border: 1px solid #bae6fd; color: #0369a1; }

.status-msg svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
}

/* ---- PREVIEW CARDS ---- */
.preview-section {
  display: none;
  margin-top: 2rem;
}

.preview-section.show {
  display: block;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 8px;
}

.preview-header h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
}

.count-badge {
  background: var(--navy);
  color: var(--white);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 1.5rem;
}

.emp-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.emp-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}

.emp-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.emp-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  line-height: 1.2;
}

.emp-id {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

.emp-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.emp-meta span strong {
  color: var(--text);
  font-weight: 500;
}

.emp-netpay {
  font-size: 17px;
  font-weight: 700;
  color: var(--green-dark);
  margin-top: 8px;
}

/* ---- DOWNLOAD ACTIONS ---- */
.download-actions {
  display: flex;
  gap: 12px;
  margin-top: 1rem;
  flex-wrap: wrap;
}

/* ---- COLUMNS GUIDE ---- */
.columns-guide {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.columns-guide-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--navy);
  color: var(--white);
}

.columns-guide-header h3 {
  font-size: 14px;
  font-weight: 600;
}

.columns-guide-header p {
  font-size: 12px;
  opacity: 0.7;
  margin-top: 2px;
}

.col-group {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.col-group:last-child {
  border-bottom: none;
}

.col-group-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.col-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.chip {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  font-family: 'DM Mono', monospace;
}

/* ---- SLIP HEADER LIVE PREVIEW ---- */
.slip-preview-box {
  margin-top: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  overflow: hidden;
}

.slip-preview-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px 20px 12px;
  border-bottom: 2px solid #0f172a;
}

.slip-preview-logo {
  width: 110px;
  height: 48px;
  background: #0f172a;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.slip-preview-logo span {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.slip-preview-logo img {
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.slip-preview-text {
  flex: 1;
  text-align: center;
}

.slip-preview-name {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.slip-preview-addr {
  font-size: 13px;
  color: #555;
  margin-top: 5px;
  line-height: 1.5;
}

.slip-preview-month {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  padding: 7px 16px;
  text-decoration: underline;
  background: #f8fafc;
  letter-spacing: 0.01em;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
  .field.span2 { grid-column: span 1; }
  .logo-upload-wrap { flex-direction: column; align-items: flex-start; }
  .main-container { padding: 1.5rem 1rem 3rem; }
  .page-title h1 { font-size: 28px; }
}
