/* ═══════════════════════════════════════════════════════
   RETAIN - ROASLAB : USER DASHBOARD
   Premium design with glassmorphism, micro-animations
   ═══════════════════════════════════════════════════════ */

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: rgba(99, 102, 241, 0.08);
  --primary-glow: rgba(99, 102, 241, 0.25);
  --bg: #f4f6fb;
  --bg-gradient: linear-gradient(135deg, #f0f0ff 0%, #f4f6fb 40%, #f0fdf4 100%);
  --card-bg: #ffffff;
  --card-border: rgba(0,0,0,0.05);
  --card-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 20px rgba(0,0,0,0.03);
  --card-shadow-hover: 0 4px 12px rgba(0,0,0,0.06), 0 8px 30px rgba(0,0,0,0.05);
  --text: #1a1a2e;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border: #e5e7eb;
  --green: #10b981;
  --green-bg: rgba(16, 185, 129, 0.08);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.08);
  --orange: #f59e0b;
  --orange-bg: rgba(245, 158, 11, 0.08);
  --blue: #3b82f6;
  --blue-bg: rgba(59, 130, 246, 0.08);
  --purple: #7c3aed;
  --purple-bg: rgba(124, 58, 237, 0.08);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.35s cubic-bezier(0.68, -0.3, 0.265, 1.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Screens ── */
.screen { display: none; opacity: 0; transition: opacity 0.4s ease; }
.screen.active { display: block; opacity: 1; }
.full-center.active {
  display: flex !important; align-items: center; justify-content: center;
  min-height: 100vh; background: var(--bg-gradient);
  position: relative; overflow: hidden;
}

/* Background decorative shapes */
.full-center::before,
.full-center::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.4;
  pointer-events: none;
  animation: floatBlob 20s ease-in-out infinite alternate;
}
.full-center::before {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(99,102,241,0.2), transparent 70%);
  top: -150px; right: -100px;
}
.full-center::after {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(16,185,129,0.15), transparent 70%);
  bottom: -100px; left: -80px;
  animation-delay: -10s;
}
@keyframes floatBlob {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(40px, -30px) scale(1.1); }
}

/* ── Glass Panel ── */
.glass-panel {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius);
  padding: 28px;
  transition: box-shadow var(--transition), transform var(--transition);
}
.glass-panel:hover {
  box-shadow: var(--card-shadow-hover);
}

/* ══════════════════════════════════════
   LOGIN SCREEN
   ══════════════════════════════════════ */

.login-container {
  width: 100%; max-width: 440px; z-index: 1;
  animation: slideUpFade 0.6s ease-out;
}
@keyframes slideUpFade {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-brand {
  text-align: center; margin-bottom: 32px;
}
.brand-icon {
  width: 64px; height: 64px; margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--primary), #818cf8);
  border-radius: 20px; display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  box-shadow: 0 8px 24px var(--primary-glow);
  animation: iconPulse 3s ease-in-out infinite;
}
@keyframes iconPulse {
  0%, 100% { box-shadow: 0 8px 24px var(--primary-glow); }
  50% { box-shadow: 0 8px 32px rgba(99, 102, 241, 0.35); }
}

.login-brand h1 {
  font-size: 28px; font-weight: 800; color: var(--text); letter-spacing: -0.5px;
}
.login-brand h1 span { color: var(--primary); }
.brand-tagline {
  color: var(--text-secondary); font-size: 14px; margin-top: 6px;
}

.login-panel {
  padding: 36px; text-align: center;
}
.login-panel h2 {
  font-size: 20px; font-weight: 700; margin-bottom: 6px;
}
.login-panel > p {
  color: var(--text-secondary); font-size: 13px; margin-bottom: 28px;
}

.input-group { text-align: left; margin-bottom: 20px; }
.input-group label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 8px;
  text-transform: uppercase; letter-spacing: 0.4px;
}
.input-icon-wrapper {
  position: relative;
}
.input-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  font-size: 14px; pointer-events: none; opacity: 0.5;
}
.input-icon-wrapper input {
  width: 100%; padding: 13px 16px 13px 42px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--bg);
  font-size: 14px; font-family: inherit; outline: none;
  transition: all var(--transition);
}
.input-icon-wrapper input:focus {
  border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light);
  background: #fff;
}
.input-icon-wrapper input::placeholder { color: var(--text-muted); }

