:root {
  --primary: #1279A6;
  --primary-dark: #0C5A7E;
  --primary-light: #E6F3F9;
  --primary-glow: rgba(18, 121, 166, 0.15);
  --accent: #1DC9A4;
  --accent-dark: #15A385;
  --amber: #F59E0B;
  --amber-light: #FEF3C7;
  --danger: #EF4444;
  --danger-light: #FEE2E2;
  --purple: #7C6FD4;
  --purple-light: #EDE9FE;
  --orange: #F97316;
  --orange-light: #FFEDD5;
  --pink: #EC4899;
  --green: #22C55E;
  --sidebar-w: 240px;
  --topbar-h: 60px;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  --sb-bg: #091827;
  --sb-bg2: #0D2235;
  --sb-border: rgba(255, 255, 255, 0.06);
  --sb-text: #7EA3BC;
  --sb-text-active: #FFFFFF;
  --sb-icon: #4D7A96;
  --sb-active-bg: rgba(18, 121, 166, 0.2);
  --sb-hover-bg: rgba(255, 255, 255, 0.05);
  --bg: #F0F4F8;
  --surface: #FFFFFF;
  --surface-2: #F8FAFC;
  --surface-3: #F1F5F9;
  --text-1: #0F2336;
  --text-2: #475569;
  --text-3: #94A3B8;
  --border: #E2E8F0;
  --border-2: #CBD5E1;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.07), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.10), 0 2px 6px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.08);
  --font-ui: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'DM Mono', 'Fira Code', monospace;
}

[data-theme="dark"] {
  --bg: #0B1929;
  --surface: #112036;
  --surface-2: #162A44;
  --surface-3: #1A3254;
  --text-1: #E8F2FC;
  --text-2: #7EA3BC;
  --text-3: #4D7A96;
  --border: rgba(255, 255, 255, 0.08);
  --border-2: rgba(255, 255, 255, 0.14);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.25);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.4);
  --primary-light: rgba(18, 121, 166, 0.18);
  --amber-light: rgba(245, 158, 11, 0.15);
  --danger-light: rgba(239, 68, 68, 0.15);
  --purple-light: rgba(124, 111, 212, 0.15);
  --orange-light: rgba(249, 115, 22, 0.15);
}

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

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-1);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input,
select,
textarea {
  font-family: inherit;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
}

#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

#sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sb-bg);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  z-index: 100;
  transition: width 0.25s ease, min-width 0.25s ease;
  border-right: 1px solid var(--sb-border);
  overflow: hidden;
}

#sidebar.collapsed {
  width: 68px;
  min-width: 68px;
}

#sidebar.collapsed .logo-text,
#sidebar.collapsed .sidebar-search,
#sidebar.collapsed .nav-section-label,
#sidebar.collapsed .user-details {
  display: none;
}

#sidebar.collapsed .nav-item>span:not(.nav-badge) {
  display: none;
}

#sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 0;
  width: 44px;
  height: 44px;
  margin: 2px auto;
  border-radius: 10px;
  position: relative;
}

#sidebar.collapsed .nav-item i {
  margin: 0;
  font-size: 16px;
}

#sidebar.collapsed .nav-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 16px;
  height: 16px;
  min-width: unset;
  font-size: 0.6rem;
  padding: 0;
  display: flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  line-height: 1;
}

#sidebar.collapsed .sidebar-header {
  padding: 16px 0;
  justify-content: center;
}

#sidebar.collapsed .logo {
  justify-content: center;
}

#sidebar.collapsed #sidebar-collapse {
  display: flex !important;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 14.5cm;
  right: 20px;
  width: 30px;
  height: 30px;
  background: var(--sb-hover-bg);
  border-radius: 6px;
}

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

#sidebar.collapsed .user-info {
  justify-content: center;
}

#sidebar.collapsed .user-avatar {
  margin: 0 auto;
}

#sidebar.collapsed #dark-mode-toggle {
  display: none;
}

#sidebar.collapsed .nav-item::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--sb-bg2);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 200;
  box-shadow: var(--shadow);
  border: 1px solid var(--sb-border);
}

#sidebar.collapsed .nav-item:hover::after {
  opacity: 1;
}

