/* ============================================================================
   Zero Web IT Support Desk — Global Theme
   Blue + White professional admin theme, with Dark Mode support via
   data-bs-theme attribute (Bootstrap 5.3 native color mode).
   ============================================================================ */

:root {
  --zw-primary: #0d3b8c;
  --zw-primary-light: #1b56c4;
  --zw-primary-dark: #082a66;
  --zw-accent: #0dcaf0;
  --zw-bg: #f4f6fb;
  --zw-card-bg: #ffffff;
  --zw-text: #212529;
  --zw-muted: #6c7685;
  --zw-border: #e6e9f0;
  --zw-sidebar-width: 260px;
  --zw-radius: 10px;
}

[data-bs-theme="dark"] {
  --zw-bg: #0f1522;
  --zw-card-bg: #161d2e;
  --zw-text: #e8ebf1;
  --zw-muted: #9aa3b5;
  --zw-border: #263049;
}

body {
  background-color: var(--zw-bg);
  color: var(--zw-text);
  font-family: 'Segoe UI', Roboto, Arial, sans-serif;
}

/* ---------------------------------------------------------------------- */
/* Layout                                                                  */
/* ---------------------------------------------------------------------- */
.zw-sidebar {
  width: var(--zw-sidebar-width);
  min-height: 100vh;
  background: linear-gradient(180deg, var(--zw-primary) 0%, var(--zw-primary-dark) 100%);
  position: fixed;
  top: 0; left: 0;
  transition: transform .25s ease;
  z-index: 1030;
}
.zw-sidebar .brand {
  padding: 1.25rem 1.25rem;
  color: #fff;
  font-weight: 700;
  font-size: 1.15rem;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.zw-sidebar .nav-link {
  color: rgba(255,255,255,.78);
  padding: .65rem 1.25rem;
  border-radius: 0;
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .92rem;
}
.zw-sidebar .nav-link .material-icons { font-size: 20px; }
.zw-sidebar .nav-link:hover,
.zw-sidebar .nav-link.active {
  background: rgba(255,255,255,.12);
  color: #fff;
  border-left: 3px solid var(--zw-accent);
}

.zw-content {
  margin-left: var(--zw-sidebar-width);
  min-height: 100vh;
  transition: margin-left .25s ease;
}

.zw-topbar {
  background: var(--zw-card-bg);
  border-bottom: 1px solid var(--zw-border);
  padding: .75rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 1020;
}

@media (max-width: 991.98px) {
  .zw-sidebar { transform: translateX(-100%); }
  .zw-sidebar.show { transform: translateX(0); }
  .zw-content { margin-left: 0; }
}

/* ---------------------------------------------------------------------- */
/* Cards / Dashboard widgets                                              */
/* ---------------------------------------------------------------------- */
.zw-card {
  background: var(--zw-card-bg);
  border: 1px solid var(--zw-border);
  border-radius: var(--zw-radius);
}

.zw-stat-card {
  border-radius: var(--zw-radius);
  padding: 1.25rem;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.zw-stat-card .material-icons { font-size: 34px; opacity: .85; }
.zw-stat-card h3 { font-weight: 700; margin-bottom: 0; }
.zw-stat-card small { opacity: .9; }
.bg-grad-blue    { background: linear-gradient(135deg,#0d3b8c,#1b56c4); }
.bg-grad-green   { background: linear-gradient(135deg,#146c43,#20c997); }
.bg-grad-orange  { background: linear-gradient(135deg,#b35309,#fd7e14); }
.bg-grad-red     { background: linear-gradient(135deg,#a71d2a,#dc3545); }
.bg-grad-purple  { background: linear-gradient(135deg,#4c1d95,#6610f2); }

/* ---------------------------------------------------------------------- */
/* Badges: status / priority                                              */
/* ---------------------------------------------------------------------- */
.badge-status, .badge-priority {
  padding: .35em .7em;
  font-weight: 600;
  font-size: .74rem;
  border-radius: 20px;
}

/* ---------------------------------------------------------------------- */
/* Ticket timeline                                                        */
/* ---------------------------------------------------------------------- */
.zw-timeline { position: relative; padding-left: 1.75rem; }
.zw-timeline::before {
  content: ''; position: absolute; left: 6px; top: 4px; bottom: 4px;
  width: 2px; background: var(--zw-border);
}
.zw-timeline-item { position: relative; padding-bottom: 1.25rem; }
.zw-timeline-item::before {
  content: ''; position: absolute; left: -1.75rem; top: 3px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--zw-primary); border: 2px solid var(--zw-card-bg);
}

/* ---------------------------------------------------------------------- */
/* Utility                                                                 */
/* ---------------------------------------------------------------------- */
.zw-loading-spinner {
  display: inline-block; width: 1.1rem; height: 1.1rem;
  border: 2px solid rgba(0,0,0,.15); border-top-color: var(--zw-primary);
  border-radius: 50%; animation: zw-spin .6s linear infinite;
}
@keyframes zw-spin { to { transform: rotate(360deg); } }

.chat-bubble {
  border-radius: var(--zw-radius);
  padding: .85rem 1rem;
  max-width: 80%;
}
.chat-bubble.mine { background: var(--zw-primary); color: #fff; margin-left: auto; }
.chat-bubble.theirs { background: var(--zw-border); }
.chat-bubble.internal-note { background: #fff3cd; border: 1px dashed #ffc107; }
