/* =====================================================
   GOLD PREMIUM DESIGN SYSTEM
   STAI Minhajul Haq — Absensi Dosen
   Vibrant • Bold • Professional
   ===================================================== */

/* =====================================================
   DESIGN TOKENS
   ===================================================== */
:root {
  /* Primary Gold Colors - Vibrant & Rich */
  --gold-50: #fffbeb;
  --gold-100: #fef3c7;
  --gold-200: #fde68a;
  --gold-300: #fcd34d;
  --gold-400: #fbbf24;
  --gold-500: #f59e0b;
  --gold-600: #d97706;
  --gold-700: #b45309;
  --gold-800: #92400e;
  --gold-900: #78350f;

  /* Warm Brown Accent */
  --brown-50: #fdf8f6;
  --brown-100: #f2e8e5;
  --brown-200: #eaddd7;
  --brown-600: #7c5e4a;
  --brown-700: #5c4033;
  --brown-800: #44312a;
  --brown-900: #2d1810;

  /* Semantic Colors */
  --success: #10b981;
  --success-bg: #d1fae5;
  --error: #ef4444;
  --error-bg: #fee2e2;

  /* Main Theme Colors */
  --primary: #f59e0b;
  --primary-light: #fbbf24;
  --primary-dark: #d97706;
  --primary-deep: #b45309;

  /* Text Colors - High Contrast */
  --text-dark: #1f1307;
  --text-primary: #3d2914;
  --text-secondary: #6b5344;
  --text-muted: #8b7355;
  --text-light: #ffffff;

  /* Background Gradients */
  --bg-page: linear-gradient(160deg, #fef7ed 0%, #fff8e7 30%, #fffbf0 70%, #fef3c7 100%);
  --bg-card: linear-gradient(180deg, #ffffff 0%, #fffcf5 50%, #fff8eb 100%);
  --bg-gold: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
  --bg-gold-dark: linear-gradient(135deg, #d97706 0%, #b45309 50%, #92400e 100%);

  /* Shadows - Rich & Deep */
  --shadow-sm: 0 2px 4px rgba(180, 83, 9, 0.08);
  --shadow-md: 0 6px 16px rgba(180, 83, 9, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 16px 40px rgba(180, 83, 9, 0.18), 0 6px 16px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 24px 56px rgba(180, 83, 9, 0.22), 0 8px 24px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 60px rgba(251, 191, 36, 0.35), 0 0 30px rgba(245, 158, 11, 0.25);
  --shadow-button: 0 6px 20px rgba(245, 158, 11, 0.4);

  /* Borders */
  --border-gold: 2px solid rgba(251, 191, 36, 0.6);
  --border-gold-strong: 2px solid #fbbf24;

  /* Typography */
  --font-primary: 'Philosopher', Georgia, serif;
  --font-body: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-slow: 0.4s ease;
}

/* Form Visibility Adjustments - Luminous Gold Edition */
/* RESET & BASE */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  font-size: 16px;
}

/* =====================================================
   LAYOUT
   ===================================================== */
.app-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
}

.container {
  width: 100%;
  max-width: 620px;
  display: flex;
  justify-content: center;
}

/* =====================================================
   MAIN CARD — Premium Gold Card
   ===================================================== */
.center-card {
  width: 100%;
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow-xl), var(--shadow-glow);
  border: 3px solid rgba(251, 191, 36, 0.4);
}

/* Top gold accent bar */
.center-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--bg-gold);
  z-index: 10;
}

/* Content positioning */
.center-card>* {
  position: relative;
  z-index: 2;
  padding: var(--space-xl) var(--space-lg);
}

/* =====================================================
   HEADER & LOGO — Clean Premium Design
   ===================================================== */
.logo-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  padding-top: var(--space-xl) !important;
  padding-bottom: var(--space-md) !important;
  position: relative;
  background: linear-gradient(180deg,
      rgba(254, 243, 199, 0.35) 0%,
      rgba(255, 251, 235, 0.2) 50%,
      transparent 100%);
}

/* Simple decorative line */
.logo-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  max-width: 300px;
  height: 1px;
  background: linear-gradient(90deg,
      transparent 0%,
      rgba(251, 191, 36, 0.4) 50%,
      transparent 100%);
}

