/* ── Variables ──────────────────────────────────────────────────────────────── */
:root {
  --primary:       #0d3b6e;
  --primary-light: #1a5599;
  --accent:        #f5a623;
  --accent-dark:   #d9901d;
  --text:          #1e1e1e;
  --text-light:    #5f6b7c;
  --bg:            #f5f7fa;
  --white:         #ffffff;
  --border:        #dde1e7;
  --radius:        6px;
  --shadow:        0 1px 4px rgba(0,0,0,.08), 0 2px 12px rgba(0,0,0,.06);
  --shadow-lg:     0 4px 24px rgba(0,0,0,.12);
  --success-bg:    #eafaf1; --success-fg: #155724; --success-bd: #28a745;
  --error-bg:      #fdedec; --error-fg:   #721c24; --error-bd:   #dc3545;
  --info-bg:       #e8f4fd; --info-fg:    #0c5460; --info-bd:    #17a2b8;
  --warning-bg:    #fff8e6; --warning-fg: #664d03; --warning-bd: #ffc107;
  --trans: .18s ease;
}

/* ── Reset ──────────────────────────────────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text); background: var(--bg); line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-light); }
img { max-width: 100%; }
ul { list-style: none; }

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 22px; border-radius: var(--radius);
  border: 2px solid transparent; cursor: pointer;
  font-size: 15px; font-weight: 600; line-height: 1.2;
  text-decoration: none; transition: var(--trans);
  white-space: nowrap; font-family: inherit;
}
.btn-primary { background: var(--primary);  color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-light); border-color: var(--primary-light); color: #fff; }
.btn-accent  { background: var(--accent);   color: var(--primary); border-color: var(--accent); }
.btn-accent:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-ghost-white { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.btn-ghost-white:hover { background: rgba(255,255,255,.12); color: #fff; border-color: #fff; }
.btn-ghost-sm {
  background: transparent; color: rgba(255,255,255,.8);
  border: 1px solid rgba(255,255,255,.4); border-radius: var(--radius);
  padding: 5px 12px; font-size: 13px; font-weight: 500; cursor: pointer;
  font-family: inherit; transition: var(--trans); text-decoration: none;
}
.btn-ghost-sm:hover { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.7); }
.btn-danger { background: #dc3545; color: #fff; border-color: #dc3545; }
.btn-danger:hover { background: #b02a37; border-color: #b02a37; color: #fff; }
.btn-sm  { padding: 6px 14px; font-size: 13px; }
.btn-lg  { padding: 14px 30px; font-size: 17px; }
.btn-block { width: 100%; justify-content: center; }

/* ── Alerts ─────────────────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: var(--radius);
  border-left: 4px solid; margin-bottom: 18px; font-size: 14px;
}
.alert-success { background: var(--success-bg); color: var(--success-fg); border-color: var(--success-bd); }
.alert-error   { background: var(--error-bg);   color: var(--error-fg);   border-color: var(--error-bd); }
.alert-info    { background: var(--info-bg);     color: var(--info-fg);    border-color: var(--info-bd); }
.alert-warning { background: var(--warning-bg);  color: var(--warning-fg); border-color: var(--warning-bd); }

/* ── Forms ──────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text); margin-bottom: 6px;
}
.form-control {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 15px; color: var(--text); background: var(--white);
  transition: border-color var(--trans), box-shadow var(--trans);
  font-family: inherit;
}
.form-control:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13,59,110,.1);
}
.form-control::placeholder { color: #b0b8c4; }
textarea.form-control { resize: vertical; min-height: 110px; }
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%235f6b7c' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 36px; cursor: pointer;
}
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint  { font-size: 12px; color: var(--text-light); margin-top: 5px; }
.form-error { font-size: 12px; color: var(--error-fg);   margin-top: 5px; }

/* ── Marketing header ───────────────────────────────────────────────────────── */
.site-header {
  background: var(--primary); position: sticky; top: 0; z-index: 200;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.site-header-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between; height: 68px;
}
.site-logo {
  font-size: 20px; font-weight: 800; color: #fff;
  letter-spacing: -.3px; text-decoration: none;
}
.site-logo span { color: var(--accent); }
.site-nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
  color: rgba(255,255,255,.82); font-size: 14px; font-weight: 500;
  padding: 6px 12px; border-radius: 4px; transition: var(--trans);
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,.1); }
.nav-sep { width: 1px; height: 22px; background: rgba(255,255,255,.22); margin: 0 6px; }
.flash-container { max-width: 1200px; margin: 20px auto; padding: 0 28px; }