.primary-btn {
  width: 100%; padding: 14px 24px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white; font-size: 14px; font-weight: 600;
  border: none; cursor: pointer; font-family: inherit;
  transition: all var(--transition);
  box-shadow: 0 2px 8px var(--primary-glow);
  position: relative; overflow: hidden;
}
.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(99,102,241,0.35);
}
.primary-btn:active { transform: translateY(0); }
.primary-btn:disabled {
  opacity: 0.7; cursor: not-allowed; transform: none;
}

.btn-loader { display: inline-flex; align-items: center; gap: 8px; }
.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff;
  border-radius: 50%; animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-msg {
  color: var(--red); font-size: 13px; margin-top: 16px;
  display: none; font-weight: 500;
  background: var(--red-bg); padding: 10px 14px; border-radius: var(--radius-xs);
}

.login-footer {
  text-align: center; margin-top: 20px;
  font-size: 13px; color: var(--text-secondary);
}
.login-footer a {
  color: var(--primary); text-decoration: none; font-weight: 600;
}
.login-footer a:hover { text-decoration: underline; }

/* ══════════════════════════════════════
   HEADER
   ══════════════════════════════════════ */

.glass-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 40px; background: rgba(255,255,255,0.88);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--card-border);
  position: sticky; top: 0; z-index: 10;
}
.header-left { display: flex; align-items: center; gap: 12px; }
.logo { font-size: 18px; font-weight: 800; letter-spacing: -0.3px; }
.logo span { color: var(--primary); }
.header-badge {
  font-size: 11px; font-weight: 700; color: var(--primary);
  background: var(--primary-light); padding: 4px 10px;
  border-radius: 20px; letter-spacing: 0.3px;
  text-transform: uppercase;
}
.header-right { display: flex; align-items: center; gap: 14px; }
.user-email-label {
  font-size: 13px; color: var(--text-secondary); font-weight: 500;
}
.icon-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm); background: transparent;
  border: 1.5px solid var(--border); color: var(--text-secondary); font-weight: 600;
  font-size: 13px; cursor: pointer; font-family: inherit;
  transition: all var(--transition);
}
.icon-btn:hover {
  border-color: var(--red); color: var(--red);
  background: var(--red-bg);
}

/* ══════════════════════════════════════
   DASHBOARD CONTENT
   ══════════════════════════════════════ */

