/*
 * AbollyHost — AlexHost-style Sidebar Layout
 * Custom CSS for Hostie child theme
 * Brand: Purple #7c3aed | Cyan #06b6d4
 */

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

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --sb-w:        210px;
  --sb-bg:       #12122a;
  --sb-border:   rgba(255,255,255,.07);
  --sb-group:    rgba(255,255,255,.32);
  --sb-item:     rgba(255,255,255,.65);
  --sb-active-bg: rgba(124,58,237,.18);
  --sb-active:   #a78bfa;
  --brand:       #7c3aed;
  --brand-dk:    #5b21b6;
  --cyan:        #06b6d4;
  --main-bg:     #f4f4f8;
  --white:       #ffffff;
  --text:        #374151;
  --text-muted:  #6b7280;
  --border:      #e5e7eb;
  --topbar-h:    48px;
  --radius:      8px;
  --ff:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html, body {
  font-family: var(--ff) !important;
  background: var(--main-bg) !important;
  color: var(--text) !important;
  margin: 0;
  padding: 0;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.ab-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sb-w);
  background: var(--sb-bg);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform .25s ease;
  overflow: hidden;
}

/* Logo */
.ab-sidebar-logo {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--sb-border);
  flex-shrink: 0;
}
.ab-sidebar-logo a { display: block; text-decoration: none !important; }
.ab-sidebar-logo img { max-height: 32px; max-width: 100%; object-fit: contain; }
.ab-logo-text {
  font-size: 18px; font-weight: 700;
  background: linear-gradient(135deg, #7c3aed, #06b6d4);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Search */
.ab-sidebar-search {
  padding: 10px 12px;
  border-bottom: 1px solid var(--sb-border);
  flex-shrink: 0;
}
.ab-search-wrap {
  position: relative;
  display: flex; align-items: center;
}
.ab-search-ico {
  position: absolute; left: 9px;
  color: rgba(255,255,255,.35); font-size: 12px;
}
.ab-search-input {
  width: 100%;
  background: rgba(255,255,255,.07) !important;
  border: 1px solid rgba(255,255,255,.1) !important;
  border-radius: 6px !important;
  color: rgba(255,255,255,.8) !important;
  font-size: 12.5px !important;
  padding: 6px 8px 6px 28px !important;
  outline: none;
  font-family: var(--ff) !important;
}
.ab-search-input::placeholder { color: rgba(255,255,255,.3) !important; }
.ab-search-input:focus {
  border-color: rgba(124,58,237,.5) !important;
  background: rgba(255,255,255,.1) !important;
}

/* Nav */
.ab-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 0 12px;
}
.ab-sidebar-nav::-webkit-scrollbar { width: 3px; }
.ab-sidebar-nav::-webkit-scrollbar-thumb { background: rgba(124,58,237,.4); border-radius: 3px; }

/* Group */
.ab-nav-group { padding: 10px 0 4px; }
.ab-nav-group-label {
  display: block;
  font-size: 9.5px; font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--sb-group);
  padding: 0 16px 4px;
  text-transform: uppercase;
}

/* Nav Item */
.ab-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px 7px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--sb-item) !important;
  text-decoration: none !important;
  border-radius: 0;
  transition: background .15s, color .15s;
  position: relative;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}
.ab-nav-item:hover {
  background: rgba(255,255,255,.06);
  color: #fff !important;
  text-decoration: none !important;
}
/* Active state — purple pill background like AlexHost */
.ab-nav-item.active {
  background: var(--sb-active-bg) !important;
  color: var(--sb-active) !important;
  font-weight: 600;
}
.ab-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--brand);
  border-radius: 0 2px 2px 0;
}

.ab-nav-icon {
  width: 16px;
  text-align: center;
  font-size: 13px;
  flex-shrink: 0;
  opacity: .75;
}
.ab-nav-item.active .ab-nav-icon,
.ab-nav-item:hover .ab-nav-icon { opacity: 1; }

.ab-nav-label { flex: 1; }

