/* =============================================
   Portal Upload Dokumentasi Program CSR Focus
   style.css — Premium Dark Theme
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Outfit:wght@400;600;700;800;900&display=swap');

/* ---- CSS Variables ---- */
:root {
  --primary: #6C63FF;
  --primary-light: #8B85FF;
  --primary-dark: #534ACC;
  --primary-glow: rgba(108, 99, 255, 0.25);

  --gold: #D97706;
  --gold-light: #FBBF24;
  --gold-glow: rgba(217, 119, 6, 0.25);

  --accent: #00A887;
  --accent-glow: rgba(0, 168, 135, 0.2);

  --danger: #E84118;
  --danger-glow: rgba(232, 65, 24, 0.2);

  --bg: #F8FAFC;
  --bg-2: #FFFFFF;
  --bg-3: #F1F5F9;
  --surface: rgba(255, 255, 255, 0.75);
  --surface-hover: rgba(255, 255, 255, 0.95);
  --border: rgba(108, 99, 255, 0.12);
  --border-focus: rgba(108, 99, 255, 0.6);

  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;

  --radius: 16px;
  --radius-sm: 8px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --shadow-glow: 0 0 40px rgba(108, 99, 255, 0.08);
  --shadow-card: 0 8px 32px rgba(31, 38, 135, 0.06);
  --shadow-button: 0 4px 20px rgba(108, 99, 255, 0.3);

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* =============================================
   OPENING ANIMATION SCREEN
   ============================================= */

#intro-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #F8FAFC;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#intro-screen.fade-out {
  animation: introFadeOut 0.8s ease forwards;
}

@keyframes introFadeOut {
  to { opacity: 0; transform: scale(1.05); pointer-events: none; }
}

/* Particles Canvas */
#particles-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Radial glow background */
.intro-bg-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(108,99,255,0.15) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
  50% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
}

/* Intro Content */
.intro-content {
  position: relative;
  z-index: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* Emblem */
.intro-emblem {
  width: 120px;
  height: 120px;
  position: relative;
  opacity: 0;
  animation: emblemAppear 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.3s forwards;
}

@keyframes emblemAppear {
  from { opacity: 0; transform: scale(0.3) rotate(-15deg); }
  to { opacity: 1; transform: scale(1) rotate(0deg); }
}

.emblem-star {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.emblem-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid;
  animation: ringRotate 8s linear infinite;
}

.emblem-ring:nth-child(1) {
  width: 120px; height: 120px;
  border-color: rgba(108,99,255,0.6);
  animation-duration: 8s;
}
.emblem-ring:nth-child(2) {
  width: 90px; height: 90px;
  border-color: rgba(245,158,11,0.4);
  animation-direction: reverse;
  animation-duration: 5s;
  border-style: dashed;
}

@keyframes ringRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.emblem-icon {
  font-size: 48px;
  filter: drop-shadow(0 0 20px var(--gold));
  animation: iconPulse 1.5s ease-in-out infinite;
  position: relative;
  z-index: 2;
}

@keyframes iconPulse {
  0%, 100% { filter: drop-shadow(0 0 12px var(--gold)); }
  50% { filter: drop-shadow(0 0 28px var(--gold)) drop-shadow(0 0 48px rgba(245,158,11,0.4)); }
}

/* Title Text */
.intro-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.intro-line1 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 8px;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(20px);
  animation: lineReveal 0.8s ease 1.0s forwards;
}

.intro-line2 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(32px, 6vw, 64px);
  font-weight: 900;
  letter-spacing: 6px;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 50%, #F97316 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0;
  transform: translateY(30px);
  animation: lineReveal 0.9s cubic-bezier(0.175, 0.885, 0.32, 1.275) 1.5s forwards;
  filter: drop-shadow(0 0 24px var(--gold-glow));
  position: relative;
}

.intro-line2::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 10%;
  width: 80%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0;
  animation: lineReveal 0.6s ease 2.2s forwards;
}

@keyframes lineReveal {
  to { opacity: 1; transform: translateY(0); }
}

/* Subtitle */
.intro-subtitle {
  font-size: clamp(13px, 2vw, 16px);
  color: var(--text-secondary);
  letter-spacing: 3px;
  text-transform: uppercase;
  opacity: 0;
  animation: lineReveal 0.6s ease 2.0s forwards;
}

/* Skip Button */
.intro-skip {
  opacity: 0;
  animation: lineReveal 0.5s ease 2.5s forwards;
  margin-top: 8px;
}