.sidebar-header {
  padding: 20px 16px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--sb-border);
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(29, 201, 164, 0.35);
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-name {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}

.logo-sub {
  font-size: 0.65rem;
  color: var(--sb-text);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

#sidebar-collapse {
  color: var(--sb-text);
  font-size: 11px;
  padding: 6px;
  border-radius: 6px;
  transition: all 0.2s;
}

#sidebar-collapse:hover {
  color: white;
  background: var(--sb-hover-bg);
}

.sidebar-search {
  padding: 12px 12px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  margin: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--sb-border);
}

.sidebar-search i {
  color: var(--sb-icon);
  font-size: 12px;
  flex-shrink: 0;
}

.sidebar-search input {
  background: none;
  border: none;
  color: var(--sb-text-active);
  font-size: 0.8rem;
  width: 100%;
  outline: none;
}

.sidebar-search input::placeholder {
  color: var(--sb-icon);
}

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

.sidebar-nav::-webkit-scrollbar {
  width: 3px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.nav-section-label {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--sb-icon);
  padding: 14px 16px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  height: 40px;
  margin: 1px 8px;
  border-radius: var(--radius-sm);
  color: var(--sb-text);
  font-size: 0.85rem;
  font-weight: 500;
  font-family: var(--font-ui);
  transition: all 0.18s ease;
  position: relative;
  cursor: pointer;
}

.nav-item:hover {
  background: var(--sb-hover-bg);
  color: #c8dce9;
}

.nav-item.active {
  background: var(--sb-active-bg);
  color: var(--sb-text-active);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 25%;
  bottom: 25%;
  width: 3px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

.nav-item i {
  width: 18px;
  text-align: center;
  font-size: 14px;
  flex-shrink: 0;
  transition: color 0.18s;
}

.nav-item.active i {
  color: var(--primary);
}

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
}

.nav-badge.warning {
  background: var(--amber);
}

.nav-badge.info {
  background: var(--primary);
}

.sidebar-footer {
  padding: 12px 12px 16px;
  border-top: 1px solid var(--sb-border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.user-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.68rem;
  color: var(--sb-text);
}

#dark-mode-toggle {
  color: var(--sb-text);
  padding: 6px;
  border-radius: 6px;
  transition: all 0.2s;
  font-size: 13px;
}

#dark-mode-toggle:hover {
  color: white;
  background: var(--sb-hover-bg);
}

#content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

#topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  gap: 16px;
  flex-shrink: 0;
  z-index: 50;
}

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

#sidebar-toggle-mobile {
  display: none;
  color: var(--text-2);
  font-size: 18px;
  padding: 6px;
}

.breadcrumb {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-1);
}

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

.topbar-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: all 0.18s;
  position: relative;
}

.topbar-btn:hover {
  background: var(--surface-3);
  color: var(--text-1);
}

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

#topbar-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  height: 36px;
}

#topbar-search-box i {
  color: var(--text-3);
  font-size: 13px;
}

#topbar-search-box input {
  border: none;
  background: none;
  font-size: 0.85rem;
  color: var(--text-1);
  width: 200px;
  outline: none;
}

.topbar-date {
  font-size: 0.8rem;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-date i {
  color: var(--primary);
}

#main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
  background: var(--bg);
}

#main-content::-webkit-scrollbar {
  width: 6px;
}

#main-content::-webkit-scrollbar-track {
  background: transparent;
}

#main-content::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: 3px;
}

.module-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.module-title h1 {
  font-family: var(--font-ui);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.4px;
}

.module-title p {
  font-size: 0.83rem;
  color: var(--text-2);
  margin-top: 2px;
}

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

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.page-title {
  font-family: var(--font-ui);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.2;
  letter-spacing: -0.3px;
}

.page-title i {
  color: var(--primary);
  font-size: 1.25rem;
}

.page-sub {
  font-size: 0.82rem;
  color: var(--text-3);
  margin-top: 3px;
}