/* =====================================================
   LOGO CONTAINER — Elegant Glowing Effect
   ===================================================== */
.logo-glow-wrap {
  position: relative;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;

  /* Clean gradient background */
  background: radial-gradient(circle at 40% 35%,
      #ffffff 0%,
      #fffef8 25%,
      #fef3c7 60%,
      #fde68a 100%);

  /* Smooth gold border matching card */
  border: 3px solid rgba(251, 191, 36, 0.4);

  /* Beautiful layered glow - all warm gold tones */
  box-shadow:
    0 0 30px rgba(251, 191, 36, 0.35),
    0 0 60px rgba(251, 191, 36, 0.2),
    0 0 90px rgba(251, 191, 36, 0.12),
    0 10px 30px rgba(251, 191, 36, 1),
    inset 0 3px 15px rgba(255, 255, 255, 0.6),
    inset 0 -3px 10px rgba(251, 191, 36, 0.3);

  transition: all 0.4s ease;
  animation: logoFloat 5s ease-in-out infinite;
}

@keyframes logoFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

.logo-glow-wrap:hover {
  transform: translateY(-8px) scale(1.03);
  border-color: rgba(252, 251, 250, 0.8);
  box-shadow:
    0 0 40px rgba(251, 191, 36, 0.7),
    0 0 80px rgba(251, 191, 36, 0.8),
    0 0 120px rgba(251, 191, 36, 0.9),
    0 15px 40px rgba(180, 83, 9, 0.3),
    inset 0 3px 15px rgba(255, 255, 255, 0.8),
    inset 0 -3px 10px rgba(251, 191, 36, 0.5);
}


.brand-logo {
  width: 78%;
  height: 78%;
  object-fit: contain;
  filter: drop-shadow(0 6px 15px rgba(255, 255, 255, 0.729));
  position: relative;
  z-index: 2;
}

/* Decorative ring SVG */
.logo-ring {
  position: absolute;
  width: 135%;
  height: 135%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.8;
  animation: ringPulse 3s ease-in-out infinite;
  filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.5));
}

@keyframes ringPulse {

  0%,
  100% {
    opacity: 0.6;
    transform: translate(-50%, -50%) scale(1);
  }

  50% {
    opacity: 0.85;
    transform: translate(-50%, -50%) scale(1.03);
  }
}

/* =====================================================
   TITLE — Premium Animated Gold Title
   ===================================================== */