.intro-skip button {
  background: rgba(108, 99, 255, 0.06);
  border: 1px solid rgba(108, 99, 255, 0.12);
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 2px;
  padding: 8px 20px;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
}
.intro-skip button:hover {
  background: rgba(108, 99, 255, 0.12);
  color: var(--text-secondary);
}

/* Sparkles */
.sparkle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  pointer-events: none;
}

/* =============================================
   MAIN PORTAL — Hidden initially
   ============================================= */

#main-portal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  min-height: 100vh;
}

#main-portal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Background ---- */
.bg-animated {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(108,99,255,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(0,212,170,0.05) 0%, transparent 60%),
    var(--bg);
  pointer-events: none;
}

/* Grid pattern overlay */
.bg-animated::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(108, 99, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(108, 99, 255, 0.035) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* ---- Layout ---- */
.portal-wrapper {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

/* ---- Header ---- */
.portal-header {
  padding: 32px 0 40px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-logo {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: 0 4px 20px var(--primary-glow), inset 0 1px 0 rgba(255,255,255,0.1);
  flex-shrink: 0;
}

.header-text h1 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(18px, 3vw, 26px);
  font-weight: 800;
  line-height: 1.2;
  background: linear-gradient(135deg, #0F172A 40%, var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-text p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
  letter-spacing: 0.5px;
}

.header-badge {
  margin-left: auto;
  background: rgba(0,212,170,0.1);
  border: 1px solid rgba(0,212,170,0.25);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ---- Cards ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  margin-bottom: 24px;
}

.card:hover {
  border-color: rgba(108,99,255,0.2);
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

.card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.card-title .icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

.icon-purple { background: rgba(108,99,255,0.15); }
.icon-gold   { background: rgba(245,158,11,0.15); }
.icon-teal   { background: rgba(0,212,170,0.12); }
.icon-red    { background: rgba(255,71,87,0.12); }

/* ---- Company Selector ---- */
.company-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.company-row .form-group { flex: 1; margin-bottom: 0; }

.btn-add-company, .btn-refresh-company, .btn-delete-company {
  height: 50px;
  width: 50px;
  min-width: 50px;
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 20px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-add-company {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 4px 15px var(--primary-glow);
  font-size: 22px;
}
.btn-add-company:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 24px var(--primary-glow);
}

.btn-refresh-company {
  background: linear-gradient(135deg, var(--accent), #00876c);
  box-shadow: 0 4px 15px var(--accent-glow);
}
.btn-refresh-company:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 24px var(--accent-glow);
}

.btn-delete-company {
  background: linear-gradient(135deg, var(--danger), #c22e0c);
  box-shadow: 0 4px 15px var(--danger-glow);
}
.btn-delete-company:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 24px var(--danger-glow);
}

/* ---- Form Grid ---- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-grid .full-width { grid-column: 1 / -1; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 0;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.form-label span.req { color: var(--danger); margin-left: 2px; }

.form-input, .form-select, .form-textarea {
  background: #FFFFFF;
  border: 1px solid rgba(108, 99, 255, 0.15);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  padding: 13px 16px;
  transition: var(--transition);
  outline: none;
  width: 100%;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--border-focus);
  background: rgba(108,99,255,0.06);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.12);
}

.form-input::placeholder, .form-textarea::placeholder {
  color: var(--text-muted);
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%239090C0'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px;
  padding-right: 40px;
}

.form-select option {
  background: var(--bg-2);
  color: var(--text-primary);
}

.form-textarea {
  resize: vertical;
  min-height: 90px;
}

/* ---- Drop Zone ---- */
.drop-zone {
  border: 2px dashed rgba(108,99,255,0.3);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: rgba(108,99,255,0.03);
  position: relative;
  overflow: hidden;
}

.drop-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(108,99,255,0.05), transparent);
  opacity: 0;
  transition: var(--transition);
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--primary);
  background: rgba(108,99,255,0.07);
}

.drop-zone:hover::before, .drop-zone.drag-over::before { opacity: 1; }

.drop-zone.drag-over {
  transform: scale(1.01);
  box-shadow: 0 0 30px var(--primary-glow);
}

.drop-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 12px;
  animation: floatUp 2s ease-in-out infinite;
}

@keyframes floatUp {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.drop-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.drop-subtext {
  font-size: 12px;
  color: var(--text-muted);
}

.drop-types {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 14px;
  flex-wrap: wrap;
}

.type-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 12px;
  text-transform: uppercase;
}