.page-header>div:last-child:not(:first-child) {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.module-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.filter-bar .form-control {
  height: 34px;
  font-size: 0.82rem;
}

.filter-bar .search-input {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  height: 34px;
}

.filter-bar .search-input i {
  color: var(--text-3);
  font-size: 12px;
}

.filter-bar .search-input input {
  border: none;
  background: none;
  font-size: 0.82rem;
  color: var(--text-1);
  outline: none;
  width: 180px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  box-shadow: var(--shadow-xs);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.card-title {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-1);
}

.card-subtitle {
  font-size: 0.78rem;
  color: var(--text-2);
  margin-top: 2px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.2s, transform 0.2s;
}

.kpi-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.kpi-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 6px;
}

.kpi-label i {
  font-size: 12px;
}

.kpi-value {
  font-family: var(--font-ui);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.5px;
  line-height: 1;
}

.kpi-sub {
  font-size: 0.75rem;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 4px;
}

.kpi-sub .up {
  color: var(--green);
}

.kpi-sub .down {
  color: var(--danger);
}

.kpi-card.primary {
  border-left: 3px solid var(--primary);
}

.kpi-card.accent {
  border-left: 3px solid var(--accent);
}

.kpi-card.amber {
  border-left: 3px solid var(--amber);
}

.kpi-card.danger {
  border-left: 3px solid var(--danger);
}

.kpi-card.purple {
  border-left: 3px solid var(--purple);
}

.kpi-card.orange {
  border-left: 3px solid var(--orange);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 16px;
  height: 36px;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  border: 1px solid transparent;
  text-decoration: none;
}

.btn i {
  font-size: 12px;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.btn-accent {
  background: var(--accent);
  color: white;
}

.btn-accent:hover {
  background: var(--accent-dark);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary-light);
}

.btn-ghost {
  background: var(--surface-3);
  color: var(--text-2);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--border);
  color: var(--text-1);
}

.btn-sm {
  height: 30px;
  padding: 0 12px;
  font-size: 0.78rem;
}

.btn-lg {
  height: 44px;
  padding: 0 24px;
  font-size: 0.95rem;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.btn-icon.sm {
  width: 28px;
  height: 28px;
  font-size: 12px;
}

.table-wrap {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.table-toolbar .search-input {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  height: 34px;
}

.table-toolbar .search-input i {
  color: var(--text-3);
  font-size: 12px;
}

.table-toolbar .search-input input {
  border: none;
  background: none;
  font-size: 0.83rem;
  color: var(--text-1);
  width: 180px;
  outline: none;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.data-table thead th {
  background: var(--surface-2);
  padding: 10px 14px;
  text-align: left;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
}

.data-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-1);
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover td {
  background: var(--surface-2);
}

.data-table .col-actions {
  text-align: right;
  white-space: nowrap;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}

.form-label .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-control {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-1);
  font-size: 0.875rem;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-control:invalid:not(:placeholder-shown) {
  border-color: var(--danger);
}

.form-control.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

textarea.form-control {
  height: auto;
  padding: 10px 12px;
  resize: vertical;
  min-height: 80px;
}

select.form-control {
  cursor: pointer;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  font-family: var(--font-ui);
  white-space: nowrap;
}

.badge-success {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}

.badge-danger {
  background: var(--danger-light);
  color: #b91c1c;
}

.badge-warning {
  background: var(--amber-light);
  color: #d97706;
}

.badge-info {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.badge-primary {
  background: rgba(18, 121, 166, 0.15);
  color: var(--primary);
}

.badge-default {
  background: var(--surface-3);
  color: var(--text-2);
  border: 1px solid var(--border);
}

.badge-purple {
  background: var(--purple-light);
  color: #5b21b6;
}

.badge-orange {
  background: var(--orange-light);
  color: #c2410c;
}

.badge-pink {
  background: rgba(236, 72, 153, 0.12);
  color: #be185d;
}

.badge-green {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

[data-theme="dark"] .badge-success {
  background: rgba(34, 197, 94, 0.18);
  color: #4ade80;
}

[data-theme="dark"] .badge-danger {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
}

[data-theme="dark"] .badge-warning {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
}

[data-theme="dark"] .badge-info {
  background: rgba(18, 121, 166, 0.25);
  color: #38bdf8;
}

[data-theme="dark"] .badge-default {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-2);
}

#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s;
  padding: 16px;
}

#modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

#modal-overlay.active #modal-dialog {
  transform: scale(1);
}

#modal-dialog {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: min(640px, 100%);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  transform: scale(0.94);
  transition: transform 0.22s;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-1);
}

