/* =========================================================
   SISTEM ADUAN KPPB - Tema Korporat Navy & Putih
   Koperasi Perbadanan Putrajaya Berhad
   ========================================================= */

:root {
  --navy-900: #081B38;
  --navy-800: #0B2A5B;
  --navy-700: #143C7A;
  --navy-600: #1E4E9C;
  --navy-100: #DCE6F5;
  --navy-50:  #F0F4FA;
  --gold:     #C9A227;
  --ink:      #1E293B;
  --muted:    #64748B;
  --bg:       #F4F7FB;
  --card:     #FFFFFF;
  --line:     #E2E8F0;
  --red:      #DC2626;
  --green:    #16A34A;
  --amber:    #D97706;
  --blue:     #2563EB;
  --shadow:   0 4px 16px rgba(11, 42, 91, .08);
  --shadow-lg: 0 12px 32px rgba(11, 42, 91, .14);
  --radius:   12px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; display: block; }
a { color: var(--navy-600); text-decoration: none; }
a:hover { color: var(--navy-800); }

.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.page { flex: 1; padding: 28px 20px 56px; }
.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--navy-800); color: #fff;
  padding: 10px 16px; z-index: 100; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Topbar ---------- */
.topbar {
  background: linear-gradient(90deg, var(--navy-900), var(--navy-700));
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 2px 10px rgba(8, 27, 56, .35);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.brand:hover { color: #fff; }
.brand-logo { width: 40px; height: 40px; border-radius: 10px; background: rgba(255,255,255,.12); padding: 4px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 15px; letter-spacing: .3px; }
.brand-text small { font-size: 11px; opacity: .75; }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer;
  padding: 8px; border-radius: 8px;
}
.nav-toggle span { width: 24px; height: 2.5px; background: #fff; border-radius: 2px; transition: .25s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

.main-nav { display: flex; align-items: center; gap: 24px; }
.nav-links { display: flex; list-style: none; gap: 6px; }
.nav-links a {
  display: block; color: rgba(255,255,255,.82); padding: 8px 14px; border-radius: 8px;
  font-size: 14px; font-weight: 600; transition: .2s;
}
.nav-links a:hover { color: #fff; background: rgba(255,255,255,.12); }
.nav-links a.active { color: #fff; background: rgba(255,255,255,.18); box-shadow: inset 0 -2px 0 var(--gold); }
.nav-user { display: flex; align-items: center; gap: 14px; border-left: 1px solid rgba(255,255,255,.2); padding-left: 20px; }
.nav-user-info { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.nav-user-name { color: #fff; font-size: 13px; font-weight: 700; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Flash ---------- */
.flash-wrap { margin-top: 18px; display: grid; gap: 10px; }
.flash {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 16px; border-radius: 10px; font-size: 14px; font-weight: 600;
  border: 1px solid; animation: slideDown .3s ease;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.flash-success { background: #ECFDF5; color: #065F46; border-color: #A7F3D0; }
.flash-error   { background: #FEF2F2; color: #991B1B; border-color: #FECACA; }
.flash-info    { background: #EFF6FF; color: #1E40AF; border-color: #BFDBFE; }
.flash-close { background: none; border: 0; font-size: 20px; cursor: pointer; color: inherit; opacity: .6; line-height: 1; }
.flash-close:hover { opacity: 1; }

/* ---------- Butang ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 9px; font-size: 14px; font-weight: 700;
  border: 1.5px solid transparent; cursor: pointer; transition: .2s; line-height: 1.4;
  text-align: center;
}
.btn-primary { background: var(--navy-800); color: #fff; }
.btn-primary:hover { background: var(--navy-700); color: #fff; }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: #B18F1D; color: #fff; }
.btn-outline { background: #fff; color: var(--navy-800); border-color: var(--navy-800); }
.btn-outline:hover { background: var(--navy-50); }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.btn-outline-light:hover { background: rgba(255,255,255,.14); color: #fff; }
.btn-danger { background: #fff; color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #15803D; color: #fff; }
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }

/* ---------- Kad ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 24px;
}
.card-header {
  padding: 18px 22px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.card-title { font-size: 17px; color: var(--navy-800); font-weight: 800; }
.card-subtitle { font-size: 13px; color: var(--muted); margin-top: 2px; }
.card-body { padding: 22px; }
.card-footer { padding: 14px 22px; border-top: 1px solid var(--line); background: var(--navy-50); border-radius: 0 0 var(--radius) var(--radius); }

/* ---------- Grid & Statistik ---------- */
.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); }

.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 16px;
  border-top: 4px solid var(--navy-700);
}
.stat-icon {
  width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: var(--navy-50); color: var(--navy-800); flex-shrink: 0;
}
.stat-value { font-size: 26px; font-weight: 800; color: var(--navy-900); line-height: 1.1; }
.stat-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat.blue  { border-top-color: var(--blue); }  .stat.blue  .stat-icon { color: var(--blue); }
.stat.amber { border-top-color: var(--amber); } .stat.amber .stat-icon { color: var(--amber); }
.stat.green { border-top-color: var(--green); } .stat.green .stat-icon { color: var(--green); }
.stat.gold  { border-top-color: var(--gold); }  .stat.gold  .stat-icon { color: var(--gold); }

/* ---------- Jadual ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.table th {
  background: var(--navy-800); color: #fff; text-align: left; padding: 12px 14px;
  font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover { background: var(--navy-50); }
.table .num { text-align: right; }
.table-empty td { text-align: center; color: var(--muted); padding: 32px; font-style: italic; }

/* ---------- Badge ---------- */
.badge {
  display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 12px;
  font-weight: 700; white-space: nowrap;
}
.badge-blue  { background: #DBEAFE; color: #1D4ED8; }
.badge-amber { background: #FEF3C7; color: #B45309; }
.badge-green { background: #DCFCE7; color: #15803D; }
.badge-gray  { background: #F1F5F9; color: #475569; }
.badge-navy  { background: var(--navy-800); color: #fff; }
.badge-red   { background: #FEE2E2; color: #B91C1C; }

/* ---------- Borang ---------- */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13.5px; font-weight: 700; color: #334155; margin-bottom: 6px; }
.req { color: var(--red); }
.form-label .req { color: var(--red); }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 9px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--ink); outline: none; transition: .2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--navy-600); box-shadow: 0 0 0 3px rgba(30, 78, 156, .14);
}
.form-textarea { min-height: 120px; resize: vertical; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.form-error { font-size: 12.5px; color: var(--red); margin-top: 5px; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.form-check input { width: 16px; height: 16px; accent-color: var(--navy-800); }
.upload-box {
  border: 2px dashed #B7C7E0; border-radius: 10px; padding: 24px; text-align: center;
  background: var(--navy-50); cursor: pointer; transition: .2s;
}
.upload-box:hover { border-color: var(--navy-600); background: var(--navy-100); }
.upload-box p { font-size: 13.5px; color: var(--muted); margin-top: 6px; }

/* ---------- Senarai gambar (preview) ---------- */
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; margin-top: 14px; }
.img-thumb {
  position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--line);
  aspect-ratio: 1/1; background: var(--navy-50);
}
.img-thumb img { width: 100%; height: 100%; object-fit: cover; }
.img-thumb .remove-img {
  position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(8, 27, 56, .75); color: #fff; border: 0; cursor: pointer; font-size: 15px; line-height: 1;
}
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.gallery a { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.gallery img { aspect-ratio: 1/1; object-fit: cover; width: 100%; transition: transform .3s; }
.gallery a:hover img { transform: scale(1.05); }

/* ---------- Timeline balasan ---------- */
.timeline { position: relative; padding-left: 34px; }
.timeline::before {
  content: ''; position: absolute; left: 13px; top: 8px; bottom: 8px; width: 2px; background: var(--navy-100);
}
.timeline-item { position: relative; margin-bottom: 22px; }
.timeline-dot {
  position: absolute; left: -34px; top: 4px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--navy-800); color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--navy-100);
}
.timeline-dot.awam { background: #fff; color: var(--navy-800); border: 2px solid var(--navy-800); }
.timeline-item .who { font-size: 13.5px; font-weight: 700; color: var(--navy-800); }
.timeline-item .when { font-size: 12px; color: var(--muted); margin: 2px 0 6px; }
.timeline-item .msg {
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px;
  font-size: 14px; white-space: pre-wrap;
}
.timeline-item .msg.staff { background: var(--navy-50); border-color: var(--navy-100); }
.timeline-item .msg.meta {
  background: #FFFDF5; border-color: #F2E8C2; color: #7A6117; font-size: 13px;
}

/* ---------- Senarai aduan / ringkas ---------- */
.aduan-item {
  display: flex; gap: 16px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; margin-bottom: 12px; transition: .2s;
}
.aduan-item:hover { box-shadow: var(--shadow); border-color: var(--navy-100); }
.aduan-item .grow { flex: 1; min-width: 0; }
.aduan-item .ref { font-size: 12.5px; font-weight: 800; color: var(--navy-600); letter-spacing: .3px; }
.aduan-item .tajuk { font-size: 15px; font-weight: 700; color: var(--ink); margin: 2px 0 4px; }
.aduan-item .meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- Kosong / Empty ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty svg { margin: 0 auto 14px; opacity: .5; }
.empty h3 { color: var(--navy-800); margin-bottom: 6px; }

/* ---------- Penapis & cari ---------- */
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.filters .form-group { margin-bottom: 0; }
.filters .form-select, .filters .form-input { min-width: 180px; }

/* ---------- Bar chart (CSS) ---------- */
.chart-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.chart-label { width: 180px; font-size: 13px; color: #334155; font-weight: 600; text-align: right; flex-shrink: 0; }
.chart-track { flex: 1; background: var(--navy-50); border-radius: 999px; height: 22px; overflow: hidden; }
.chart-fill { height: 100%; background: linear-gradient(90deg, var(--navy-700), var(--navy-600)); border-radius: 999px; transition: width .6s; min-width: 0; }
.chart-num { width: 44px; font-size: 13px; font-weight: 800; color: var(--navy-900); }

/* ---------- Halaman log masuk ---------- */
.auth-wrap { display: flex; align-items: center; justify-content: center; padding: 48px 20px; flex: 1; }
.auth-card {
  width: 100%; max-width: 430px; background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: var(--shadow-lg); border: 1px solid var(--line);
}
.auth-head { background: linear-gradient(135deg, var(--navy-900), var(--navy-700)); color: #fff; padding: 28px; text-align: center; }
.auth-head .auth-logo { width: 54px; height: 54px; margin: 0 auto 10px; border-radius: 14px; background: rgba(255,255,255,.14); padding: 8px; }
.auth-head h1 { font-size: 19px; }
.auth-head p { font-size: 13px; opacity: .8; margin-top: 3px; }
.auth-body { padding: 26px 28px; }

/* ---------- Laman utama (landing) ---------- */
.landing-top { background: linear-gradient(135deg, var(--navy-900), var(--navy-700)); color: #fff; }
.landing-nav { display: flex; align-items: center; justify-content: space-between; height: 70px; gap: 16px; }
.landing-nav .brand { color: #fff; }
.landing-nav .brand-logo { background: rgba(255,255,255,.12); }
.hero { padding: 72px 0 88px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero-eyebrow {
  display: inline-block; background: rgba(201,162,39,.16); color: var(--gold); border: 1px solid rgba(201,162,39,.4);
  padding: 5px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 700; letter-spacing: .5px; margin-bottom: 18px;
}
.hero h1 { font-size: clamp(30px, 4.5vw, 46px); line-height: 1.2; font-weight: 800; margin-bottom: 16px; }
.hero h1 span { color: var(--gold); }
.hero p { font-size: 16.5px; color: rgba(255,255,255,.82); max-width: 520px; margin-bottom: 28px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-art {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); border-radius: 18px;
  padding: 30px; backdrop-filter: blur(4px);
}
.hero-art .mini-card { background: #fff; color: var(--ink); border-radius: 12px; padding: 16px 18px; margin-bottom: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.hero-art .mini-card:last-child { margin-bottom: 0; }
.mini-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.mini-head .ref { font-weight: 800; color: var(--navy-600); font-size: 13px; }

.section { padding: 64px 0; }
.section-alt { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.section-head h2 { font-size: 28px; color: var(--navy-900); font-weight: 800; }
.section-head p { color: var(--muted); margin-top: 8px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step-card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 26px;
  text-align: center; box-shadow: var(--shadow); position: relative;
}
.step-num {
  width: 44px; height: 44px; margin: 0 auto 14px; border-radius: 50%; background: var(--navy-800); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px;
}
.step-card h3 { font-size: 16.5px; color: var(--navy-900); margin-bottom: 8px; }
.step-card p { font-size: 13.5px; color: var(--muted); }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.feature-card { background: var(--navy-50); border: 1px solid var(--navy-100); border-radius: 14px; padding: 24px; }
.feature-card h3 { font-size: 16px; color: var(--navy-800); margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.feature-card p { font-size: 13.5px; color: var(--muted); }
.feature-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--navy-800); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-900); color: rgba(255,255,255,.75); margin-top: auto; }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 22px 20px; font-size: 13px; }

/* ---------- Utiliti ---------- */
.muted { color: var(--muted); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; } .mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 20px; } .mb-4 { margin-bottom: 32px; }
.flex { display: flex; align-items: center; gap: 12px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.wrap { flex-wrap: wrap; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--navy-100); color: var(--navy-800);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; flex-shrink: 0;
}
.divider { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* ---------- Responsif ---------- */
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .steps, .feature-grid { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; padding: 48px 0 64px; }
  .hero-art { display: none; }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: absolute; top: 64px; left: 0; right: 0; background: var(--navy-900);
    flex-direction: column; align-items: stretch; gap: 0; padding: 12px 20px 20px;
    display: none; border-top: 1px solid rgba(255,255,255,.12);
  }
  .main-nav.open { display: flex; }
  .nav-links { flex-direction: column; gap: 2px; }
  .nav-user { border-left: 0; padding-left: 0; border-top: 1px solid rgba(255,255,255,.15); margin-top: 12px; padding-top: 14px; justify-content: space-between; }
  .nav-user-info { align-items: flex-start; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .chart-label { width: 120px; font-size: 12px; }
  .table th, .table td { padding: 10px 10px; }
  .footer-inner { flex-direction: column; text-align: center; }
  .auth-wrap { padding: 28px 16px; }
}
