/* ============================================================
   NEXENTORA TECHNOLOGIES — PORTAL SHARED STYLES
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary: #0ea5e9;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #06b6d4;
  --purple: #a855f7;

  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-hover: #263148;
  --border: rgba(99,102,241,0.15);
  --border-light: rgba(255,255,255,0.06);

  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  --sidebar-w: 260px;
  --topbar-h: 64px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.35);
  --shadow-card: 0 2px 12px rgba(0,0,0,0.25);
  --transition: all 0.2s ease;
}

*, *::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);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── LOGIN ─────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(99,102,241,0.12) 0%, transparent 70%);
  top: -200px; right: -200px;
  border-radius: 50%;
}

.login-page::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(14,165,233,0.08) 0%, transparent 70%);
  bottom: -100px; left: -100px;
  border-radius: 50%;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 42px;
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
  box-shadow: 0 25px 60px rgba(0,0,0,0.4);
}

.login-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.3);
  color: var(--primary-light);
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 20px;
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo img {
  width: 56px; height: 56px;
  border-radius: 12px;
  object-fit: cover;
  margin-bottom: 12px;
}

.login-logo h1 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.login-logo p {
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* ── FORM ────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-control {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text);
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  background: rgba(99,102,241,0.08);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control { cursor: pointer; -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8.5L1 3.5h10z' fill='%2394a3b8'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

/* Fix dropdown options for dark theme */
select.form-control option,
.form-control option,
select option {
  background-color: #1e293b;
  color: #f1f5f9;
  padding: 8px 14px;
}
select.form-control option:hover,
.form-control option:hover {
  background-color: #334155;
}

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

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99,102,241,0.4); }

.btn-secondary {
  background: rgba(255,255,255,0.05);
  color: var(--text);
  border: 1px solid var(--border-light);
}
.btn-secondary:hover { background: rgba(255,255,255,0.1); }

.btn-success { background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; }
.btn-danger  { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; }
.btn-warning { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }
.btn-info    { background: linear-gradient(135deg, #0ea5e9, #0284c7); color: #fff; }
.btn-dark-outline { background: transparent; border: 1px solid rgba(255,255,255,0.15); color: var(--text-secondary); }
.btn-dark-outline:hover { background: rgba(255,255,255,0.06); }
.btn-success:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(34,197,94,0.35); }
.btn-danger:hover  { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(239,68,68,0.35); }

.btn-lg  { padding: 13px 28px; font-size: 0.95rem; }
.btn-sm  { padding: 7px 14px; font-size: 0.78rem; }
.btn-full { width: 100%; justify-content: center; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ── ALERTS ──────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 18px;
}
.alert-error   { background: rgba(239,68,68,0.1);  border: 1px solid rgba(239,68,68,0.25);  color: #fca5a5; }
.alert-success { background: rgba(34,197,94,0.1);  border: 1px solid rgba(34,197,94,0.25);  color: #86efac; }
.alert-info    { background: rgba(99,102,241,0.1); border: 1px solid rgba(99,102,241,0.25); color: #a5b4fc; }
.alert-warning { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.25); color: #fcd34d; }

/* ── PORTAL LAYOUT ───────────────────────────────────────── */
.portal-layout {
  display: flex;
  min-height: 100vh;
}

/* sidebar */
.portal-sidebar {
  width: var(--sidebar-w);
  background: var(--bg-card);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border-light);
}

.sidebar-logo {
  width: 38px; height: 38px;
  border-radius: 10px;
  object-fit: cover;
}

.sidebar-brand-text h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.sidebar-brand-text span {
  font-size: 0.68rem;
  color: var(--primary-light);
  font-weight: 500;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: 16px 12px; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.nav-label {
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 12px 10px 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 2px;
  border: none;
  background: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.nav-link .nav-icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.04);
  border-radius: 7px;
  font-size: 0.8rem;
  flex-shrink: 0;
  transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
  color: var(--text);
  background: rgba(99,102,241,0.12);
}

.nav-link:hover .nav-icon,
.nav-link.active .nav-icon {
  background: rgba(99,102,241,0.2);
  color: var(--primary-light);
}

.nav-link.active { color: var(--primary-light); }

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border-light);
}

/* topbar */
.portal-topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--topbar-h);
  background: rgba(15,23,42,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 90;
}

.topbar-title h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.topbar-title p {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.topbar-actions { display: flex; align-items: center; gap: 14px; }

.user-chip {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-light);
  border-radius: 50px;
  padding: 6px 14px 6px 6px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}
.user-chip:hover { background: rgba(255,255,255,0.08); }

.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; color: #fff;
}

.user-chip-name { font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); }

/* content */
.portal-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  padding: 28px;
  min-height: calc(100vh - var(--topbar-h));
  flex: 1;
}

