/* ===================================================================
   RENTARA ADMIN PORTAL — Premium Redesign CSS
   =================================================================== */

/* --- 1. HERO ADMIN SECTION --- */
.admin-hero {
  position: relative;
  padding: 30px 34px 28px;
  margin: -38px -42px 28px;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-bottom: 1px solid #1e293b;
  overflow: hidden;
  color: #fff;
}

.admin-hero::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(56,189,248,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.admin-hero::after {
  content: '';
  position: absolute;
  bottom: -60px; left: 15%;
  width: 250px; height: 250px;
  background: radial-gradient(circle, rgba(98,81,201,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.admin-hero-top {
  position: relative;
  z-index: 1;
}

.admin-hero-badge {
  display: inline-block;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 5px;
  margin-bottom: 8px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  text-transform: uppercase;
}

.admin-hero h1 {
  font-size: 28px !important;
  font-weight: 700 !important;
  letter-spacing: -0.5px !important;
  margin: 0 0 6px !important;
  color: #f8fafc !important;
}

.admin-hero-summary {
  font-size: 12.5px;
  color: #94a3b8;
  line-height: 1.6;
  margin: 0;
}

/* --- 2. ADMIN STAT CARDS --- */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 26px;
}

.admin-kpi-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: 0 2px 8px rgba(20,30,55,0.03);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.admin-kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(20,30,55,0.08);
  border-color: #cbd5e1;
}

.admin-kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.admin-kpi-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.admin-kpi-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.admin-kpi-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
  font-family: 'Outfit', sans-serif;
}

.admin-kpi-value small {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.admin-kpi-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

/* --- 3. UPGRADE PLANS SETTINGS --- */
.admin-plans-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 15px;
}

.admin-plan-row {
  display: grid;
  grid-template-columns: 1.5fr 2fr 1.2fr 1fr 1fr;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  transition: border-color 0.2s, background 0.2s;
}

.admin-plan-row:hover {
  background: #fff;
  border-color: #cbd5e1;
}

.admin-plan-row label {
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.3;
}

.admin-plan-row label small {
  display: block;
  font-size: 9.5px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 3px;
  text-transform: uppercase;
}

.admin-plan-row input {
  margin: 0;
  width: 100%;
  padding: 10px 12px;
  font-size: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  outline: none;
  font-family: 'DM Sans', sans-serif;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.admin-plan-row input:focus {
  border-color: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.1);
}

.admin-plans-message {
  margin-top: 12px;
  padding: 10px 14px;
  background: #edfbf3;
  border: 1px solid #c8f2d8;
  border-radius: 8px;
  color: #1aac5e;
  font-size: 11.5px;
  font-weight: 600;
  text-align: center;
}

/* --- 4. ADMIN USER & LOG TABLES --- */
.admin-role-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.admin-role-badge.superadmin { background: #fee2e2; color: #ef4444; }
.admin-role-badge.owner      { background: #e0f2fe; color: #0284c7; }

.admin-status-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 700;
}

.admin-status-badge.aktif { background: #edfbf3; color: #1aac5e; }
.admin-status-badge.pending { background: #fff8e6; color: #b07010; }

/* Timeline design for logs */
.log-timeline {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 15px;
  position: relative;
  padding-left: 16px;
}

.log-timeline::before {
  content: '';
  position: absolute;
  top: 4px; bottom: 4px; left: 5px;
  width: 2px;
  background: #e2e8f0;
}

.log-item {
  position: relative;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink);
}

.log-item::before {
  content: '';
  position: absolute;
  left: -15px; top: 4px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  border: 2px solid #fff;
  z-index: 1;
}

.log-time {
  font-weight: 700;
  color: var(--muted);
  font-size: 9.5px;
  text-transform: uppercase;
  margin-bottom: 2px;
  display: block;
}

.log-item strong {
  color: var(--ink);
  font-weight: 600;
}

/* --- 5. BAR CHART (Tenant & Wilayah Pengguna) --- */
.admin-rental-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-chart-row {
  display: grid;
  grid-template-columns: 180px 1fr 34px;
  align-items: center;
  gap: 12px;
}

.admin-chart-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-chart-label small {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 1px;
}

.admin-chart-track {
  height: 10px;
  background: #eef2f7;
  border-radius: 999px;
  overflow: hidden;
}

.admin-chart-track span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #a855f7, #6366f1);
}

.admin-chart-row > strong {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  text-align: right;
}

.admin-chart-empty {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 18px 0;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .admin-plan-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .admin-plan-row label { grid-column: span 2; }
}

@media (max-width: 900px) {
  .admin-hero { margin: -38px -22px 22px; padding: 22px 22px; }
  .admin-plan-row { grid-template-columns: 1fr; gap: 8px; }
  .admin-plan-row label { grid-column: span 1; }
}

@media (max-width: 650px) {
  .admin-hero { margin: -24px -16px 18px; padding: 18px 16px; }
  .admin-hero h1 { font-size: 22px !important; }
  .admin-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
}
