/* ===== PBC Linear Brand Theme ===== */
/* Primary Blue: #0078E6 | Dark Blue: #005BA6 | Accent Red: #E60514 */
/* Light Grey: #BACBD4 | Dark Grey: #98B1BE | White: #FFFFFF */
/* Font: Roboto (Regular, Medium, Bold) + Roboto Condensed for tables */

/* --- Global Font Override --- */
body,
.title,
.subtitle,
.button,
.input,
.textarea,
.select select,
.label,
.navbar {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.table {
  font-family: 'Roboto Condensed', 'Roboto', sans-serif;
}

body {
  background-color: #f4f6f8;
}

/* --- Bulma Color Overrides (PBC Linear Blue) --- */
.button.is-link {
  background-color: #0078E6;
}

.button.is-link:hover {
  background-color: #005BA6;
}

.has-text-link,
a.navbar-item:hover,
a:not(.button):not(.navbar-item):not(.tag) {
  color: #0078E6;
}

.navbar-signout {
  color: #0078E6 !important;
}

.tag.is-info.is-light {
  background-color: #e8f4fd;
  color: #005BA6;
}

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 240px;
  height: 100vh;
  background: #1b2a3d;
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: width 0.2s ease;
  overflow: hidden;
}

.sidebar-brand {
  padding: 18px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.sidebar-brand a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.sidebar-logo {
  flex-shrink: 0;
  filter: brightness(0) invert(1);
}

.sidebar-logo--full {
  height: 26px;
  display: block;
}

.sidebar-logo--icon {
  height: 28px;
  display: none;
  filter: none;
}

.sidebar-section-label {
  padding: 20px 20px 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,0.3);
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  padding: 4px 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  margin: 2px 10px;
  border-radius: 8px;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-item:hover {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.95);
}

.sidebar-item.is-active {
  background: rgba(0, 120, 230, 0.2);
  color: #fff;
  font-weight: 500;
}

.sidebar-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sidebar-item.is-active .sidebar-icon {
  color: #4da6ff;
}

.sidebar-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-divider {
  height: 1px;
  background: rgba(255,255,255,0.07);
  margin: 6px 20px;
}

.sidebar-footer {
  padding: 12px 20px;
  border-top: 1px solid rgba(255,255,255,0.07);
}

.sidebar-toggle {
  background: none;
  border: none;
  color: #98B1BE;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}

.sidebar-toggle:hover {
  color: #fff;
}

/* Collapsed state */
.sidebar-collapsed .sidebar {
  width: 60px;
}

.sidebar-collapsed .sidebar-logo--full {
  display: none;
}

.sidebar-collapsed .sidebar-logo--icon {
  display: block;
}

.sidebar-collapsed .sidebar-label,
.sidebar-collapsed .sidebar-section-label {
  display: none;
}

.sidebar-collapsed .sidebar-brand {
  padding: 14px 0;
}

.sidebar-collapsed .sidebar-brand a {
  justify-content: center;
}

.sidebar-collapsed .sidebar-item {
  justify-content: center;
  padding: 10px 0;
  margin: 2px 8px;
  gap: 0;
}

.sidebar-collapsed .sidebar-toggle svg {
  transform: rotate(180deg);
}

.sidebar-collapsed .sidebar-divider {
  margin: 6px 12px;
}

.sidebar-collapsed .sidebar-footer {
  display: flex;
  justify-content: center;
  padding: 12px 0;
}

/* ===== TOPBAR ===== */
.topbar {
  height: 48px;
  background: #fff;
  border-bottom: 1px solid #e8eaed;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.topbar-title {
  font-size: 15px;
  font-weight: 500;
  color: #333;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #666;
}

.topbar-signout {
  color: #0078E6 !important;
  text-decoration: none;
  font-size: 13px;
}

.topbar-signout:hover {
  text-decoration: underline;
}

/* ===== APP LAYOUT ===== */
.app-main {
  margin-left: 240px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.2s ease;
}

.sidebar-collapsed .app-main {
  margin-left: 60px;
}

.app-content {
  flex: 1;
  padding: 24px;
}

.app-content--flush {
  padding: 0;
}

/* --- Login Page --- */
.login-hero {
  background: linear-gradient(135deg, #005BA6 0%, #0078E6 100%);
}

.login-logo {
  height: 40px;
  margin-bottom: 0.75rem;
}

/* Login divider ("or" between SSO and password) */
.divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
  color: #98B1BE;
  font-size: 13px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #BACBD4;
}

.divider::before { margin-right: 12px; }
.divider::after { margin-left: 12px; }

/* --- Module Cards (Welcome Page) --- */
.module-card {
  transition: box-shadow 0.2s, border-color 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
  border-left: 3px solid transparent;
}

.module-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  border-left-color: #0078E6;
}

.module-card--admin {
  border: 2px dashed #BACBD4;
  background: #f8fafb;
}

.module-card--admin:hover {
  border-color: #0078E6;
}

/* --- Admin Setup Dashboard --- */
.setup-card-icon {
  color: #0078E6;
}

/* --- Users Split-Panel Layout --- */
.users-panel {
  height: calc(100vh - 48px);
}

.users-sidebar {
  border-right: 1px solid #BACBD4;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
}

.users-list {
  flex: 1;
  overflow-y: auto;
}

.user-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid #f0f2f4;
  cursor: pointer;
  transition: background 0.1s;
}

.user-list-item:hover {
  background: #f4f8fc;
}

.user-list-item--active {
  background: #e8f4fd;
  border-left: 3px solid #0078E6;
}

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

.user-list-info > div {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- User Avatars --- */
.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #BACBD4;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  flex-shrink: 0;
}

.user-avatar--lg {
  width: 64px;
  height: 64px;
  font-size: 26px;
}

/* --- Status Dots --- */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot--active { background: #48c78e; }
.status-dot--pending { background: #ffe08a; }
.status-dot--disabled { background: #E60514; }

/* --- User Detail Panel --- */
.users-detail {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  background: #f4f6f8;
}

.users-detail-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

/* --- Audit Log --- */
.audit-entry {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid #f0f2f4;
  margin-bottom: 0 !important;
}

/* --- Section Headers (Zoho-style blue bar) --- */
.section-heading {
  background: linear-gradient(135deg, #005BA6 0%, #0078E6 100%);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 4px 4px 0 0;
  font-weight: 700;
  font-size: 15px;
}

/* --- Version Footer --- */
.version-footer {
  position: fixed;
  bottom: 12px;
  right: 12px;
  font-size: 11px;
  color: #98B1BE;
  font-family: 'Roboto Condensed', monospace;
  z-index: 50;
}
