/* 
 * Style Aplikasi SISTEM PENGECEKAN DPS & DPT PILKADES
 * Tema: Resmi Pemerintahan, Modern, Bersih, Responsif
 */

:root {
  --primary-color: #0d5f42;       /* Hijau Tua Resmi */
  --primary-dark: #083c2a;
  --primary-light: #167a57;
  --primary-soft: #e8f5ed;
  --secondary-color: #1e293b;     /* Slate Navy */
  --accent-gold: #c59b27;
  --sidebar-width: 260px;
  --header-height: 64px;
  --card-border-radius: 10px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #f4f6f9;
  color: #334155;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Wrapper & Layout */
#app-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Sidebar Styling */
#sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #093c29 0%, #062b1d 100%);
  color: #e2e8f0;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1040;
  overflow-y: auto;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 4px 0 16px rgba(0, 0, 0, 0.12);
}

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

.sidebar-brand img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.sidebar-brand .brand-text {
  line-height: 1.2;
}

.sidebar-brand .brand-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #ffffff;
  text-transform: uppercase;
}

.sidebar-brand .brand-subtitle {
  font-size: 11px;
  color: #86efac;
  letter-spacing: 0.3px;
}

.sidebar-user {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}

.sidebar-user .user-role {
  font-size: 11px;
  font-weight: 600;
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
  padding: 2px 8px;
  border-radius: 20px;
  display: inline-block;
  margin-top: 4px;
}

.sidebar-menu {
  padding: 12px 10px;
  list-style: none;
  margin: 0;
}

.sidebar-heading {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #6ee7b7;
  padding: 12px 14px 4px;
}

.sidebar-item {
  margin-bottom: 3px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  color: #cbd5e1;
  text-decoration: none;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.2s ease;
  gap: 12px;
}

.sidebar-link i {
  font-size: 17px;
  width: 22px;
  text-align: center;
  color: #a7f3d0;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  transform: translateX(3px);
}

.sidebar-link.active {
  background: #10b981;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.sidebar-link.active i {
  color: #ffffff;
}

/* Main Content Area */
#main-content {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
}

/* Top Navbar */
.top-navbar {
  height: var(--header-height);
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.page-container {
  padding: 24px;
  flex: 1;
}

/* Cards & Statistics */
.card-official {
  border: 1px solid #e2e8f0;
  border-radius: var(--card-border-radius);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  background: #ffffff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-official:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.card-header-official {
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
  padding: 14px 20px;
  font-weight: 600;
  font-size: 14.5px;
  color: #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Metric Cards */
.stat-card {
  padding: 18px 20px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
}

.stat-card.primary::before { background: #0d5f42; }
.stat-card.info::before { background: #0284c7; }
.stat-card.success::before { background: #10b981; }
.stat-card.warning::before { background: #f59e0b; }
.stat-card.danger::before { background: #ef4444; }
.stat-card.purple::before { background: #8b5cf6; }
.stat-card.dark::before { background: #334155; }

.stat-card .stat-value {
  font-size: 26px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.1;
  margin: 6px 0 2px;
}

.stat-card .stat-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card .stat-icon {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 38px;
  opacity: 0.15;
}

/* Big Search Box for Cek Pemilih */
.search-box-large {
  background: #ffffff;
  border-radius: 12px;
  padding: 28px;
  border: 1px solid #cbd5e1;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
}

.search-input-big {
  font-size: 18px;
  padding: 14px 20px;
  border-radius: 8px;
  border: 2px solid #94a3b8;
  transition: border-color 0.2s;
}

.search-input-big:focus {
  border-color: #0d5f42;
  box-shadow: 0 0 0 4px rgba(13, 95, 66, 0.15);
}

/* Result Card */
.result-status-card {
  border-radius: 12px;
  border: 2px solid transparent;
  padding: 24px;
  margin-top: 24px;
}

.result-status-card.status-dpt {
  background: #ecfdf5;
  border-color: #10b981;
}

.result-status-card.status-dps {
  background: #f0f9ff;
  border-color: #0284c7;
}

.result-status-card.status-warning {
  background: #fffbeb;
  border-color: #f59e0b;
}

.result-status-card.status-danger {
  background: #fef2f2;
  border-color: #ef4444;
}

.result-title-badge {
  font-size: 18px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Kop Surat Resmi Desa untuk Laporan */
.kop-surat {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 3px double #000000;
  text-align: center;
  position: relative;
}

.kop-surat .kop-logo-left {
  width: 75px;
  height: 75px;
  object-fit: contain;
  position: absolute;
  left: 10px;
}

.kop-surat .kop-logo-right {
  width: 75px;
  height: 75px;
  object-fit: contain;
  position: absolute;
  right: 10px;
}

.kop-surat .kop-text h2 {
  font-size: 16px;
  font-weight: bold;
  margin: 0;
  text-transform: uppercase;
  color: #000;
}

.kop-surat .kop-text h1 {
  font-size: 18px;
  font-weight: 800;
  margin: 2px 0;
  text-transform: uppercase;
  color: #000;
}

.kop-surat .kop-text p {
  font-size: 12px;
  margin: 0;
  color: #333;
}

/* Responsiveness */
@media (max-width: 991.98px) {
  #sidebar {
    margin-left: calc(-1 * var(--sidebar-width));
  }

  #sidebar.show {
    margin-left: 0;
  }

  #main-content {
    margin-left: 0;
    width: 100%;
  }

  .sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1035;
    display: none;
  }

  .sidebar-backdrop.show {
    display: block;
  }
}

/* Print CSS Khusus Laporan */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 12pt;
  }

  #sidebar,
  .top-navbar,
  .no-print,
  .btn,
  .dataTables_filter,
  .dataTables_length,
  .dataTables_paginate,
  .dataTables_info,
  .card-header-official .btn-group {
    display: none !important;
  }

  #main-content {
    margin: 0 !important;
    width: 100% !important;
    padding: 0 !important;
  }

  .page-container {
    padding: 0 !important;
  }

  .card-official {
    border: none !important;
    box-shadow: none !important;
  }

  .table {
    border-collapse: collapse !important;
    width: 100% !important;
    color: #000 !important;
  }

  .table th, .table td {
    border: 1px solid #000 !important;
    padding: 5px 8px !important;
  }

  .kop-surat {
    border-bottom: 3px double #000 !important;
  }
}