.title {
  font-family: var(--font-primary) !important;
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-align: center;
  position: relative;
  margin-bottom: var(--space-md);

  /* Animated gold gradient text */
  background: linear-gradient(135deg,
      #92400e 0%,
      #b45309 20%,
      #d97706 40%,
      #f59e0b 50%,
      #fbbf24 60%,
      #d97706 80%,
      #92400e 100%);
  background-size: 200% auto;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;

  /* Glow effect */
  filter: drop-shadow(0 2px 4px rgba(180, 83, 9, 0.4));

  /* Animation */
  animation: titleGradient 4s ease-in-out infinite;
}

@keyframes titleGradient {

  0%,
  100% {
    background-position: 0% center;
  }

  50% {
    background-position: 100% center;
  }
}

.header-text {
  text-align: center;
}

.date-display {
  font-family: var(--font-primary);
  font-size: 1.1rem;
  color: var(--brown-700);
  margin-top: -8px;
  /* Dekatkan ke judul */
  margin-bottom: var(--space-sm);
  font-weight: 500;
  opacity: 0.9;
}

/* =====================================================
   CARD BODY
   ===================================================== */
.card-body {
  padding-top: var(--space-sm) !important;
}

/* =====================================================
   TABS — Vibrant Gold Pills
   ===================================================== */
.tabs {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.tab-btn {
  position: relative;
  flex: 1;
  max-width: 220px;
  padding: var(--space-md) var(--space-lg);
  border: 2px solid #e7e5e4;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #ffffff 0%, #f5f5f4 50%, #e7e5e4 100%);
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: 700;
  color: var(--brown-600);
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  overflow: hidden;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.tab-btn:hover {
  border-color: var(--gold-400);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.15), inset 0 1px 0 #fff;
  color: var(--gold-700);
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
}

.tab-btn[aria-selected="true"] {
  background: linear-gradient(135deg, #fcd34d 0%, #fbbf24 50%, #f59e0b 100%);
  color: var(--brown-900);
  border: 2px solid var(--gold-600);
  box-shadow:
    0 10px 20px rgba(180, 83, 9, 0.2),
    0 6px 6px rgba(180, 83, 9, 0.1),
    inset 0 2px 0 rgba(255, 255, 255, 0.45);
  transform: translateY(-4px);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
  z-index: 2;
}

.tab-btn[aria-selected="true"]::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0%, transparent 100%);
  pointer-events: none;
}

.tab-btn[aria-selected="true"]:hover {
  box-shadow:
    0 15px 30px rgba(180, 83, 9, 0.25),
    0 8px 10px rgba(180, 83, 9, 0.15),
    inset 0 2px 0 #ffffff99;
  transform: translateY(-6px);
}

/* Remove the after pseudo-element bar */
.tab-btn::after {
  display: none;
}

/* =====================================================
   PANELS
   ===================================================== */
.panel {
  display: none;
  opacity: 0;
  transform: translateY(10px);
}

.panel.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
  animation: fadeSlideIn 0.35s ease-out;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =====================================================
   PANEL HEADINGS — Bold & Clear
   ===================================================== */
.panel h3,
.form-title {
  font-family: var(--font-primary);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brown-800);
  text-align: center;
  margin-bottom: var(--space-md);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* =====================================================
   FORM ELEMENTS — Clear & Bold Labels
   ===================================================== */
.form-label {
  display: block;
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 1rem;
  color: var(--brown-700);
  margin-bottom: var(--space-sm);
  text-align: center;
  letter-spacing: 0.3px;
}

.small-note {
  font-size: 0.95rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: var(--space-lg);
  line-height: 1.6;
}

.small-note strong {
  color: var(--gold-700);
  font-weight: 700;
}

/* =====================================================
   INPUT STYLING — Premium Gold Theme
   ===================================================== */
input,
select,
textarea {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  border: 2px solid rgba(251, 191, 36, 0.4);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #ffffff 0%, #fffdf7 100%);
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: all var(--transition-fast);
  text-align: center;
  margin-bottom: var(--space-md);
  box-shadow: var(--shadow-sm), inset 0 1px 2px rgba(255, 255, 255, 0.8);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--gold-400);
  box-shadow: var(--shadow-md);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--gold-500);
  background: linear-gradient(180deg, #ffffff 0%, #fffbeb 100%);
  box-shadow:
    0 0 0 4px rgba(251, 191, 36, 0.2),
    var(--shadow-md),
    inset 0 1px 2px rgba(255, 255, 255, 0.9);
}

/* Select custom styling */
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23b45309' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 20px;
  padding-right: 48px;
  cursor: pointer;
  font-weight: 600;
}

select option {
  padding: var(--space-sm);
  font-weight: 500;
}

/* Textarea */
textarea {
  text-align: left;
  resize: vertical;
  min-height: 110px;
  line-height: 1.6;
}

/* Disabled state */
input:disabled,
select:disabled,
textarea:disabled {
  background: linear-gradient(180deg, #f5f5f4 0%, #e7e5e4 100%);
  border-color: #d6d3d1;
  color: var(--text-muted);
  cursor: not-allowed;
}

/* Row layout for jam selection (DEPRECATED - Replaced by Grid) */
/* .row { ... } */

/* =====================================================
   COMPACT ATTENDANCE GRID (TOGGLE STYLE)
   ===================================================== */
.attendance-grid-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  background: rgba(255, 255, 255, 0.5);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.attendance-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.row-label {
  font-family: var(--font-primary);
  font-weight: 700;
  color: var(--brown-700);
  min-width: 60px;
  /* Lebar label JAM 1 etc */
  font-size: 1.1rem;
}

.toggle-group {
  display: flex;
  flex: 1;
  gap: 6px;
  background: #fff;
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid #e7e5e4;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03);
}

/* Hide actual radios */
.toggle-group input[type="radio"] {
  display: none;
}

/* Base Style for Toggle Button */
.toggle-btn {
  flex: 1;
  text-align: center;
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition-base);
  user-select: none;
  border: 1px solid transparent;
}