.dashboard-content {
  padding: 32px 40px; max-width: 1100px;
  margin: 0 auto; display: flex; flex-direction: column; gap: 24px;
  animation: fadeIn 0.5s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── License Hero Card ── */
.license-hero {
  display: flex; align-items: center; justify-content: space-between;
  padding: 36px 40px;
  background: linear-gradient(135deg, #fafaff 0%, #f5f3ff 50%, #eff6ff 100%);
  border: 1px solid rgba(99,102,241,0.08);
  position: relative; overflow: hidden;
}
.license-hero::before {
  content: ''; position: absolute; top: -40px; right: -40px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(99,102,241,0.06), transparent 70%);
  border-radius: 50%;
}

.hero-status-area { display: flex; flex-direction: column; gap: 8px; }
.hero-badge-wrapper { display: flex; align-items: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 16px; border-radius: 24px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.3px;
}
.hero-badge.Active {
  background: var(--green-bg); color: var(--green);
  box-shadow: 0 0 0 1px rgba(16,185,129,0.15);
}
.hero-badge.Active::before { content: '●'; font-size: 8px; animation: blink 2s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.hero-badge.Expired {
  background: var(--red-bg); color: var(--red);
  box-shadow: 0 0 0 1px rgba(239,68,68,0.15);
}
.hero-badge.Expired::before { content: '●'; font-size: 8px; }
.hero-badge.Revoked {
  background: var(--red-bg); color: #dc2626;
  box-shadow: 0 0 0 1px rgba(220,38,38,0.15);
}
.hero-badge.Revoked::before { content: '⊘'; font-size: 10px; }

.hero-status-area h2 {
  font-size: 28px; font-weight: 800; letter-spacing: -0.5px; color: var(--text);
}
.hero-sub { font-size: 14px; color: var(--text-secondary); font-weight: 500; font-family: 'Courier New', monospace; letter-spacing: 1px; }

.hero-stats { display: flex; align-items: center; gap: 32px; }
.hero-stat { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.hero-stat-value { font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: -0.3px; }
.hero-stat-label { font-size: 11px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.hero-divider { width: 1px; height: 44px; background: var(--border); }

/* ── Info Grid ── */
.info-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.info-card {
  display: flex; align-items: center; gap: 16px;
  padding: 22px 24px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.info-card:hover { transform: translateY(-2px); }

.info-card-icon {
  width: 48px; height: 48px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.info-card-icon.blue { background: var(--blue-bg); }
.info-card-icon.green { background: var(--green-bg); }
.info-card-icon.orange { background: var(--orange-bg); }
.info-card-icon.purple { background: var(--purple-bg); }

.info-card-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.info-card-label {
  font-size: 11px; font-weight: 600; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.4px;
}
.info-card-value {
  font-size: 16px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── Two Columns Layout ── */
.two-columns {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
}

.column-card { padding: 28px 30px; }
.column-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--border);
}
.column-header h3 { font-size: 15px; font-weight: 700; }

.shops-counter {
  font-size: 12px; font-weight: 700; color: var(--primary);
  background: var(--primary-light); padding: 4px 12px;
  border-radius: 20px;
}

/* ── Shops List ── */
.shops-list-container { display: flex; flex-direction: column; gap: 8px; }
.shop-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg); padding: 14px 18px; border-radius: var(--radius-sm);
  transition: background var(--transition), transform var(--transition);
  animation: slideIn 0.3s ease;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}
.shop-item:hover { background: rgba(0,0,0,0.04); transform: translateX(2px); }
.shop-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--orange-bg); display: flex; align-items: center;
  justify-content: center; font-size: 16px; flex-shrink: 0;
}
.shop-name { font-size: 14px; font-weight: 600; color: var(--text); }
.shops-empty {
  text-align: center; color: var(--text-secondary); font-size: 13px;
  padding: 32px 16px; background: var(--bg); border-radius: var(--radius-sm);
}
.shops-empty-icon { font-size: 32px; display: block; margin-bottom: 8px; }
.shop-slot-bar {
  margin-top: 16px; padding: 14px 18px; background: var(--bg);
  border-radius: var(--radius-sm);
}
.slot-bar-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.slot-bar-header span { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.slot-bar-track {
  width: 100%; height: 8px; background: var(--border);
  border-radius: 4px; overflow: hidden;
}
.slot-bar-fill {
  height: 100%; background: linear-gradient(90deg, var(--primary), #818cf8);
  border-radius: 4px; transition: width 0.6s ease;
}

/* ── Timeline ── */
.timeline {
  position: relative; padding-left: 36px;
  max-height: 380px; overflow-y: auto;
}
.timeline::-webkit-scrollbar { width: 4px; }
.timeline::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.08); border-radius: 2px; }
.timeline::before {
  content: ''; position: absolute; left: 15px; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, rgba(99,102,241,0.3), rgba(99,102,241,0.03));
  border-radius: 1px;
}

.timeline-item {
  position: relative; padding: 8px 0 22px;
  animation: fadeSlideUp 0.4s ease;
}
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute; left: -30px; top: 10px;
  width: 22px; height: 22px; border-radius: 50%;
  background: white; border: 2px solid var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; z-index: 1;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.timeline-item.created .timeline-dot { border-color: var(--green); }
