/* ============================================================
   SWELDO by AltaSME — Global Design System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=DM+Mono:wght@400;500&display=swap');

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
  /* Brand Colors */
  --blue-900: #0F2547;
  --blue-800: #1B3A6B;
  --blue-700: #1E4D8C;
  --blue-600: #2563AB;
  --blue-100: #DBEAFE;
  --blue-50:  #EFF6FF;

  --orange-600: #EA580C;
  --orange-500: #F97316;
  --orange-100: #FFEDD5;
  --orange-50:  #FFF7ED;

  --green-700: #15803D;
  --green-600: #16A34A;
  --green-100: #DCFCE7;
  --green-50:  #F0FDF4;

  --red-600:   #DC2626;
  --red-100:   #FEE2E2;
  --red-50:    #FFF5F5;

  --yellow-600: #CA8A04;
  --yellow-100: #FEF9C3;

  /* Neutrals */
  --gray-950: #0A0F1A;
  --gray-900: #111827;
  --gray-800: #1F2937;
  --gray-700: #374151;
  --gray-600: #4B5563;
  --gray-500: #6B7280;
  --gray-400: #9CA3AF;
  --gray-300: #D1D5DB;
  --gray-200: #E5E7EB;
  --gray-100: #F3F4F6;
  --gray-50:  #F9FAFB;
  --white:    #FFFFFF;

  /* Semantic */
  --color-primary:    var(--blue-800);
  --color-accent:     var(--orange-500);
  --color-success:    var(--green-600);
  --color-danger:     var(--red-600);
  --color-warning:    var(--yellow-600);
  --color-bg:         #F1F5F9;
  --color-surface:    var(--white);
  --color-border:     var(--gray-200);
  --color-text:       var(--gray-900);
  --color-text-muted: var(--gray-500);
  --color-text-light: var(--gray-400);

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'DM Mono', monospace;

  /* Sizing */
  --sidebar-width: 240px;
  --header-height: 60px;
  --content-max:   1080px;
  --radius-sm:     6px;
  --radius-md:     10px;
  --radius-lg:     16px;
  --radius-xl:     24px;
  --radius-full:   9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.06);

  /* Transitions */
  --transition: 150ms ease;
  --transition-slow: 300ms ease;
}


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

html { font-size: 15px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
img { max-width: 100%; display: block; }


/* ============================================================
   TYPOGRAPHY
   ============================================================ */
.text-xs    { font-size: 11px; }
.text-sm    { font-size: 13px; }
.text-base  { font-size: 15px; }
.text-lg    { font-size: 17px; }
.text-xl    { font-size: 20px; }
.text-2xl   { font-size: 24px; }
.text-3xl   { font-size: 30px; }

.font-normal   { font-weight: 400; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }
.font-extrabold{ font-weight: 800; }

.text-primary { color: var(--color-primary); }
.text-accent  { color: var(--color-accent); }
.text-success { color: var(--color-success); }
.text-danger  { color: var(--color-danger); }
.text-muted   { color: var(--color-text-muted); }
.text-light   { color: var(--color-text-light); }

.font-mono { font-family: var(--font-mono); }
.tabular   { font-variant-numeric: tabular-nums; }


/* ============================================================
   LAYOUT — APP SHELL
   ============================================================ */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--blue-900);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition-slow);
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo-mark {
  font-size: 20px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.5px;
}

.sidebar-logo-mark span {
  color: var(--orange-500);
}

.sidebar-logo-sub {
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: rgba(255,255,255,0.65);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 2px;
}

.nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: var(--white);
}

.nav-item.active {
  background: var(--orange-500);
  color: var(--white);
}

.nav-item-icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.plan-badge {
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 12px;
}

.plan-badge-label {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.plan-badge-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  margin-top: 2px;
}

.plan-badge-limit {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  margin-top: 4px;
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-header {
  background: var(--white);
  border-bottom: 1px solid var(--color-border);
  padding: 0 32px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.page-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text);
}

.page-body {
  padding: 32px;
  max-width: var(--content-max);
  width: 100%;
}


