/* ==========================================================================
   Nearit Agency — Official Admin CMS Stylesheet
   Matches 100% of the Public Website's Light Iridescent Glassmorphic Aesthetic
   ========================================================================== */

:root {
  --sky: #D1E7FF;
  --white: #ffffff;
  --ink: #1B1B1B;
  --blue: #7E93FF;
  --blue-hover: #687ee6;
  --bg: #F8F9FA;
  --muted: #5b6270;
  --light-muted: #8a90a0;
  --glass: rgba(255, 255, 255, 0.75);
  --glass-card: rgba(255, 255, 255, 0.85);
  --line: rgba(126, 147, 255, 0.22);
  --border: rgba(220, 226, 238, 0.8);
  
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-full: 999px;
  
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.04);
  --shadow-glass: 0 10px 40px rgba(126, 147, 255, 0.12);
  --shadow-hover: 0 14px 40px rgba(126, 147, 255, 0.2);
}

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

body {
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  background: radial-gradient(70% 60% at 80% 20%, #e6e9ff, transparent),
              radial-gradient(60% 60% at 20% 80%, #dce8ff, transparent),
              linear-gradient(135deg, #eef2f8, #dfe6f3);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Glass Utility */
.glass {
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glass);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--ink);
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 10px 20px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(27, 27, 27, 0.16);
  transition: all 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(27, 27, 27, 0.22);
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn.ghost:hover {
  background: #fff;
  border-color: var(--blue);
}

.btn.sm {
  padding: 6px 14px;
  font-size: 0.8rem;
  border-radius: 10px;
}

.btn.danger {
  background: #fee2e2;
  color: #b91c1c;
  box-shadow: none;
  border: 1px solid #fecaca;
}

.btn.danger:hover {
  background: #fecaca;
}

.btn.blue {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 6px 18px rgba(126, 147, 255, 0.35);
}

.btn.blue:hover {
  background: var(--blue-hover);
}

/* 1. Login View */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  padding: 40px 32px;
  text-align: center;
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.logo i {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: conic-gradient(#7E93FF, #5fd4e8, #b07cff, #7E93FF);
  display: inline-block;
  position: relative;
}

.logo i:after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: #fff;
}

.login-card h2 {
  font-size: 1.8rem;
  font-weight: 200;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.login-card h2 b {
  font-weight: 700;
}

.login-card p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

.form-group {
  margin-bottom: 16px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  transition: all 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(126, 147, 255, 0.2);
}

.login-alert {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  border-radius: 10px;
  padding: 10px;
  font-size: 0.85rem;
  margin-bottom: 16px;
  display: none;
}

/* 2. Admin App Layout */
.app-wrap {
  width: min(1200px, 94%);
  margin: 20px auto 60px;
}

/* Glass Header & Navbar */
.admin-header {
  margin-bottom: 28px;
}

.admin-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  gap: 16px;
}

.admin-nav-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pill-admin {
  background: #dde3ff;
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  text-transform: uppercase;
}

.admin-nav-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.admin-tab-btn {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  padding: 8px 16px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-tab-btn:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.5);
}

.admin-tab-btn.active {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 4px 14px rgba(27, 27, 27, 0.18);
}

.tab-badge {
  background: #ef4444;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
}

.admin-nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hostinger-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #0e7039;
  background: #e6f8ed;
  border: 1px solid #b7ebd0;
  padding: 5px 12px;
  border-radius: 99px;
}

.hostinger-status::before {
  content: "";
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
}

/* Views & Content */
.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
}

/* Stat Cards (matching .svc card aesthetic with corner flares) */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  padding: 24px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #fff, #eefaff 60%, #e9e6ff);
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.stat-card:after {
  content: "";
  position: absolute;
  right: -25px;
  bottom: -25px;
  width: 100px;
  height: 100px;
  border-radius: 38%;
  background: conic-gradient(from 90deg, #7E93FF, #5fd4e8, #b07cff, #7E93FF);
  opacity: 0.45;
  transform: rotate(var(--r, 20deg));
}

.stat-card-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--light-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.stat-card-num {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.1;
}

.stat-card-sub {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 6px;
}

/* Card Box Container */
.card-box {
  background: var(--glass);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glass);
  overflow: hidden;
  margin-bottom: 28px;
}

.card-box-head {
  padding: 22px 28px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-box-head h3 {
  font-size: 1.25rem;
  font-weight: 700;
}

.card-box-head p {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 2px;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.data-table th {
  background: rgba(255, 255, 255, 0.6);
  color: var(--muted);
  font-weight: 600;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.data-table td {
  padding: 16px 24px;
  border-bottom: 1px solid rgba(220, 226, 238, 0.6);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.5);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.74rem;
  font-weight: 700;
}

.badge-web { background: #dde3ff; color: var(--ink); }
.badge-apps { background: #e0f2fe; color: #0369a1; }
.badge-host { background: #e6f8ed; color: #0e7039; }
.badge-mkt { background: #fef3c7; color: #b45309; }
.badge-ai { background: #f3e8ff; color: #7e22ce; }

.badge-status-new { background: #fee2e2; color: #b91c1c; }
.badge-status-contacted { background: #fef3c7; color: #b45309; }
.badge-status-closed { background: #dcfce7; color: #15803d; }

/* Grid for Services / Cards Management */
.services-cms-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 24px;
}

.svc-cms-card {
  padding: 24px;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(160deg, #fff, #eefaff 60%, #e9e6ff);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
  position: relative;
  overflow: hidden;
  min-height: 200px;
}

.svc-cms-card:after {
  content: "";
  position: absolute;
  right: -25px;
  bottom: -25px;
  width: 100px;
  height: 100px;
  border-radius: 38%;
  background: conic-gradient(from 90deg, #7E93FF, #5fd4e8, #b07cff, #7E93FF);
  opacity: 0.45;
  transform: rotate(var(--r, 20deg));
}

.svc-cms-card h4 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.svc-cms-card p {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: 16px;
  max-width: 32ch;
}

.svc-cms-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 2;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(126, 147, 255, 0.15);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 35, 0.55);
  backdrop-filter: blur(6px);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: #ffffff;
  border-radius: 24px;
  max-width: 580px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.9);
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: #f1f4fb;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.modal-box h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 20px;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .services-cms-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .admin-nav {
    flex-direction: column;
    align-items: stretch;
  }
  .admin-nav-tabs {
    overflow-x: auto;
    padding-bottom: 6px;
  }
  .stats-grid,
  .services-cms-grid {
    grid-template-columns: 1fr;
  }
}