.toggle-btn:hover {
  background: var(--gold-50);
  color: var(--brown-800);
}

/* Checked States - Color Coded */
input[type="radio"]:checked+.toggle-btn[data-type="hadir"] {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4);
  border-color: #047857;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
}

input[type="radio"]:checked+.toggle-btn[data-type="tidak"] {
  background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
  color: #fff;
  box-shadow: 0 2px 6px rgba(107, 114, 128, 0.4);
  border-color: #4b5563;
}

input[type="radio"]:checked+.toggle-btn[data-type="izin"] {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
  border-color: #b45309;
}

/* Responsive for Grid */
@media (max-width: 480px) {
  .attendance-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .row-label {
    font-size: 0.95rem;
    margin-left: 4px;
    color: var(--gold-700);
  }

  .toggle-group {
    width: 100%;
  }

  .toggle-btn {
    font-size: 0.85rem;
    padding: 10px 4px;
    /* Larger touch target */
  }
}


/* =====================================================
   BUTTONS — Vibrant & Bold
   ===================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-primary);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: var(--bg-gold);
  color: var(--brown-900);
  box-shadow: var(--shadow-button), inset 0 2px 0 rgba(255, 255, 255, 0.35);
  border: 2px solid var(--gold-600);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow:
    0 10px 30px rgba(245, 158, 11, 0.5),
    inset 0 2px 0 rgba(255, 255, 255, 0.4);
  background: linear-gradient(135deg, #fcd34d 0%, #fbbf24 50%, #f59e0b 100%);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.btn-ghost {
  background: linear-gradient(180deg, #ffffff 0%, #fafaf9 100%);
  color: var(--brown-700);
  border: 2px solid #d6d3d1;
  box-shadow: var(--shadow-sm);
}

.btn-ghost:hover {
  border-color: var(--gold-400);
  color: var(--gold-700);
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-ghost:active {
  transform: translateY(0);
  background: var(--gold-100);
}

/* Actions container */
.actions {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  margin-top: var(--space-xl);
  flex-wrap: wrap;
}

/* =====================================================
   SIGNATURE SECTION
   ===================================================== */
.ttd-section {
  margin-top: var(--space-xl);
}

.ttd-section .form-label {
  font-size: 1.1rem;
  color: var(--brown-700);
}

.ttd-box {
  border: 3px dashed var(--gold-400) !important;
  border-radius: var(--radius-md) !important;
  background: linear-gradient(180deg, #ffffff 0%, #fffdf7 100%) !important;
  padding: var(--space-sm) !important;
  margin-top: var(--space-sm) !important;
  transition: all var(--transition-fast);
}

.ttd-box:hover {
  border-color: var(--gold-500) !important;
  box-shadow: var(--shadow-md);
}

#ttdCanvas {
  width: 100% !important;
  height: 160px !important;
  display: block !important;
  cursor: crosshair !important;
  border-radius: var(--radius-sm) !important;
  background: #ffffff !important;
}

.ttd-section .small-note {
  font-size: 0.9rem;
  margin-top: var(--space-md);
  color: var(--text-muted);
}

/* =====================================================
   ALERTS — Clear Feedback
   ===================================================== */
.alert {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
  margin-top: var(--space-md);
}