.modal-header button {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.18s;
}

.modal-header button:hover {
  background: var(--surface-3);
  color: var(--text-1);
}

.modal-body {
  padding: 22px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-1);
  max-width: 360px;
  pointer-events: all;
  transform: translateX(100%);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast i:first-child {
  font-size: 14px;
  flex-shrink: 0;
}

.toast span {
  flex: 1;
  line-height: 1.4;
}

.toast button {
  color: var(--text-3);
  font-size: 11px;
  padding: 2px;
  flex-shrink: 0;
  margin-left: 4px;
}

.toast button:hover {
  color: var(--text-1);
}

.toast-success i:first-child {
  color: var(--green);
}

.toast-error i:first-child {
  color: var(--danger);
}

.toast-warning i:first-child {
  color: var(--amber);
}

.toast-info i:first-child {
  color: var(--primary);
}

.search-results-panel {
  position: fixed;
  top: 56px;
  right: 16px;
  width: 300px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 500;
  overflow: hidden;
}

.sr-group {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 8px 14px 4px;
  letter-spacing: 0.5px;
}

.sr-item {
  padding: 10px 14px;
  font-size: 0.84rem;
  color: var(--text-1);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s;
}

.sr-item:hover {
  background: var(--surface-2);
}

.sr-item i {
  color: var(--primary);
  font-size: 12px;
  width: 16px;
}

.sr-item small {
  color: var(--text-3);
  font-size: 0.75rem;
  margin-left: auto;
}

.sr-empty {
  padding: 16px 14px;
  font-size: 0.84rem;
  color: var(--text-3);
  text-align: center;
}

.tabs {
  display: flex;
  gap: 2px;
  background: var(--surface-3);
  padding: 4px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  width: fit-content;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 7px 16px;
  font-family: var(--font-ui);
  font-size: 0.81rem;
  font-weight: 600;
  color: var(--text-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}

.tab-btn.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-xs);
}

.tab-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.5);
  color: var(--text-1);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cal-header h3 {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-1);
}

.cal-nav {
  display: flex;
  gap: 4px;
}

.cal-nav button {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s;
  border: 1px solid var(--border);
}

.cal-nav button:hover {
  background: var(--surface-3);
  color: var(--text-1);
}

.cal-grid-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cal-day {
  min-height: 70px;
  padding: 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
  border: 1px solid transparent;
}

.cal-day:hover {
  background: var(--surface-2);
}

.cal-day.other-month .cal-day-num {
  color: var(--text-3);
}

.cal-day.today {
  border-color: var(--primary);
  background: var(--primary-light);
}

.cal-day.today .cal-day-num {
  color: var(--primary);
  font-weight: 700;
}

.cal-day.selected {
  background: var(--primary-light);
  border-color: var(--primary);
}

.cal-day-num {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 3px;
}

.cal-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.cal-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.kanban-col {
  background: var(--surface-2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

.kanban-col-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kanban-col-header h4 {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-1);
}

.kanban-col-header .count {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: var(--radius-full);
}

.kanban-col-body {
  padding: 8px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kanban-col-body.drag-over {
  background: var(--primary-light);
}

.kanban-card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 12px;
  cursor: grab;
  transition: all 0.18s;
  box-shadow: var(--shadow-xs);
}

.kanban-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.kanban-card.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.kanban-card h5 {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 6px;
}

.kanban-card-meta {
  font-size: 0.75rem;
  color: var(--text-3);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kanban-card-nps {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--text-3);
  min-height: 300px;
}

.loading-state i {
  font-size: 2.5rem;
  color: var(--primary);
  opacity: 0.5;
}

.loading-state p {
  font-size: 0.9rem;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-3);
  padding: 48px 24px;
  text-align: center;
}

.empty-state i {
  font-size: 3rem;
  opacity: 0.3;
}

.empty-state h3 {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-2);
}

.empty-state p {
  font-size: 0.85rem;
  max-width: 280px;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  margin-top: 16px;
}

