/* =============================================
   Castlewalk Group — Bill System Styles
   ============================================= */

:root {
  --navy:   #1B2A5E;
  --orange: #C87820;
  --bg:     #F4F6FB;
  --white:  #FFFFFF;
  --green:  #2E7D32;
  --yellow: #F57C00;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Arial, sans-serif; background: var(--bg); color: #333; }

/* ---- TOPBAR ---- */
.topbar {
  background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; height: 64px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.topbar-left  { display: flex; align-items: center; gap: 14px; }
.topbar-right { display: flex; align-items: center; gap: 14px; font-size: 13px; }
.topbar-logo  { height: 42px; object-fit: contain; }
.topbar-left strong { display: block; font-size: 15px; letter-spacing: 1px; }
.topbar-left small  { font-size: 10px; opacity: 0.65; }
.dot-green { width:8px;height:8px;border-radius:50%;background:#22c55e;
             box-shadow:0 0 6px #22c55e;display:inline-block; }

/* ---- BUTTONS ---- */
.btn-primary {
  background: var(--orange); color: #fff; border: none;
  border-radius: 8px; padding: 9px 20px; font-weight: 700;
  font-size: 13px; cursor: pointer; text-decoration: none; display: inline-block;
}
.btn-outline {
  border: 1.5px solid rgba(255,255,255,0.5); color: #fff; background: transparent;
  border-radius: 8px; padding: 7px 16px; font-size: 13px;
  cursor: pointer; text-decoration: none; display: inline-block;
}
.btn-sm { padding: 6px 14px; font-size: 12px; }

/* ---- LOGIN PAGE ---- */
.login-page {
  display:flex; align-items:center; justify-content:center; min-height:100vh;
  flex-direction: column; gap: 0;
}
.login-card {
  background: var(--white); border-radius: 18px;
  box-shadow: 0 8px 40px rgba(27,42,94,0.13);
  padding: 52px 56px; text-align: center; max-width: 420px; width: 90%;
}
.login-card .logo-wrap { margin-bottom: 20px; }
.login-card .logo-wrap img { height: 60px; }
.login-card h2 { color: var(--navy); margin-bottom: 10px; font-size: 22px; }
.login-card p  { color: #666; font-size: 14px; margin-bottom: 20px; }
.login-card .perms { list-style: none; background: var(--bg); border-radius: 10px;
  padding: 16px 20px; margin-bottom: 28px; text-align: left; }
.login-card .perms li { font-size: 13px; color: #444; margin-bottom: 8px; }
.login-card .perms li::before { content: ''; }
.btn-qbo {
  display: block; background: var(--orange); color: #fff;
  border-radius: 10px; padding: 13px 0; font-weight: 800;
  font-size: 15px; text-decoration: none; margin-bottom: 0;
}

/* ---- MAIN CONTAINER ---- */
.container { padding: 28px 32px; max-width: 1200px; margin: 0 auto; }
.page-title { margin-bottom: 20px; }
.page-title h2 { color: var(--navy); font-size: 22px; }
.page-title small { color: #888; font-size: 13px; }

/* ---- BILLS TABLE ---- */
.bills-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  background: var(--white); border-radius: 14px;
  box-shadow: 0 2px 12px rgba(27,42,94,0.08); overflow: hidden;
}
.bills-table thead tr { background: var(--navy); color: #fff; }
.bills-table th { padding: 13px 16px; text-align: left; font-size: 12px; font-weight: 700; }
.bills-table td { padding: 13px 16px; border-bottom: 1px solid #EEF0F6; }
.bills-table tbody tr:nth-child(even) { background: #F9FAFC; }
.bills-table tbody tr:hover { background: #EEF3FF; }
.bills-table td strong { color: var(--navy); }
.bills-table td small  { color: #999; font-size: 11px; display: block; }

/* ---- BADGES ---- */
.badge { padding: 3px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.badge-approved { background: #E6F4EA; color: var(--green); border: 1px solid #A5D6A7; }
.badge-pending  { background: #FFF8E1; color: var(--yellow); border: 1px solid #FFE082; }
.approved { color: var(--green); }
.muted    { color: #bbb; font-size: 12px; }

/* ---- ALERT ---- */
.alert-error {
  background: #FFEBEE; color: #c62828; border: 1px solid #EF9A9A;
  border-radius: 8px; padding: 12px 18px; margin-bottom: 20px; font-size: 13px;
}

/* ---- BILL DETAIL WRAPPER ---- */
.bill-wrapper {
  background: var(--white); border-radius: 16px; max-width: 820px;
  margin: 28px auto; box-shadow: 0 4px 24px rgba(27,42,94,0.10); overflow: hidden;
}

/* BILL HEADER */
.bill-header {
  background: var(--navy); padding: 28px 36px;
  display: flex; justify-content: space-between; align-items: center;
}
.bill-header-left { display: flex; align-items: center; gap: 16px; }
.bill-logo { height: 52px; filter: brightness(0) invert(1); }
.company-name { color: #fff; font-weight: 900; font-size: 20px; letter-spacing: 1px; }
.company-site { color: rgba(255,255,255,0.55); font-size: 11px; }
.bill-title  { color: var(--orange); font-weight: 900; font-size: 30px; letter-spacing: 3px; text-align: right; }
.bill-number { color: rgba(255,255,255,0.9); font-size: 15px; font-weight: 700; text-align: right; }

/* STATUS BANNER */
.status-banner {
  padding: 10px 36px; font-weight: 800; font-size: 13px;
  border-bottom: 3px solid;
}
.status-approved { background: #E6F4EA; color: var(--green); border-color: #22c55e; }
.status-pending  { background: #FFF8E1; color: var(--yellow); border-color: var(--orange); }

/* BILL INFO */
.bill-info-grid {
  padding: 28px 36px 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 24; margin-bottom: 24px;
}
.bill-vendor label { color: #999; font-size: 11px; font-weight: 700;
  text-transform: uppercase; display: block; margin-bottom: 4px; }
.bill-vendor strong { font-weight: 800; font-size: 17px; color: var(--navy); }
.bill-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.info-cell label { color: #999; font-size: 10px; font-weight: 700;
  text-transform: uppercase; display: block; margin-bottom: 2px; }
.info-cell span  { font-weight: 700; color: #333; font-size: 13px; }

/* WORKFLOW BOX */
.workflow-box {
  margin: 0 36px 24px; background: var(--bg); border-radius: 12px;
  padding: 18px 22px; display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px;
  align-items: center; border: 1.5px solid #D0D7EE;
}
.workflow-user { display: flex; align-items: flex-start; gap: 12px; }
.workflow-icon { width:36px;height:36px;border-radius:50%;background:#fff;
  display:flex;align-items:center;justify-content:center;font-size:18px;
  border:2px solid var(--navy);flex-shrink:0; }
.workflow-user label { color:#999;font-size:10px;font-weight:700;
  text-transform:uppercase;display:block;margin-bottom:2px; }
.workflow-user strong { display:block;font-size:14px;font-weight:800; }
.workflow-user small  { color:#999;font-size:11px;display:block; }
.workflow-divider { width:1px;height:60px;background:#D0D7EE;margin:0 auto; }

/* LINES TABLE */
.lines-table { width:100%;border-collapse:collapse;font-size:13px;margin: 0 0 0 0; }
.lines-table thead tr { background: var(--navy); }
.lines-table th { padding:10px 36px;color:#fff;text-align:left;font-size:12px;font-weight:700; }
.lines-table th:not(:first-child) { text-align:right; }
.lines-table td { padding:11px 36px;border-bottom:1px solid #EEF0F6; }
.lines-table td:not(:first-child) { text-align:right; }
.lines-table tbody tr:nth-child(even) { background:#F9FAFC; }

/* TOTALS */
.totals-wrap { display:flex;justify-content:flex-end;padding:20px 36px 0; }
.totals-box  { width:260px; }
.total-row   { display:flex;justify-content:space-between;padding:7px 0;
  border-bottom:1px solid #EEF0F6;font-size:13px; }
.total-row.grand {
  border-top:3px solid var(--navy);border-bottom:none;margin-top:4px;
  padding-top:12px;
}
.total-row.grand span:first-child { font-weight:900;font-size:16px;color:var(--navy); }
.total-row.grand span:last-child  { font-weight:900;font-size:18px;color:var(--orange); }

/* MEMO */
.memo-box { border-top:1px solid #EEF0F6;padding:18px 36px; }
.memo-box label { color:#999;font-size:11px;font-weight:700;text-transform:uppercase;display:block;margin-bottom:4px; }
.memo-box p { font-size:13px;color:#555; }

/* SIGNATURES */
.signatures { display:grid;grid-template-columns:1fr 1fr;gap:40px;
  padding:28px 36px;border-top:1px solid #EEF0F6; }
.sig-box label { font-size:11px;color:#999;font-weight:700;
  text-transform:uppercase;display:block;margin-bottom:4px; }
.sig-box span  { font-size:13px;color:#333;font-weight:600; }
.sig-line { border-bottom:2px solid var(--navy);height:40px;margin-bottom:8px; }

/* BILL FOOTER */
.bill-footer {
  background: var(--bg); border-top:3px solid var(--orange);
  padding:14px 36px; display:flex; justify-content:space-between; align-items:center;
  font-size:11px; color:#999;
}
.bill-footer a { color:var(--orange);font-weight:700;text-decoration:none; }

/* GLOBAL FOOTER */
.footer { text-align:center;padding:24px;font-size:11px;color:#bbb; }
.footer a { color:var(--orange);font-weight:700;text-decoration:none; }

/* PRINT OVERRIDE */
@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  .bill-wrapper { box-shadow: none; border-radius: 0; margin: 0; max-width: 100%; }
}