.alert.success {
  background: var(--success-bg);
  color: #065f46;
  border: 2px solid rgba(16, 185, 129, 0.3);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.alert.error {
  background: var(--error-bg);
  color: #991b1b;
  border: 2px solid rgba(239, 68, 68, 0.3);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

/* =====================================================
   FOOTER
   ===================================================== */
.footer {
  text-align: center;
  padding: var(--space-md) var(--space-lg) !important;

  /* Text Color: Dark Brown for contrast on Gold */
  color: var(--brown-900);
  font-size: 0.95rem;
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);

  /* Glossy Gold Gradient (Matching Active Tab) */
  background: linear-gradient(135deg, #fcd34d 0%, #fbbf24 50%, #f59e0b 100%);

  /* Border & Shape */
  border: 1px solid var(--gold-600);
  border-radius: var(--radius-md);
  margin-top: var(--space-xl);

  /* Glossy Effects */
  box-shadow:
    0 4px 12px rgba(180, 83, 9, 0.15),
    /* Soft Drop Shadow */
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    /* Top Highlight (Glassy Edge) */
    inset 0 0 20px rgba(255, 255, 255, 0.2);
  /* Inner Glow */

  position: relative;
  overflow: hidden;
  max-width: 100%;
}

.footer .year {
  font-weight: 800;
}

.footer-brand {
  font-family: var(--font-primary);
  font-size: 1.35rem;
  font-weight: 700;
  /* Bold (Max for Philosopher) */
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 4px;

  /* Thicken the text slightly for 'Extra Bold' feel */
  -webkit-text-stroke: 0.5px #78350f;

  /* Animated Dark Bronze/Coffee Gradient (High Contrast on Gold) */
  background: linear-gradient(135deg,
      #2d1810 0%,
      #78350f 25%,
      #b45309 50%,
      #78350f 75%,
      #2d1810 100%);
  background-size: 200% auto;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;

  /* Subtle Glow/Highlight for depth */
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.5));

  /* Reuse the existing title animation */
  animation: titleGradient 4.5s ease-in-out infinite;
}

.footer-meta {
  /* Match Font and Weight */
  font-family: var(--font-primary);
  font-size: 0.95rem;
  /* Slightly larger for readability with gradient */
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-top: 2px;

  /* Match Stroke Effect (Slightly thinner for small text) */
  -webkit-text-stroke: 0.3px #78350f;

  /* Match Gradient & Animation */
  background: linear-gradient(135deg,
      #2d1810 0%,
      #78350f 25%,
      #b45309 50%,
      #78350f 75%,
      #2d1810 100%);
  background-size: 200% auto;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;

  /* Match Shadow/Glow */
  filter: drop-shadow(0 0.5px 0 rgba(255, 255, 255, 0.5));

  /* Match Animation */
  animation: titleGradient 4.5s ease-in-out infinite;
}

.footer::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 95%;
  height: 80%;

  /* Logo Watermark */
  background-image: url("landscape white.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;

  /* Subtle visibility on Gold */
  opacity: 0.45;
  mix-blend-mode: overlay;
  /* Blends nicely with gold */
  z-index: 1;
  pointer-events: none;
}

/* =====================================================
   MAHASISWA PANEL SPECIFIC
   ===================================================== */
#panel-mahasiswa {
  text-align: center;
}

#panel-mahasiswa h3 {
  margin-bottom: var(--space-sm);
}

#panel-mahasiswa .input-ghost {
  text-align: center;
  text-align-last: center;
  max-width: 400px;
  margin: 0 auto var(--space-md);
}

#openSheet {
  margin-top: var(--space-lg);
}

/* =====================================================
   SIGNATURE CANVAS STYLING
   ===================================================== */
.ttd-wrapper {
  position: relative;
  margin-top: 4px;
}

.ttd-box {
  border: 1px dashed var(--gold-600);
  border-radius: var(--radius-md);
  background: #fffaf4;
  /* Warm white */
  padding: 6px;
  overflow: hidden;
}

#ttdCanvas {
  width: 100%;
  height: 160px;
  /* Fixed height */
  display: block;
  cursor: crosshair;
  touch-action: none;
  background-color: #fffaf4;
}

.btn-clear-float {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--gold-400);
  color: var(--brown-700);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(45, 24, 16, 0.1);
  transition: all 0.2s ease;
  z-index: 5;
  backdrop-filter: blur(2px);
}

.btn-clear-float:hover {
  background: #fff;
  border-color: #dc2626;
  /* Red border */
  color: #dc2626;
  /* Red icon */
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 4px 8px rgba(220, 38, 38, 0.15);
}

.btn-clear-float svg {
  width: 16px;
  height: 16px;
}

/* =====================================================
   VALIDATION ANIMATIONS
   ===================================================== */
@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-5px);
  }

  75% {
    transform: translateX(5px);
  }
}

.error-border {
  border-color: #ef4444 !important;
  /* Red-500 */
  animation: shake 0.4s ease-in-out;
}

