/* ========== BASE RESET & TYPOGRAPHY ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: url('latar.png') no-repeat center center fixed;
  background-size: cover;
  min-height: 100vh;
  color: #333;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, rgba(26,82,118,0.85) 0%, rgba(46,134,193,0.80) 50%, rgba(52,152,219,0.75) 100%);
  z-index: -1;
}

.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 20px;
}

.admin-container {
  max-width: 1200px;
}

/* ========== HEADER ========== */
.header {
  text-align: center;
  color: white;
  padding: 30px 20px 20px;
}

.logo-area {
  margin-bottom: 10px;
}

.logo {
  width: 90px;
  height: 90px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
}

.header h1 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 8px;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.header h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 5px;
  opacity: 0.95;
}

.header h3 {
  font-size: 0.95rem;
  font-weight: 400;
  opacity: 0.9;
  line-height: 1.5;
}

/* ========== CARD ========== */
.card {
  background: white;
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  margin-bottom: 20px;
}

.login-card {
  max-width: 420px;
  margin: 0 auto 20px;
  text-align: center;
}

.login-icon {
  font-size: 3rem;
  margin-bottom: 10px;
}

.login-title {
  font-size: 1.3rem;
  color: #1a5276;
  margin-bottom: 25px;
}

.login-footer {
  margin-top: 20px;
  text-align: center;
}

.login-footer a {
  color: #2e86c1;
  text-decoration: none;
  font-size: 0.9rem;
}

.login-footer a:hover {
  text-decoration: underline;
}

/* ========== FORM ELEMENTS ========== */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: #2c3e50;
  font-size: 0.95rem;
}

.required {
  color: #e74c3c;
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="password"],
.form-group input[type="number"] {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #dce6f0;
  border-radius: 10px;
  font-size: 1rem;
  transition: border-color 0.3s, box-shadow 0.3s;
  outline: none;
}

.form-group input:focus {
  border-color: #2e86c1;
  box-shadow: 0 0 0 3px rgba(46,134,193,0.15);
}

small {
  display: block;
  margin-top: 4px;
  color: #7f8c8d;
  font-size: 0.85rem;
}

/* ========== RADIO & CHECKBOX ========== */
.radio-group, .checkbox-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.radio-label, .checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border: 2px solid #dce6f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s;
  flex: 1;
  min-width: 140px;
  justify-content: center;
}

.radio-label:hover, .checkbox-label:hover {
  border-color: #2e86c1;
  background: #f0f7ff;
}

.radio-label input[type="radio"], .checkbox-label input[type="checkbox"] {
  display: none;
}

.radio-label input[type="radio"]:checked ~ .radio-text,
.checkbox-label input[type="checkbox"]:checked ~ .checkbox-text {
  font-weight: 700;
}

.radio-text, .checkbox-text {
  font-size: 0.95rem;
}