/* ============================================================
   AUTH LAYOUT (login/signup)
   ============================================================ */
.auth-shell {
  min-height: 100vh;
  display: flex;
  background: var(--color-bg);
}

.auth-panel {
  width: 100%;
  max-width: 460px;
  margin: auto;
  padding: 40px 24px;
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo-mark {
  font-size: 28px;
  font-weight: 800;
  color: var(--blue-800);
  letter-spacing: -1px;
}

.auth-logo-mark span { color: var(--orange-500); }

.auth-logo-tag {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.auth-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: 28px;
}


/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.card-body { padding: 24px; }
.card-header {
  padding: 20px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
}


/* ============================================================
   FORMS
   ============================================================ */
.form-group {
  margin-bottom: 20px;
  position: relative;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
}

.form-label .required { color: var(--color-danger); margin-left: 2px; }

.form-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--color-text);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(37, 99, 171, 0.12);
}

.form-input.input--error {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.10);
}

.form-input::placeholder { color: var(--gray-400); }

.field-error {
  display: block;
  font-size: 12px;
  color: var(--color-danger);
  margin-top: 5px;
  font-weight: 500;
}

.form-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 5px;
}

/* Peso input prefix */
.input-peso-wrapper {
  position: relative;
}

.input-peso-wrapper .peso-prefix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--color-text-muted);
  font-weight: 600;
  pointer-events: none;
}

.input-peso-wrapper .form-input {
  padding-left: 28px;
  font-family: var(--font-mono);
}


/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
  outline: none;
}

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

.btn-primary {
  background: var(--blue-800);
  color: var(--white);
}

.btn-primary:hover:not(:disabled) {
  background: var(--blue-700);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(27, 58, 107, 0.3);
}

.btn-accent {
  background: var(--orange-500);
  color: var(--white);
}

.btn-accent:hover:not(:disabled) {
  background: var(--orange-600);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.btn-success {
  background: var(--green-600);
  color: var(--white);
}

.btn-success:hover:not(:disabled) {
  background: var(--green-700);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--blue-600);
  color: var(--blue-800);
  background: var(--blue-50);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  padding: 8px 12px;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--gray-100);
  color: var(--color-text);
}

.btn-danger {
  background: var(--red-600);
  color: var(--white);
}

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-full { width: 100%; }
.btn-icon { padding: 9px; }


/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-blue   { background: var(--blue-100);   color: var(--blue-800); }
.badge-orange { background: var(--orange-100); color: var(--orange-600); }
.badge-green  { background: var(--green-100);  color: var(--green-700); }
.badge-red    { background: var(--red-100);    color: var(--red-600); }
.badge-gray   { background: var(--gray-100);   color: var(--gray-600); }
.badge-yellow { background: var(--yellow-100); color: var(--yellow-600); }


/* ============================================================
   COMPUTATION CARD (The Wow Moment)
   ============================================================ */
.computation-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.computation-header {
  background: var(--blue-900);
  padding: 20px 24px;
  color: var(--white);
}

.computation-name {
  font-size: 18px;
  font-weight: 700;
}

.computation-type {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin-top: 2px;
}

.computation-body {
  padding: 24px;
}

.computation-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.computation-row.visible {
  opacity: 1;
  transform: translateY(0);
}

.computation-row:last-child { border-bottom: none; }

.computation-row-label {
  font-size: 14px;
  color: var(--color-text-muted);
}

.computation-row-value {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
}

.computation-row.is-salary .computation-row-label { font-weight: 600; color: var(--color-text); }
.computation-row.is-salary .computation-row-value { font-size: 16px; font-weight: 700; }

.computation-row.is-deduction .computation-row-value { color: var(--color-danger); }

.computation-divider {
  height: 1px;
  background: var(--color-border);
  margin: 8px 0;
}

.computation-netpay {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0 4px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.computation-netpay.visible {
  opacity: 1;
  transform: translateY(0);
}

.computation-netpay-label {
  font-size: 16px;
  font-weight: 800;
  color: var(--color-text);
}

.computation-netpay-value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--green-600);
}