/* ── Hero ───────────────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(140deg, #0a2f58 0%, var(--primary) 55%, #1a5599 100%);
  color: #fff; padding: 100px 28px; text-align: center;
}
.hero-icon { font-size: 64px; display: block; margin-bottom: 20px; filter: drop-shadow(0 0 20px rgba(245,166,35,.4)); }
.hero h1 { font-size: clamp(32px, 5vw, 58px); font-weight: 800; line-height: 1.12; margin-bottom: 20px; }
.hero h1 em { color: var(--accent); font-style: normal; }
.hero p { font-size: 19px; opacity: .88; max-width: 580px; margin: 0 auto 38px; }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ── Sections ───────────────────────────────────────────────────────────────── */
.section       { padding: 80px 28px; }
.section-white { background: var(--white); }
.section-dark  { background: var(--primary); color: #fff; }
.container     { max-width: 1200px; margin: 0 auto; }
.section-hd    { text-align: center; margin-bottom: 52px; }
.section-hd h2 { font-size: 36px; font-weight: 700; color: var(--primary); margin-bottom: 12px; }
.section-hd h2 em { color: var(--accent); font-style: normal; }
.section-hd p  { font-size: 17px; color: var(--text-light); }
.section-dark .section-hd h2 { color: #fff; }
.section-dark .section-hd p  { color: rgba(255,255,255,.75); }

/* ── Services grid ──────────────────────────────────────────────────────────── */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 24px; }
.service-card {
  background: var(--white); border-radius: 10px; padding: 32px 24px;
  text-align: center; box-shadow: var(--shadow);
  border-top: 4px solid transparent; transition: transform var(--trans), box-shadow var(--trans), border-color var(--trans);
}
.service-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-top-color: var(--accent); }
.service-icon { font-size: 48px; display: block; margin-bottom: 16px; }
.service-card h3 { font-size: 19px; font-weight: 700; color: var(--primary); margin-bottom: 10px; }
.service-card p  { color: var(--text-light); font-size: 15px; line-height: 1.65; }