.pagination button {
  min-width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-2);
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s;
}

.pagination button:hover:not(:disabled) {
  background: var(--surface-3);
  color: var(--text-1);
}

.pagination button.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination span {
  color: var(--text-3);
  font-size: 0.85rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.grid-4 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 16px;
}

.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.col-span-2 {
  grid-column: span 2;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-muted {
  color: var(--text-3);
  font-size: 0.82rem;
}

.text-small {
  font-size: 0.78rem;
}

.text-mono {
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.font-bold {
  font-weight: 700;
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gap-8 {
  gap: 8px;
}

.gap-12 {
  gap: 12px;
}

.mt-16 {
  margin-top: 16px;
}

.mb-16 {
  margin-bottom: 16px;
}

.p-0 {
  padding: 0 !important;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.chart-container {
  position: relative;
  height: 220px;
}

.chart-container-lg {
  position: relative;
  height: 280px;
}

.chart-container-sm {
  position: relative;
  height: 160px;
}

.specialty-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
}

.time-slot {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.time-slot-time {
  width: 50px;
  font-size: 0.78rem;
  color: var(--text-3);
  font-family: var(--font-mono);
  padding-top: 3px;
  flex-shrink: 0;
}

.appointment-block {
  flex: 1;
  background: var(--primary-light);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.18s;
}

.appointment-block:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.appointment-block .apt-name {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-1);
}

.appointment-block .apt-meta {
  font-size: 0.75rem;
  color: var(--text-2);
  margin-top: 2px;
}

.nps-score {
  font-size: 2.5rem;
  font-weight: 800;
  font-family: var(--font-ui);
  letter-spacing: -1px;
  line-height: 1;
}

.nps-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  overflow: hidden;
  margin-top: 8px;
}

.nps-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--danger), var(--amber), var(--accent));
  transition: width 0.6s ease;
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  margin-bottom: 12px;
}

.alert i {
  font-size: 14px;
  margin-top: 1px;
  flex-shrink: 0;
}

.alert-warning {
  background: var(--amber-light);
  color: #92400e;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-danger {
  background: var(--danger-light);
  color: #991b1b;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-info {
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid rgba(18, 121, 166, 0.15);
}

.alert-success {
  background: rgba(34, 197, 94, 0.1);
  color: #166534;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.stock-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}

.stock-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s;
}

.stock-ok {
  background: var(--green);
}

.stock-low {
  background: var(--amber);
}

.stock-critical {
  background: var(--danger);
}

.timeline {
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 20px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 2px var(--border);
}

.timeline-date {
  font-size: 0.72rem;
  color: var(--text-3);
  margin-bottom: 4px;
  font-family: var(--font-mono);
}

.timeline-content {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.portal-login {
  max-width: 400px;
  margin: 60px auto;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: 36px 32px;
  text-align: center;
}

.portal-logo {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 12px;
}

.portal-login h2 {
  font-family: var(--font-ui);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.portal-login p {
  font-size: 0.84rem;
  color: var(--text-2);
  margin-bottom: 24px;
}

.equip-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: all 0.18s;
  box-shadow: var(--shadow-xs);
}

.equip-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.equip-card.alert {
  border-left: 3px solid var(--danger);
}

.equip-card.warning {
  border-left: 3px solid var(--amber);
}

.equip-card.ok {
  border-left: 3px solid var(--green);
}

.equip-icon {
  width: 44px;
  height: 44px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--primary);
  margin-bottom: 12px;
}

@media (max-width: 900px) {
  #sidebar {
    position: fixed;
    left: -100%;
    z-index: 200;
    transition: left 0.3s;
  }

  #sidebar.mobile-open {
    left: 0;
  }

  #sidebar-toggle-mobile {
    display: flex;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .grid-3 {
    grid-template-columns: 1fr 1fr;
  }

  .grid-4 {
    grid-template-columns: 1fr 1fr;
  }

  .kanban-board {
    grid-template-columns: 1fr 1fr;
  }

  .form-row,
  .form-row-3 {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  #main-content {
    padding: 16px;
  }

  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .kanban-board {
    grid-template-columns: 1fr;
  }

  .module-header {
    flex-direction: column;
  }
}