.ab-nav-badge {
  background: var(--brand);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: auto;
  flex-shrink: 0;
}
.ab-nav-badge-warn { background: #f59e0b; }

/* Sidebar footer icons */
.ab-sidebar-foot {
  padding: 10px 12px;
  border-top: 1px solid var(--sb-border);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.ab-sidebar-foot-link {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 6px;
  color: rgba(255,255,255,.5) !important;
  font-size: 13px;
  text-decoration: none !important;
  transition: all .2s;
}
.ab-sidebar-foot-link:hover {
  background: rgba(124,58,237,.2);
  border-color: rgba(124,58,237,.4);
  color: #a78bfa !important;
}

/* ── Mobile overlay ───────────────────────────────────────── */
.ab-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,.55);
}
.ab-overlay.ab-overlay-show { display: block; }

/* ── Main Column ──────────────────────────────────────────── */
.ab-main {
  margin-left: var(--sb-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--main-bg);
}

/* ── Topbar ───────────────────────────────────────────────── */
.ab-topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}
.ab-topbar-left { display: flex; align-items: center; gap: 10px; }
.ab-topbar-right { display: flex; align-items: center; gap: 8px; }

.ab-burger {
  width: 32px; height: 32px;
  display: none;
  align-items: center; justify-content: center;
  background: none; border: none;
  font-size: 16px; color: var(--text-muted);
  cursor: pointer; border-radius: 6px;
  transition: background .15s;
}
.ab-burger:hover { background: var(--border); }

.ab-topbar-btn {
  position: relative;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted) !important;
  background: var(--main-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  text-decoration: none !important;
  transition: all .15s;
}
.ab-topbar-btn:hover { border-color: var(--brand); color: var(--brand) !important; }
.ab-topbar-dot {
  position: absolute; top: -4px; right: -4px;
  background: var(--brand); color: #fff;
  font-size: 8px; font-weight: 700;
  width: 15px; height: 15px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}

.ab-topbar-badge {
  font-size: 11.5px; font-weight: 600;
  padding: 4px 10px;
  background: rgba(245,158,11,.1);
  color: #b45309 !important;
  border: 1px solid rgba(245,158,11,.3);
  border-radius: 50px;
  text-decoration: none !important;
  transition: all .15s;
}
.ab-topbar-badge:hover { background: rgba(245,158,11,.2); }

