/* ==========================================================================
   SIPAA - SISTEM INFORMASI PELAPORAN ALAT ANGKUT
   Kementerian Imigrasi dan Pemasyarakatan - Direktorat Jenderal Imigrasi
   Modern Navy & Cyan Maritime Design System
   ========================================================================== */

:root {
  --primary-dark: #071933;
  --primary-navy: #0B2246;
  --primary-blue: #153E75;
  --primary-light: #1E5199;
  --accent-cyan: #0EA5E9;
  --accent-teal: #06B6D4;
  --accent-amber: #F59E0B;
  --accent-green: #10B981;
  --accent-purple: #8B5CF6;
  --accent-rose: #F43F5E;

  --bg-page: #F1F5F9;
  --bg-card: #FFFFFF;
  --bg-input: #FFFFFF;
  --border-color: #E2E8F0;
  --border-focus: #38BDF8;

  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-light: #94A3B8;
  --text-white: #FFFFFF;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.08);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 14px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--accent-cyan);
}

/* ==========================================================================
   LAYOUT: SIDEBAR + MAIN CONTENT (Matches IMG-20260915-WA0004.jpg)
   ========================================================================== */

.app-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.sidebar {
  width: 260px;
  background: linear-gradient(180deg, #0B2246 0%, #071933 100%);
  color: var(--text-white);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  box-shadow: 4px 0 12px rgba(0,0,0,0.1);
  z-index: 20;
}

/* Maritime wave decor at bottom of sidebar */
.sidebar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 130px;
  background-image: radial-gradient(circle at 50% 120%, rgba(14, 165, 233, 0.2) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

.sidebar-brand {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand img {
  height: 40px;
  width: auto;
}

.sidebar-brand .brand-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #FFFFFF;
}

.sidebar-brand .brand-subtitle {
  font-size: 10px;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-nav {
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  position: relative;
  z-index: 2;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.4);
  padding: 12px 14px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.75);
  font-weight: 500;
  font-size: 13.5px;
  transition: all 0.2s ease;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.8;
  transition: all 0.2s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
}

.nav-item:hover svg {
  opacity: 1;
  transform: translateX(2px);
}

.nav-item.active {
  background: #1E5199;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(30, 81, 153, 0.4);
  font-weight: 600;
}

.nav-item.active svg {
  opacity: 1;
  color: #38BDF8;
}

.nav-badge {
  margin-left: auto;
  background: var(--accent-rose);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  position: relative;
  z-index: 2;
  text-align: center;
}

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background-color: #F8FAFC;
}

/* TOP NAVBAR */
.topbar {
  height: 70px;
  background: #FFFFFF;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 15;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-navy);
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Notifications Bell */
.notification-trigger {
  position: relative;
  background: #F1F5F9;
  border: 1px solid var(--border-color);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.notification-trigger:hover {
  background: #E2E8F0;
  color: var(--primary-navy);
}

.notification-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: var(--accent-rose);
  color: white;
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #FFFFFF;
}

/* User Profile Badge */
.user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: #FFFFFF;
  transition: all 0.2s ease;
}