/* =====================================================
   ANIMATIONS & GREETING
   ===================================================== */
.greeting-text {
  font-family: var(--font-primary);
  font-size: 1.25rem;
  color: var(--gold-600);
  font-weight: 600;
  margin-bottom: 2px;
  font-style: italic;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

@keyframes fadeSlideUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-enter {
  opacity: 0;
  /* Initially hidden */
  animation: fadeSlideUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* Hidden/Visible Field Animation */
.hidden-field {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 0;
  transform: translateY(-10px);
}

.visible-field {
  max-height: 200px;
  /* Lebar cukup untuk textarea */
  opacity: 1;
  margin-bottom: var(--space-lg);
  transform: translateY(0);
}

/* =====================================================
   THEME TOGGLE BUTTON
   ===================================================== */
.theme-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--gold-400);
  background: white;
  color: var(--gold-600);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  z-index: 1000;
}

[data-theme="dark"] .theme-toggle {
  background: var(--dark-card);
  color: var(--gold-400);
  border-color: var(--dark-border);
}

.theme-toggle:hover {
  transform: rotate(30deg) scale(1.1);
  box-shadow: var(--shadow-lg);
}

.theme-toggle svg {
  width: 22px;
  height: 22px;
  position: absolute;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Toggle Logic: Sun/Moon visibility */
.theme-toggle .moon {
  opacity: 0;
  transform: scale(0);
}

.theme-toggle .sun {
  opacity: 1;
  transform: scale(1);
}

[data-theme="dark"] .theme-toggle .moon {
  opacity: 1;
  transform: scale(1);
}

[data-theme="dark"] .theme-toggle .sun {
  opacity: 0;
  transform: scale(0);
}

/* =====================================================
   UTILITY CLASSES
   ===================================================== */
.mt-1 {
  margin-top: var(--space-sm);
}

.input-ghost {
  padding: 8px 12px;
  border: 1px solid #d6d3d1;
  border-radius: var(--radius-sm);
  background: #fff;
  width: 100%;
  font-family: var(--font-body);
  transition: all var(--transition-fast);
}

.input-ghost:focus {
  outline: none;
  border-color: var(--gold-400);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.15);
}

/* Fix Signature Scroll on Mobile */
#ttdCanvas {
  touch-action: none;
}

.inline {
  display: inline-flex;
  gap: var(--space-sm);
  align-items: center;
}

