/* 
  SIPONKIA GLOBALS
  Base layout, variables, reset, and shared components (Navbar/Footer)
*/

:root {
  /* Common */
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.4);
  --secondary: #0ea5e9;
  --radius-lg: 2rem;
  --radius-md: 1rem;
  --radius-sm: 0.75rem;
  --trans: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Light Theme (Default) */
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --white: #ffffff;
  --glass: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(255, 255, 255, 0.4);
  --nav-bg: rgba(255, 255, 255, 0.7);
  --btn-lips: 1px solid transparent;
  --btn-glow: none;
}

[data-theme="dark"] {
  --bg-main: #0f172a;
  --bg-card: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border: #334155;
  --white: #1e293b;
  --glass: rgba(15, 23, 42, 0.8);
  --glass-border: rgba(255, 255, 255, 0.1);
  --nav-bg: rgba(15, 23, 42, 0.7);
  --btn-lips: 1.5px solid var(--primary);
  --btn-glow: 0 0 10px rgba(99, 102, 241, 0.3);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color var(--trans), color var(--trans);
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  color: var(--text-main);
  font-weight: 700;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.centered-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

h1, h2, h3, h4 {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1010;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  transition: all var(--trans);
}

.navbar-scrolled {
  height: 70px;
  background: var(--bg-card);
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.nav-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo img {
  height: 42px;
  object-fit: contain;
  transition: height var(--trans);
}

.navbar-scrolled .logo img {
  height: 36px;
}

.logo span {
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 1.5rem;
  color: var(--text-main);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  list-style: none;
  align-items: center;
  gap: 2rem;
  margin-left: auto;
  margin-right: 2rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.95rem;
  transition: color var(--trans);
  opacity: 0.9;
}

.nav-links a:hover {
  color: var(--primary);
  opacity: 1;
}

.nav-btn {
  background: var(--primary);
  color: white !important;
  padding: 10px 24px;
  border-radius: 50px;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.nav-btn-alt {
  color: var(--primary) !important;
  border: 2px solid var(--primary);
  padding: 8px 22px;
  border-radius: 50px;
}

.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  z-index: 999;
  transition: 0.4s;
}

.menu-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  width: 45px;
  height: 45px;
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--text-main);
  cursor: pointer;
  z-index: 1001;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
  transition: 0.3s;
}

.mobile-menu-toggle:active {
  transform: scale(0.9);
}

@media (max-width: 768px) {
  .navbar {
    height: 60px;
  }

  .nav-container {
    height: 100%;
  }

  .logo img {
    height: 32px;
  }

  .mobile-menu-toggle {
    display: flex;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 1.25rem;
    z-index: 1005;
  }

  .nav-links {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-card);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    gap: 1.8rem; /* Increased for better breathing space */
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
  }

  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav-links li {
    width: 100%;
    max-width: 280px;
    text-align: center;
    transform: translateY(15px);
    opacity: 0;
    transition: 0.4s;
  }

  .nav-links.active li {
    transform: translateY(0);
    opacity: 1;
  }

  /* Staggered animation */
  .nav-links.active li:nth-child(1) { transition-delay: 0.1s; }
  .nav-links.active li:nth-child(2) { transition-delay: 0.15s; }
  .nav-links.active li:nth-child(3) { transition-delay: 0.2s; }
  .nav-links.active li:nth-child(4) { transition-delay: 0.25s; }
  .nav-links.active li:nth-child(5) { transition-delay: 0.3s; }

  .nav-links a {
    font-size: 1.35rem; /* Slightly larger for readability */
    font-weight: 800;
    padding: 10px;
    font-family: 'Outfit', sans-serif;
    border-bottom: none;
    color: var(--text-main);
  }

  .nav-btn, .nav-btn-alt {
    width: 100%;
    height: 56px; /* Uniform height */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.5rem;
    padding: 0 2rem !important;
    font-size: 1.1rem;
    border-radius: 16px;
    font-weight: 700;
    letter-spacing: 0.02em;
  }

  .nav-links li:has(.nav-btn-alt), 
  .nav-links li:has(.nav-btn) {
    padding-top: 0.5rem;
  }
}

/* Footer */
.footer {
  background: var(--bg-card);
  color: var(--text-main);
  padding: 80px 0 40px;
  border-top: 1px solid var(--border);
}

.footer-top {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
  gap: 4rem;
  margin-bottom: 60px;
}

.footer h4 { margin-bottom: 1.5rem; font-size: 1.1rem; color: var(--text-main); }
.footer ul { list-style: none; }
.footer img { height: 40px; }
.footer a { color: var(--text-muted); text-decoration: none; transition: 0.3s; }
.footer a:hover { color: var(--primary); }
.social-icons { display: flex; gap: 15px; margin-top: 1.5rem; }
.social-icons a { 
  width: 40px; 
  height: 40px; 
  background: var(--bg-main); 
  color: var(--text-main);
  display: flex; 
  align-items: center; 
  justify-content: center; 
  border-radius: 10px; 
  font-size: 1.2rem; 
  border: 1px solid var(--border);
}
.footer-bottom { border-top: 1px solid var(--border); padding-top: 40px; text-align: center; color: var(--text-muted); font-size: 0.9rem; }