/* ========== BUTTONS ========== */
.btn-submit {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #1a5276, #2e86c1);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  margin-top: 10px;
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(26,82,118,0.3);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-reset {
  display: inline-block;
  padding: 12px 30px;
  background: #2e86c1;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 15px;
  text-decoration: none;
}

.btn-reset:hover {
  background: #1a5276;
}

/* ========== MESSAGES ========== */
.success-message {
  text-align: center;
  padding: 30px;
}

.success-icon {
  font-size: 4rem;
  margin-bottom: 15px;
}

.success-message h3 {
  color: #27ae60;
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.success-message p {
  color: #666;
  font-size: 1.05rem;
}

.error-message {
  background: #fdf2f2;
  color: #e74c3c;
  padding: 10px 15px;
  border-radius: 8px;
  margin-bottom: 15px;
  font-size: 0.9rem;
  border: 1px solid #f5c6cb;
}

/* ========== ADMIN STYLES ========== */
.admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  padding: 12px 20px;
  border-radius: 12px;
  margin-bottom: 15px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  flex-wrap: wrap;
  gap: 10px;
}

.admin-badge {
  font-weight: 600;
  color: #1a5276;
}

.toolbar-right {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-toolbar {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
}

.btn-refresh { background: #eaf2f8; color: #2e86c1; }
.btn-refresh:hover { background: #d4e6f1; }
.btn-print { background: #eafaf1; color: #27ae60; }
.btn-print:hover { background: #d5f5e3; }
.btn-export { background: #fef9e7; color: #f39c12; }
.btn-export:hover { background: #fdebd0; }
.btn-logout { background: #fdf2f2; color: #e74c3c; }
.btn-logout:hover { background: #fadbd8; }

/* ========== STATS ROW ========== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 15px;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  border-top: 4px solid;
}

.stat-total { border-top-color: #2e86c1; }
.stat-hadir { border-top-color: #27ae60; }
.stat-tidak { border-top-color: #e74c3c; }
.stat-wakil { border-top-color: #f39c12; }

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: #1a5276;
}

.stat-label {
  font-size: 0.85rem;
  color: #666;
  margin-top: 4px;
}

/* ========== FILTER BAR ========== */
.filter-bar {
  background: white;
  padding: 12px 20px;
  border-radius: 12px;
  margin-bottom: 15px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.filter-form {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-form label {
  font-weight: 600;
  color: #2c3e50;
}

.filter-form select {
  padding: 8px 12px;
  border: 2px solid #dce6f0;
  border-radius: 8px;
  font-size: 0.9rem;
  outline: none;
}

.filter-form select:focus {
  border-color: #2e86c1;
}

.filter-form input[type="text"] {
  flex: 1;
  min-width: 200px;
  padding: 8px 12px;
  border: 2px solid #dce6f0;
  border-radius: 8px;
  font-size: 0.9rem;
  outline: none;
}

.filter-form input[type="text"]:focus {
  border-color: #2e86c1;
}

/* ========== DATA TABLE ========== */
.table-wrapper {
  background: white;
  border-radius: 12px;
  overflow-x: auto;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  margin-bottom: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: linear-gradient(135deg, #1a5276, #2e86c1);
  color: white;
}

th {
  padding: 14px 12px;
  text-align: left;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

td {
  padding: 12px;
  border-bottom: 1px solid #eee;
  font-size: 0.9rem;
}

tr:hover {
  background: #f8fbff;
}

.center {
  text-align: center;
}

.empty-row {
  text-align: center;
  color: #999;
  padding: 40px !important;
  font-style: italic;
}

/* ========== BADGES ========== */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-hadir { background: #eafaf1; color: #27ae60; }
.badge-tidak { background: #fdf2f2; color: #e74c3c; }
.badge-wakil { background: #fef9e7; color: #f39c12; }
.badge-laki { background: #e3f2fd; color: #1976d2; }
.badge-perempuan { background: #fce4ec; color: #c2185b; }
.badge-ya { background: #e8f5e8; color: #2e7d32; }
.badge-tidak-kacamata { background: #fff3e0; color: #f57c00; }

/* ========== DELETE BUTTON ========== */
.btn-delete {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.2s;
}

.btn-delete:hover {
  background: #fdf2f2;
}

/* ========== FOOTER ========== */
.footer {
  text-align: center;
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
  padding: 15px;
}

/* ========== PRINT STYLES ========== */
.print-footer {
  display: none;
}

@media print {
  body {
    background: white !important;
    color: black;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body::before {
    display: none;
  }

  .no-print {
    display: none !important;
  }

  .container, .admin-container {
    max-width: 100%;
    padding: 0;
    margin: 0;
  }

  .header {
    color: black;
    padding: 15px 0;
    border-bottom: 3px double #000;
    margin-bottom: 15px;
  }

  .header h1 { text-shadow: none; font-size: 1.2rem; }
  .header h2 { font-size: 1rem; }
  .header h3 { font-size: 0.9rem; }

  .logo {
    filter: none;
  }

  .stats-row {
    grid-template-columns: repeat(4, 1fr);
    margin-bottom: 10px;
  }

  .stat-card {
    box-shadow: none;
    border: 1px solid #ccc;
    padding: 10px;
  }

  .stat-number { font-size: 1.3rem; color: black; }

  .table-wrapper {
    box-shadow: none;
    border: 1px solid #ccc;
    border-radius: 0;
  }

  thead {
    background: #1a5276 !important;
    color: white !important;
  }

  th { padding: 8px 6px; font-size: 0.75rem; }
  td { padding: 6px; font-size: 0.8rem; }

  .badge {
    border: 1px solid #ccc;
    background: transparent !important;
    color: black !important;
  }

  .print-footer {
    display: block;
    margin-top: 30px;
    text-align: center;
    font-size: 0.85rem;
  }

  .signature-area {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
  }

  .signature-box {
    text-align: center;
    min-width: 250px;
  }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 600px) {
  .container {
    padding: 10px;
  }

  .card {
    padding: 20px;
    border-radius: 12px;
  }

  .header h1 {
    font-size: 1.1rem;
  }

  .radio-group, .checkbox-group {
    flex-direction: column;
  }

  .radio-label, .checkbox-label {
    min-width: auto;
  }

  .admin-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-right {
    justify-content: center;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .filter-form {
    flex-direction: column;
    align-items: stretch;
  }
}

