/* SiteOps by WPTopDev — Brand Design System & Dashboard CSS */
:root {
  --color-primary: #DA251D;
  --color-primary-dark: #A91C16;
  --color-secondary: #FFCD00;
  --color-secondary-light: #FFE56B;
  --color-white: #FFFFFF;
  --color-text: #241A18;
  --color-background: #FFF9E8;
  --muted: color-mix(in srgb, var(--color-text) 58%, transparent);
  --line: color-mix(in srgb, var(--color-text) 14%, transparent);
  --line-strong: color-mix(in srgb, var(--color-text) 24%, transparent);
  --max: 1200px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Manrope", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --card-shadow: 0 4px 20px rgba(36, 26, 24, 0.04);
  --card-shadow-hover: 0 12px 32px rgba(36, 26, 24, 0.08);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 999px;
}

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

body {
  font-family: var(--font);
  color: var(--color-text);
  background: var(--color-background);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrap {
  width: min(100% - 2.5rem, var(--max));
  margin-inline: auto;
}

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

/* Header & Navigation */
.top-bar {
  background: var(--color-text);
  color: var(--color-white);
  font-size: 0.8rem;
  padding: 0.4rem 0;
  font-weight: 500;
}
.top-bar .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 10px #10B981;
  display: inline-block;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--color-background) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  transition: all 0.2s var(--ease);
}
.nav__in {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 0;
  gap: 1.5rem;
}
.brand {
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.04em;
  display: inline-flex;
  align-items: baseline;
}
.brand .logo__mark {
  color: var(--color-primary);
  font-style: normal;
}
.brand-sub {
  font-size: 0.75rem;
  font-family: var(--mono);
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  background: var(--color-white);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  margin-left: 0.6rem;
  color: var(--color-primary-dark);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--muted);
}
.nav__links button {
  background: none;
  border: none;
  font: inherit;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  position: relative;
  padding: 0.25rem 0;
  transition: color 0.2s;
}
.nav__links button:hover,
.nav__links button.is-active {
  color: var(--color-text);
}
.nav__links button.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2.5px;
  background: var(--color-primary);
  border-radius: var(--radius-full);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  font-family: var(--font);
}
.btn-p {
  background: var(--color-primary);
  color: var(--color-white);
}
.btn-p:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--color-primary) 30%, transparent);
}
.btn-g {
  background: var(--color-white);
  color: var(--color-text);
  border-color: var(--line);
}
.btn-g:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-1px);
}
.btn-sm {
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
}
.btn-approve {
  background: #10B981;
  color: white;
}
.btn-approve:hover {
  background: #059669;
}
.btn-reject {
  background: #EF4444;
  color: white;
}
.btn-reject:hover {
  background: #DC2626;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-family: var(--mono);
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-online { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.badge-offline { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.badge-pending { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }
.badge-critical { background: #7F1D1D; color: #FEE2E2; }
.badge-high { background: #FEE2E2; color: #991B1B; }
.badge-medium { background: #FEF3C7; color: #92400E; }
.badge-low { background: #F3F4F6; color: #374151; }

/* Panels & Cards */
.panel {
  background: var(--color-white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  margin-bottom: 1.5rem;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}
.panel-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--color-white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  box-shadow: var(--card-shadow);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
}
.stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}
.stat-val {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

/* Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.data-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  background: color-mix(in srgb, var(--color-background) 40%, var(--color-white));
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.data-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
}
.data-table tr:hover td {
  background: color-mix(in srgb, var(--color-background) 25%, var(--color-white));
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(36, 26, 24, 0.45);
  backdrop-filter: blur(4px);
  display: none;
  place-items: center;
  z-index: 100;
}
.modal-backdrop.is-open {
  display: grid;
}
.modal {
  background: var(--color-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  width: min(92vw, 520px);
  box-shadow: 0 20px 48px rgba(36, 26, 24, 0.16);
  padding: 1.75rem;
}
.form-group {
  margin-bottom: 1.2rem;
}
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.form-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  font-family: var(--font);
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus {
  border-color: var(--color-primary);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  background: var(--color-text);
  color: white;
  font-size: 0.88rem;
  font-weight: 600;
  z-index: 150;
  box-shadow: 0 10px 24px rgba(0,0,0,0.2);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s var(--ease);
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* ==========================================
   SAAS DASHBOARD LAYOUT & SIDEBAR NAVIGATION
   ========================================== */
#app-root {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
}

.dashboard-layout {
  display: flex !important;
  flex-direction: row !important;
  min-height: 100vh;
  width: 100%;
  background: var(--color-background);
}

/* Sidebar */
.sidebar {
  width: 270px !important;
  min-width: 270px !important;
  max-width: 270px !important;
  background: #181312 !important; /* Deep luxury charcoal */
  color: #F8FAFC !important;
  display: flex !important;
  flex-direction: column !important;
  flex-shrink: 0 !important;
  position: sticky !important;
  top: 0;
  height: 100vh;
  z-index: 100;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
  transition: transform 0.25s var(--ease);
}

.sidebar-header {
  padding: 1.5rem 1.25rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.sidebar-brand {
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.04em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #FFFFFF;
}

.sidebar-brand .logo__mark {
  color: var(--color-primary);
}

.sidebar-brand-badge {
  font-size: 0.68rem;
  font-family: var(--mono);
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  background: rgba(218, 37, 29, 0.2);
  border: 1px solid rgba(218, 37, 29, 0.45);
  border-radius: var(--radius-full);
  color: #FF6B6B;
}

.sidebar-status {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 0.65rem;
}

.sidebar-nav {
  flex: 1;
  padding: 1.25rem 0.85rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-section-title {
  font-size: 0.68rem;
  font-family: var(--mono);
  font-weight: 700;
  color: rgba(255, 255, 255, 0.42);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.85rem 0.75rem 0.35rem;
}

.sidebar-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  padding: 0.72rem 0.85rem !important;
  border-radius: var(--radius-sm) !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  color: rgba(255, 255, 255, 0.75) !important;
  font-family: var(--font) !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  text-align: left !important;
  cursor: pointer !important;
  transition: all 0.18s var(--ease) !important;
  outline: none !important;
  box-sizing: border-box !important;
}

.sidebar-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #FFFFFF !important;
  transform: translateX(2px);
}

.sidebar-btn.is-active {
  background: var(--color-primary) !important;
  color: #FFFFFF !important;
  box-shadow: 0 4px 14px rgba(218, 37, 29, 0.45) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

.sidebar-btn-content {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.sidebar-btn-icon {
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  flex-shrink: 0;
}

.sidebar-badge {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
}

.sidebar-btn.is-active .sidebar-badge {
  background: rgba(0, 0, 0, 0.25);
  color: #FFFFFF;
}

.sidebar-footer {
  padding: 1rem 1.1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.user-profile-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), #FFCD00);
  color: #FFFFFF;
  font-weight: 800;
  font-size: 0.85rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-info-name {
  font-weight: 700;
  font-size: 0.85rem;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-info-role {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: #FFCD00;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.signout-btn {
  background: rgba(220, 38, 38, 0.15);
  border: 1px solid rgba(220, 38, 38, 0.35);
  color: #F87171;
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
  flex-shrink: 0;
}

.signout-btn:hover {
  background: #DC2626;
  color: #FFFFFF;
}

/* Main Content Area beside Sidebar */
.main-wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--color-background);
  min-height: 100vh;
}

.main-header {
  height: 68px;
  background: color-mix(in srgb, var(--color-background) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 40;
}

.main-content {
  flex: 1;
  padding: 2rem 2.5rem 4rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.mobile-toggle-btn {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.65rem;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--color-text);
}

.sidebar-overlay {
  display: none;
}

@media (max-width: 1024px) {
  .sidebar {
    position: fixed !important;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    z-index: 200;
  }
  .sidebar.is-open {
    transform: translateX(0);
  }
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 190;
    display: none;
  }
  .sidebar-overlay.is-open {
    display: block;
  }
  .mobile-toggle-btn {
    display: inline-flex;
  }
  .main-content {
    padding: 1.5rem 1rem 3rem;
  }
  .main-header {
    padding: 0 1rem;
  }
}