/* ── About ──────────────────────────────────────────────────────────────────── */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.about-text h2 { font-size: 36px; font-weight: 700; color: var(--primary); margin-bottom: 16px; }
.about-text h2 em { color: var(--accent); font-style: normal; }
.about-text p  { color: var(--text-light); font-size: 16px; margin-bottom: 16px; line-height: 1.8; }
.about-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 32px; }
.stat-box { background: var(--bg); border-radius: 8px; padding: 20px; text-align: center; }
.stat-num  { font-size: 38px; font-weight: 800; color: var(--primary); display: block; }
.stat-lbl  { font-size: 13px; color: var(--text-light); }
.about-visual {
  background: linear-gradient(135deg, var(--primary), #1a5599);
  border-radius: 14px; height: 380px;
  display: flex; align-items: center; justify-content: center; font-size: 110px;
}

/* ── Contact / CTA section ──────────────────────────────────────────────────── */
.contact-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px,1fr)); gap: 20px; }
.contact-card {
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18);
  border-radius: 10px; padding: 28px 20px; text-align: center;
}
.contact-card .cc-icon { font-size: 36px; display: block; margin-bottom: 12px; }
.contact-card h4 { font-size: 16px; font-weight: 700; color: #fff; margin-bottom: 6px; }
.contact-card p  { font-size: 15px; color: rgba(255,255,255,.82); }
.contact-card a  { color: var(--accent); }
.cta-portal {
  margin-top: 48px; text-align: center; padding: 36px;
  background: rgba(255,255,255,.08); border-radius: 12px;
  border: 1px solid rgba(255,255,255,.15);
}
.cta-portal h3 { font-size: 22px; font-weight: 700; color: #fff; margin-bottom: 10px; }
.cta-portal p  { color: rgba(255,255,255,.82); margin-bottom: 24px; font-size: 16px; }
.cta-portal .btn-cta-pair { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ── Footer ─────────────────────────────────────────────────────────────────── */
.site-footer {
  background: #081e3a; color: rgba(255,255,255,.55);
  padding: 28px; text-align: center; font-size: 14px;
}
.site-footer a { color: var(--accent); }
.footer-inner { max-width: 1200px; margin: 0 auto; }
.footer-inner p + p { margin-top: 4px; }

/* ── Auth pages ─────────────────────────────────────────────────────────────── */
.auth-wrap {
  min-height: calc(100vh - 68px - 70px);
  display: flex; align-items: center; justify-content: center; padding: 48px 24px;
}
.auth-card {
  background: var(--white); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 44px 40px;
  width: 100%; max-width: 520px;
}
.auth-card h1     { font-size: 26px; font-weight: 700; color: var(--primary); margin-bottom: 6px; }
.auth-subtitle    { color: var(--text-light); font-size: 15px; margin-bottom: 28px; }
.auth-footer-link { text-align: center; margin-top: 20px; font-size: 14px; color: var(--text-light); }

/* ── Portal header ──────────────────────────────────────────────────────────── */
.portal-header {
  background: var(--primary); height: 58px;
  display: flex; align-items: center;
  position: sticky; top: 0; z-index: 200;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.portal-inner {
  width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 28px;
  display: flex; align-items: center; gap: 24px;
}
.portal-logo {
  font-size: 18px; font-weight: 800; color: #fff;
  text-decoration: none; white-space: nowrap; flex-shrink: 0;
}
.portal-logo span { color: var(--accent); }
.portal-nav { display: flex; align-items: center; gap: 2px; flex: 1; }
.portal-nav a {
  color: rgba(255,255,255,.78); font-size: 14px; font-weight: 500;
  padding: 6px 14px; border-radius: 4px; transition: var(--trans);
  text-decoration: none;
}
.portal-nav a:hover, .portal-nav a.active {
  background: rgba(255,255,255,.15); color: #fff;
}
.portal-user-bar  { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.portal-user-info { display: flex; flex-direction: column; align-items: flex-end; }
.portal-user-name { font-size: 13px; font-weight: 600; color: #fff; line-height: 1.2; }
.portal-user-company { font-size: 11px; color: rgba(255,255,255,.6); }
.flash-wrap { background: var(--white); border-bottom: 1px solid var(--border); padding: 12px 28px; }
.flash-wrap .alert { margin: 0; max-width: 1200px; margin: 0 auto; }

/* ── Portal content ─────────────────────────────────────────────────────────── */
.portal-content { max-width: 1200px; margin: 0 auto; padding: 32px 28px; }
.page-hd {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 28px; flex-wrap: wrap;
}
.page-hd h1      { font-size: 24px; font-weight: 700; color: var(--primary); }
.page-hd-sub     { font-size: 13px; color: var(--text-light); margin-top: 3px; }

/* ── Stats row ──────────────────────────────────────────────────────────────── */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 14px; margin-bottom: 28px; }
.stat-card {
  background: var(--white); border-radius: 8px; padding: 20px 22px;
  box-shadow: var(--shadow); border-left: 4px solid;
}
.stat-card.open       { border-color: #17a2b8; }
.stat-card.in-progress{ border-color: #ffc107; }
.stat-card.completed  { border-color: #28a745; }
.stat-card.cancelled  { border-color: #adb5bd; }
.sc-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-light); margin-bottom: 6px; }
.sc-value { font-size: 34px; font-weight: 800; color: var(--primary); line-height: 1; }

/* ── Card ───────────────────────────────────────────────────────────────────── */
.card { background: var(--white); border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; }
.card-header {
  padding: 16px 22px; display: flex; align-items: center;
  justify-content: space-between; border-bottom: 1px solid var(--border);
}
.card-header h2 { font-size: 16px; font-weight: 600; color: var(--primary); }
.card-body { padding: 22px; }

/* ── Table ──────────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  padding: 11px 16px; text-align: left; font-size: 11px;
  font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-light); background: var(--bg); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 13px 16px; font-size: 14px; border-bottom: 1px solid var(--border);
  color: var(--text); vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td      { background: #f9fafb; }
.data-table a { color: var(--primary); font-weight: 500; }
.data-table a:hover { text-decoration: underline; }

/* ── Badges ─────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 12px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge-open        { background: #cff4fc; color: #055160; }
.badge-in-progress { background: #fff3cd; color: #664d03; }
.badge-completed   { background: #d1e7dd; color: #0a3622; }
.badge-cancelled   { background: #e9ecef; color: #495057; }
.badge-Low         { background: #d1e7dd; color: #0a3622; }
.badge-Normal      { background: #cff4fc; color: #055160; }
.badge-High        { background: #fff3cd; color: #664d03; }
.badge-Urgent      { background: #f8d7da; color: #58151c; }

/* ── Job detail ─────────────────────────────────────────────────────────────── */
.job-grid    { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.job-main    { display: flex; flex-direction: column; gap: 20px; }
.job-sidebar { display: flex; flex-direction: column; gap: 16px; }
.detail-block { margin-bottom: 20px; }
.detail-block:last-child { margin-bottom: 0; }
.detail-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-light); margin-bottom: 6px; }
.detail-value { font-size: 15px; color: var(--text); line-height: 1.65; white-space: pre-wrap; }
.detail-meta  { display: flex; flex-wrap: wrap; gap: 20px; font-size: 13px; color: var(--text-light); }
.detail-meta strong { color: var(--text); }

/* ── Sidebar info list ──────────────────────────────────────────────────────── */
.info-list { font-size: 14px; }
.info-list dt { font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-light); margin-bottom: 3px; }
.info-list dd { margin-bottom: 14px; }

/* ── Empty state ────────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 64px 24px; color: var(--text-light); }
.empty-state .es-icon { font-size: 56px; display: block; margin-bottom: 14px; opacity: .3; }
.empty-state h3 { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.empty-state p  { margin-bottom: 22px; font-size: 15px; }

/* ── Filter pills ───────────────────────────────────────────────────────────── */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-pill {
  padding: 5px 14px; border-radius: 20px; font-size: 13px; font-weight: 500;
  border: 1px solid var(--border); background: var(--white);
  color: var(--text-light); text-decoration: none; transition: var(--trans);
}
.filter-pill:hover, .filter-pill.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
}

/* ── Status update form ─────────────────────────────────────────────────────── */
.status-form { display: flex; flex-direction: column; gap: 12px; }
.status-form select,
.status-form textarea { font-size: 14px; }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-visual { display: none; }
  .job-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .form-row    { grid-template-columns: 1fr; }
  .hero        { padding: 64px 20px; }
  .section     { padding: 56px 20px; }
  .section-hd h2 { font-size: 28px; }
  .nav-link    { display: none; }
  .portal-user-info { display: none; }
  .stats-row   { grid-template-columns: 1fr 1fr; }
  .auth-card   { padding: 32px 24px; }
}
@media (max-width: 480px) {
  .hero h1     { font-size: 28px; }
  .hero-cta    { flex-direction: column; align-items: stretch; }
  .stats-row   { grid-template-columns: 1fr; }
  .auth-card   { padding: 28px 18px; }
  .portal-nav a { padding: 6px 10px; font-size: 13px; }
}