@media (max-width: 992px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 576px) {
  .footer-top { grid-template-columns: 1fr; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 12px;
  transition: 0.4s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 10px 20px -5px var(--primary-glow);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.btn-secondary:hover {
  background: var(--bg-main);
}

.btn-outline {
  border: 2px solid var(--primary);
  color: var(--primary);
  background: transparent;
}

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

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}/* ======================================
   RESPONSIVE TABLE TO CARD SYSTEM
   ========================================= */
@media (max-width: 768px) {
  .table-responsive-card thead {
    display: none;
  }

  .table-responsive-card, 
  .table-responsive-card tbody, 
  .table-responsive-card tr, 
  .table-responsive-card td {
    display: block;
    width: 100%;
  }

  .table-responsive-card tr {
    margin-bottom: 1.5rem;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    border: 1px solid var(--border);
    padding: 1rem;
    transition: transform 0.3s ease;
  }

  .table-responsive-card tr:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
  }

  .table-responsive-card td {
    text-align: right;
    padding: 0.75rem 0;
    position: relative;
    border: none !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border) !important;
  }

  .table-responsive-card td:last-child {
    border-bottom: none !important;
    padding-bottom: 0;
  }

  .table-responsive-card td::before {
    content: attr(data-label);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.7rem;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-right: 15px;
  }

  .table-responsive-card td .avatar, 
  .table-responsive-card td .btn,
  .table-responsive-card td .badge {
    margin: 0 !important;
  }

  .table-responsive-card .text-right, 
  .table-responsive-card .text-center {
    text-align: right !important;
    justify-content: space-between !important;
  }
}

/* Utility Helpers */
.d-flex { display: flex !important; }
.d-none { display: none !important; }
.align-items-center { align-items: center !important; }
.justify-content-center { justify-content: center !important; }
.mr-1 { margin-right: 0.25rem !important; }
.mr-2 { margin-right: 0.5rem !important; }
.mr-3 { margin-right: 1rem !important; }
.ml-1 { margin-left: 0.25rem !important; }
.ml-2 { margin-left: 0.5rem !important; }
.ml-3 { margin-left: 1rem !important; }
.mb-0 { margin-bottom: 0 !important; }

@media (min-width: 992px) {
    .d-lg-none { display: none !important; }
    .d-lg-block { display: block !important; }
    .d-lg-flex { display: flex !important; }
}

.btn-icon {
}

/* ======================================
   SIPONKIA CUSTOM UI COMPONENTS
   (Standardized Tables & Buttons)
   ========================================= */

/* Custom Table Design */
.custom-table {
    table-layout: fixed;
    width: 100%;
}
.custom-table th {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 700;
    border-bottom: 2px solid var(--border) !important;
    border-top: none !important;
    padding: 12px 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.custom-table td {
    vertical-align: middle;
    padding: 16px;
    border-bottom: 1px dotted var(--border);
    color: var(--text-main);
    overflow: hidden;
    word-wrap: break-word; /* Ensure content wraps inside fixed cells */
}
@media (max-width: 992px) {
    .custom-table {
        table-layout: auto; /* Revert to auto on mobile card view for proper stacking */
    }
}

/* Badges */
.badge-nik {
    background: var(--bg-main);
    color: var(--primary);
    border: 1px solid var(--border);
    padding: 6px 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-radius: 8px;
    font-size: 0.85rem;
}
.badge-pending { 
    background: rgba(var(--danger-rgb), 0.1); 
    color: var(--danger); 
    padding: 6px 12px; 
    border-radius: 8px; 
    font-size: 0.75rem; 
    font-weight: 700; 
    border: 1px solid var(--border); 
}

/* Buttons */
.btn-detil, .btn-selesai, .btn-pulihkan, .btn-hapus, .btn-download, .btn-pending, .btn-warning {
    border-radius: 10px; 
    padding: 8px 16px; 
    font-size: 0.8rem; 
    font-weight: 700; 
    transition: all 0.2s;
    display: inline-flex; 
    align-items: center; 
    gap: 6px; 
    height: 38px; 
    border: none; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.btn-detil { 
    background: var(--bg-card); 
    color: var(--primary); 
    border: 1px solid var(--border); 
}
.btn-detil:hover { 
    background: var(--primary); 
    color: white; 
    transform: translateY(-2px); 
    box-shadow: 0 4px 6px -1px var(--primary-glow);
}

.btn-download {
    background: var(--bg-main);
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.btn-download:hover {
    background: var(--border);
    color: var(--text-main);
}

.btn-selesai, .btn-pulihkan { 
    background: #10b981; 
    color: white; 
}
.btn-selesai:hover, .btn-pulihkan:hover { 
    background: #059669; 
    transform: translateY(-2px); 
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3);
}

.btn-hapus { 
    background: #ef4444; 
    color: white; 
}
.btn-hapus:hover { 
    background: #dc2626; 
    transform: translateY(-2px); 
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.3);
}

.btn-pending, .btn-warning {
    background: #f59e0b;
    color: white;
}
.btn-pending:hover, .btn-warning:hover {
    background: #d97706;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.3);
}

/* Helper Classes */
.waktu-daftar {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--bg-main);
    padding: 4px 10px;
    border-radius: 6px;
    display: inline-block;
    white-space: nowrap;
}
.page-link-custom {
    border-radius: 8px !important;
    margin: 0 4px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: all 0.2s;
    background: var(--bg-card);
}
.page-item.active .page-link-custom {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    box-shadow: 0 4px 6px -1px var(--primary-glow);
    color: white !important;
}