.eq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.eq-card {
  transition: transform 0.15s, box-shadow 0.15s;
}

.eq-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.eq-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}

.eq-meta-label {
  font-size: 0.72rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.eq-meta-label i {
  margin-right: 4px;
  font-size: 10px;
}

.eq-meta-val {
  font-size: 0.83rem;
  color: var(--text-1);
  font-weight: 500;
}

#main-content {
  position: relative;
}

#main-content::after {
  content: '';
  position: fixed;
  right: -30px;
  bottom: -30px;
  width: 320px;
  height: 320px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%231279A6' d='M12 21.593c-5.63-5.539-11-10.297-11-14.402 0-3.791 3.068-5.191 5.281-5.191 1.312 0 4.151.501 5.719 4.457 1.59-3.968 4.464-4.447 5.726-4.447 2.54 0 5.274 1.621 5.274 5.181 0 4.069-5.136 8.625-11 14.402z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.025;
  pointer-events: none;
  z-index: 0;
}

[data-theme="dark"] #main-content::after {
  opacity: 0.04;
}

.portal-login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--topbar-h) - 48px);
}

.portal-login-box {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: 40px 36px;
  text-align: center;
}

.portal-logo-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 2rem;
  color: #fff;
  box-shadow: 0 8px 24px rgba(18, 121, 166, 0.3);
}

.portal-login-box h2 {
  font-family: var(--font-ui);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 4px;
}

.portal-login-box>p {
  font-size: 0.85rem;
  color: var(--text-3);
  margin-bottom: 28px;
}

.notif-panel {
  position: fixed;
  width: 340px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  overflow: hidden;
  display: none;
  animation: fadeIn 0.18s ease both;
}

.notif-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-1);
  background: var(--surface-2);
}

.notif-panel-header i {
  color: var(--primary);
  margin-right: 6px;
}

.notif-count {
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

.notif-panel-body {
  max-height: 360px;
  overflow-y: auto;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.notif-item:hover {
  background: var(--surface-2);
}

.notif-item:last-child {
  border-bottom: none;
}

.notif-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 1px;
}

.notif-item-text {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-1);
  line-height: 1.4;
}

.notif-item-sub {
  font-size: 0.75rem;
  color: var(--text-3);
  margin-top: 2px;
}

.notif-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-3);
}

.notif-empty i {
  font-size: 2rem;
  color: var(--accent);
  display: block;
  margin-bottom: 8px;
}

.notif-empty p {
  font-size: 0.85rem;
}

.data-table th {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.card-body {
  padding: 16px;
}

.card-body.p-0 {
  padding: 0 !important;
}

.card {
  position: relative;
  z-index: 1;
}

.btn-group {
  display: flex;
}

.btn-group .btn {
  border-radius: 0;
  border-right-width: 0;
}

.btn-group .btn:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.btn-group .btn:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  border-right-width: 1px;
}

.btn-xs {
  padding: 3px 8px;
  font-size: 0.74rem;
  border-radius: 5px;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar-lg {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cal-month {
  padding: 12px;
}

.cal-month-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  margin-bottom: 6px;
}

.cal-wday {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 6px 0;
}

.cal-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.cal-day {
  min-height: 72px;
  padding: 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
  border: 1px solid transparent;
  position: relative;
}

.cal-day:hover {
  background: var(--surface-2);
}

.cal-day-empty {
  background: none;
  cursor: default;
}

.cal-today {
  border-color: var(--primary) !important;
  background: var(--primary-light);
}

.cal-today .cal-day-num {
  color: var(--primary);
  font-weight: 700;
}

.cal-day-num {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-1);
  display: block;
  margin-bottom: 4px;
}

.cal-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-bottom: 2px;
}

.cal-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.dot-concluido {
  background: var(--accent);
}

.dot-confirmado {
  background: var(--primary);
}

.dot-agendado {
  background: var(--amber);
}

.dot-cancelado {
  background: var(--danger);
}

.cal-count {
  position: absolute;
  top: 5px;
  right: 5px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  border-radius: var(--radius-full);
  padding: 1px 5px;
  line-height: 1.4;
}

