@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&family=Roboto:wght@300;400;500;700&display=swap');
/* TRIVIX OS Manager - Style Premium Corporativo */
:root {
  --font-primary: "DM Sans", Roboto, sans-serif;
  --trivix-black: #050505;
  --trivix-dark: #111111;
  --trivix-border: #2b2b2b;
  --trivix-white: #ffffff;
  --trivix-bg: #f5f6f8;
  --trivix-cyan: #00eaff;
  --trivix-purple: #5b35d5;
  --trivix-text: #0f172a;
  --trivix-text-muted: #64748b;
  --sidebar-width: 250px;
  --sidebar-collapsed: 70px;
  --topbar-height: 60px;
  --radius: 0px;
}

* { border-radius: 0 !important; }
input, select, textarea, button, .btn, .card, .modal-content, .form-control, .form-select, 
.dropdown-menu, .alert, .badge, .nav-tabs .nav-link, .table, .list-group-item, 
.accordion-item, .accordion-header, .accordion-button, .toast, .popover, .tooltip-inner,
.progress-bar, .page-link, .page-item:first-child .page-link, .page-item:last-child .page-link,
.img-thumbnail, .thumbnail, .rounded, .rounded-1, .rounded-2, .rounded-3, .rounded-pill, 
.rounded-circle, .rounded-top, .rounded-end, .rounded-bottom, .rounded-start,
.rounded-top-0, .rounded-end-0, .rounded-bottom-0, .rounded-start-0,
.kanban-column, .kanban-card, .side-panel, .quick-action-btn, .shortcut-icon,
.card-dash, .stat-card, .metric-card, .quote-pdf-box, .os-pdf-box, .contract-pdf-box,
.navbar, .navbar-toggler, .sidebar, .sidebar-item, .main-content,
.modal-header, .modal-footer, .modal-body, .card-header, .card-footer,
.accordion-body, .btn-group > .btn:first-child, .btn-group > .btn:last-child,
.input-group > .form-control:first-child, .input-group > .form-control:last-child,
.input-group > .input-group-text:first-child, .input-group > .input-group-text:last-child {
  border-radius: 0 !important;
}

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

body {
  font-family: var(--font-primary);
  background: var(--trivix-bg);
  color: var(--trivix-text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* SIDEBAR */
#wrapper { display: flex; width: 100%; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-width);
  background: var(--trivix-black);
  height: 100vh;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 1000;
  transition: width 0.3s ease;
  overflow: hidden;
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }

.sidebar-brand {
  margin: 14px 12px 10px;
  height: 56px;
  padding: 0 16px;
  background: #151515;
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  overflow: hidden;
  flex-shrink: 0;
}
.sidebar-brand img { max-width: 118px; max-height: 32px; object-fit: contain; transition: all 0.3s ease; }
.sidebar.collapsed .sidebar-brand { justify-content: center; padding: 0 8px; margin: 12px 8px 16px; height: 48px; }
.sidebar.collapsed .sidebar-brand img { max-width: 32px; max-height: 26px; }

.sidebar-menu {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 0 12px;
  list-style: none;
}
.sidebar-menu::-webkit-scrollbar { width: 6px; }
.sidebar-menu::-webkit-scrollbar-track { background: transparent; }
.sidebar-menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.16); }
.sidebar-menu { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.16) transparent; }

