/* ============================================
   MISPAY LEGAL - Main CSS
   Matches reference design: Navy + Orange
   ============================================ */

:root {
  --navy: #0d1b2e;
  --navy2: #162540;
  --navy3: #1e3050;
  --orange: #e8642a;
  --orange2: #d45a22;
  --cream: #faf9f6;
  --white: #ffffff;
  --text: #1a1a2e;
  --muted: #6b7280;
  --border: #e5e7eb;
  --success: #059669;
  --danger: #dc2626;
  --warning: #d97706;
  --info: #2563eb;
  --sidebar-w: 260px;
}

*, *::before, *::after { box-sizing: border-box; }
body { font-family: 'DM Sans', sans-serif; background: var(--cream); color: var(--text); font-size: 15px; }
h1,h2,h3,h4,h5 { font-family: 'DM Serif Display', serif; }
a { color: var(--orange); text-decoration: none; }
a:hover { color: var(--orange2); }

/* ---- BUTTONS ---- */
.btn-primary    { background: var(--orange)!important; border-color: var(--orange)!important; font-weight:600; }
.btn-primary:hover { background: var(--orange2)!important; border-color: var(--orange2)!important; }
.btn-dark       { background: var(--navy)!important; border-color: var(--navy)!important; font-weight:600; }
.btn-outline-primary { color: var(--orange)!important; border-color: var(--orange)!important; font-weight:600; }
.btn-outline-primary:hover { background: var(--orange)!important; color: white!important; }