.cal-week-wrap {
  overflow-x: auto;
}

.cal-week-header {
  display: grid;
  grid-template-columns: 52px repeat(6, 1fr);
  border-bottom: 2px solid var(--border);
  background: var(--surface-2);
  position: sticky;
  top: 0;
  z-index: 2;
}

.cal-week-day {
  padding: 8px 6px;
  text-align: center;
  font-size: 0.77rem;
  font-weight: 600;
  color: var(--text-2);
  border-left: 1px solid var(--border);
}

.cal-today-col {
  color: var(--primary);
  background: var(--primary-light);
}

.cal-time-col {
  width: 52px;
  min-width: 52px;
  font-size: 0.7rem;
  color: var(--text-3);
  text-align: right;
  padding-right: 8px;
  line-height: 1;
  padding-top: 4px;
}

.cal-week-body {
  overflow-y: auto;
  max-height: 480px;
}

.cal-week-row {
  display: grid;
  grid-template-columns: 52px repeat(6, 1fr);
  border-bottom: 1px solid var(--border);
  min-height: 44px;
}

.cal-week-cell {
  border-left: 1px solid var(--border);
  padding: 2px;
  min-height: 44px;
  cursor: pointer;
  transition: background 0.12s;
}

.cal-week-cell:hover {
  background: var(--surface-2);
}

.cal-event {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 500;
  margin-bottom: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.ev-agendado {
  background: #FEF3C7;
  color: #92400E;
  border-left: 3px solid var(--amber);
}

.ev-confirmado {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-left: 3px solid var(--primary);
}

.ev-concluido {
  background: rgba(29, 201, 164, 0.15);
  color: var(--accent-dark);
  border-left: 3px solid var(--accent);
}

.ev-cancelado {
  background: var(--danger-light);
  color: #991B1B;
  border-left: 3px solid var(--danger);
  border-left-style: dashed;
}

.ev-em_andamento {
  background: var(--primary-light);
  color: var(--primary);
  border-left: 3px solid var(--primary);
}

.cal-day-view {
  padding: 8px 0;
}

.cal-day-row {
  display: grid;
  grid-template-columns: 52px 1fr;
  border-bottom: 1px solid var(--border);
  min-height: 52px;
}

.cal-day-cell {
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cal-event-full {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border-left: 4px solid;
  background: var(--surface-2);
  width: 100%;
}

.ev-agendado.cal-event-full {
  border-color: var(--amber);
}

.ev-confirmado.cal-event-full {
  border-color: var(--primary);
}

.ev-concluido.cal-event-full {
  border-color: var(--accent);
}

.ev-cancelado.cal-event-full {
  border-color: var(--danger);
  opacity: 0.7;
}

.cev-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-1);
}

.cev-meta {
  font-size: 0.76rem;
  color: var(--text-3);
  margin-top: 2px;
}

.cev-actions {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

.pending-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}

.pending-item:last-child {
  border-bottom: none;
}

.pending-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-1);
}

.pending-meta {
  font-size: 0.75rem;
  color: var(--text-3);
  margin-top: 1px;
}

.fav-patient {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  cursor: grab;
  transition: background 0.15s;
}

.fav-patient:last-child {
  border-bottom: none;
}

.fav-patient:hover {
  background: var(--surface-2);
}

.fav-name {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-1);
}

.fav-meta {
  font-size: 0.74rem;
  color: var(--text-3);
}

.fin-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

.fin-item:last-child {
  border-bottom: none;
}

.fin-icon-in {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(29, 201, 164, 0.15);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.fin-icon-out {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--danger-light);
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.fin-valor-pos {
  font-weight: 700;
  color: var(--accent);
}

.fin-valor-neg {
  font-weight: 700;
  color: var(--danger);
}

.dre-receita {
  color: var(--accent);
  font-weight: 600;
}

.dre-desp {
  color: var(--danger);
}

.dre-resultado {
  font-weight: 700;
  border-top: 2px solid var(--border);
}

.bi-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.bi-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-item {
  display: flex;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.timeline-item:last-child {
  border-bottom: none;
}

.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--surface);
  flex-shrink: 0;
  margin-top: 4px;
  box-shadow: 0 0 0 3px var(--primary-light);
}