/* ── CARDS ───────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 24px;
  transition: var(--transition);
}
.card:hover { border-color: var(--border); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

/* ── STAT CARDS ──────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}
.stat-card:hover { border-color: var(--border); transform: translateY(-2px); }

.stat-icon {
  width: 50px; height: 50px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.stat-icon.primary { background: rgba(99,102,241,0.15); color: var(--primary-light); }
.stat-icon.success { background: rgba(34,197,94,0.15);  color: var(--success); }
.stat-icon.warning { background: rgba(245,158,11,0.15); color: var(--warning); }
.stat-icon.danger  { background: rgba(239,68,68,0.15);  color: var(--danger); }
.stat-icon.info    { background: rgba(6,182,212,0.15);  color: var(--info); }
.stat-icon.purple  { background: rgba(168,85,247,0.15); color: var(--purple); }

.stat-info .stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.stat-info .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

/* ── PROGRESS BAR ────────────────────────────────────────── */
.progress-wrap { margin: 8px 0; }
.progress-label {
  display: flex; justify-content: space-between;
  font-size: 0.72rem; color: var(--text-muted);
  margin-bottom: 6px;
}
.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.6s ease;
}
.progress-fill.success { background: linear-gradient(90deg, #22c55e, #16a34a); }
.progress-fill.warning { background: linear-gradient(90deg, #f59e0b, #d97706); }

/* ── BADGES ──────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-primary   { background: rgba(99,102,241,0.15); color: var(--primary-light); border: 1px solid rgba(99,102,241,0.3); }
.badge-success   { background: rgba(34,197,94,0.15);  color: #86efac;  border: 1px solid rgba(34,197,94,0.3); }
.badge-warning   { background: rgba(245,158,11,0.15); color: #fcd34d;  border: 1px solid rgba(245,158,11,0.3); }
.badge-danger    { background: rgba(239,68,68,0.15);  color: #fca5a5;  border: 1px solid rgba(239,68,68,0.3); }
.badge-info      { background: rgba(6,182,212,0.15);  color: #67e8f9;  border: 1px solid rgba(6,182,212,0.3); }
.badge-secondary { background: rgba(100,116,139,0.15);color: var(--text-muted); border: 1px solid rgba(100,116,139,0.3); }
.badge-purple    { background: rgba(168,85,247,0.15); color: #d8b4fe;  border: 1px solid rgba(168,85,247,0.3); }

/* ── TABLES ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}
td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.84rem;
  color: var(--text-secondary);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* ── TIMELINE ────────────────────────────────────────────── */
.timeline { position: relative; padding-left: 32px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 10px; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--primary), transparent);
}
.timeline-item {
  position: relative;
  margin-bottom: 28px;
}
.timeline-dot {
  position: absolute;
  left: -26px; top: 4px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 2px var(--primary);
}
.timeline-dot.success { background: var(--success); box-shadow: 0 0 0 2px var(--success); }
.timeline-dot.warning { background: var(--warning); box-shadow: 0 0 0 2px var(--warning); }

.timeline-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.timeline-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.timeline-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ── MODULE CARD ────────────────────────────────────────── */
.module-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.module-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  opacity: 0;
  transition: opacity 0.2s;
}
.module-card:hover { border-color: var(--border); transform: translateY(-2px); }
.module-card:hover::before { opacity: 1; }
.module-card.completed { border-color: rgba(34,197,94,0.3); }
.module-card.completed::before { background: var(--success); opacity: 1; }
.module-card.in-progress::before { opacity: 1; }

.module-order {
  font-size: 0.68rem;
  color: var(--primary-light);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.module-title {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.module-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 14px;
}

/* ── PAYMENT CARD ───────────────────────────────────────── */
.payment-info-box {
  background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(14,165,233,0.08));
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.payment-method-tabs {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin-bottom: 20px;
}

.pay-tab {
  flex: 1; min-width: 140px;
  background: rgba(255,255,255,0.04);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}
.pay-tab:hover { border-color: var(--primary); background: rgba(99,102,241,0.08); }
.pay-tab.active { border-color: var(--primary); background: rgba(99,102,241,0.15); }
.pay-tab i { font-size: 1.4rem; color: var(--primary-light); display: block; margin-bottom: 8px; }
.pay-tab span { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); display: block; }

/* ── GRID HELPERS ────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; }

.page-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.page-subtitle { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 24px; }

/* ── PORTAL LANDING ─────────────────────────────────────── */
.portal-landing {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
  padding: 40px 20px;
  position: relative; overflow: hidden;
}
.portal-landing::before {
  content: '';
  position: absolute;
  width: 800px; height: 800px;
  background: radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 70%);
  top: 50%; left: 50%; transform: translate(-50%,-50%);
  border-radius: 50%;
}

.portal-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  max-width: 1000px;
  width: 100%;
  position: relative; z-index: 1;
}

.portal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 36px 28px;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease;
  display: block;
}
.portal-card:hover {
  transform: translateY(-6px);
  border-color: var(--primary);
  box-shadow: 0 20px 40px rgba(99,102,241,0.2);
}
.portal-card-icon {
  width: 68px; height: 68px;
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  margin: 0 auto 18px;
}
.portal-card-icon.admin   { background: rgba(99,102,241,0.15); color: var(--primary-light); }
.portal-card-icon.client  { background: rgba(14,165,233,0.15); color: var(--secondary); }
.portal-card-icon.intern  { background: rgba(34,197,94,0.15);  color: var(--success); }
.portal-card-icon.staff   { background: rgba(245,158,11,0.15); color: var(--warning); }

.portal-card h3 { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.portal-card p  { font-size: 0.78rem; color: var(--text-muted); line-height: 1.6; }

.portal-enter-btn {
  margin-top: 16px;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.78rem; font-weight: 600;
  color: var(--primary-light); text-decoration: none;
}

/* ── EMPTY STATE ─────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 60px 20px;
}
.empty-state i { font-size: 3rem; color: var(--text-muted); margin-bottom: 16px; display: block; }
.empty-state h3 { font-size: 0.95rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p  { font-size: 0.8rem; color: var(--text-muted); }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .portal-sidebar { transform: translateX(-100%); }
  .portal-sidebar.open { transform: translateX(0); }
  .portal-content { margin-left: 0; }
  .portal-topbar  { left: 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2,1fr); }
}
