/* ═══════════════════════════════════════════════════════════
   Portal User RGW — Main CSS
   Las variables de color vienen del theme activo (hostingred.css / lionhoster.css)
   ═══════════════════════════════════════════════════════════ */

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

body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo img { max-width: 140px; height: auto; }

.logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
  border-left: 3px solid transparent;
}

.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.nav-item:hover {
  color: #FFFFFF;
  background: rgba(255,255,255,0.12);
}

.nav-item.active {
  color: var(--primary-light);
  background: rgba(var(--primary-rgb, 200, 16, 46), 0.08);
  border-left-color: var(--primary);
}

.nav-item.logout {
  color: var(--danger);
  margin-top: auto;
}
.nav-item.logout:hover { background: rgba(239,68,68,0.08); }

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

/* ── Main Content ────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.top-bar {
  height: var(--header-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.page-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-name { font-size: 13px; color: var(--text-muted); }

.user-avatar {
  width: 34px; height: 34px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  color: white;
}

.content { padding: 28px; flex: 1; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

/* ── Stats Grid ──────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color 0.2s;
}
.stat-card:hover { border-color: var(--primary); }

.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  background: rgba(200,16,46,0.12);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary-light);
  flex-shrink: 0;
}
.stat-icon svg { width: 22px; height: 22px; }

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Welcome Banner ──────────────────────────────────────── */
.welcome-banner {
  background: linear-gradient(135deg, #2A2A2A, #3A3A3A);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 24px;
}
.welcome-banner h2 { font-size: 22px; font-weight: 700; color: white; }
.welcome-banner p  { color: rgba(255,255,255,0.7); font-size: 13px; margin-top: 4px; }

/* ── Quick Actions ───────────────────────────────────────── */
.quick-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.quick-action {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}
.quick-action svg { width: 16px; height: 16px; }
.quick-action:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--bg-hover);
}

/* ── Botones ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  text-decoration: none;
  font-family: var(--font-main);
}
.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger  { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: rgba(239,68,68,0.1); }
.btn-ghost   { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-ghost:hover { background: #333333; color: #FFFFFF; border-color: #333333; }
.btn-full    { width: 100%; justify-content: center; padding: 12px; }
.btn svg     { width: 15px; height: 15px; }

/* ── Tablas ──────────────────────────────────────────────── */
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.table-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.table-header h3 { font-size: 15px; font-weight: 600; }

table { width: 100%; border-collapse: collapse; }
thead { background: var(--bg-thead); }
th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: #444444;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  background: var(--bg-card);
}
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg-hover); }

/* ── Formularios ─────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 11px 14px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-main);
  transition: border-color 0.15s;
  outline: none;
}
input:focus { border-color: var(--primary); }

.password-wrapper { position: relative; }
.toggle-pass {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: #444444;
}
.toggle-pass svg { width: 16px; height: 16px; }

/* ── Alertas ─────────────────────────────────────────────── */
.alert {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 18px;
}
.alert svg { width: 16px; height: 16px; flex-shrink: 0; }
.alert-error   { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: #FCA5A5; }
.alert-success { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3); color: #86EFAC; }
.alert-info    { background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.3); color: #93C5FD; }

/* ── Login ───────────────────────────────────────────────── */
.login-body {
  background: #0D0D0D !important;
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-container { width: 100%; max-width: 420px; }
.login-card {
  background: #000000 !important;
  border-color: #333 !important;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow);
}
.login-logo {
  display: flex; justify-content: center;
  margin-bottom: 28px;
}
.login-logo img { max-height: 50px; }
.logo-fallback {
  flex-direction: column; align-items: center; gap: 8px;
}
.logo-fallback span { font-size: 20px; font-weight: 700; color: var(--primary); }

.login-title {
  color: #F0F0F0 !important;
  font-size: 22px; font-weight: 700;
  text-align: center; margin-bottom: 6px;
}
.login-subtitle {
  color: #A0A0A0 !important;
  text-align: center; color: var(--text-muted);
  font-size: 13px; margin-bottom: 28px;
}
.login-form { margin-bottom: 20px; }
.login-lang {
  display: flex; justify-content: center; gap: 8px;
  margin-top: 16px;
}

/* ── Selector de idioma ──────────────────────────────────── */
.lang-switcher { display: flex; gap: 6px; margin-bottom: 12px; }
.lang-btn {
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-main);
  transition: all 0.15s;
}
.lang-btn.active { border-color: var(--primary); color: var(--primary-light); }
.lang-btn:hover  { border-color: var(--primary); }

/* ── Code / Keys ─────────────────────────────────────────── */
.key-box {
  background: var(--bg-thead);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.key-label {
  font-size: 11px;
  color: #444444;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.key-value {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--primary);
  word-break: break-all;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.copy-btn {
  background: none; border: none; cursor: pointer;
  color: #444444; flex-shrink: 0;
  transition: color 0.15s;
}
.copy-btn:hover { color: var(--primary-light); }
.copy-btn svg { width: 15px; height: 15px; }

/* ── Breadcrumb ──────────────────────────────────────────── */
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-muted);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--primary-light); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { color: #444444; }

/* ── Empty State ─────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state svg {
  width: 48px; height: 48px;
  margin-bottom: 16px;
  color: #444444;
}
.empty-state h3 { font-size: 16px; margin-bottom: 8px; }
.empty-state p  { font-size: 13px; margin-bottom: 20px; }

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.6);
  align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
}
.modal h3 { font-size: 17px; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ── Usage bar ───────────────────────────────────────────── */
.usage-bar {
  background: #E0E0E0;
  border-radius: 99px;
  height: 6px;
  overflow: hidden;
  margin-top: 6px;
}
.usage-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 99px;
  transition: width 0.5s ease;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .content { padding: 16px; }
}
