/* ============================================================
   InsuraCo - Shared Stylesheet
   Optimized for automation testing (Selenium, Playwright, etc.)
   ============================================================ */

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

:root {
  --primary:      #1B4F72;
  --primary-dark: #154360;
  --primary-light:#2E86C1;
  --accent:       #27AE60;
  --accent-dark:  #1E8449;
  --warning:      #F39C12;
  --warning-bg:   #FEF9E7;
  --error:        #C0392B;
  --error-bg:     #FDECEA;
  --success:      #27AE60;
  --success-bg:   #EAF7EE;
  --info:         #2980B9;
  --info-bg:      #EBF5FB;
  --text:         #1C1C1C;
  --text-muted:   #6C757D;
  --border:       #D5DBE3;
  --bg:           #F4F6F9;
  --white:        #FFFFFF;
  --card-shadow:  0 2px 8px rgba(0,0,0,0.10);
  --radius:       8px;
  --nav-h:        64px;
}

html { font-size: 16px; }
body { font-family: 'Segoe UI', Arial, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }
a { color: var(--primary-light); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navbar ─────────────────────────────────────────────── */
#main-navbar {
  background: var(--primary); height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
#navbar-brand { display: flex; align-items: center; gap: 10px; color: var(--white); font-size: 1.35rem; font-weight: 700; text-decoration: none; }
#navbar-brand .brand-icon { font-size: 1.5rem; }
#navbar-links { display: flex; align-items: center; gap: 4px; list-style: none; }
#navbar-links li a {
  display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: var(--radius);
  color: rgba(255,255,255,0.85); font-size: 0.9rem; font-weight: 500; transition: all 0.15s;
  text-decoration: none;
}
#navbar-links li a:hover { background: rgba(255,255,255,0.15); color: #fff; }
#navbar-links li a.active { background: rgba(255,255,255,0.20); color: #fff; font-weight: 600; }
#navbar-user { display: flex; align-items: center; gap: 12px; }
#navbar-username { color: rgba(255,255,255,0.9); font-size: 0.9rem; }
#btn-logout { background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.3); color: #fff; padding: 6px 14px; border-radius: var(--radius); cursor: pointer; font-size: 0.875rem; transition: background 0.15s; }
#btn-logout:hover { background: rgba(255,255,255,0.28); }

/* ── Layout ─────────────────────────────────────────────── */
.page-wrapper { max-width: 1160px; margin: 0 auto; padding: 32px 24px; }
.page-title { font-size: 1.75rem; font-weight: 700; color: var(--primary); margin-bottom: 6px; }
.page-subtitle { color: var(--text-muted); margin-bottom: 24px; font-size: 0.95rem; }

