/* =========================================================
   RH SYSTEM — MAIN CSS
   Dark Premium Theme
   ========================================================= */

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

:root {
  --bg-base:        #0B0B18;
  --bg-surface:     #12121F;
  --bg-card:        rgba(255,255,255,0.04);
  --bg-card-hover:  rgba(255,255,255,0.07);
  --sidebar-bg:     #0E0E1C;
  --sidebar-width:  260px;

  --accent:         #7C3AED;
  --accent-light:   #9D5FF5;
  --accent-glow:    rgba(124,58,237,0.35);
  --accent-2:       #06B6D4;
  --accent-3:       #10B981;
  --danger:         #EF4444;
  --warning:        #F59E0B;

  --text-primary:   #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted:     #475569;

  --border:         rgba(255,255,255,0.07);
  --border-accent:  rgba(124,58,237,0.4);

  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  18px;
  --radius-xl:  24px;

  --shadow-card:  0 4px 24px rgba(0,0,0,0.4);
  --shadow-glow:  0 0 40px rgba(124,58,237,0.2);
  --transition:   all 0.3s cubic-bezier(0.4,0,0.2,1);
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

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

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 999px; }

/* ── Typography ── */
h1 { font-size: 2rem; font-weight: 800; }
h2 { font-size: 1.5rem; font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }
p, span, td, th, li { font-size: 0.9rem; }
a { text-decoration: none; color: inherit; }

/* ── Glass Card ── */
.glass {
  background: var(--bg-card);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  transition: var(--transition);
}
.glass:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  outline: none;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #fff;
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
}
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-accent);
}

.btn-danger {
  background: linear-gradient(135deg,#EF4444,#DC2626);
  color:#fff;
  box-shadow: 0 4px 20px rgba(239,68,68,0.3);
}
.btn-danger:hover { transform: translateY(-2px); }

.btn-success {
  background: linear-gradient(135deg,#10B981,#059669);
  color:#fff;
  box-shadow: 0 4px 20px rgba(16,185,129,0.3);
}
.btn-success:hover { transform: translateY(-2px); }

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

/* ── Alerts ── */
.alert {
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: .875rem;
  border: 1px solid transparent;
}
.alert-success { background: rgba(16,185,129,.12); border-color: rgba(16,185,129,.3); color: #34D399; }
.alert-danger  { background: rgba(239,68,68,.12);  border-color: rgba(239,68,68,.3);  color: #F87171; }

/* ── Form select ── */
.form-select {
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: .875rem;
  padding: 10px 14px;
  outline: none;
  transition: border-color .2s;
  cursor: pointer;
}
.form-select:focus { border-color: var(--accent); }

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-purple  { background: rgba(124,58,237,0.2);  color: #A78BFA; }
.badge-green   { background: rgba(16,185,129,0.2);  color: #34D399; }
.badge-cyan    { background: rgba(6,182,212,0.2);   color: #22D3EE; }
.badge-red     { background: rgba(239,68,68,0.2);   color: #FCA5A5; }
.badge-yellow  { background: rgba(245,158,11,0.2);  color: #FCD34D; }

/* ── Input ── */
.form-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  transition: var(--transition);
  outline: none;
}
.form-input::placeholder { color: var(--text-muted); }
.form-input:focus {
  border-color: var(--accent);
  background: rgba(124,58,237,0.08);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.form-group { margin-bottom: 18px; }

/* ── Avatar ── */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.avatar-sm  { width: 32px;  height: 32px; }
.avatar-md  { width: 44px;  height: 44px; }
.avatar-lg  { width: 64px;  height: 64px; }
.avatar-xl  { width: 80px;  height: 80px; }

.avatar-placeholder {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}

/* ── Divider ── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* ── Progress bar ── */
.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  transition: width 1.2s cubic-bezier(0.4,0,0.2,1);
}

/* ── Animations ── */
@keyframes fadeInUp {
  from { opacity:0; transform: translateY(24px); }
  to   { opacity:1; transform: translateY(0); }
}
@keyframes fadeInLeft {
  from { opacity:0; transform: translateX(-24px); }
  to   { opacity:1; transform: translateX(0); }
}
@keyframes fadeInRight {
  from { opacity:0; transform: translateX(24px); }
  to   { opacity:1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity:0; transform: scale(0.92); }
  to   { opacity:1; transform: scale(1); }
}
@keyframes pulse-glow {
  0%,100% { box-shadow: 0 0 20px var(--accent-glow); }
  50%      { box-shadow: 0 0 45px rgba(124,58,237,0.5); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes float {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes countUp {
  from { opacity:0; transform: translateY(10px); }
  to   { opacity:1; transform: translateY(0); }
}
@keyframes slideDown {
  from { opacity:0; transform: translateY(-10px); }
  to   { opacity:1; transform: translateY(0); }
}
@keyframes ripple {
  to { transform: scale(2.5); opacity:0; }
}

.anim-fadeInUp   { animation: fadeInUp   0.6s cubic-bezier(0.4,0,0.2,1) both; }
.anim-fadeInLeft { animation: fadeInLeft 0.6s cubic-bezier(0.4,0,0.2,1) both; }
.anim-scaleIn    { animation: scaleIn    0.5s cubic-bezier(0.4,0,0.2,1) both; }

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }
.delay-7 { animation-delay: 0.7s; }
.delay-8 { animation-delay: 0.8s; }

/* ── Skeleton loader ── */
.skeleton {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.04) 25%,
    rgba(255,255,255,0.09) 50%,
    rgba(255,255,255,0.04) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
  border-radius: var(--radius-md);
}

/* ── Tooltip ── */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  background: #1E1E35;
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  white-space: nowrap;
  border: 1px solid var(--border);
  pointer-events: none;
  opacity: 0;
  transition: var(--transition);
}
[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* ── Notification dot ── */
.notif-dot {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  position: absolute;
  top: 2px; right: 2px;
  animation: pulse-glow 2s infinite;
}

/* ── Table ── */
.rh-table {
  width: 100%;
  border-collapse: collapse;
}
.rh-table thead th {
  padding: 14px 16px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.rh-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.rh-table tbody tr:hover {
  background: rgba(255,255,255,0.03);
}
.rh-table tbody td {
  padding: 14px 16px;
  color: var(--text-secondary);
  vertical-align: middle;
}

/* ── Responsive helpers ── */
@media (max-width: 768px) {
  h1 { font-size: 1.4rem; }
  h2 { font-size: 1.15rem; }
  h3 { font-size: 1rem; }
}
@media (max-width: 480px) {
  h1 { font-size: 1.25rem; }
}