.computation-verified {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--green-600);
  font-weight: 600;
  padding: 12px 24px;
  background: var(--green-50);
  border-top: 1px solid var(--green-100);
}


/* ============================================================
   DEADLINE CARDS
   ============================================================ */
.deadline-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--gray-100);
}

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

.deadline-info { display: flex; align-items: center; gap: 12px; }

.deadline-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: var(--blue-50);
}

.deadline-icon.urgent { background: var(--orange-50); }
.deadline-icon.overdue { background: var(--red-50); }

.deadline-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

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

.deadline-days {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--gray-100);
  color: var(--gray-600);
}

.deadline-days.urgent {
  background: var(--orange-100);
  color: var(--orange-600);
}

.deadline-days.overdue {
  background: var(--red-100);
  color: var(--red-600);
}

.deadline-lock {
  font-size: 12px;
  color: var(--color-text-light);
  display: flex;
  align-items: center;
  gap: 4px;
}


/* ============================================================
   EMPLOYEE LIST ITEM
   ============================================================ */
.employee-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--gray-100);
}

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

.employee-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--blue-100);
  color: var(--blue-800);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.employee-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

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

.employee-salary {
  margin-left: auto;
  text-align: right;
}

.employee-salary-amount {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

.employee-salary-label {
  font-size: 11px;
  color: var(--color-text-muted);
}


/* ============================================================
   UPSELL CARD
   ============================================================ */
.upsell-card {
  border-left: 4px solid var(--orange-500);
  background: var(--orange-50);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.upsell-text { flex: 1; }
.upsell-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 4px;
}

.upsell-desc {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.upsell-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--orange-600);
  margin-top: 6px;
}

.upsell-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.upsell-dismiss {
  font-size: 12px;
  color: var(--color-text-muted);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
}


/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.sw-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--gray-900);
  color: var(--white);
  padding: 12px 20px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transition: all var(--transition-slow);
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
}

.sw-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.sw-toast--success { background: var(--green-700); }
.sw-toast--error   { background: var(--red-600); }
.sw-toast--warning { background: var(--yellow-600); }


/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 6px;
}

.empty-state-desc {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: 20px;
  line-height: 1.6;
}


/* ============================================================
   STEP INDICATOR (onboarding)
   ============================================================ */
.step-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 32px;
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--gray-200);
  transition: all var(--transition);
}

.step-dot.active {
  width: 24px;
  background: var(--blue-800);
}

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


/* ============================================================
   EMPLOYMENT TYPE CARDS (onboarding selector)
   ============================================================ */
.type-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 8px;
}

.type-card {
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--white);
}

.type-card:hover {
  border-color: var(--blue-600);
  background: var(--blue-50);
}

.type-card.selected {
  border-color: var(--blue-800);
  background: var(--blue-50);
  box-shadow: 0 0 0 3px rgba(27, 58, 107, 0.12);
}

.type-card-icon { font-size: 24px; margin-bottom: 8px; }
.type-card-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.type-card-desc {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 3px;
  line-height: 1.4;
}


/* ============================================================
   WATERMARK (free tier payslip)
   ============================================================ */
.watermark-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-30deg);
  font-size: 48px;
  font-weight: 800;
  color: rgba(27, 58, 107, 0.06);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  letter-spacing: 2px;
  text-transform: uppercase;
}


/* ============================================================
   DIVIDER
   ============================================================ */
.divider {
  height: 1px;
  background: var(--color-border);
  margin: 24px 0;
}

.divider-text {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-text-muted);
  font-size: 12px;
  margin: 20px 0;
}

.divider-text::before,
.divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}


/* ============================================================
   RESPONSIVE — Mobile
   ============================================================ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .page-body {
    padding: 16px;
  }

  .type-cards {
    grid-template-columns: 1fr;
  }

  .upsell-card {
    flex-direction: column;
  }

  .upsell-actions {
    align-items: flex-start;
  }

  .auth-card {
    padding: 28px 20px;
  }

  .computation-netpay-value {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .page-header { padding: 0 16px; }
}
