/* ============================================================
   MVC DIGITAL PLATFORM — Stylesheet
   Malaysian Veterinary Council branding: navy + crimson
   ============================================================ */
:root {
  --navy: #13294b;
  --navy-2: #0d1f3a;
  --navy-3: #1d3a66;
  --red: #c8102e;
  --red-dark: #a00d25;
  --red-soft: #fdecef;
  --green: #1a7f5a;
  --green-soft: #e6f4ee;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --gold: #f0a500;
  --bg: #f4f6fa;
  --card: #ffffff;
  --line: #e2e8f0;
  --text: #1e293b;
  --muted: #64748b;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 4px 14px rgba(15, 23, 42, .05);
  --shadow-lg: 0 8px 30px rgba(15, 23, 42, .12);
  --font: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15.5px; line-height: 1.6; }
img { max-width: 100%; }
a { color: var(--navy-3); text-decoration: none; }
a:hover { color: var(--red); }
h1, h2, h3, h4 { line-height: 1.25; color: var(--navy); font-weight: 700; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---------------- public top bar + nav ---------------- */
.topbar { background: var(--navy-2); color: #cbd5e1; font-size: 13px; padding: 7px 0; }
.topbar .container { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.topbar a { color: #e2e8f0; }
.topbar a:hover { color: #fff; }

.site-header { background: var(--navy); position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 12px rgba(0,0,0,.25); }
.site-header .container { display: flex; align-items: center; gap: 28px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; font-weight: 800; }
.brand:hover { color: #fff; }
.brand img, .brand svg { height: 44px; width: auto; }
.brand .brand-text small { display: block; font-size: 10.5px; font-weight: 600; color: #94a3b8; letter-spacing: .06em; text-transform: uppercase; }
.brand .brand-text span { font-size: 17px; letter-spacing: .01em; }

.main-nav { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.main-nav a { color: #dbe4f0; font-weight: 600; font-size: 14px; padding: 10px 13px; border-radius: 8px; }
.main-nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.main-nav a.active { color: #fff; background: rgba(200,16,46,.35); }
.main-nav .btn { margin-left: 8px; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid rgba(255,255,255,.3); color: #fff; font-size: 20px; padding: 6px 12px; border-radius: 8px; cursor: pointer; }

/* ---------------- buttons ---------------- */
.btn { display: inline-block; background: var(--red); color: #fff; font-weight: 700; font-size: 14px; padding: 10px 20px; border-radius: 9px; border: 0; cursor: pointer; transition: .15s; font-family: var(--font); }
.btn:hover { background: var(--red-dark); color: #fff; transform: translateY(-1px); }
.btn-outline { background: transparent; border: 1.5px solid rgba(255,255,255,.55); color: #fff; }
.btn-outline:hover { background: rgba(255,255,255,.12); }
.btn-navy { background: var(--navy); }
.btn-navy:hover { background: var(--navy-3); }
.btn-light { background: #eef2f7; color: var(--navy); }
.btn-light:hover { background: #e2e8f0; color: var(--navy); transform: none; }
.btn-green { background: var(--green); }
.btn-green:hover { background: #14684a; }
.btn-sm { padding: 6px 13px; font-size: 13px; }
.btn-block { display: block; width: 100%; text-align: center; }

/* ---------------- hero ---------------- */
.hero { background: linear-gradient(135deg, var(--navy-2) 0%, var(--navy) 55%, #224270 100%); color: #fff; padding: 72px 0 84px; position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; right: -120px; top: -120px; width: 460px; height: 460px; border-radius: 50%; background: radial-gradient(circle, rgba(200,16,46,.28), transparent 65%); }
.hero .container { position: relative; z-index: 1; display: grid; grid-template-columns: 1.2fr .8fr; gap: 48px; align-items: center; }
.hero h1 { color: #fff; font-size: 42px; font-weight: 800; letter-spacing: -.01em; margin-bottom: 16px; }
.hero h1 em { font-style: normal; color: #ff9eae; }
.hero p.lead { color: #c7d2e4; font-size: 17px; max-width: 540px; margin-bottom: 28px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-kicker { display: inline-block; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); padding: 6px 14px; border-radius: 99px; font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #ffd9de; margin-bottom: 20px; }

/* quick verify panel in hero */
.verify-panel { background: #fff; border-radius: 16px; padding: 26px; color: var(--text); box-shadow: var(--shadow-lg); }
.verify-panel h3 { font-size: 17px; margin-bottom: 6px; }
.verify-panel p { font-size: 13.5px; color: var(--muted); margin-bottom: 14px; }
.verify-panel form { display: flex; gap: 8px; }
.verify-panel input { flex: 1; }

/* ---------------- stats strip ---------------- */
.stats-strip { background: #fff; border-bottom: 1px solid var(--line); }
.stats-strip .container { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 22px 10px; text-align: center; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; }
.stat b { display: block; font-size: 28px; color: var(--navy); font-weight: 800; }
.stat span { font-size: 13px; color: var(--muted); font-weight: 600; }

/* ---------------- sections / cards ---------------- */
.section { padding: 56px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.section-head h1, .section-head h2 { font-size: 27px; }
.section-head p { color: var(--muted); margin-top: 4px; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-body { padding: 22px; }
.card h3 { font-size: 16.5px; margin-bottom: 8px; }
.card p { font-size: 14px; color: var(--muted); }
.feature-card { padding: 26px 24px; transition: .18s; }
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #cbd5e1; }
.feature-card .icon { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 14px; background: var(--red-soft); }
.feature-card.alt .icon { background: var(--green-soft); }
.feature-card.alt2 .icon { background: #e7edf7; }

/* ---------------- forms ---------------- */
label { display: block; font-weight: 600; font-size: 13.5px; margin: 14px 0 5px; color: var(--navy); }
input, select, textarea {
  width: 100%; padding: 10px 13px; border: 1.5px solid #d7dee9; border-radius: 9px;
  font-family: var(--font); font-size: 14.5px; background: #fff; color: var(--text); transition: border .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy-3); box-shadow: 0 0 0 3px rgba(29,58,102,.12); }
textarea { min-height: 120px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.req { color: var(--red); }

/* ---------------- alerts / badges ---------------- */
.alert { padding: 12px 16px; border-radius: 10px; font-size: 14px; font-weight: 600; margin: 14px 0; border: 1px solid transparent; }
.alert-success { background: var(--green-soft); color: var(--green); border-color: #bfe3d3; }
.alert-danger { background: var(--red-soft); color: var(--red-dark); border-color: #f6c6cf; }
.alert-warning { background: var(--amber-soft); color: var(--amber); border-color: #fde08a; }
.alert-info { background: #e7edf7; color: var(--navy-3); border-color: #c9d6ea; }

.badge { display: inline-block; padding: 3px 11px; border-radius: 99px; font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.badge-success { background: var(--green-soft); color: var(--green); }
.badge-danger { background: var(--red-soft); color: var(--red-dark); }
.badge-warning { background: var(--amber-soft); color: var(--amber); }
.badge-info { background: #e7edf7; color: var(--navy-3); }
.badge-muted { background: #eef1f6; color: var(--muted); }

/* ---------------- tables ---------------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; background: #fff; font-size: 14px; }
table.data th { text-align: left; background: #f1f4f9; color: var(--navy); font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; padding: 11px 14px; border-bottom: 2px solid var(--line); white-space: nowrap; }
table.data td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:hover td { background: #f8fafc; }
table.data .num { text-align: right; }

/* ---------------- pagination ---------------- */
.pagination { display: flex; gap: 6px; margin: 22px 0; flex-wrap: wrap; }
.page-link { padding: 7px 13px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-weight: 600; font-size: 13.5px; }
.page-link.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.page-dots { padding: 7px 4px; color: var(--muted); }

/* ---------------- footer ---------------- */
.site-footer { background: var(--navy-2); color: #9fb0c8; margin-top: 64px; font-size: 14px; }
.site-footer .footer-main { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 36px; padding: 48px 0 40px; }
.site-footer h4 { color: #fff; font-size: 14.5px; margin-bottom: 14px; letter-spacing: .03em; }
.site-footer a { color: #b9c7da; display: block; padding: 3.5px 0; }
.site-footer a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.09); padding: 16px 0; font-size: 13px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* ---------------- auth pages ---------------- */
.auth-wrap { min-height: calc(100vh - 72px); display: flex; align-items: center; justify-content: center; padding: 48px 20px; background: linear-gradient(160deg, var(--bg) 60%, #e7edf7); }
.auth-card { width: 100%; max-width: 440px; background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); padding: 38px 36px; }
.auth-card .auth-logo { text-align: center; margin-bottom: 18px; }
.auth-card h1 { font-size: 22px; text-align: center; margin-bottom: 4px; }
.auth-card .sub { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 10px; }

/* ============================================================
   PORTAL (member + admin) layout
   ============================================================ */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 256px; background: var(--navy-2); color: #c2cede; flex-shrink: 0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { padding: 20px 20px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar nav { padding: 14px 12px; flex: 1; }
.sidebar nav .nav-label { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #6e82a0; padding: 14px 12px 6px; }
.sidebar nav a { display: flex; align-items: center; gap: 11px; color: #c2cede; font-weight: 600; font-size: 14px; padding: 10px 12px; border-radius: 9px; margin-bottom: 2px; }
.sidebar nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar nav a.active { background: var(--red); color: #fff; }
.sidebar nav a .ico { width: 20px; text-align: center; font-size: 16px; }
.sidebar .sidebar-foot { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12.5px; color: #6e82a0; }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-topbar { background: #fff; border-bottom: 1px solid var(--line); padding: 0 28px; min-height: 64px; display: flex; align-items: center; gap: 18px; position: sticky; top: 0; z-index: 50; }
.app-topbar h1 { font-size: 19px; }
.app-topbar .top-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.bell { position: relative; font-size: 20px; color: var(--navy); }
.bell .dot { position: absolute; top: -6px; right: -9px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 800; min-width: 17px; height: 17px; border-radius: 99px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.userchip { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 700; color: var(--navy); }
.userchip .avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; }
.userchip small { display: block; color: var(--muted); font-weight: 600; font-size: 11.5px; }

.app-content { padding: 28px; max-width: 1280px; width: 100%; }
.page-title { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.page-title h2 { font-size: 24px; }
.page-title p { color: var(--muted); font-size: 14px; }

/* stat tiles */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 26px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.tile .t-label { font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.tile .t-value { font-size: 28px; font-weight: 800; color: var(--navy); margin: 4px 0 2px; }
.tile .t-sub { font-size: 12.5px; color: var(--muted); }
.tile.t-red { border-top: 3px solid var(--red); }
.tile.t-green { border-top: 3px solid var(--green); }
.tile.t-navy { border-top: 3px solid var(--navy-3); }
.tile.t-gold { border-top: 3px solid var(--gold); }

/* progress (CPD) */
.progress { background: #e9eef5; border-radius: 99px; height: 12px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--green), #27ae7b); border-radius: 99px; }
.progress.warn > span { background: linear-gradient(90deg, var(--gold), #f5b833); }

/* ---------------- digital membership card ---------------- */
.mcard { width: 100%; max-width: 540px; aspect-ratio: 1.62; background: linear-gradient(125deg, #0d1f3a 0%, #13294b 50%, #1d3a66 100%); border-radius: 20px; color: #fff; padding: 26px 30px; position: relative; overflow: hidden; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.mcard::before { content: ''; position: absolute; right: -80px; bottom: -110px; width: 300px; height: 300px; border-radius: 50%; background: radial-gradient(circle, rgba(200,16,46,.4), transparent 65%); }
.mcard::after { content: ''; position: absolute; left: -60px; top: -80px; width: 220px; height: 220px; border-radius: 50%; border: 38px solid rgba(255,255,255,.045); }
.mcard .mc-head { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.mcard .mc-head img, .mcard .mc-head svg { height: 38px; }
.mcard .mc-head .mc-org { font-size: 13px; font-weight: 800; letter-spacing: .04em; line-height: 1.3; }
.mcard .mc-head .mc-org small { display: block; font-weight: 600; font-size: 10px; color: #9db1cc; letter-spacing: .12em; text-transform: uppercase; }
.mcard .mc-body { display: flex; justify-content: space-between; align-items: flex-end; margin-top: auto; position: relative; z-index: 1; gap: 16px; }
.mcard .mc-field { margin-top: 10px; }
.mcard .mc-field small { display: block; font-size: 9.5px; font-weight: 700; color: #8fa3b855; color: #8aa3c5; letter-spacing: .14em; text-transform: uppercase; }
.mcard .mc-field b { font-size: 15.5px; font-weight: 700; letter-spacing: .02em; }
.mcard .mc-name { font-size: 19px; font-weight: 800; margin-top: 14px; }
.mcard .mc-qr { background: #fff; padding: 9px; border-radius: 12px; flex-shrink: 0; }
.mcard .mc-qr img, .mcard .mc-qr canvas { display: block; width: 104px !important; height: 104px !important; }
.mc-status-active { color: #6ee7b7 !important; }
.mc-status-bad { color: #fda4af !important; }

/* verification result */
.verify-result { max-width: 620px; margin: 0 auto; }
.verify-result .v-icon { font-size: 56px; text-align: center; margin-bottom: 8px; }

/* timeline (complaints) */
.timeline { list-style: none; margin: 18px 0; position: relative; padding-left: 26px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 18px 14px; }
.timeline li::before { content: ''; position: absolute; left: -23px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--navy-3); border: 2.5px solid #fff; box-shadow: 0 0 0 2px var(--line); }
.timeline li .tl-meta { font-size: 12.5px; color: var(--muted); font-weight: 600; }

/* misc */
.muted { color: var(--muted); }
.mt-0{margin-top:0}.mt-1{margin-top:8px}.mt-2{margin-top:16px}.mt-3{margin-top:24px}.mt-4{margin-top:36px}
.mb-1{margin-bottom:8px}.mb-2{margin-bottom:16px}.mb-3{margin-bottom:24px}
.flex { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.text-center { text-align: center; }
.w-auto { width: auto; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 18px; }
.filters label { margin: 0 0 4px; }
.filters > div { min-width: 160px; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .e-ico { font-size: 42px; margin-bottom: 10px; }

/* receipt / invoice / certificate print documents */
.doc { background: #fff; max-width: 780px; margin: 0 auto; padding: 44px 48px; border: 1px solid var(--line); border-radius: var(--radius); }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; border-bottom: 3px solid var(--navy); padding-bottom: 18px; margin-bottom: 24px; }
.doc-head .doc-org b { font-size: 17px; color: var(--navy); display: block; }
.doc-head .doc-org small { color: var(--muted); white-space: pre-line; font-size: 12.5px; }
.doc h1.doc-type { font-size: 26px; letter-spacing: .06em; color: var(--navy); text-align: right; }
.cert { text-align: center; border: 10px double var(--navy); padding: 56px 48px; }
.cert .cert-org { font-size: 14px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.cert h1 { font-size: 34px; margin: 18px 0 6px; color: var(--navy); }
.cert .cert-name { font-size: 28px; color: var(--red); font-weight: 800; margin: 18px 0 6px; }

@media print {
  body { background: #fff; }
  .site-header, .topbar, .site-footer, .sidebar, .app-topbar, .no-print, .alert { display: none !important; }
  .app-content { padding: 0; max-width: none; }
  .doc, .card { border: 0; box-shadow: none; }
  .mcard { box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------------- responsive ---------------- */
@media (max-width: 1024px) {
  .hero .container { grid-template-columns: 1fr; gap: 32px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .site-footer .footer-main { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--navy-2); flex-direction: column; align-items: stretch; padding: 12px 16px 18px; gap: 4px; box-shadow: 0 14px 24px rgba(0,0,0,.25); }
  .main-nav.open { display: flex; }
  .sidebar { position: fixed; left: -270px; z-index: 200; transition: left .22s; height: 100vh; }
  .sidebar.open { left: 0; box-shadow: 0 0 0 100vmax rgba(13,31,58,.45); }
  .app-topbar { padding: 0 16px; }
  .menu-btn { display: inline-flex !important; }
  .app-content { padding: 18px 14px; }
}
.menu-btn { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; font-size: 19px; padding: 5px 11px; cursor: pointer; color: var(--navy); }
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .hero h1 { font-size: 30px; }
  .stats-strip .container { grid-template-columns: repeat(2, 1fr); }
  .stat { border-left: 0; }
  .tiles { grid-template-columns: 1fr; }
  .site-footer .footer-main { grid-template-columns: 1fr; }
  .doc { padding: 26px 20px; }
  .userchip .uc-text { display: none; }
  .app-topbar { gap: 10px; }
  .app-topbar h1 { font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .app-topbar .top-right { gap: 10px; }
  .app-topbar .top-right .btn { padding: 5px 10px; font-size: 12px; }
  .userchip .avatar { width: 32px; height: 32px; font-size: 13px; }
  .app-main { max-width: 100vw; overflow-x: hidden; }
}
