/* =========================
   Base
   ========================= */
:root{
  --bg: #f7f7fb;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #6b7280;
  --border: #e5e7eb;

  --brand: #2563eb;         /* primary */
  --brand-600: #1d4ed8;
  --success: #16a34a;
  --success-600: #15803d;
  --danger: #dc2626;
  --danger-600: #b91c1c;
  --warning: #f59e0b;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body{
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans", "Helvetica Neue", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img{ max-width: 100%; height: auto; display: block; }

a{
  color: var(--brand);
  text-decoration: none;
}
a:hover,
a:focus{
  text-decoration: underline;
}

/* =========================
   Layout
   ========================= */
.container{
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
}

.card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.section-title{
  margin: 0 0 16px 0;
  font-size: 1.375rem;
  font-weight: 700;
}

.subtle{
  color: var(--muted);
  font-size: 0.95rem;
}

/* =========================
   Forms
   ========================= */
label{
  display: block;
  font-weight: 600;
  margin: 14px 0 6px 0;
}

input[type="text"],
input[type="email"],
input[type="date"],
input[type="number"],
input[type="file"],
textarea,
select{
  width: 100%;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
}

textarea{
  min-height: 120px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus{
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.grid{
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 720px){
  .grid{ grid-template-columns: 1fr; }
}

/* Inline messages under inputs */
.input-hint{
  margin-top: 6px;
  font-size: 0.9rem;
  color: var(--muted);
}

/* =========================
   Buttons
   ========================= */
button,
.btn{
  display: inline-block;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.02s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  text-align: center;
}

button:hover,
.btn:hover{
  background: var(--brand-600);
  border-color: var(--brand-600);
  text-decoration: none;
}

button:active,
.btn:active{
  transform: translateY(1px);
}

.btn-outline{
  background: transparent;
  color: var(--brand);
  border-color: var(--brand);
}
.btn-outline:hover{
  background: rgba(37, 99, 235, 0.08);
}

.btn-success{
  background: var(--success);
  border-color: var(--success);
}
.btn-success:hover{
  background: var(--success-600);
  border-color: var(--success-600);
}

.btn-danger{
  background: var(--danger);
  border-color: var(--danger);
}
.btn-danger:hover{
  background: var(--danger-600);
  border-color: var(--danger-600);
}

.btn-block{ width: 100%; }

/* Button links in emails landing pages */
a.btnlink{
  display: inline-block;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
}
a.btnlink.btn-success{
  border-color: var(--success);
  background: var(--success);
}
a.btnlink.btn-danger{
  border-color: var(--danger);
  background: var(--danger);
}

/* =========================
   Tables (if you list invoices later)
   ========================= */
.table{
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.table th,
.table td{
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.table thead th{
  background: #f3f4f6;
  font-weight: 700;
}
.table tr:last-child td{ border-bottom: none; }

/* =========================
   Alerts
   ========================= */
.alert{
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f9fafb;
  color: var(--text);
  margin: 12px 0;
}
.alert-success{
  border-color: rgba(22, 163, 74, 0.25);
  background: rgba(22, 163, 74, 0.08);
}
.alert-danger{
  border-color: rgba(220, 38, 38, 0.25);
  background: rgba(220, 38, 38, 0.08);
}
.alert-warning{
  border-color: rgba(245, 158, 11, 0.25);
  background: rgba(245, 158, 11, 0.08);
}

/* =========================
   Utility
   ========================= */
.mt-0{ margin-top: 0; }
.mt-8{ margin-top: 8px; }
.mt-12{ margin-top: 12px; }
.mt-16{ margin-top: 16px; }
.mt-24{ margin-top: 24px; }

.mb-0{ margin-bottom: 0; }
.mb-8{ margin-bottom: 8px; }
.mb-12{ margin-bottom: 12px; }
.mb-16{ margin-bottom: 16px; }
.mb-24{ margin-bottom: 24px; }

.text-center{ text-align: center; }
.text-right{ text-align: right; }
.muted{ color: var(--muted); }

/* =========================
   Page-specific helpers
   ========================= */
.approval-summary p{
  margin: 6px 0;
}

.form-actions{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
@media (max-width: 480px){
  .form-actions{ flex-direction: column; }
  .form-actions .btn{ width: 100%; }
}