.ab-topbar-user {
  display: flex; align-items: center; gap: 7px;
  padding: 4px 10px;
  background: var(--main-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none !important;
  color: var(--text) !important;
  font-size: 13px; font-weight: 500;
  transition: all .15s;
}
.ab-topbar-user:hover { border-color: var(--brand); }

.ab-user-avatar {
  width: 26px; height: 26px;
  background: linear-gradient(135deg, #7c3aed, #06b6d4);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: #fff; font-weight: 700;
  flex-shrink: 0;
}

.ab-user-name { color: var(--text) !important; }

.ab-topbar-action-btn {
  font-size: 12.5px; font-weight: 600;
  padding: 5px 12px;
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  color: #fff !important;
  border-radius: 6px;
  text-decoration: none !important;
  transition: all .15s;
  white-space: nowrap;
}
.ab-topbar-action-btn:hover { opacity: .9; color: #fff !important; }
.ab-topbar-action-btn-outline {
  background: transparent !important;
  border: 1px solid #7c3aed;
  color: #7c3aed !important;
}
.ab-topbar-action-btn-outline:hover {
  background: #7c3aed !important;
  color: #fff !important;
}

/* Dropdown menus */
.ab-dd-menu {
  background: #fff !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.1) !important;
  min-width: 220px;
  padding: 6px 0 !important;
}
.ab-dd-item {
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.ab-dd-item:last-child { border-bottom: none; }
.dropdown-item { font-size: 13px; color: var(--text) !important; }
.dropdown-item:hover { background: rgba(124,58,237,.07) !important; color: var(--brand) !important; }
.dropdown-item.text-danger { color: #dc2626 !important; }
.dropdown-item.text-danger:hover { background: rgba(220,38,38,.08) !important; }
.dropdown-divider { border-color: var(--border) !important; }

/* ── Content ──────────────────────────────────────────────── */
.ab-content {
  flex: 1;
  padding: 24px 28px;
}

/* ── Footer ───────────────────────────────────────────────── */
.ab-footer {
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 12px 28px;
  flex-shrink: 0;
}
.ab-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}
.ab-footer-copy a { color: var(--brand); text-decoration: none; }
.ab-footer-links { display: flex; gap: 14px; }
.ab-footer-links a { color: var(--text-muted); text-decoration: none; }
.ab-footer-links a:hover { color: var(--brand); }
.ab-footer-status { display: flex; align-items: center; gap: 5px; }
.ab-status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 5px #10b981;
  display: inline-block;
  animation: abPulse 2s infinite;
}
@keyframes abPulse { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ── Bootstrap overrides for light theme ──────────────────── */
.card { border-color: var(--border) !important; border-radius: var(--radius) !important; }
.card-header { background: #fafafa !important; border-color: var(--border) !important; font-weight: 600; }
.btn-primary {
  background: linear-gradient(135deg, #7c3aed, #5b21b6) !important;
  border-color: #5b21b6 !important; color: #fff !important;
}
.btn-primary:hover { background: linear-gradient(135deg, #6d28d9, #4c1d95) !important; border-color: #4c1d95 !important; }
.btn-outline-primary { color: #7c3aed !important; border-color: #7c3aed !important; }
.btn-outline-primary:hover { background: #7c3aed !important; color: #fff !important; }
.badge-primary { background: #7c3aed !important; }
.badge-success { background: #10b981 !important; }
.badge-danger  { background: #ef4444 !important; }
.badge-warning { background: #f59e0b !important; }
.badge-info    { background: #06b6d4 !important; color: #fff !important; }
.text-primary { color: #7c3aed !important; }
.form-control:focus { border-color: #7c3aed !important; box-shadow: 0 0 0 .2rem rgba(124,58,237,.18) !important; }
.nav-tabs .nav-link.active { color: #7c3aed !important; border-bottom-color: #7c3aed !important; }
.page-item.active .page-link { background: #7c3aed !important; border-color: #7c3aed !important; }
.page-link { color: #7c3aed !important; }
a { color: #7c3aed; }
a:hover { color: #5b21b6; }

/* Sidebar panels from WHMCS *}
.sidebar { background: transparent; border: none; }
.sidebar .panel { background: transparent; border: none; box-shadow: none; }
.sidebar .list-group-item {
  background: transparent; border: none; padding: 0;
  display: flex; flex-direction: column;
}
.sidebar .list-group-item a,
.sidebar .list-group-item.active a {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 14px 7px 16px;
  font-size: 13px; font-weight: 500;
  color: rgba(255,255,255,.65) !important;
  text-decoration: none !important;
  transition: all .15s;
}
.sidebar .list-group-item a:hover { background: rgba(255,255,255,.06); color: #fff !important; }
.sidebar .list-group-item.active a { background: rgba(124,58,237,.18) !important; color: #a78bfa !important; }
.sidebar .panel-heading { display: none; }

/* Alert overrides */
.alert-info { background: rgba(124,58,237,.07) !important; border-color: rgba(124,58,237,.2) !important; color: #5b21b6 !important; }
.alert-success { background: rgba(16,185,129,.08) !important; border-color: rgba(16,185,129,.2) !important; }

/* Modal overrides */
.modal-content { border-radius: var(--radius) !important; border-color: var(--border) !important; }
.modal-header { border-color: var(--border) !important; }
.modal-footer { border-color: var(--border) !important; }

/* Table */
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); }
.table td { color: var(--text); vertical-align: middle; }

/* ── Homepage (full width, no sidebar) ────────────────────── */
.ab-home .ab-sidebar { display: none !important; }
.ab-home .ab-main { margin-left: 0 !important; }
.ab-home .ab-topbar { display: none !important; }

/* ── Guest pages (login) ──────────────────────────────────── */
.ab-guest .ab-sidebar { display: none !important; }
.ab-guest .ab-main { margin-left: 0 !important; }
.ab-guest .ab-topbar {
  background: var(--sb-bg) !important;
  border-bottom: 1px solid rgba(255,255,255,.08) !important;
}
.ab-guest .ab-content {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--topbar-h) - 50px);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 991px) {
  .ab-sidebar { transform: translateX(-100%); }
  .ab-sidebar.ab-sidebar-open { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.5); }
  .ab-main { margin-left: 0 !important; }
  .ab-burger { display: flex !important; }
  .ab-content { padding: 16px; }
}
@media (max-width: 576px) {
  .ab-user-name { display: none; }
  .ab-footer-inner { flex-direction: column; text-align: center; gap: 6px; }
}
@media print {
  .ab-sidebar, .ab-topbar, .ab-footer { display: none !important; }
  .ab-main { margin-left: 0 !important; }
}