.timeline-item.revoked .timeline-dot { border-color: var(--red); }
.timeline-item.activated .timeline-dot { border-color: var(--green); }
.timeline-item.unbind .timeline-dot { border-color: var(--orange); }
.timeline-item.payment .timeline-dot { border-color: #059669; }
.timeline-item.renewed .timeline-dot { border-color: var(--blue); }
.timeline-item.upgraded .timeline-dot { border-color: var(--purple); }
.timeline-item.downgraded .timeline-dot { border-color: #78716c; }

.timeline-content {
  background: var(--bg); padding: 14px 18px; border-radius: 12px;
  transition: background var(--transition), transform var(--transition);
}
.timeline-content:hover { background: rgba(0,0,0,0.04); transform: translateX(2px); }

.timeline-action { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.timeline-detail { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.timeline-date { font-size: 11px; color: var(--text-muted); margin-top: 5px; font-weight: 500; }
.timeline-empty {
  text-align: center; color: var(--text-secondary); font-size: 13px; padding: 32px;
}
.timeline-empty-icon { font-size: 32px; display: block; margin-bottom: 8px; }

/* ── Footer ── */
.dashboard-footer {
  text-align: center; padding: 24px 40px; margin-top: 8px;
  border-top: 1px solid var(--card-border);
}
.dashboard-footer p { font-size: 12px; color: var(--text-muted); }
.dashboard-footer a { color: var(--primary); text-decoration: none; font-weight: 600; }
.dashboard-footer a:hover { text-decoration: underline; }

/* ── Toast ── */
.toast-container {
  position: fixed; top: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 9999; pointer-events: none;
}
.toast {
  background: #fff; border-radius: 12px; padding: 14px 18px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.1), 0 1px 3px rgba(0,0,0,0.06);
  border-left: 4px solid var(--primary);
  transform: translateX(120%); opacity: 0;
  transition: all var(--transition-spring);
  pointer-events: auto; min-width: 260px;
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast-success { border-left-color: var(--green); }
.toast-error { border-left-color: var(--red); }
.toast-warning { border-left-color: var(--orange); }
.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast-message { font-size: 13px; font-weight: 500; color: var(--text); }

/* ── Modal ── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  z-index: 1000; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.active { display: flex; animation: fadeInModal 0.2s ease; }
@keyframes fadeInModal { from { opacity: 0; } to { opacity: 1; } }

.modal-panel {
  width: 100%; max-width: 450px;
  animation: slideUpModal 0.3s cubic-bezier(0.68, -0.3, 0.265, 1.35);
  padding: 32px;
}
@keyframes slideUpModal {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.modal-header h3 { font-size: 18px; font-weight: 700; color: var(--text); }
.modal-close-btn {
  background: var(--bg); border: none; width: 32px; height: 32px;
  border-radius: var(--radius-sm); font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); transition: all var(--transition);
}
.modal-close-btn:hover { background: var(--red-bg); color: var(--red); transform: rotate(90deg); }
.modal-body { display: flex; flex-direction: column; gap: 8px; }

/* ── Skeleton Loading ── */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #fafafa 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-xs);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── WhatsApp Float Btn ── */
.wa-float-btn {
  position: fixed; bottom: 24px; right: 24px;
  width: 56px; height: 56px;
  background: #25D366; color: white;
  border-radius: 50%; display: flex;
  align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
  z-index: 900; transition: all var(--transition-spring);
}
.wa-float-btn:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.5);
}

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */

@media (max-width: 900px) {
  .info-grid { grid-template-columns: repeat(2, 1fr); }
  .two-columns { grid-template-columns: 1fr; }
  .license-hero { flex-direction: column; gap: 24px; text-align: center; padding: 28px; }
  .hero-stats { gap: 24px; }
}

@media (max-width: 640px) {
  .glass-header { padding: 12px 16px; flex-direction: column; gap: 10px; }
  .header-right { width: 100%; justify-content: space-between; }
  .dashboard-content { padding: 20px 16px; }
  .info-grid { grid-template-columns: 1fr; }
  .hero-stats { flex-direction: column; gap: 16px; }
  .hero-divider { width: 44px; height: 1px; }
  .login-container { padding: 0 16px; }
  .login-panel { padding: 28px 24px; }
}