.type-badge.foto { background: rgba(108,99,255,0.15); color: var(--primary-light); border: 1px solid rgba(108,99,255,0.2); }
.type-badge.video { background: rgba(245,158,11,0.12); color: var(--gold); border: 1px solid rgba(245,158,11,0.2); }
.type-badge.doc { background: rgba(0,212,170,0.1); color: var(--accent); border: 1px solid rgba(0,212,170,0.2); }

#file-input { display: none; }

/* ---- File List ---- */
.file-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.file-list::-webkit-scrollbar { width: 4px; }
.file-list::-webkit-scrollbar-track { background: transparent; }
.file-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  animation: fileItemIn 0.3s ease;
}

@keyframes fileItemIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

.file-item-icon { font-size: 22px; flex-shrink: 0; }

.file-item-info { flex: 1; min-width: 0; }

.file-item-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-item-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.file-type-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 8px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.file-type-tag.foto { background: rgba(108,99,255,0.2); color: var(--primary-light); }
.file-type-tag.video { background: rgba(245,158,11,0.15); color: var(--gold); }

.file-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 2px;
  border-radius: 4px;
  transition: var(--transition-fast);
  flex-shrink: 0;
}
.file-remove:hover { color: var(--danger); background: rgba(255,71,87,0.1); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  letter-spacing: 0.3px;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: var(--transition-fast);
}

.btn:hover::before { background: rgba(255,255,255,0.06); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: var(--shadow-button);
}
.btn-primary:hover { box-shadow: 0 8px 30px rgba(108,99,255,0.5); transform: translateY(-1px); }

.btn-gold {
  background: linear-gradient(135deg, var(--gold) 0%, #F97316 100%);
  color: #1a1000;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(245,158,11,0.35);
}
.btn-gold:hover { box-shadow: 0 8px 30px rgba(245,158,11,0.5); transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary-light); background: rgba(108,99,255,0.06); }

.btn-danger {
  background: rgba(255,71,87,0.1);
  border: 1px solid rgba(255,71,87,0.25);
  color: var(--danger);
}
.btn-danger:hover { background: rgba(255,71,87,0.18); }

.btn-full { width: 100%; }
.btn-lg { padding: 16px 32px; font-size: 15px; }
.btn-sm { padding: 8px 16px; font-size: 12px; }

/* ---- Upload Button with ripple ---- */
#btn-upload {
  position: relative;
  overflow: hidden;
}

.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  transform: scale(0);
  animation: rippleAnim 0.6s linear;
  pointer-events: none;
}

@keyframes rippleAnim {
  to { transform: scale(4); opacity: 0; }
}

/* ---- Progress Bar ---- */
.progress-wrap {
  display: none;
  margin-top: 16px;
}

.progress-wrap.show { display: block; }

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.progress-bar-track {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  width: 0%;
  transition: width 0.3s ease;
  box-shadow: 0 0 8px var(--primary-glow);
}

/* ---- Download Toggle ---- */
.download-section {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.format-toggle {
  display: flex;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
}

.format-btn {
  padding: 8px 20px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Inter', sans-serif;
}

.format-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 2px 10px var(--primary-glow);
}

.format-btn:not(.active):hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
}

/* ---- Result Panel ---- */
.result-panel {
  display: none;
  animation: resultSlideIn 0.5s ease;
}

.result-panel.show { display: block; }

@keyframes resultSlideIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-success {
  background: linear-gradient(135deg, rgba(0,212,170,0.08), rgba(0,212,170,0.03));
  border: 1px solid rgba(0,212,170,0.2);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}

.result-error {
  background: linear-gradient(135deg, rgba(255,71,87,0.08), rgba(255,71,87,0.03));
  border: 1px solid rgba(255,71,87,0.2);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}

.result-status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.result-icon {
  font-size: 32px;
  line-height: 1;
}

.result-title {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 700;
}