.user-menu:hover {
  background: #F8FAFC;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

.user-info {
  text-align: left;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.2;
}

.user-role-badge {
  font-size: 10.5px;
  color: var(--accent-cyan);
  font-weight: 500;
}

/* ==========================================================================
   PAGE BODY & HERO BANNER
   ========================================================================== */

.page-body {
  padding: 24px 32px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* HERO BANNER (Matches IMG-20260915-WA0004.jpg) */
.hero-banner {
  background: linear-gradient(135deg, #0B2246 0%, #153E75 60%, #0EA5E9 100%);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.hero-content {
  max-width: 620px;
  position: relative;
  z-index: 2;
}

.hero-tag {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #38BDF8;
  margin-bottom: 8px;
}

.hero-title {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.hero-subtitle {
  font-size: 16px;
  font-weight: 600;
  color: #E2E8F0;
  margin-bottom: 12px;
}

.hero-desc {
  font-size: 13.5px;
  color: #CBD5E1;
  line-height: 1.6;
  margin-bottom: 20px;
}

.hero-bg-art {
  position: absolute;
  right: 0;
  bottom: 0;
  top: 0;
  width: 48%;
  background-image: url('../images/preview_mockup.jpg');
  background-size: cover;
  background-position: center right;
  opacity: 0.35;
  mix-blend-mode: luminosity;
  pointer-events: none;
}

/* ==========================================================================
   METRIC STAT CARDS (Matches IMG-20260915-WA0004.jpg 4 cards)
   ========================================================================== */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  position: relative;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #CBD5E1;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon.blue { background: #E0F2FE; color: #0284C7; }
.stat-icon.green { background: #DCFCE7; color: #16A34A; }
.stat-icon.orange { background: #FEF3C7; color: #D97706; }
.stat-icon.purple { background: #F3E8FF; color: #7C3AED; }

.stat-body {
  flex: 1;
}

.stat-header-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}

.stat-number {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}

.stat-trend {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.stat-trend.up { background: #DCFCE7; color: #15803D; }

.stat-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.stat-desc {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 2px;
}

/* ==========================================================================
   DASHBOARD 3-COLUMN CONTENT GRID
   ========================================================================== */

.content-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 280px;
  gap: 20px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.content-grid > .card {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-navy);
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.card-body {
  padding: 20px;
  flex: 1;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

/* Menu Utama Grids */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.menu-item-box {
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  color: var(--text-main);
  text-decoration: none;
}

.menu-item-box:hover {
  background: #FFFFFF;
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.menu-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.menu-icon-circle.blue { background: #0284C7; }
.menu-icon-circle.teal { background: #0D9488; }
.menu-icon-circle.purple { background: #7C3AED; }
.menu-icon-circle.navy { background: #0B2246; }

.menu-item-box span {
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.3;
}

/* Quick Access List */
.quick-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.quick-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
  min-width: 0;
  overflow: hidden;
}

.quick-link > div:last-child {
  min-width: 0;
  overflow: hidden;
}

.quick-link > div:last-child > div:first-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-link:hover {
  background: #FFFFFF;
  border-color: var(--accent-cyan);
  color: var(--primary-light);
  transform: translateX(3px);
}

.quick-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: #E0F2FE;
  color: #0284C7;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   TABLES & BADGES
   ========================================================================== */

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.sipaa-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.sipaa-table th {
  background: #F8FAFC;
  padding: 12px 16px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

.sipaa-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

.sipaa-table tbody tr:hover {
  background-color: #F8FAFC;
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-success { background: #DCFCE7; color: #15803D; }
.badge-warning { background: #FEF3C7; color: #B45309; }
.badge-info { background: #E0F2FE; color: #0369A1; }
.badge-danger { background: #FFE4E6; color: #BE123C; }
.badge-secondary { background: #F1F5F9; color: #475569; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  line-height: 1.4;
}

.btn-primary {
  background: var(--primary-blue);
  color: white;
}
.btn-primary:hover {
  background: var(--primary-navy);
  color: white;
}

.btn-success {
  background: var(--accent-green);
  color: white;
}
.btn-success:hover {
  background: #059669;
  color: white;
}

.btn-danger {
  background: var(--accent-rose);
  color: white;
}
.btn-danger:hover {
  background: #E11D48;
  color: white;
}

.btn-outline {
  background: #FFFFFF;
  border-color: var(--border-color);
  color: var(--text-main);
}
.btn-outline:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

/* ==========================================================================
   FORMS & INPUTS
   ========================================================================== */

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  font-size: 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-main);
  outline: none;
  transition: all 0.2s ease;
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

/* Side by Side Diff Viewer */
.diff-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.diff-box {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
}

.diff-box.old-version {
  border-top: 4px solid var(--accent-amber);
}

.diff-box.new-version {
  border-top: 4px solid var(--accent-green);
}

.diff-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #F1F5F9;
  font-size: 12.5px;
}

.diff-row.changed {
  background-color: #FEF3C7;
  padding-left: 6px;
  padding-right: 6px;
  border-radius: 4px;
  font-weight: 600;
}

.diff-row .label {
  color: var(--text-muted);
  font-weight: 500;
}

.diff-row .value {
  color: var(--text-main);
  text-align: right;
}

/* Alerts */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.alert-success { background: #DCFCE7; color: #166534; border: 1px solid #BBF7D0; }
.alert-danger { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.alert-info { background: #E0F2FE; color: #075985; border: 1px solid #BAE6FD; }

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11, 34, 70, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.modal-header {
  padding: 18px 24px;
  background: var(--primary-navy);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  background: #F8FAFC;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Footer Banner (Matches IMG-20260915-WA0004.jpg) */
.footer-banner {
  background: linear-gradient(90deg, #0B2246 0%, #153E75 50%, #0EA5E9 100%);
  color: white;
  padding: 14px 32px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.footer-motto {
  font-style: italic;
  font-family: 'Georgia', serif;
  font-size: 14px;
}

/* ==========================================================================
   MOBILE & RESPONSIVE DESIGN SYSTEM
   Supports iPhone, Android, iPad, Tablets, and Small Laptops
   ========================================================================== */

/* Mobile Controls Default (Desktop Hidden) */
.sidebar-toggle-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: #F8FAFC;
  color: var(--primary-navy);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
  background: #E2E8F0;
  color: var(--primary-blue);
}

.sidebar-close-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-sm);
  color: #FFFFFF;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sidebar-close-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #38BDF8;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 13, 26, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-backdrop.active {
  opacity: 1 !important;
  pointer-events: auto !important;
  display: block !important;
}

.mobile-bottom-nav {
  display: none;
}

/* Page Header & Action Flex Utilities */
.page-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 14px;
  flex-wrap: wrap;
}

.form-actions-bar {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

/* Tablet & Laptop Breakpoint (max-width: 1366px) */
@media (max-width: 1366px) {
  .content-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .quick-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
  }
}

/* Tablet Breakpoint (max-width: 1200px) */
@media (max-width: 1200px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile & Small Tablet Off-Canvas Drawer (max-width: 992px) */
@media (max-width: 992px) {
  .sidebar-toggle-btn {
    display: inline-flex !important;
    touch-action: manipulation;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .sidebar-close-btn {
    display: flex !important;
    touch-action: manipulation;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 280px !important;
    max-width: 85vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 99999 !important;
    transform: translateX(-100%) !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: none !important;
  }

  .sidebar.open {
    transform: translateX(0) !important;
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.65) !important;
    visibility: visible !important;
    display: flex !important;
  }

  .main-content {
    width: 100%;
    min-width: 0;
  }

  .topbar {
    padding: 0 20px;
    height: 64px;
  }
}

/* Mobile Phones (max-width: 768px) */
@media (max-width: 768px) {
  .topbar {
    padding: 0 14px;
    height: 60px;
  }

  .topbar-title span:last-child {
    display: none;
  }

  .topbar-right {
    gap: 10px;
  }

  .user-info {
    display: none;
  }

  #btn-enable-push span {
    display: none;
  }

  #btn-enable-push {
    padding: 7px 9px;
  }

  .page-body {
    padding: 14px 14px calc(76px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .hero-banner {
    padding: 22px 18px;
    border-radius: var(--radius-md);
  }

  .hero-title {
    font-size: 22px;
    line-height: 1.25;
  }

  .hero-subtitle {
    font-size: 14px;
  }

  .hero-desc {
    font-size: 13px;
    margin-bottom: 16px;
  }

  .hero-banner .btn {
    width: 100%;
    justify-content: center;
  }

  .hero-content > div:last-child {
    flex-direction: column;
    width: 100%;
    align-items: stretch !important;
  }

  /* Stat Grid on Mobile: 2 Compact Columns */
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .stat-card {
    padding: 14px;
  }

  .stat-icon {
    width: 42px;
    height: 42px;
  }

  .stat-number {
    font-size: 22px;
  }

  .stat-title {
    font-size: 12px;
  }

  .stat-desc {
    display: none;
  }

  /* Form Controls on Touchscreens */
  .form-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .form-control {
    font-size: 14px;
    min-height: 42px;
  }

  .form-label {
    font-size: 13px;
  }

  /* Diff Viewer on Mobile */
  .diff-container {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* Table Horizontal Scrolling */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
    box-shadow: 0 0 0 1px var(--border-color);
  }

  .sipaa-table th,
  .sipaa-table td {
    padding: 10px 12px;
    font-size: 12px;
  }

  /* Native App Feel Bottom Navigation Bar */
  .mobile-bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(58px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(11, 34, 70, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.35);
  }

  .bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: #94A3B8;
    font-size: 10px;
    font-weight: 600;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 0;
    transition: all 0.2s ease;
  }

  .bottom-nav-item svg {
    width: 20px;
    height: 20px;
  }

  .bottom-nav-item.active,
  .bottom-nav-item:active,
  .bottom-nav-item:hover {
    color: #38BDF8;
  }

  .bottom-nav-badge {
    position: absolute;
    top: -4px;
    right: -8px;
    background: var(--accent-rose);
    color: white;
    font-size: 9px;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 9999px;
    line-height: 1.2;
  }

  /* Footer on Mobile */
  .footer-banner {
    margin-bottom: calc(58px + env(safe-area-inset-bottom, 0px));
    flex-direction: column;
    gap: 6px;
    text-align: center;
    padding: 14px 16px;
    font-size: 11px;
  }

  .footer-motto {
    font-size: 12px;
  }

  /* Modal Cards on Mobile */
  .modal-card {
    max-height: 92vh;
    border-radius: var(--radius-md);
  }

  .modal-body {
    padding: 16px;
  }

  .modal-header,
  .modal-footer {
    padding: 14px 16px;
  }
}

/* Very Small Phones (max-width: 480px) */
@media (max-width: 480px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .menu-grid {
    grid-template-columns: 1fr;
  }

  .btn {
    padding: 9px 14px;
    font-size: 12.5px;
  }
}