.sheet-link {
  margin-top: var(--space-sm);
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.sheet-link .url {
  font-size: 0.95rem;
  word-break: break-all;
  font-weight: 500;
}

.small-help {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: var(--space-md);
  text-align: center;
  font-weight: 500;
}

/* =====================================================
   RESPONSIVE DESIGN
   ===================================================== */
@media (max-width: 640px) {
  .app-wrap {
    padding: var(--space-md);
  }

  .center-card>* {
    padding: var(--space-md) var(--space-md);
  }

  /* Header adjustments - reduced spacing */
  .logo-header {
    padding-top: var(--space-lg) !important;
    padding-bottom: var(--space-sm) !important;
    gap: var(--space-sm);
  }

  .card-body {
    padding-top: var(--space-xs) !important;
  }

  .logo-glow-wrap {
    width: 150px;
    height: 150px;
  }

  .title {
    font-size: 1.8rem;
    letter-spacing: 1px;
    margin-bottom: 0;
  }

  .tabs {
    flex-direction: row;
    gap: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-md);
  }

  .tab-btn {
    flex: 1;
    font-size: 0.85rem;
    padding: 10px 6px;
    line-height: 1.2;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .row {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .actions {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 280px;
  }

  .panel h3,
  .form-title {
    font-size: 1.3rem;
  }
}

@media (max-width: 480px) {
  .title {
    font-size: 1.7rem;
    letter-spacing: 0.5px;
  }

  .logo-glow-wrap {
    width: 140px;
    height: 140px;
  }

  input,
  select,
  textarea {
    font-size: 1rem;
    padding: var(--space-md);
  }

  .tab-btn {
    font-size: 0.95rem;
    padding: var(--space-md);
  }

  .btn {
    font-size: 1rem;
    padding: var(--space-md) var(--space-lg);
  }
}

/* =====================================================
   ACCESSIBILITY & PERFORMANCE
   ===================================================== */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus visible */
:focus-visible {
  outline: 3px solid var(--gold-400);
  outline-offset: 3px;
}

/* Touch optimization */
@media (hover: none) and (pointer: coarse) {

  .btn,
  .tab-btn,
  select,
  input {
    touch-action: manipulation;
  }

  .btn:active,
  .tab-btn:active {
    transform: scale(0.98);
  }
}

/* =====================================================
   PRINT STYLES
   ===================================================== */
@media print {
  .app-wrap {
    padding: 0;
    min-height: auto;
  }

  .center-card {
    box-shadow: none;
    border: 2px solid #ccc;
  }

  .tabs,
  .actions,
  .ttd-section {
    display: none;
  }
}

/* =====================================================
   SUCCESS MODAL (ANIMATED)
   ===================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(45, 24, 16, 0.6);
  /* Dark Brown Overlay */
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: linear-gradient(135deg, #ffffff 0%, #fffbf0 100%);
  padding: 32px;
  border-radius: 20px;
  width: 90%;
  max-width: 360px;
  text-align: center;
  border: 2px solid var(--gold-400);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.3),
    0 0 30px rgba(251, 191, 36, 0.4);
  transform: scale(0.8) translateY(20px);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.open .modal-card {
  transform: scale(1) translateY(0);
}

.modal-icon {
  width: 70px;
  height: 70px;
  background: var(--success);
  border-radius: 50%;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 8px 16px rgba(16, 185, 129, 0.3);

  /* Initial state for animation */
  transform: scale(0);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s;
}

.modal-overlay.open .modal-icon {
  transform: scale(1);
}

.modal-icon svg {
  width: 40px;
  height: 40px;
}

.modal-title {
  font-family: var(--font-primary);
  font-size: 1.6rem;
  color: var(--brown-900);
  margin-bottom: 8px;
  font-weight: 700;
}

.modal-msg {
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.5;
}

.modal-close-btn {
  width: 100%;
  padding: 12px;
  font-size: 1.05rem;
}

/* Header Actions inside Panels */
.panel-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 12px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: #fff;
  border: 1px solid var(--gold-400);
  color: var(--gold-700);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--gold-50);
  border-color: var(--gold-600);
  color: var(--gold-800);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-small {
  padding: 8px 14px;
  font-size: 0.85rem;
}

@media (max-width: 480px) {
  .panel-header-actions {
    flex-direction: column;
    text-align: center;
  }
}

/* =====================================================
   ABSENSI MAHASISWA - FORM LANGSUNG
   ===================================================== */

/* Filter Section */
.mhs-filter-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: var(--space-md);
}

.filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.filter-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-item.full {
  width: 100%;
}

.filter-item .form-label {
  text-align: left;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.filter-item input,
.filter-item select {
  margin-bottom: 0;
}

/* List Wrapper */
.mhs-list-wrapper {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(254, 243, 199, 0.2) 100%);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  animation: fadeSlideIn 0.35s ease-out;
}

/* List Header */
.mhs-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(251, 191, 36, 0.3);
}

.mhs-list-header h4 {
  font-family: var(--font-primary);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--brown-800);
  margin: 0;
}

/* Quick Actions */
.quick-actions {
  display: flex;
  gap: var(--space-sm);
}

.btn-quick {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: 1px solid #d6d3d1;
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-quick svg {
  width: 14px;
  height: 14px;
}

.btn-quick.hadir-all {
  border-color: #10b981;
  color: #059669;
}

.btn-quick.hadir-all:hover {
  background: #d1fae5;
  border-color: #059669;
}

.btn-quick.reset-all {
  color: var(--text-secondary);
}

.btn-quick.reset-all:hover {
  background: var(--gold-50);
  border-color: var(--gold-400);
  color: var(--gold-700);
}

/* Legend */
.mhs-legend {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-md);
  font-size: 0.85rem;
  font-weight: 500;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
}