/* Animations */
@keyframes slideInKIA {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes slideOutKIA {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Mobile Responsive Table Overrides */
/* Responsive Table To Card View Breakpoint (Optimal for high-density tables) */
@media (max-width: 992px) {
    .custom-table {
        border: none;
        display: block !important;
        width: 100% !important;
        overflow-x: hidden;
    }
    .custom-table thead {
        display: none;
    }
    .custom-table tbody {
        display: block !important;
        width: 100% !important;
    }
    .custom-table tbody tr {
        display: block;
        width: 100% !important;
        margin-bottom: 20px;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: 16px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.03);
        overflow: hidden;
        padding: 5px 0;
        box-sizing: border-box;
    }
    .custom-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 18px !important;
        border-bottom: 1px dashed var(--border);
        width: 100% !important;
        box-sizing: border-box;
    }
    .custom-table tbody td:last-child {
        border-bottom: none;
        background: var(--bg-main);
        justify-content: flex-end;
        padding: 14px 18px !important;
    }
    .custom-table tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        font-size: 0.75rem;
        text-transform: uppercase;
        color: var(--text-muted);
        letter-spacing: 0.5px;
        margin-right: 15px;
        min-width: 100px;
        flex-shrink: 0;
    }
    .info-cell {
        text-align: right;
        flex-grow: 1;
        overflow: hidden;
        word-wrap: break-word;
    }
}

/* ── ACTION BUTTONS STANDARDIZED ── */
.btn-detil, .btn-selesai, .btn-verif, .btn-pulihkan, .btn-restore, .btn-pending, .btn-hapus, .btn-cetak {
    width: 34px !important;
    height: 34px !important;
    border-radius: 10px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: none !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer !important;
    padding: 0 !important;
    text-decoration: none !important;
    font-size: 1.1rem !important;
    vertical-align: middle !important;
    outline: none !important;
    flex-shrink: 0 !important;
}

.btn-detil:hover, .btn-selesai:hover, .btn-verif:hover, .btn-pulihkan:hover, .btn-restore:hover, .btn-pending:hover, .btn-hapus:hover, .btn-cetak:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 5px 12px rgba(0,0,0,0.1) !important;
}

/* Indigo (View/Detail) */
.btn-detil { background: rgba(99, 102, 241, 0.1) !important; color: #6366f1 !important; }
.btn-detil:hover { background: #6366f1 !important; color: #fff !important; }

/* Emerald (Success/Verify) */
.btn-selesai, .btn-verif { background: rgba(16, 185, 129, 0.1) !important; color: #10b981 !important; }
.btn-selesai:hover, .btn-verif:hover { background: #10b981 !important; color: #fff !important; }

/* Cyan (Restore/Refresh) */
.btn-pulihkan, .btn-restore { background: rgba(6, 182, 212, 0.1) !important; color: #06b6d4 !important; }
.btn-pulihkan:hover, .btn-restore:hover { background: #06b6d4 !important; color: #fff !important; }

/* Amber (Warning/Pending) */
.btn-pending { background: rgba(245, 158, 11, 0.1) !important; color: #f59e0b !important; }
.btn-pending:hover { background: #f59e0b !important; color: #fff !important; }

/* Rose (Danger/Delete) */
.btn-hapus { background: rgba(239, 68, 68, 0.1) !important; color: #ef4444 !important; }
.btn-hapus:hover { background: #ef4444 !important; color: #fff !important; }

/* Purple (Print/Export) */
.btn-cetak { background: rgba(139, 92, 246, 0.1) !important; color: #8b5cf6 !important; }
.btn-cetak:hover { background: #8b5cf6 !important; color: #fff !important; }

/* ── PREMIUM LARGE BUTTONS ── */
.btn-premium {
    border-radius: 12px !important;
    padding: 10px 24px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: none !important;
    font-size: 0.9rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    cursor: pointer !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1) !important;
}

.btn-premium:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15) !important;
}

.btn-premium-primary { background: var(--primary) !important; color: white !important; }
.btn-premium-danger { background: #ef4444 !important; color: white !important; }
.btn-premium-success { background: #10b981 !important; color: white !important; }
.btn-premium-muted { background: var(--bg-main) !important; color: var(--text-muted) !important; border: 1px solid var(--border) !important; }
