/* ============================================================
   Webora Agency CMS — Main Stylesheet
   Colors: #e00031 (primary), #ffffff (white), #000000 (black)
   Font: Livvic, sans-serif
   ============================================================ */

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

:root {
  --wb-red:     #e00031;
  --wb-red-dk:  #b5001f;
  --wb-red-lt:  #ff1a45;
  --wb-black:   #000000;
  --wb-white:   #ffffff;
  --wb-gray-50: #f9fafb;
  --wb-gray-100:#f3f4f6;
  --wb-gray-200:#e5e7eb;
  --wb-gray-300:#d1d5db;
  --wb-gray-500:#6b7280;
  --wb-gray-700:#374151;
  --wb-gray-900:#111827;
  --sidebar-w:  260px;
  --topbar-h:   60px;
}

* { box-sizing: border-box; }

body {
  font-family: 'Livvic', sans-serif;
  background: var(--wb-gray-50);
  color: var(--wb-gray-900);
  font-size: 14px;
  line-height: 1.6;
}

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--wb-white);
  border-right: 1px solid var(--wb-gray-200);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--wb-gray-200);
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.sidebar-logo .logo-mark {
  width: 36px; height: 36px;
  background: var(--wb-red);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}

.sidebar-logo .logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--wb-black);
  letter-spacing: -0.3px;
}
.sidebar-logo .logo-text span {
  color: var(--wb-red);
}

.sidebar-section {
  padding: 16px 12px 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--wb-gray-500);
}

.sidebar-nav { padding: 0 8px; flex: 1; }

.nav-item a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--wb-gray-700);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all .15s ease;
  margin-bottom: 2px;
}
.nav-item a:hover { background: var(--wb-gray-100); color: var(--wb-black); }
.nav-item a.active {
  background: #fff0f3;
  color: var(--wb-red);
  font-weight: 600;
}
.nav-item a i {
  width: 18px;
  text-align: center;
  font-size: 15px;
  opacity: .8;
}
.nav-item a.active i { opacity: 1; }

.nav-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--wb-red);
  color: white;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--wb-gray-200);
}
.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--wb-gray-700);
  text-decoration: none;
  font-size: 13px;
  transition: .15s;
}
.sidebar-footer a:hover { background: var(--wb-gray-100); }

/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--topbar-h);
  background: var(--wb-white);
  border-bottom: 1px solid var(--wb-gray-200);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  z-index: 999;
}

.topbar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--wb-black);
  flex: 1;
}

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.topbar-btn {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid var(--wb-gray-200);
  background: var(--wb-white);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--wb-gray-700);
  cursor: pointer;
  position: relative;
  text-decoration: none;
  transition: .15s;
}
.topbar-btn:hover { background: var(--wb-gray-100); border-color: var(--wb-gray-300); }

.notif-dot {
  position: absolute;
  top: 5px; right: 5px;
  width: 8px; height: 8px;
  background: var(--wb-red);
  border-radius: 50%;
  border: 2px solid white;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  color: var(--wb-gray-700);
  border: 1px solid var(--wb-gray-200);
  transition: .15s;
}
.topbar-user:hover { background: var(--wb-gray-100); }
.topbar-user .avatar {
  width: 28px; height: 28px;
  background: var(--wb-red);
  border-radius: 50%;
  color: white;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Main content ────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  padding-top: var(--topbar-h);
  min-height: 100vh;
}

.page-content {
  padding: 28px 28px;
}