.legend-item .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.legend-item.hadir .dot {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.legend-item.izin .dot {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.legend-item.alpha .dot {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* List Container */
.mhs-list-container {
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

/* Custom Scrollbar */
.mhs-list-container::-webkit-scrollbar {
  width: 6px;
}

.mhs-list-container::-webkit-scrollbar-track {
  background: rgba(251, 191, 36, 0.1);
  border-radius: 3px;
}

.mhs-list-container::-webkit-scrollbar-thumb {
  background: var(--gold-400);
  border-radius: 3px;
}

/* Student Row */
.mhs-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 10px 14px;
  background: #fff;
  border: 1px solid #e7e5e4;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.mhs-row:hover {
  border-color: var(--gold-400);
  box-shadow: var(--shadow-sm);
}

.mhs-number {
  min-width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gold-100);
  color: var(--gold-700);
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
}

.mhs-name {
  flex: 1;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.95rem;
}

/* Status Toggle Group */
.mhs-status-group {
  display: flex;
  gap: 4px;
  background: #f5f5f4;
  padding: 3px;
  border-radius: var(--radius-sm);
}

.mhs-status-group input[type="radio"] {
  display: none;
}

.mhs-status-btn {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.mhs-status-btn:hover {
  background: #fff;
  color: var(--text-primary);
}

/* Active States */
input[type="radio"]:checked+.mhs-status-btn[data-status="hadir"] {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border-color: #047857;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

input[type="radio"]:checked+.mhs-status-btn[data-status="izin"] {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  border-color: #b45309;
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

input[type="radio"]:checked+.mhs-status-btn[data-status="alpha"] {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  border-color: #b91c1c;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl) var(--space-lg);
  text-align: center;
  color: var(--text-muted);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  stroke: var(--gold-400);
  margin-bottom: var(--space-md);
  opacity: 0.7;
}

.empty-state p {
  font-size: 0.95rem;
  line-height: 1.6;
}

.empty-state strong {
  color: var(--gold-700);
}

/* Responsive */
@media (max-width: 520px) {
  .app-wrap {
    padding: var(--space-md);
  }

  .center-card>* {
    padding: var(--space-lg) var(--space-md);
  }

  .title {
    font-size: 1.8rem;
    letter-spacing: 1.5px;
  }

  .logo-glow-wrap {
    width: 140px;
    height: 140px;
  }

  .filter-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .mhs-list-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .mhs-list-header h4 {
    font-size: 1.05rem;
  }

  .quick-actions {
    width: auto;
  }

  .btn-quick {
    padding: 6px 10px;
    font-size: 0.75rem;
  }

  .mhs-row {
    padding: 10px;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
  }

  .mhs-number {
    min-width: 24px;
    height: 24px;
    font-size: 0.75rem;
  }

  .mhs-name {
    font-size: 0.9rem;
    flex: 1;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-all;
    line-height: 1.2;
    font-weight: 600;
  }

  .mhs-status-group {
    width: 100%;
    margin-top: 4px;
    justify-content: space-between;
  }

  .mhs-status-btn {
    flex: 1;
    text-align: center;
    padding: 8px 4px;
    font-size: 0.75rem;
  }

  .mhs-legend {
    gap: var(--space-md);
    font-size: 0.75rem;
    margin-bottom: 10px;
  }

  input,
  select,
  textarea {
    font-size: 0.9rem;
    padding: 10px 12px;
    text-align: left;
  }

  select {
    padding-right: 36px;
    background-position: right 10px center;
  }
}

/* =====================================================
   FOOTER & SIGNATURE
   ===================================================== */
.footer {
  text-align: center;
  margin-top: var(--space-xl);
  padding: var(--space-lg) 0;
  position: relative;
}

.footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 2px;
  background: var(--gold-300);
  border-radius: var(--radius-full);
  opacity: 0.4;
}

.footer-brand {
  font-family: var(--font-primary);
  font-weight: 700;
  color: var(--brown-700);
  font-size: 1.1rem;
  margin-bottom: 2px;
  letter-spacing: 0.5px;
}

.footer-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0.8;
}

.footer-author {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.35;
  margin-top: 16px;
  transition: all var(--transition-base);
  cursor: default;
  display: inline-block;
}

.footer-author:hover {
  opacity: 0.8;
  color: var(--gold-700);
  transform: translateY(-1px);
}