.sidebar-menu .nav-divider {
  padding: 18px 20px 6px;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.4);
  font-weight: 500;
}
.sidebar-menu .nav-collapse-header {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-menu .nav-collapse-header:hover {
  color: rgba(255,255,255,0.7);
}
.sidebar-menu .nav-collapse-arrow {
  font-size: 8px;
  transition: transform 0.2s ease;
  float: none;
  margin-top: 0;
}
.nav-collapse.hidden { display: none; }
.sidebar.collapsed .nav-divider { display: none; }
.sidebar.collapsed .nav-collapse { display: none; }
.sidebar.collapsed .nav-collapse-header { display: none; }
.sidebar-menu .nav-item { padding: 0; }

.sidebar-link {
  min-height: 46px;
  padding: 0 18px;
  margin: 3px 8px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: rgba(255,255,255,0.72);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-link i { width: 22px; min-width: 22px; font-size: 18px; text-align: center; opacity: 0.85; flex-shrink: 0; }
.sidebar-link:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar-link.active {
  background: linear-gradient(180deg, #2a2a2a, #1e1e1e);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.1);
}
.sidebar.collapsed .sidebar-link { justify-content: center; padding: 0; margin: 3px 8px; min-height: 44px; }
.sidebar.collapsed .sidebar-link i { margin: 0; font-size: 20px; }
.sidebar.collapsed .sidebar-link span { display: none; }

/* SIDEBAR SHORTCUTS */
.sidebar-shortcuts {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 8px 0;
}
.sidebar.collapsed .sidebar-shortcuts { display: none; }
.shortcut-link {
  min-height: 38px;
  padding: 0 18px;
  margin: 1px 8px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 13px;
  transition: all 0.2s;
}
.shortcut-link i { width: 20px; font-size: 14px; text-align: center; }
.shortcut-link:hover { color: #fff; background: rgba(255,255,255,0.06); }

.sidebar-footer {
  flex-shrink: 0;
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-footer .user-avatar {
  width: 32px; height: 32px;
  background: rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 12px; color: #fff; flex-shrink: 0;
}
.sidebar-footer .user-info { flex: 1; min-width: 0; color: rgba(255,255,255,0.7); font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-footer .user-info small { display: block; font-size: 10px; color: rgba(255,255,255,0.4); font-weight: 400; }
.sidebar-footer a { color: rgba(255,255,255,0.5); font-size: 16px; flex-shrink: 0; transition: color 0.2s; }
.sidebar-footer a:hover { color: #fff; }
.sidebar.collapsed .sidebar-footer { justify-content: center; padding: 12px 8px; }
.sidebar.collapsed .sidebar-footer .user-info,
.sidebar.collapsed .sidebar-footer a { display: none; }

/* TOPBAR */
.topbar {
  background: var(--trivix-white);
  border-bottom: 1px solid #e2e8f0;
  padding: 12px 24px;
  min-height: var(--topbar-height);
  position: sticky;
  top: 0; z-index: 900;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.page-title { font-size: 18px; font-weight: 600; color: var(--trivix-text); }

/* MAIN CONTENT */
#page-content-wrapper {
  width: calc(100% - var(--sidebar-width));
  margin-left: var(--sidebar-width);
  transition: all 0.3s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.sidebar.collapsed + #page-content-wrapper {
  width: calc(100% - var(--sidebar-collapsed));
  margin-left: var(--sidebar-collapsed);
}
.main-content { flex: 1; padding: 24px; }
.page-header { margin-bottom: 20px; }
.page-header .page-title { font-size: 22px; font-weight: 700; }

/* CARDS */
.card {
  background: var(--trivix-white);
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s ease;
}
.card-header {
  background: transparent;
  border-bottom: 1px solid #e2e8f0;
  padding: 14px 20px;
  font-weight: 600;
  font-size: 14px;
}
.card-body { padding: 20px; }
.card-dash .card-body {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
}
.dash-icon {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.dash-info { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.dash-label { font-size: 11px; color: var(--trivix-text-muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-value { font-size: 18px; font-weight: 700; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* BUTTONS - Padronizados */
.btn {
  font-family: var(--font-primary);
  font-weight: 600;
  padding: 6px 16px;
  font-size: 13px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn:active { transform: scale(0.97); }
.btn i { font-size: 0.95em; }

.btn-primary { background: var(--trivix-black); border-color: var(--trivix-black); color: var(--trivix-white); }
.btn-primary:hover { background: #1a1a1a; border-color: #1a1a1a; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.btn-secondary { background: #64748b; border-color: #64748b; color: #fff; }
.btn-secondary:hover { background: #475569; border-color: #475569; }
.btn-success { background: #10b981; border-color: #10b981; color: #fff; }
.btn-success:hover { background: #059669; border-color: #059669; }
.btn-danger { background: #ef4444; border-color: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; border-color: #dc2626; }
.btn-info { background: var(--trivix-cyan); border-color: var(--trivix-cyan); color: #000; }
.btn-info:hover { background: #00c4d4; border-color: #00c4d4; }
.btn-ghost { background: transparent; border: 1px solid transparent; color: var(--trivix-text-muted); }
.btn-ghost:hover { background: #f1f5f9; color: var(--trivix-text); border-color: transparent; }
.btn-outline-primary { border-color: var(--trivix-black); color: var(--trivix-black); background: transparent; }
.btn-outline-primary:hover { background: var(--trivix-black); color: var(--trivix-white); }
.btn-sm { padding: 3px 10px; font-size: 12px; }
.btn-lg { padding: 10px 24px; font-size: 15px; }
.btn-block { width: 100%; justify-content: center; }
.btn-loading { pointer-events: none; opacity: 0.7; position: relative; }
.btn-loading::after {
  content: '';
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  animation: spin 0.6s linear infinite;
  margin-left: 8px;
}
.btn-loading-text { visibility: hidden; display: inline-block; }
.btn-loading-label { display: inline-flex; align-items: center; gap: 6px; }


/* FLOATING ACTION BUTTON */
.fab-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
}
.fab-main {
  width: 56px; height: 56px;
  background: var(--trivix-black);
  color: var(--trivix-white);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
.fab-main:hover { transform: scale(1.05); box-shadow: 0 6px 20px rgba(0,0,0,0.35); }
.fab-main.open { transform: rotate(45deg); background: var(--trivix-purple); }
.fab-menu {
  position: absolute;
  bottom: 70px;
  right: 0;
  min-width: 220px;
  background: var(--trivix-white);
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  border: 1px solid #e2e8f0;
  padding: 8px;
  display: none;
  animation: fabIn 0.2s ease;
}
.fab-menu.open { display: block; }
@keyframes fabIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.fab-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: var(--trivix-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s;
}
.fab-menu-item:hover { background: #f1f5f9; color: var(--trivix-text); }
.fab-menu-item i { width: 20px; font-size: 16px; text-align: center; color: var(--trivix-purple); }

/* TABLES */
.table { margin-bottom: 0; font-size: 14px; }
.table thead th {
  border-bottom: 2px solid #e2e8f0;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--trivix-text-muted);
  padding: 12px;
}
.table td { padding: 12px; vertical-align: middle; border-bottom: 1px solid #f1f5f9; }
.table-hover tbody tr:hover { background: #f8fafc; }

/* BADGES */
.badge { font-weight: 600; font-size: 11px; padding: 4px 10px; letter-spacing: 0.3px; }
.bg-success { background: #10b981 !important; }
.bg-danger { background: #ef4444 !important; }
.bg-warning { background: #f59e0b !important; color: #fff !important; }
.bg-info { background: var(--trivix-cyan) !important; color: #000 !important; }
.bg-primary { background: var(--trivix-purple) !important; }
.bg-secondary { background: #94a3b8 !important; }
.bg-light { background: #f1f5f9 !important; color: var(--trivix-text) !important; }

/* FORMS */
.form-control, .form-select {
  font-family: var(--font-primary);
  border: 1.5px solid #e2e8f0;
  padding: 8px 14px;
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-control:focus, .form-select:focus {
  border-color: var(--trivix-purple);
  box-shadow: 0 0 0 3px rgba(91,53,213,0.1);
}
.form-label { font-weight: 600; font-size: 13px; color: var(--trivix-text); margin-bottom: 6px; }
.input-group-text { background: #f8fafc; border: 1.5px solid #e2e8f0; }

/* AVATAR */
.avatar-sm {
  width: 32px; height: 32px;
  background: var(--trivix-purple);
  color: var(--trivix-white);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}

/* LOGIN */
.login-container {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--trivix-black) 0%, #1a1a2e 100%);
}
.login-card { background: var(--trivix-white); box-shadow: 0 20px 60px rgba(0,0,0,0.3); width: 100%; max-width: 420px; overflow: hidden; }
.login-header { text-align: center; padding: 40px 30px 20px; }
.login-header h2 { font-weight: 700; margin-top: 10px; }
.login-logo { max-height: 60px; }
.login-body { padding: 0 30px 30px; }

/* SIGNATURE */
.signature-pad { border: 2px dashed var(--trivix-border); background: #fff; cursor: crosshair; width: 100%; height: 200px; touch-action: none; }

/* PAGINATION */
.page-link { margin: 0 2px; color: var(--trivix-text); border: 1px solid #e2e8f0; }
.page-item.active .page-link { background: var(--trivix-black); border-color: var(--trivix-black); color: var(--trivix-white); }
.page-item.disabled .page-link { color: var(--trivix-text-muted); }

/* COLLAPSIBLE SECTIONS (OS mobile) */
.collapse-section { margin-bottom: 16px; }
.collapse-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--trivix-white);
  border: 1px solid #e2e8f0;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: background 0.2s;
}
.collapse-section-header:hover { background: #f8fafc; }
.collapse-section-header i { transition: transform 0.3s; font-size: 12px; }
.collapse-section-header.collapsed i { transform: rotate(-90deg); }
.collapse-section-body { padding: 16px; border: 1px solid #e2e8f0; border-top: none; }

/* CONTRACTS */
.contract-timeline { position: relative; padding-left: 30px; }
.contract-timeline::before {
  content: '';
  position: absolute; left: 10px; top: 0; bottom: 0;
  width: 2px; background: #e2e8f0;
}
.timeline-item { position: relative; padding-bottom: 20px; }
.timeline-item::before {
  content: '';
  position: absolute; left: -24px; top: 4px;
  width: 12px; height: 12px;
  background: var(--trivix-purple);
  border: 2px solid var(--trivix-white);
  box-shadow: 0 0 0 2px var(--trivix-purple);
}
.timeline-item .text-muted { font-size: 12px; }

/* CONTRACT VALUE CARD */
.value-card {
  text-align: center;
  padding: 20px;
  border: 1px solid #e2e8f0;
}
.value-card .value { font-size: 28px; font-weight: 700; }
.value-card .label { font-size: 12px; color: var(--trivix-text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }

/* UTILITIES */
.text-trivix-cyan { color: var(--trivix-cyan); }
.text-trivix-purple { color: var(--trivix-purple); }
.bg-trivix-cyan { background: var(--trivix-cyan); }
.bg-trivix-purple { background: var(--trivix-purple); }

.alert { border: none; font-size: 14px; }
.nav-tabs .nav-link { font-weight: 500; color: var(--trivix-text-muted); border: none; padding: 10px 20px; }
.nav-tabs .nav-link.active { color: var(--trivix-purple); background: transparent; border-bottom: 2px solid var(--trivix-purple); }
.dropdown-menu { border: 1px solid #e2e8f0; box-shadow: 0 10px 30px rgba(0,0,0,0.1); padding: 8px; }
.dropdown-menu .dropdown-item { padding: 8px 14px; font-size: 14px; }
.dropdown-menu .dropdown-item:hover { background: #f1f5f9; }
.empty-state { text-align: center; padding: 60px 20px; }
.loading {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid var(--trivix-border);
  border-top-color: var(--trivix-purple);
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-sm { width: 14px; height: 14px; border-width: 2px; display: inline-block; vertical-align: middle; }

/* RESPONSIVE - TABLET */
@media (max-width: 991.98px) {
  .sidebar { width: var(--sidebar-collapsed); }
  .sidebar .sidebar-brand-title,
  .sidebar .sidebar-link span,
  .sidebar .nav-divider,
  .sidebar .sidebar-shortcuts,
  .sidebar .sidebar-footer .user-info,
  .sidebar .sidebar-footer a { display: none; }
  .sidebar .sidebar-link { justify-content: center; padding: 0; }
  .sidebar .sidebar-link i { margin: 0; font-size: 20px; }
  .sidebar-footer { justify-content: center; padding: 12px 8px; }
  .sidebar-brand { justify-content: center; padding: 0 8px; height: 48px; }
  .sidebar-brand img { max-width: 32px; max-height: 26px; }
  #page-content-wrapper { width: calc(100% - var(--sidebar-collapsed)); margin-left: var(--sidebar-collapsed); }
}

/* RESPONSIVE - MOBILE */
@media (max-width: 767.98px) {
  .sidebar { width: 0; overflow: hidden; position: fixed; z-index: 1050; transition: width 0.3s ease; }
  .sidebar.open { width: var(--sidebar-width); }
  .sidebar.open .sidebar-shortcuts { display: block; }
  #page-content-wrapper { width: 100%; margin-left: 0; }
  .main-content { padding: 16px; }
  .topbar { padding: 10px 16px; }
  .dash-value { font-size: 16px; }
  .dash-icon { width: 40px; height: 40px; font-size: 16px; }
  .page-header .page-title { font-size: 18px; }

  .fab-container { bottom: 16px; right: 16px; }
  .fab-main { width: 52px; height: 52px; font-size: 22px; }

  /* Table to Cards */
  .table-card-view thead { display: none; }
  .table-card-view tbody tr {
    display: block;
    border: 1px solid #e2e8f0;
    margin-bottom: 12px;
    padding: 12px;
    background: var(--trivix-white);
  }
  .table-card-view tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border: none;
    font-size: 13px;
  }
  .table-card-view tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--trivix-text-muted);
    letter-spacing: 0.3px;
    margin-right: 8px;
  }

  .btn { padding: 8px 16px; min-height: 40px; justify-content: center; }
  .btn-sm { padding: 5px 10px; min-height: 32px; font-size: 12px; }
  .btn-group { display: flex; gap: 4px; }
  .btn-group .btn { margin: 0; flex: 1; }

  .card-body { padding: 16px; }
  .card-header { padding: 12px 16px; }

  .form-control, .form-select { padding: 10px 14px; min-height: 44px; font-size: 16px; }
  .form-label { font-size: 14px; }

  .modal-dialog { margin: 8px; }
  .modal-content { }
  .modal-header { padding: 14px 16px; }
  .modal-body { padding: 16px; }
  .modal-footer { padding: 12px 16px; flex-direction: column; gap: 8px; }
  .modal-footer .btn { width: 100%; }

  .collapse-section-header { padding: 14px 16px; min-height: 48px; }
  .collapse-section-body { padding: 12px; }

  .page-header .d-flex { flex-direction: column; gap: 8px; }
  .page-header .d-flex .btn { width: 100%; }
}

/* ============================================================
   KANBAN / CRM - TRELLO STYLE
   ============================================================ */
.kanban-wrapper {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 12px;
  min-height: calc(100vh - 200px);
  margin: -8px;
  padding: 8px;
}
.kanban-board {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  min-height: calc(100vh - 220px);
  width: max-content;
  padding-bottom: 20px;
}
.kanban-column {
  width: 290px;
  min-width: 290px;
  background: #f1f5f9;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 230px);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.kanban-column-header {
  padding: 14px 14px 10px;
  display: flex;
  align-items: center;
  background: #f8fafc;
  flex-shrink: 0;
}
.column-title {
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--trivix-text);
}
.column-count {
  font-size: 10px !important;
  padding: 2px 8px !important;
  font-weight: 600;
}
.kanban-cards {
  padding: 6px 10px 10px;
  overflow-y: auto;
  flex: 1;
  min-height: 60px;
}
.kanban-cards::-webkit-scrollbar { width: 4px; }
.kanban-cards::-webkit-scrollbar-thumb { background: #cbd5e1; }
.kanban-column-footer {
  padding: 6px 10px 10px;
  flex-shrink: 0;
}
.kanban-column-footer .btn-ghost:hover {
  background: #e2e8f0;
  color: var(--trivix-text);
}

/* Cards */
.kanban-card {
  background: #fff;
  margin-bottom: 10px;
  cursor: grab;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s, transform 0.15s;
  overflow: hidden;
  position: relative;
  border: 1px solid #e2e8f0;
}
.kanban-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}
.kanban-card.overdue {
  border-left: 3px solid #ef4444;
}
.kanban-card.overdue .card-title {
  color: #dc2626;
}
.card-priority-bar {
  height: 3px;
  width: 100%;
}
.card-body-inner {
  padding: 10px 12px 8px;
}
.card-title {
  font-size: 13px;
  line-height: 1.3;
  color: var(--trivix-text);
}
.card-desc {
  font-size: 11px;
  line-height: 1.3;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-value {
  font-size: 10px;
  padding: 2px 6px;
  white-space: nowrap;
}
.avatar-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--trivix-purple);
  color: #fff;
  font-weight: 700;
  flex-shrink: 0;
}

/* Drag states */
.kanban-card-ghost {
  opacity: 0.4;
  border: 2px dashed var(--trivix-purple) !important;
}
.kanban-card-dragging {
  transform: rotate(3deg) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15) !important;
  z-index: 999;
}

/* Side Panel */
.kanban-side-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  z-index: 1060;
  visibility: hidden;
  transition: visibility 0s 0.3s;
}
.kanban-side-panel.open {
  visibility: visible;
  transition: visibility 0s 0s;
}
.side-panel-backdrop {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.3);
  opacity: 0;
  transition: opacity 0.3s;
}
.kanban-side-panel.open .side-panel-backdrop {
  opacity: 1;
}
.side-panel-content {
  position: absolute;
  top: 0;
  right: -480px;
  width: 460px;
  max-width: 92vw;
  height: 100%;
  background: #fff;
  box-shadow: -4px 0 24px rgba(0,0,0,0.12);
  overflow-y: auto;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}
.kanban-side-panel.open .side-panel-content {
  right: 0;
}
.side-panel-header {
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}
.side-panel-body {
  padding: 16px;
  flex: 1;
}
.panel-section {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}
.panel-section:last-child {
  border-bottom: none;
}
.panel-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--trivix-text-muted);
  font-weight: 600;
  margin-bottom: 6px;
}
.panel-label i {
  margin-right: 4px;
}
.activity-item {
  border-bottom: 1px solid #f8fafc;
}
.activity-item:last-child {
  border-bottom: none;
}
.history-item {
  border-bottom: 1px solid #f8fafc;
}
.history-item:last-child {
  border-bottom: none;
}
.smallest {
  font-size: 10px;
}

/* Kanban responsive */
@media (max-width: 767.98px) {
  .kanban-column {
    width: 260px;
    min-width: 260px;
    max-height: none;
  }
  .kanban-board {
    min-height: auto;
  }
  .side-panel-content {
    width: 100vw;
    max-width: 100vw;
  }
  .kanban-wrapper {
    margin: -8px -12px;
    padding: 8px 12px;
  }
}

/* ============================================================
   QUICK ACTIONS BAR
   ============================================================ */
.quick-actions-bar .btn {
  transition: all 0.2s;
}
.quick-actions-bar .btn:hover {
  background: var(--trivix-purple) !important;
  color: #fff !important;
  border-color: var(--trivix-purple) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(91,53,213,0.2);
}
.quick-action-item {
  transition: all 0.2s;
}
.quick-action-item:hover {
  border-color: var(--trivix-purple) !important;
  box-shadow: 0 2px 8px rgba(91,53,213,0.15);
}

/* FULLCALENDAR OVERRIDE */
.fc { font-family: var(--font-primary); }
.fc .fc-toolbar-title { font-size: 18px !important; font-weight: 700; }
.fc .fc-button-primary { background: var(--trivix-black) !important; border-color: var(--trivix-black) !important; }
.fc .fc-button-primary:hover { background: #1a1a1a !important; }
.fc .fc-button-primary:not(:disabled).fc-button-active { background: var(--trivix-purple) !important; border-color: var(--trivix-purple) !important; }
.fc .fc-day-today { background: rgba(91,53,213,0.05) !important; }
.fc .fc-daygrid-event { border-radius: 0 !important; padding: 2px 6px !important; font-size: 12px !important; }
.fc .fc-event-title { font-weight: 500; }
.fc .fc-col-header-cell { font-weight: 600; font-size: 12px; text-transform: uppercase; color: var(--trivix-text-muted); padding: 8px 0; }

/* ============================================================
   LOADING SYSTEM
   ============================================================ */
.top-loading-bar {
  position: fixed; top: 0; left: 0; height: 3px;
  background: var(--trivix-purple, #5b35d5);
  z-index: 99999; width: 0;
  transition: width 0.4s ease;
}
.top-loading-bar.active { width: 60%; }
.top-loading-bar.complete { width: 100%; transition: width 0.15s ease; }

.page-loading {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.85);
  z-index: 99990;
  display: none; align-items: center; justify-content: center;
  flex-direction: column; gap: 16px;
}
.page-loading.active { display: flex; }
.page-loading .page-loading-spinner {
  width: 36px; height: 36px;
  border: 3px solid #e2e8f0; border-top-color: var(--trivix-purple, #5b35d5);
  animation: spin 0.6s linear infinite;
}
.page-loading .page-loading-text {
  font-size: 14px; color: var(--trivix-text-muted); font-weight: 500;
}

/* Skeleton Loading */
@keyframes shimmer {
  0% { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}
.skeleton {
  background: #e2e8f0;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200px 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  min-height: 1em;
}
.skeleton-text { height: 14px; margin-bottom: 8px; width: 100%; }
.skeleton-text-sm { height: 10px; width: 60%; }
.skeleton-title { height: 20px; width: 40%; margin-bottom: 12px; }
.skeleton-avatar { width: 36px; height: 36px; min-width: 36px; min-height: 36px; }
.skeleton-btn { height: 38px; width: 120px; }
.skeleton-thumb { width: 80px; height: 80px; }

/* Table Loading */
.table-loading {
  position: relative; min-height: 200px;
}
.table-loading .table-loading-overlay {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
}
.table-loading .table-loading-spinner {
  width: 28px; height: 28px;
  border: 3px solid #e2e8f0; border-top-color: var(--trivix-purple, #5b35d5);
  animation: spin 0.6s linear infinite;
}

/* Inline loading spinner */
.loading-inline {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--trivix-text-muted);
}
.loading-inline::before {
  content: ''; width: 14px; height: 14px;
  border: 2px solid #e2e8f0; border-top-color: var(--trivix-purple, #5b35d5);
  animation: spin 0.6s linear infinite;
}

/* PERMISSIONS GRID */
.permissions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 6px;
}
.perm-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 5px 10px;
  background: #fafbfc;
  border: 1px solid #f1f5f9;
  min-height: 34px;
  transition: background 0.15s;
}
.perm-item:hover {
  background: #f1f5f9;
}
.perm-item .form-check-input {
  margin-top: 0;
  flex-shrink: 0;
}
.perm-item .form-check-label {
  font-size: 13px;
  line-height: 1.3;
  cursor: pointer;
  word-break: break-word;
  user-select: none;
}
.module-card .card-header .form-check {
  min-height: 0;
}
.module-card .card-header .form-check-input {
  margin-top: 0;
}

/* LOGIN CUSTOM LOGO */
.login-logo {
  max-height: 60px;
  max-width: 80%;
  object-fit: contain;
  margin-bottom: 8px;
}
