/* ============================================================
   SeraNeon Salary Slip Portal - app stylesheet
   ============================================================ */

:root {
  --primary: #ff494a;
  --primary-dark: #e02f30;
  --primary-soft: #fff1f1;
  --text: #1f2328;
  --muted: #6a737d;
  --border: #e6e8eb;
  --bg: #f7f8fa;
  --card: #ffffff;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.04);
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
.link { color: var(--primary-dark); text-decoration: underline; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* ----------------------------------------------------------
   Top bar
   ---------------------------------------------------------- */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand img { height: 32px; }
.brand-text {
  font-weight: 600;
  font-size: 15px;
  color: #333;
}
.topbar nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* ----------------------------------------------------------
   Layout
   ---------------------------------------------------------- */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 24px 60px;
  display: grid;
  gap: 22px;
}

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

.card h1 {
  margin: 0 0 6px;
  font-size: 22px;
  letter-spacing: -0.2px;
}
.card h2 {
  margin: 0 0 14px;
  font-size: 17px;
  letter-spacing: -0.2px;
}
.card p { margin: 6px 0 14px; }

/* ----------------------------------------------------------
   Forms
   ---------------------------------------------------------- */
.form-grid {
  display: grid;
  gap: 18px;
  margin-top: 14px;
}

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: #2b2f33;
}
.field .req { color: var(--primary); margin-left: 2px; }
.field .hint { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }
.field input[type=text],
.field input[type=password],
.field input[type=file],
.field select {
  width: 100%;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
}
.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,73,74,.15);
}
.field input[type=file] {
  padding: 8px;
  cursor: pointer;
}
.field.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 400;
  margin-left: 6px;
}

/* ----------------------------------------------------------
   Buttons
   ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: transform .04s ease, background .15s ease, border-color .15s ease;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; }
.btn-ghost {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: #f3f4f6; text-decoration: none; }
.btn-danger {
  background: #fff;
  color: #9e1d1d;
  border-color: #f5c4c4;
}
.btn-danger:hover {
  background: #9e1d1d;
  color: #fff;
  border-color: #9e1d1d;
  text-decoration: none;
}
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn.block { width: 100%; }

/* ----------------------------------------------------------
   Auth (login)
   ---------------------------------------------------------- */
body.auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(255,73,74,.18), transparent 70%),
    radial-gradient(900px 500px at 110% 110%, rgba(255,73,74,.12), transparent 70%),
    var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 32px 30px 22px;
  text-align: center;
}
.auth-logo img { height: 44px; }
.auth-card h1 { margin: 14px 0 4px; font-size: 20px; }
.auth-card p { margin: 0 0 18px; }
.auth-card form { display: grid; gap: 14px; text-align: left; margin-top: 8px; }
.auth-card label span { display: block; font-weight: 600; margin-bottom: 6px; }
.auth-card input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}
.auth-card input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,73,74,.15);
}
.auth-card .legal { margin-top: 18px; font-size: 12px; color: var(--muted); text-align: center; }

/* ----------------------------------------------------------
   Alerts
   ---------------------------------------------------------- */
.alert {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  border: 1px solid transparent;
}
.alert-error {
  background: #fff4f4;
  color: #9e1d1d;
  border-color: #f5c4c4;
}
.alert-success {
  background: #effaf3;
  color: #136a37;
  border-color: #b8e8c8;
}
.alert-info {
  background: #eef6ff;
  color: #1d4783;
  border-color: #c7dbf3;
}
.alert ul { margin: 6px 0 0 18px; padding: 0; }
.alert code {
  background: rgba(0,0,0,.05);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12.5px;
}

/* ----------------------------------------------------------
   Misc / lists / tables
   ---------------------------------------------------------- */
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.numbered {
  margin: 4px 0 0 22px;
  padding: 0;
}
.numbered li { padding: 4px 0; }
.tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef0f3;
  color: #495057;
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.tag-required {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.data th, table.data td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.data th {
  background: #fafbfc;
  font-weight: 600;
  color: #495057;
}
table.data th.r, table.data td.r { text-align: right; }
table.data code {
  font-size: 12.5px;
  background: #f5f6f8;
  padding: 2px 6px;
  border-radius: 4px;
}

/* ----------------------------------------------------------
   Run detail page
   ---------------------------------------------------------- */
.run-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.run-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
  font-size: 13px;
}
.run-stats .stat {
  background: #f5f6f8;
  color: #495057;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #e6e8eb;
}
.run-stats .stat strong { color: #1f2328; }
.run-stats .stat-sent    { background: #effaf3; color: #136a37; border-color: #b8e8c8; }
.run-stats .stat-pending { background: #fff8e6; color: #8a6500; border-color: #f3df9b; }
.run-stats .stat-failed  { background: #fff4f4; color: #9e1d1d; border-color: #f5c4c4; }
.run-stats .stat-muted   { background: #f5f6f8; color: #6a737d; }

.run-table tbody tr:hover { background: #fafbfc; }

.row-actions {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ----------------------------------------------------------
   Status badges
   ---------------------------------------------------------- */
.badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid transparent;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.badge-sent    { background: #effaf3; color: #136a37; border-color: #b8e8c8; }
.badge-pending { background: #fff8e6; color: #8a6500; border-color: #f3df9b; }
.badge-failed  { background: #fff4f4; color: #9e1d1d; border-color: #f5c4c4; }
.badge-muted   { background: #f1f3f5; color: #6a737d; border-color: #e6e8eb; }

/* ----------------------------------------------------------
   Inline filter (e.g. "Filter by month" on the runs list)
   ---------------------------------------------------------- */
.inline-filter {
  display: flex;
  align-items: center;
  gap: 8px;
}
.inline-filter select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  font-family: inherit;
}

/* ----------------------------------------------------------
   Footer
   ---------------------------------------------------------- */
.footer {
  text-align: center;
  padding: 18px 0 28px;
}