.result-link-box {
  background: rgba(108, 99, 255, 0.05);
  border: 1px solid rgba(108, 99, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.result-link {
  color: var(--accent);
  font-size: 13px;
  text-decoration: none;
  font-weight: 500;
  word-break: break-all;
}
.result-link:hover { text-decoration: underline; }

.copy-link-btn {
  background: rgba(0,212,170,0.1);
  border: 1px solid rgba(0,212,170,0.2);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
}
.copy-link-btn:hover { background: rgba(0,212,170,0.18); }

/* ---- Notif Preview ---- */
.notif-preview {
  background: #E8F5E9;
  border: 1px solid rgba(46, 125, 50, 0.15);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 16px;
  font-size: 13px;
  line-height: 1.7;
  color: #1B5E20;
  font-family: 'Courier New', monospace;
  position: relative;
  max-height: 280px;
  overflow-y: auto;
}

.notif-preview-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #2E7D32;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: #4CAF50; animation: blink 1.5s ease infinite; }

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ---- History Table & Responsive Wrapper ---- */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 10px;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.history-table th {
  padding: 14px 12px;
  background: var(--bg-3);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

.history-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: 250px;
}

.history-table tbody tr {
  transition: var(--transition-fast);
}

.history-table tbody tr:hover {
  background: rgba(108, 99, 255, 0.04);
}

.history-table td a.history-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(0, 168, 135, 0.1);
  color: var(--accent);
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  transition: var(--transition-fast);
}

.history-table td a.history-link-btn:hover {
  background: rgba(0, 168, 135, 0.2);
  transform: translateY(-1px);
}

#btn-close-history:hover {
  background: rgba(0, 0, 0, 0.05) !important;
  color: var(--text-primary) !important;
}

/* ---- Company Manager ---- */
.company-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 4px;
}

.company-chip {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  cursor: pointer;
}

.company-chip:hover {
  border-color: var(--primary);
  background: rgba(108,99,255,0.07);
}

.company-chip-icon { font-size: 18px; }

.company-chip-name {
  font-size: 13px;
  font-weight: 500;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.company-chip-del {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  opacity: 0;
  transition: var(--transition-fast);
  padding: 2px;
}

.company-chip:hover .company-chip-del { opacity: 1; }
.company-chip-del:hover { color: var(--danger); }

/* ---- Add Company Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 440px;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}

.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.modal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  background: rgba(255,255,255,0.06);
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}
.modal-close:hover { background: rgba(255,71,87,0.15); color: var(--danger); }

/* ---- Toast Notification ---- */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 380px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: toastSlideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  font-size: 13px;
  font-weight: 500;
}

.toast.success { border-left: 3px solid var(--accent); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--primary); }
.toast.warning { border-left: 3px solid var(--gold); }

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ---- Loading Spinner ---- */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---- Stats Row ---- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: var(--transition);
}

.stat-card:hover {
  border-color: rgba(108,99,255,0.2);
  background: rgba(108,99,255,0.04);
}

.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}

/* ---- Section Divider ---- */
.section-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0 24px;
}

/* ---- Action Row ---- */
.action-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .form-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr; }
  .download-section { flex-direction: column; align-items: flex-start; }
  .portal-header { flex-wrap: wrap; }
  .header-badge { margin-left: 0; }
  .company-row { flex-direction: column; }
  .btn-add-company { width: 100%; }
}

/* ---- Utility ---- */
.text-muted { color: var(--text-muted); font-size: 12px; }
.text-success { color: var(--accent); }
.text-danger { color: var(--danger); }
.text-gold { color: var(--gold); }
.mb-0 { margin-bottom: 0 !important; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ---- Daftar Link Drive Section ---- */
.drive-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.drive-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.drive-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.05);
  border-color: rgba(108, 99, 255, 0.3);
}

.drive-item-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.drive-item-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: rgba(232, 65, 24, 0.05);
  border-radius: 50%;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.drive-item:hover .drive-item-icon-wrapper {
  background: rgba(232, 65, 24, 0.1);
  transform: scale(1.05);
}

.drive-item-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.drive-item-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drive-item-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin: 2px 0 0 0;
}

.drive-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.drive-item-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.drive-item-btn:hover {
  background: var(--bg-3);
  color: var(--text-primary);
  transform: scale(1.05);
}

.drive-item-btn.btn-open:hover {
  color: var(--accent);
  border-color: rgba(0, 184, 148, 0.3);
  background: rgba(0, 184, 148, 0.05);
}

.drive-item-btn.btn-edit:hover {
  color: var(--primary);
  border-color: rgba(108, 99, 255, 0.3);
  background: rgba(108, 99, 255, 0.05);
}

.drive-item-btn.btn-delete:hover {
  color: var(--danger);
  border-color: rgba(232, 65, 24, 0.3);
  background: rgba(232, 65, 24, 0.05);
}