.timeline-card {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow-xs);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.timeline-field {
  margin-bottom: 6px;
  font-size: 0.84rem;
  line-height: 1.5;
}

.timeline-field strong {
  color: var(--primary);
  font-weight: 600;
  margin-right: 6px;
}

.receita-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
}

.receita-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.pep-receita,
.pep-atestado {
  font-size: 0.82rem;
  line-height: 1.6;
  white-space: pre-wrap;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 6px;
}

.patient-list-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}

.patient-list-item:hover {
  background: var(--surface-2);
}

.patient-list-item.active {
  background: var(--primary-light);
  border-left: 3px solid var(--primary);
}

.patient-list-item:last-child {
  border-bottom: none;
}

.kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 6px;
  cursor: grab;
  transition: box-shadow 0.15s;
  box-shadow: var(--shadow-xs);
}

.kanban-card:hover {
  box-shadow: var(--shadow);
}

.kanban-items {
  padding: 8px;
  min-height: 60px;
}

.kanban-count {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.kcard-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-1);
  margin-bottom: 2px;
}

.kcard-meta {
  font-size: 0.75rem;
  color: var(--text-3);
}

.kcard-date {
  font-size: 0.74rem;
  color: var(--text-3);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.kcard-nps {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 4px;
}

.kcard-actions {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.stock-bar-wrap {
  width: 80px;
  height: 8px;
  background: var(--surface-3);
  border-radius: var(--radius-full);
  overflow: hidden;
  flex-shrink: 0;
}

.stock-bar {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.3s;
}

.alert-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 8px;
}

.alert-danger {
  border-left: 4px solid var(--danger);
}

.alert-warning {
  border-left: 4px solid var(--amber);
}

.rh-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.rh-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-xs);
  transition: transform 0.15s, box-shadow 0.15s;
}

.rh-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.rh-card-top {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.rh-card-info {
  flex: 1;
}

.rh-card-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-1);
  margin-bottom: 2px;
}

.rh-card-role {
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 500;
}

.rh-card-esp {
  font-size: 0.75rem;
  color: var(--text-3);
}

.rh-card-reg {
  font-size: 0.74rem;
  color: var(--text-3);
  margin-top: 2px;
}

.rh-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.rh-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.nps-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.portal-nps-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 2px solid var(--border);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-2);
  background: var(--surface);
}

.portal-nps-btn:hover,
.portal-nps-btn.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.portal-nps-btn[data-score="9"],
.portal-nps-btn[data-score="10"] {
  color: var(--accent);
}

.portal-nps-btn[data-score="9"]:hover,
.portal-nps-btn[data-score="9"].selected,
.portal-nps-btn[data-score="10"]:hover,
.portal-nps-btn[data-score="10"].selected {
  border-color: var(--accent);
  background: rgba(29, 201, 164, 0.1);
  color: var(--accent);
}

.kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.kpi-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  margin-top: 4px;
}

.trend-up {
  color: var(--accent);
}

.trend-down {
  color: var(--danger);
}

.trend-neutral {
  color: var(--text-3);
}

.nav-item.active {
  position: relative;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.camp-card {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.18s, transform 0.18s;
}

.camp-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.camp-card-accent {
  width: 5px;
  flex-shrink: 0;
}

.camp-card-body {
  flex: 1;
  padding: 16px 18px;
  min-width: 0;
}

.camp-card-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}

.camp-card-channel {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(37, 211, 102, 0.12);
  color: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.camp-card-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-1);
  margin-bottom: 4px;
}

.camp-card-msg {
  font-size: 0.8rem;
  color: var(--text-3);
  line-height: 1.5;
  font-style: italic;
}

.camp-card-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 8px 12px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  color: var(--text-2);
}

.camp-card-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.camp-card-meta i {
  color: var(--text-3);
  font-size: 11px;
}

.camp-card-footer {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.camp-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.inativo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}

.inativo-row:last-child {
  border-bottom: none;
}

.inativo-row:hover {
  background: var(--surface-2);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.animate-in {
  animation: fadeIn 0.3s ease both;
}

.fa-spin {
  animation: spin 1s linear infinite;
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}