/* =========================================================
   SEDAYUSolar VMS — Design System
   Palette: navy (primary/trust) + amber (solar/energy accent)
   Type: Space Grotesk (display) / Inter (body) / IBM Plex Mono (data)
   ========================================================= */

:root {
  --navy: #0F2A3D;
  --navy-light: #16405C;
  --amber: #F5A623;
  --amber-dark: #C9840F;
  --bg: #F6F7F9;
  --surface: #FFFFFF;
  --border: #E2E6EB;
  --text: #16232E;
  --muted: #6B7A88;
  --success: #2F9E58;
  --success-bg: #EAF7EF;
  --danger: #B42318;
  --danger-bg: #FDECEC;
  --warn: #B7791F;
  --warn-bg: #FFFBF2;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 42, 61, 0.06), 0 1px 8px rgba(15, 42, 61, 0.04);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 600;
  color: var(--navy);
  margin: 0 0 4px;
}

h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 14px; }

p { margin: 0 0 8px; }

a { color: var(--navy); }

.mono {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
}

/* ---------- Layout: auth (login / lupa password) ---------- */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--navy);
  background-image:
    radial-gradient(circle, rgba(245, 166, 35, 0.16) 1.5px, transparent 1.5px);
  background-size: 28px 28px;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  padding: 32px 28px;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.auth-logo .mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.auth-logo .mark svg { display: block; }

.auth-logo .name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--navy);
  line-height: 1.2;
}

.auth-logo .sub {
  font-size: 11px;
  color: var(--muted);
}

.auth-card h1 { font-size: 18px; margin-bottom: 4px; }
.auth-card .lead { color: var(--muted); font-size: 13px; margin-bottom: 20px; }

/* ---------- Form elements ---------- */

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="number"],
.field input[type="date"],
.field textarea,
.field select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: border-color .15s ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(15, 42, 61, 0.08);
}

.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: filter .15s ease;
}

.btn:hover { filter: brightness(1.08); }