/* ---- BADGES ---- */
.badge-success   { background: #d1fae5; color: #065f46; padding: 4px 10px; border-radius: 100px; font-size: 12px; font-weight: 600; }
.badge-danger    { background: #fee2e2; color: #991b1b; padding: 4px 10px; border-radius: 100px; font-size: 12px; font-weight: 600; }
.badge-warning   { background: #fef3c7; color: #92400e; padding: 4px 10px; border-radius: 100px; font-size: 12px; font-weight: 600; }
.badge-info      { background: #dbeafe; color: #1e40af; padding: 4px 10px; border-radius: 100px; font-size: 12px; font-weight: 600; }
.badge-primary   { background: #ede9fe; color: #5b21b6; padding: 4px 10px; border-radius: 100px; font-size: 12px; font-weight: 600; }
.badge-secondary { background: #f3f4f6; color: #374151; padding: 4px 10px; border-radius: 100px; font-size: 12px; font-weight: 600; }

/* ---- CARDS ---- */
.card { border: 1px solid var(--border); border-radius: 12px; background: var(--white); box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.card-header { background: var(--white); border-bottom: 1px solid var(--border); padding: 16px 20px; font-weight: 700; color: var(--navy); border-radius: 12px 12px 0 0!important; }

/* ---- FORMS ---- */
.form-control, .form-select { border: 1.5px solid var(--border); border-radius: 8px; padding: 10px 14px; font-size: 14px; transition: all .2s; }
.form-control:focus, .form-select:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(232,100,42,.12); outline: none; }
.form-label { font-weight: 600; font-size: 13px; color: var(--navy); margin-bottom: 6px; }

/* ---- TABLE ---- */
.table th { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #f9fafb; }
.table td { font-size: 14px; vertical-align: middle; }
.table-hover tbody tr:hover { background: #fff8f5; }

/* ---- TOPBAR ---- */
.topbar { background: var(--navy); color: #8fa8c0; font-size: 12px; padding: 7px 0; }
.topbar a { color: #8fa8c0; } .topbar a:hover { color: var(--orange); }

/* ---- MAIN NAV ---- */
.main-nav { background: var(--white); border-bottom: 1px solid var(--border); position: sticky; top:0; z-index:200; box-shadow: 0 1px 8px rgba(0,0,0,.06); }
.main-nav .navbar-brand { font-family: 'DM Serif Display', serif; font-size: 20px; color: var(--navy)!important; }
.main-nav .nav-link { color: var(--text)!important; font-weight:500; font-size:14px; }
.main-nav .nav-link:hover { color: var(--orange)!important; }
.logo-icon { width:36px; height:36px; background: var(--navy); border-radius:8px; display:inline-flex; align-items:center; justify-content:center; color: var(--orange); font-size:16px; margin-right:8px; }

/* ---- DASHBOARD LAYOUT (sidebar in sidebar.css) ---- */
.dashboard-wrap { display: flex; min-height: calc(100vh - 62px); }
.main-content { flex: 1; padding: 28px; overflow-x: hidden; min-width: 0; }

/* ---- STAT CARDS ---- */
.stat-card { background: white; border-radius: 12px; padding: 20px; border: 1px solid var(--border); }
.stat-card .stat-icon { width:44px; height:44px; border-radius:10px; display:flex; align-items:center; justify-content:center; font-size:20px; margin-bottom:12px; }
.stat-card .stat-val { font-size: 28px; font-weight: 800; color: var(--navy); line-height:1; }
.stat-card .stat-label { font-size: 13px; color: var(--muted); margin-top:4px; }
.stat-card .stat-change { font-size: 12px; margin-top: 8px; }
.stat-icon-orange { background: #fff4ef; }
.stat-icon-blue   { background: #eff6ff; }
.stat-icon-green  { background: #f0fdf4; }
.stat-icon-red    { background: #fef2f2; }

/* ---- PAGE HEADER ---- */
.page-header { margin-bottom: 24px; }
.page-header h2 { font-size: 26px; color: var(--navy); margin-bottom: 4px; }
.page-header p { color: var(--muted); font-size: 14px; }
.breadcrumb { font-size: 13px; }
.breadcrumb-item a { color: var(--orange); }

/* ---- STATUS TIMELINE ---- */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content:''; position:absolute; left:9px; top:0; bottom:0; width:2px; background: var(--border); }
.tl-item { position: relative; margin-bottom: 20px; }
.tl-dot { position:absolute; left:-24px; width:16px; height:16px; border-radius:50%; background: var(--border); border:2px solid white; top:3px; }
.tl-dot.active { background: var(--orange); }
.tl-dot.success { background: var(--success); }
.tl-title { font-weight:600; font-size:14px; color:var(--navy); }
.tl-meta  { font-size:12px; color:var(--muted); }

/* ---- SERVICE CARD ---- */
.service-pick-card {
  border: 2px solid var(--border); border-radius: 12px; padding: 20px;
  cursor: pointer; transition: all .2s; background: white;
}
.service-pick-card:hover { border-color: var(--orange); background: #fff8f5; transform: translateY(-2px); }
.service-pick-card.selected { border-color: var(--orange); background: #fff4ef; }
.service-pick-card .s-icon { font-size:28px; margin-bottom:10px; }
.service-pick-card .s-name { font-weight:700; font-size:15px; color:var(--navy); }
.service-pick-card .s-price { color:var(--orange); font-weight:700; font-size:14px; margin-top:6px; }
.service-pick-card .s-days  { font-size:12px; color:var(--muted); }

/* ---- ALERTS ---- */
.alert { border-radius:10px; font-size:14px; }
.alert-success { background:#d1fae5; color:#065f46; border:1px solid #a7f3d0; }
.alert-danger  { background:#fee2e2; color:#991b1b; border:1px solid #fca5a5; }
.alert-info    { background:#dbeafe; color:#1e40af; border:1px solid #93c5fd; }
.alert-warning { background:#fef3c7; color:#92400e; border:1px solid #fcd34d; }

/* ---- MISC ---- */
.section-label { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.1em; color:var(--orange); }
.divider { border:none; border-top:1px solid var(--border); margin:24px 0; }
.text-orange { color: var(--orange); }
.text-navy   { color: var(--navy); }
.bg-navy     { background: var(--navy); }
.bg-orange   { background: var(--orange); }
.fw-700      { font-weight: 700; }
.rounded-lg  { border-radius: 12px; }
.shadow-sm   { box-shadow: 0 2px 8px rgba(0,0,0,.06)!important; }

/* ---- NOTIF BADGE ---- */
.notif-badge { position:absolute; top:-4px; right:-4px; background:var(--orange); color:white; font-size:10px; width:16px; height:16px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-weight:700; }

/* ---- UPLOAD BOX ---- */
.upload-box { border: 2px dashed var(--border); border-radius:12px; padding:32px; text-align:center; transition:all .2s; cursor:pointer; }
.upload-box:hover { border-color:var(--orange); background:#fff8f5; }
.upload-box i { font-size:32px; color:var(--muted); }

/* ---- GOVT PORTAL BOX ---- */
.govt-portal-box { background: var(--navy); color:white; border-radius:12px; padding:24px; }
.govt-portal-box .gp-title { font-size:14px; font-weight:700; color:#a8b8cc; text-transform:uppercase; letter-spacing:.08em; }
.govt-portal-box .gp-name  { font-size:20px; font-weight:700; color:white; margin:8px 0; }
.govt-portal-box .gp-url   { font-size:13px; color:var(--orange); }



/* ============================================
   MOBILE RESPONSIVE — Full Site
   ============================================ */

/* ── GLOBAL MOBILE FIXES ── */
* { -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; height: auto; }
table { width: 100%; }

/* ── NAV MOBILE ── */
@media (max-width: 768px) {
  .main-nav .navbar-brand { font-size: 16px; }
  .main-nav .navbar-brand .logo-icon { width:30px; height:30px; font-size:15px; }
  .nav-links { display: none; }
  .topbar { display: none; }
}

/* ── HOMEPAGE HERO MOBILE ── */
@media (max-width: 768px) {
  .hero { grid-template-columns: 1fr; padding: 40px 16px 32px; gap: 24px; }
  .hero h1 { font-size: 30px; }
  .hero p { font-size: 14px; }
  .hero-visual { display: none; }
  .hero-btns { gap: 10px; }
  .btn-hero-primary, .btn-hero-secondary { padding: 12px 18px; font-size: 14px; }

  .stats-inner { gap: 24px; padding: 20px 16px; flex-wrap: wrap; }
  .stat-item h3 { font-size: 22px; }

  .services-head { grid-template-columns: 1fr; gap: 16px; margin-bottom: 24px; }
  .services-head h2 { font-size: 26px; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .service-card { padding: 16px; }
  .sicon { width: 36px; height: 36px; font-size: 18px; }
  .sname { font-size: 13px; }

  .steps { grid-template-columns: 1fr; gap: 28px; }
  .hiw-section h2 { font-size: 28px; }
  .step-num { font-size: 48px; }

  .t-grid { grid-template-columns: 1fr; }
  .t-head { flex-direction: column; gap: 12px; }
  .t-head h2 { font-size: 26px; }

  .cta-section { flex-direction: column; align-items: flex-start; padding: 40px 16px; }
  .cta-section h2 { font-size: 28px; }
  .cta-btns { flex-direction: column; width: 100%; }
  .cta-btns > * { width: 100%; text-align: center; justify-content: center; }

  .footer-inner { grid-template-columns: 1fr 1fr; gap: 24px; padding: 32px 16px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; padding: 16px; }

  /* Track section */
  #track > div > div { grid-template-columns: 1fr !important; gap: 24px !important; }

  .section { padding: 48px 16px; }
  .wa-float { bottom: 16px; right: 16px; padding: 10px 14px; font-size: 12px; }
}

/* ── DASHBOARD MOBILE ── */
@media (max-width: 768px) {
  .main-content { padding: 16px; }
  .dashboard-wrap { flex-direction: column; }
  .page-header h2 { font-size: 20px; }

  .stat-card { padding: 16px; }
  .stat-val { font-size: 22px; }

  /* Tables scroll horizontally */
  .table-responsive { -webkit-overflow-scrolling: touch; }
  .table td, .table th { white-space: nowrap; }

  /* Cards full width */
  .row.g-4 > [class*='col-lg'], .row.g-3 > [class*='col-lg'] { width: 100%; }

  /* Hide less important columns on mobile */
  .hide-mobile { display: none !important; }

  /* Chat UI mobile */
  .chat-wrap { height: calc(100vh - 280px); }
  .chat-bubble { max-width: 90%; }

  /* Complaints list + chat */
  .col-md-4.complaints-list { max-height: 300px; overflow-y: auto; }
}

@media (max-width: 480px) {
  .services-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .btn-hero-primary, .btn-hero-secondary { width: 100%; justify-content: center; }
  .hero-btns { flex-direction: column; }
  .kpi-val { font-size: 22px; }
}

/* ── TOUCH IMPROVEMENTS ── */
.btn { min-height: 40px; }
.form-control, .form-select { min-height: 44px; font-size: 16px; } /* prevent iOS zoom */
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], textarea, select { font-size: 16px !important; }

/* ── CARD TOUCH ── */
.service-card:active, .svc-item:active, .ticket-item:active { transform: scale(0.98); }

/* ── STICKY BOTTOM BAR for mobile ── */
@media (max-width: 768px) {
  .mobile-bottom-bar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 150;
    background: white; border-top: 1px solid var(--border);
    padding: 8px 16px; display: flex; justify-content: space-around;
    box-shadow: 0 -4px 20px rgba(0,0,0,.08);
  }
  .mobile-bottom-bar a {
    display: flex; flex-direction: column; align-items: center;
    gap: 2px; color: var(--muted); text-decoration: none;
    font-size: 11px; font-weight: 600; padding: 4px 8px;
  }
  .mobile-bottom-bar a.active { color: var(--orange); }
  .mobile-bottom-bar a i { font-size: 20px; }
  body { padding-bottom: 70px; }
  .wa-float { bottom: 80px; }
}