/* ── Cards ──────────────────────────────────────────────── */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--card-shadow); padding: 24px; margin-bottom: 24px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-size: 1.1rem; font-weight: 600; color: var(--primary); }
.card-icon { font-size: 1.5rem; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: var(--radius); font-size: 0.9rem; font-weight: 500; cursor: pointer; border: none; transition: all 0.15s; text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-success { background: var(--accent); color: #fff; }
.btn-success:hover { background: var(--accent-dark); color: #fff; }
.btn-outline { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { background: #A93226; color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 0.82rem; }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1.5px solid var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

/* ── Forms ──────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-weight: 500; margin-bottom: 6px; font-size: 0.9rem; color: var(--text); }
.form-control {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius);
  font-size: 0.95rem; font-family: inherit; transition: border-color 0.15s;
  background: var(--white); color: var(--text);
}
.form-control:focus { outline: none; border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(46,134,193,0.15); }
.form-control.is-invalid { border-color: var(--error); }
.field-error { display: none; color: var(--error); font-size: 0.82rem; margin-top: 4px; }
.field-error.visible { display: block; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

/* ── Alerts ─────────────────────────────────────────────── */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 14px 18px; border-radius: var(--radius); font-size: 0.9rem; margin-bottom: 16px; border: 1px solid transparent; }
.alert.hidden { display: none; }
.alert-icon { font-size: 1.1rem; flex-shrink: 0; }
.alert-success { background: var(--success-bg); border-color: var(--accent); color: #1A6B32; }
.alert-error   { background: var(--error-bg); border-color: var(--error); color: #922B21; }
.alert-warning { background: var(--warning-bg); border-color: var(--warning); color: #9A6A00; }
.alert-info    { background: var(--info-bg); border-color: var(--info); color: #1A5276; }

/* ── Badges ─────────────────────────────────────────────── */
.badge { display: inline-block; padding: 3px 10px; border-radius: 50px; font-size: 0.78rem; font-weight: 600; }
.badge-active    { background: #D5F5E3; color: #1A6B32; }
.badge-pending   { background: #FEF9E7; color: #9A6A00; border: 1px solid #F39C12; }
.badge-expired   { background: #F2F3F4; color: #626567; }
.badge-cancelled { background: #FDECEA; color: #922B21; }
.badge-submitted { background: #EBF5FB; color: #1A5276; }
.badge-under_review { background: #FEF9E7; color: #9A6A00; border: 1px solid #F39C12; }
.badge-approved  { background: #D6EAF8; color: #1A5276; }
.badge-rejected  { background: #FDECEA; color: #922B21; }
.badge-paid      { background: #D5F5E3; color: #1A6B32; }

/* ── Tables ─────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
thead th { background: var(--primary); color: #fff; padding: 12px 16px; text-align: left; font-weight: 600; font-size: 0.85rem; }
tbody tr { border-bottom: 1px solid var(--border); transition: background 0.1s; }
tbody tr:hover { background: #F0F4F8; }
tbody td { padding: 12px 16px; vertical-align: middle; }

/* ── KPI Cards ──────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 24px; }
.kpi-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--card-shadow); padding: 20px 24px; display: flex; flex-direction: column; gap: 8px; border-left: 4px solid var(--primary); }
.kpi-card.auto  { border-color: #2980B9; }
.kpi-card.health{ border-color: #27AE60; }
.kpi-card.home  { border-color: #8E44AD; }
.kpi-card.life  { border-color: #E67E22; }
.kpi-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; font-weight: 600; letter-spacing: 0.5px; }
.kpi-value { font-size: 2rem; font-weight: 700; color: var(--primary); }
.kpi-sub   { font-size: 0.8rem; color: var(--text-muted); }

/* ── Filter bar ─────────────────────────────────────────── */
.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 20px; padding: 16px; background: var(--white); border-radius: var(--radius); box-shadow: var(--card-shadow); }
.filter-bar label { font-size: 0.85rem; font-weight: 500; color: var(--text-muted); }
.filter-bar select, .filter-bar input { padding: 7px 12px; border: 1.5px solid var(--border); border-radius: var(--radius); font-size: 0.88rem; }

/* ── Policy cards ───────────────────────────────────────── */
.policy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.policy-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--card-shadow); padding: 20px; border-top: 4px solid var(--primary); transition: box-shadow 0.15s; cursor: pointer; }
.policy-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.15); }
.policy-card.auto   { border-top-color: #2980B9; }
.policy-card.health { border-top-color: #27AE60; }
.policy-card.home   { border-top-color: #8E44AD; }
.policy-card.life   { border-top-color: #E67E22; }
.policy-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.policy-type-icon { font-size: 2rem; }
.policy-number { font-size: 0.78rem; color: var(--text-muted); font-family: monospace; }
.policy-type-label { font-weight: 600; color: var(--primary); margin-bottom: 4px; }
.policy-detail-row { display: flex; justify-content: space-between; font-size: 0.85rem; padding: 4px 0; border-bottom: 1px solid var(--border); }
.policy-detail-row:last-child { border-bottom: none; }
.policy-detail-label { color: var(--text-muted); }
.policy-actions { margin-top: 14px; display: flex; gap: 8px; }

/* ── Claim status tracker ───────────────────────────────── */
.status-track { display: flex; align-items: center; gap: 0; margin: 16px 0; }
.status-step { flex: 1; text-align: center; position: relative; }
.status-step::before { content:''; position: absolute; top: 16px; left: 50%; right: -50%; height: 2px; background: var(--border); z-index: 0; }
.status-step:last-child::before { display: none; }
.status-dot { width: 32px; height: 32px; border-radius: 50%; background: var(--border); display: flex; align-items: center; justify-content: center; margin: 0 auto 6px; font-size: 0.8rem; position: relative; z-index: 1; }
.status-step.done .status-dot { background: var(--accent); color: #fff; }
.status-step.active .status-dot { background: var(--primary); color: #fff; box-shadow: 0 0 0 3px rgba(27,79,114,0.25); }
.status-step.rejected .status-dot { background: var(--error); color: #fff; }
.status-step span { font-size: 0.72rem; color: var(--text-muted); display: block; }
.status-step.done span, .status-step.active span { color: var(--text); font-weight: 500; }

/* ── Modals ─────────────────────────────────────────────── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 200; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal { background: var(--white); border-radius: 12px; width: 100%; max-width: 600px; max-height: 90vh; overflow-y: auto; box-shadow: 0 8px 32px rgba(0,0,0,0.2); }
.modal-header { padding: 20px 24px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 1.1rem; font-weight: 600; color: var(--primary); }
.modal-close { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--text-muted); line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ── Login page ─────────────────────────────────────────── */
.login-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--primary) 0%, #2E86C1 100%); padding: 24px; }
.login-box { background: var(--white); border-radius: 14px; padding: 40px; width: 100%; max-width: 420px; box-shadow: 0 12px 40px rgba(0,0,0,0.2); }
.login-logo { text-align: center; font-size: 3rem; margin-bottom: 6px; }
.login-brand { text-align: center; font-size: 1.5rem; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.login-tagline { text-align: center; color: var(--text-muted); font-size: 0.88rem; margin-bottom: 28px; }
.demo-box { background: var(--info-bg); border: 1px solid var(--info); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 24px; font-size: 0.82rem; color: var(--info); }
.demo-box strong { display: block; margin-bottom: 6px; color: var(--primary); }

/* ── Profile avatar ─────────────────────────────────────── */
.profile-header { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }
.profile-avatar { width: 72px; height: 72px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; font-weight: 700; flex-shrink: 0; }
.profile-name { font-size: 1.4rem; font-weight: 700; color: var(--primary); }
.profile-role { font-size: 0.85rem; color: var(--text-muted); }

/* ── Empty state ─────────────────────────────────────────── */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state p { font-size: 1rem; }

/* ── Quick action cards on dashboard ───────────────────── */
.quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.quick-action-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--card-shadow); padding: 20px; text-align: center; cursor: pointer; transition: all 0.15s; text-decoration: none; color: var(--text); display: block; }
.quick-action-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.15); transform: translateY(-2px); color: var(--primary); }
.quick-action-card .qa-icon { font-size: 2.2rem; margin-bottom: 8px; }
.quick-action-card .qa-label { font-weight: 600; font-size: 0.9rem; color: var(--primary); }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .page-wrapper { padding: 20px 16px; }
  .form-row { grid-template-columns: 1fr; }
  #main-navbar { padding: 0 16px; }
  #navbar-links li a { padding: 6px 8px; font-size: 0.8rem; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Utility ─────────────────────────────────────────────── */
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.flex { display: flex; } .flex-wrap { flex-wrap: wrap; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