.btn-primary { background: var(--navy); color: #fff; width: 100%; }
.btn-amber { background: var(--amber); color: var(--navy); }
.btn-outline { background: #fff; color: var(--text); border-color: var(--border); }
.btn-danger-text { background: transparent; color: var(--danger); }
.btn-sm { padding: 6px 12px; font-size: 12px; }

.auth-links {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  font-size: 12.5px;
}

.auth-links a { color: var(--muted); text-decoration: none; }
.auth-links a:hover { color: var(--navy); text-decoration: underline; }

/* ---------- Alerts / flash messages ---------- */

.alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.alert-error { background: var(--danger-bg); color: var(--danger); border-color: #F3C6C2; }
.alert-success { background: var(--success-bg); color: #1E7A44; border-color: #BFE6CC; }
.alert-warn { background: var(--warn-bg); color: var(--warn); border-color: #F0DFAE; }

/* ---------- Layout: dashboard (sidebar + content) ---------- */

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--navy);
  color: #fff;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 6px 20px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar .brand .mark {
  width: 30px; height: 30px; border-radius: 7px;
  background: rgba(245,166,35,0.15);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.sidebar .brand .name { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 14px; }
.sidebar .brand .sub { font-size: 10.5px; color: rgba(255,255,255,0.55); }

.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 7px;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}

.sidebar nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar nav a.active { background: var(--amber); color: var(--navy); }

.sidebar .user-box {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 12px;
  margin-top: 12px;
  font-size: 12px;
}

.sidebar .user-box .who { color: #fff; font-weight: 500; margin-bottom: 2px; }
.sidebar .user-box .role { color: rgba(255,255,255,0.5); text-transform: capitalize; }
.sidebar .user-box a { color: rgba(255,255,255,0.55); font-size: 11.5px; text-decoration: none; }
.sidebar .user-box a:hover { color: #fff; }

.main { flex: 1; min-width: 0; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar h1 { font-size: 17px; margin: 0; }

.content { padding: 24px 28px; }

/* ---------- Widgets / cards ---------- */

.widget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}

.widget .label {
  font-size: 11.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}

.widget .value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--navy);
}

.widget.warn .value { color: var(--warn); }
.widget.danger .value { color: var(--danger); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card .card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card .card-body { padding: 18px; }

/* ---------- Table ---------- */

table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data-table th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--muted);
  font-weight: 600;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
table.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
table.data-table tr:last-child td { border-bottom: none; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
}
.badge-default { background: #EEF1F4; color: var(--muted); }
.badge-pending { background: var(--warn-bg); color: var(--warn); }
.badge-success { background: var(--success-bg); color: #1E7A44; }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: #EAF2FA; color: #1E5A85; }

/* ---------- Empty state ---------- */

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Vendor portal (non-sidebar) ---------- */

.vendor-header {
  background: var(--navy);
  padding: 16px 24px;
}

.vendor-header .inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.vendor-header .mark {
  width: 30px; height: 30px; border-radius: 7px;
  background: rgba(245,166,35,0.15);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.vendor-header .name { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 14px; color: #fff; }
.vendor-header .sub { font-size: 10.5px; color: rgba(255,255,255,0.55); }

.vendor-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

/* Stepper: progres tahapan pengajuan vendor */

.stepper { display: flex; align-items: flex-start; width: 100%; margin-bottom: 8px; }

.stepper .step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  width: 88px;
}

.stepper .dot {
  width: 26px; height: 26px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  border: 2px solid var(--border);
  background: #fff;
  color: var(--muted);
}

.stepper .step.done .dot { background: var(--navy); border-color: var(--navy); color: #fff; }
.stepper .step.current .dot { background: #fff; border-color: var(--navy); color: var(--navy); }

.stepper .label {
  font-size: 10.5px;
  text-align: center;
  color: var(--muted);
  line-height: 1.3;
}

.stepper .step.current .label,
.stepper .step.done .label { color: var(--navy); font-weight: 600; }

.stepper .line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin-top: 12px;
}

.stepper .line.done { background: var(--navy); }

/* Info / notice boxes */

.notice {
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 12.5px;
  line-height: 1.6;
  margin: 20px 0;
}

.notice-amber { background: var(--warn-bg); border: 1px solid #F0DFAE; color: #7A5B12; }
.notice-blue { background: #F0F6FB; border: 1px solid #CFE2F0; color: #1E5A85; }
.notice-red { background: var(--danger-bg); border: 1px solid #F3C6C2; color: var(--danger); }
.notice-green { background: var(--success-bg); border: 1px solid #BFE6CC; color: #1E7A44; }

/* Upload dropzone */

.dropzone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

.dropzone:hover { border-color: var(--navy); background: #FAFBFC; }
.dropzone .icon { font-size: 22px; margin-bottom: 6px; }
.dropzone input[type="file"] { display: none; }
.dropzone .filename { margin-top: 8px; font-size: 12px; color: var(--text); font-weight: 500; }

/* Line-item form table (submission penawaran) */

.item-form-table { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.item-form-table th {
  text-align: left; font-size: 11px; text-transform: uppercase;
  color: var(--muted); padding: 6px 8px; font-weight: 600;
}
.item-form-table td { padding: 6px 8px; }
.item-form-table input {
  width: 100%; padding: 7px 9px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 12.5px; font-family: inherit;
}
.item-form-table input:focus { outline: none; border-color: var(--navy); }
.item-form-table .remove-row {
  background: none; border: none; color: var(--danger); cursor: pointer;
  font-size: 16px; line-height: 1; padding: 4px;
}

.add-item-btn {
  background: none; border: 1px dashed var(--border); color: var(--muted);
  border-radius: 6px; padding: 8px; width: 100%; font-size: 12.5px;
  cursor: pointer; margin-bottom: 16px;
}
.add-item-btn:hover { border-color: var(--navy); color: var(--navy); }

.total-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-top: 1px solid var(--border); margin-top: 4px;
}
.total-row .amount { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 18px; color: var(--navy); }


/* ---------- Mobile responsiveness ---------- */

@media (max-width: 860px) {
  .app-shell { flex-direction: column; }

  .sidebar {
    width: 100%;
    flex-direction: row;
    align-items: center;
    padding: 10px 14px;
    overflow-x: auto;
    gap: 14px;
  }

  .sidebar .brand {
    border-bottom: none;
    border-right: 1px solid rgba(255,255,255,0.1);
    padding: 0 14px 0 0;
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .sidebar nav {
    flex-direction: row;
    flex: 1;
    overflow-x: auto;
  }

  .sidebar nav a { white-space: nowrap; }

  .sidebar .user-box {
    border-top: none;
    border-left: 1px solid rgba(255,255,255,0.1);
    padding: 0 0 0 14px;
    margin: 0;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .topbar { padding: 12px 16px; }
  .content { padding: 16px; }

  .vendor-header .inner { flex-wrap: wrap; row-gap: 10px; }
}

@media (max-width: 600px) {
  .widget-grid { grid-template-columns: 1fr; }

  .card table.data-table,
  .item-form-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .stepper { overflow-x: auto; }
  .stepper .step { width: 66px; flex-shrink: 0; }
  .stepper .label { font-size: 9.5px; }

  .auth-card { padding: 24px 20px; }
  .vendor-container { padding: 20px 14px 48px; }

  .card-header { flex-wrap: wrap; gap: 8px; }
}