/* ── Page header ─────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}
.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--wb-black);
  margin: 0;
}
.page-header p {
  color: var(--wb-gray-500);
  font-size: 13px;
  margin: 2px 0 0;
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--wb-white);
  border: 1px solid var(--wb-gray-200);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--wb-gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
}
.card-header h5, .card-header h6 {
  font-weight: 600;
  color: var(--wb-black);
  margin: 0;
}
.card-body { padding: 20px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--wb-gray-200); background: transparent; }

/* ── Stat Cards ──────────────────────────────────────────── */
.stat-card {
  background: var(--wb-white);
  border: 1px solid var(--wb-gray-200);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.stat-icon.red   { background: #fff0f3; color: var(--wb-red); }
.stat-icon.blue  { background: #eff6ff; color: #2563eb; }
.stat-icon.green { background: #f0fdf4; color: #16a34a; }
.stat-icon.amber { background: #fffbeb; color: #d97706; }
.stat-icon.purple{ background: #f5f3ff; color: #7c3aed; }
.stat-icon.cyan  { background: #ecfeff; color: #0891b2; }

.stat-label { font-size: 12px; color: var(--wb-gray-500); font-weight: 500; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--wb-black); line-height: 1.2; }
.stat-sub   { font-size: 11px; color: var(--wb-gray-500); margin-top: 2px; }

/* ── Tables ──────────────────────────────────────────────── */
.table { font-size: 13.5px; }
.table thead th {
  background: var(--wb-gray-50);
  border-bottom: 1px solid var(--wb-gray-200);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--wb-gray-500);
  padding: 10px 14px;
}
.table td { padding: 12px 14px; vertical-align: middle; border-bottom: 1px solid var(--wb-gray-100); }
.table tbody tr:hover { background: var(--wb-gray-50); }
.table-bordered td, .table-bordered th { border: 1px solid var(--wb-gray-200); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  font-family: 'Livvic', sans-serif;
  font-weight: 600;
  border-radius: 8px;
  font-size: 13.5px;
  padding: 7px 16px;
}
.btn-primary {
  background: var(--wb-red);
  border-color: var(--wb-red);
  color: white;
}
.btn-primary:hover { background: var(--wb-red-dk); border-color: var(--wb-red-dk); color: white; }
.btn-outline-primary {
  color: var(--wb-red);
  border-color: var(--wb-red);
  background: transparent;
}
.btn-outline-primary:hover { background: var(--wb-red); color: white; }
.btn-sm { padding: 5px 12px; font-size: 12.5px; }
.btn-xs { padding: 3px 8px; font-size: 11.5px; }
.btn-icon {
  width: 34px; height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

/* ── Forms ───────────────────────────────────────────────── */
.form-label { font-weight: 600; font-size: 12.5px; color: var(--wb-gray-700); }
.form-control, .form-select {
  border-radius: 8px;
  border: 1px solid var(--wb-gray-300);
  font-family: 'Livvic', sans-serif;
  font-size: 13.5px;
  padding: 8px 12px;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--wb-red);
  box-shadow: 0 0 0 3px rgba(224,0,49,.1);
  outline: none;
}

/* ── Badges ──────────────────────────────────────────────── */
.badge { font-family: 'Livvic', sans-serif; font-weight: 600; font-size: 11px; padding: 4px 8px; border-radius: 6px; }
.bg-primary { background: var(--wb-red) !important; }
.badge.bg-outline-primary { background: #fff0f3; color: var(--wb-red); border: 1px solid var(--wb-red); }

/* ── Status Colors ───────────────────────────────────────── */
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
  border-radius: 10px;
  border: none;
  font-size: 13.5px;
  font-weight: 500;
}
.alert-success { background: #f0fdf4; color: #15803d; }
.alert-danger   { background: #fff1f2; color: #be123c; }
.alert-warning  { background: #fffbeb; color: #92400e; }
.alert-info     { background: #eff6ff; color: #1d4ed8; }

/* ── Progress bar ────────────────────────────────────────── */
.progress { height: 6px; border-radius: 4px; background: var(--wb-gray-200); }
.progress-bar { border-radius: 4px; background: var(--wb-red); }
.progress-bar.bg-success { background: #16a34a !important; }
.progress-bar.bg-warning { background: #d97706 !important; }

/* ── Ticket-specific ─────────────────────────────────────── */
.ticket-card {
  border: 1px solid var(--wb-gray-200);
  border-radius: 10px;
  padding: 14px 16px;
  background: white;
  margin-bottom: 8px;
  transition: .15s;
  cursor: pointer;
  text-decoration: none;
  display: block;
  color: inherit;
}
.ticket-card:hover { border-color: var(--wb-red); box-shadow: 0 2px 8px rgba(224,0,49,.08); }
.ticket-card.priority-critical { border-left: 4px solid #dc2626; }
.ticket-card.priority-high     { border-left: 4px solid #ea580c; }
.ticket-card.priority-normal   { border-left: 4px solid #2563eb; }
.ticket-card.priority-low      { border-left: 4px solid #9ca3af; }

/* ── Timeline (ticket replies) ───────────────────────────── */
.timeline { position: relative; }
.timeline::before {
  content: '';
  position: absolute;
  left: 19px; top: 0; bottom: 0;
  width: 2px;
  background: var(--wb-gray-200);
}
.timeline-item { display: flex; gap: 14px; margin-bottom: 20px; position: relative; }
.timeline-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  z-index: 1;
}
.timeline-avatar.staff  { background: var(--wb-red); color: white; }
.timeline-avatar.client { background: #2563eb; color: white; }
.timeline-avatar.system { background: var(--wb-gray-300); color: var(--wb-gray-700); }
.timeline-avatar.internal { background: #7c3aed; color: white; }

.timeline-body {
  flex: 1;
  background: white;
  border: 1px solid var(--wb-gray-200);
  border-radius: 10px;
  overflow: hidden;
}
.timeline-body.internal-note { background: #fefce8; border-color: #fde68a; }

.timeline-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--wb-gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
}
.timeline-content { padding: 14px; font-size: 13.5px; line-height: 1.7; }

/* ── Kanban board ────────────────────────────────────────── */
.kanban-board { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 16px; }
.kanban-col {
  min-width: 260px;
  background: var(--wb-gray-100);
  border-radius: 12px;
  padding: 12px;
}
.kanban-col-header {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--wb-gray-700);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.kanban-task {
  background: white;
  border: 1px solid var(--wb-gray-200);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  cursor: grab;
  font-size: 13px;
}
.kanban-task:hover { border-color: var(--wb-red); }

/* ── Portal specific ─────────────────────────────────────── */
.portal-topbar { background: var(--wb-black); }
.portal-topbar .navbar-brand { color: white; font-weight: 700; }
.portal-hero {
  background: linear-gradient(135deg, var(--wb-black) 0%, #1a0008 100%);
  color: white;
  padding: 32px;
  border-radius: 16px;
  margin-bottom: 24px;
}

/* ── Login page ──────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--wb-gray-50);
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: white;
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
}
.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo .logo-mark {
  width: 52px; height: 52px;
  background: var(--wb-red);
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 24px;
  margin-bottom: 10px;
}
.login-logo h1 { font-size: 22px; font-weight: 700; margin: 0; }
.login-logo p  { color: var(--wb-gray-500); font-size: 13px; margin: 4px 0 0; }

/* ── Dropdown ─────────────────────────────────────────────── */
.dropdown-menu {
  border: 1px solid var(--wb-gray-200);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  font-family: 'Livvic', sans-serif;
  font-size: 13.5px;
}
.dropdown-item { padding: 8px 14px; border-radius: 6px; }
.dropdown-item:hover { background: var(--wb-gray-100); }
.dropdown-item:active { background: #fff0f3; color: var(--wb-red); }

/* ── Nav tabs ─────────────────────────────────────────────── */
.nav-tabs .nav-link {
  color: var(--wb-gray-500);
  font-weight: 600;
  font-size: 13px;
  border: none;
  padding: 10px 16px;
  border-bottom: 2px solid transparent;
  border-radius: 0;
}
.nav-tabs .nav-link.active {
  color: var(--wb-red);
  border-bottom-color: var(--wb-red);
  background: transparent;
}
.nav-tabs { border-bottom: 1px solid var(--wb-gray-200); }

/* ── Charts area ─────────────────────────────────────────── */
.chart-container { position: relative; height: 220px; }

/* ── Empty state ─────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--wb-gray-500);
}
.empty-state i { font-size: 48px; opacity: .3; display: block; margin-bottom: 12px; }
.empty-state h5 { font-weight: 600; color: var(--wb-gray-700); }
.empty-state p  { font-size: 13px; }

/* ── Search box ──────────────────────────────────────────── */
.search-box {
  position: relative;
}
.search-box input {
  padding-left: 36px;
}
.search-box i {
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  color: var(--wb-gray-500);
  pointer-events: none;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: .3s; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .topbar { left: 0; }
  .page-content { padding: 16px; }
}

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--wb-gray-100); }
::-webkit-scrollbar-thumb { background: var(--wb-gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--wb-gray-500); }

/* ── Utilities ───────────────────────────────────────────── */
.text-red { color: var(--wb-red) !important; }
.bg-red-lt { background: #fff0f3 !important; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fs-12  { font-size: 12px; }
.fs-13  { font-size: 13px; }
.gap-8  { gap: 8px; }
.rounded-10 { border-radius: 10px !important; }
.border-red { border-color: var(--wb-red) !important; }

/* ── Utility: small avatar ───────────────────────────── */
.avatar-sm {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: var(--wb-red);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

/* ── Pagination wrapper ──────────────────────────────── */
.pagination { gap: 2px; }
