@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,500;0,600;1,400&family=DM+Mono:wght@400;500&display=swap');

:root {
  color-scheme: light dark;
  --bg: #F4F2EE;
  --surface: #FFFFFF;
  --surface2: #EEECEA;
  --surface3: #E6E3DF;
  --border: #E0DDD8;
  --border2: #CCCAC4;
  --text: #1A1916;
  --text2: #6B6860;
  --text3: #A8A59E;
  --teal: #1D9E75;
  --teal-bg: #E1F5EE;
  --teal-dark: #085041;
  --amber: #BA7517;
  --amber-bg: #FAEEDA;
  --red: #A32D2D;
  --red-bg: #FCEBEB;
  --blue: #185FA5;
  --blue-bg: #E6F1FB;
  --r: 8px;
  --r-lg: 12px;
  --sidebar-w: 212px;
  --sidebar-w-collapsed: 52px;
  --topbar-h: 50px;
  --mobile-nav-h: 56px;
  --transition: .18s ease;
  --card-bg: #FFFFFF;
  --text-muted: #6B6860;
}

[data-theme="dark"] {
  --bg: #0F1117;
  --surface: #181B23;
  --surface2: #1E2130;
  --surface3: #252A3A;
  --border: #2A2F42;
  --border2: #353B52;
  --text: #E8EAED;
  --text2: #9AA0B4;
  --text3: #5C6480;
  --teal: #20B07F;
  --teal-bg: rgba(32, 176, 127, .12);
  --teal-dark: #57D9A3;
  --amber: #D4880A;
  --amber-bg: rgba(212, 136, 10, .12);
  --red: #C0392B;
  --red-bg: rgba(192, 57, 43, .12);
  --blue: #2E86C1;
  --blue-bg: rgba(46, 134, 193, .12);
  --card-bg: #181B23;
  --text-muted: #9AA0B4;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0
}

html,
body {
  height: 100%;
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden
}

body.modal-open {
  overflow: hidden
}

button,
input,
select,
textarea {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px
}

.hidden {
  display: none !important
}

a {
  text-decoration: none;
  color: inherit
}

::-webkit-scrollbar {
  width: 5px;
  height: 5px
}

::-webkit-scrollbar-track {
  background: transparent
}

::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 10px
}

/* â”€â”€ LOGIN â”€â”€ */
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px
}

.login-card {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, .07)
}

.login-hero {
  padding: 40px;
  background: var(--text);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px
}

.login-hero h1 {
  font-size: 30px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.5px;
  color: #fff;
  margin: 20px 0 10px
}

.login-hero p {
  font-size: 12.5px;
  line-height: 1.7;
  color: rgba(255, 255, 255, .5)
}

.lbrand {
  display: flex;
  align-items: center;
  gap: 8px
}

.lbrand-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--teal);
  display: flex;
  align-items: center;
  justify-content: center
}

.lbrand-icon svg {
  width: 14px;
  height: 14px;
  color: #fff
}

.lbrand-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.3px;
  color: #fff
}

.lbrand-name span {
  color: var(--teal)
}

.hero-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: auto
}

.hero-stat {
  padding: 14px;
  border-radius: var(--r);
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .04)
}

.hero-stat .k {
  font-size: 11px;
  color: rgba(255, 255, 255, .4);
  margin-bottom: 4px
}

.hero-stat .v {
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -.3px
}

.login-form-wrap {
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  background: var(--surface)
}

.form-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 3px
}

.form-sub {
  font-size: 12px;
  color: var(--text3);
  margin-bottom: 22px
}

.field-grid {
  display: grid;
  gap: 11px
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px
}

.field label {
  font-size: 11.5px;
  color: var(--text2);
  font-weight: 500
}

.login-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap
}

.login-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px
}

.login-chip {
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--text3);
  background: var(--surface2)
}

.login-error {
  font-size: 12px;
  color: var(--red);
  background: var(--red-bg);
  border: 1px solid #f5c4c4;
  border-radius: var(--r);
  padding: 8px 10px;
  margin-bottom: 10px
}

.forgot-link {
  font-size: 11.5px;
  color: var(--text3);
  display: block;
  margin-top: 10px;
  text-align: center;
  transition: color var(--transition)
}

.forgot-link:hover {
  color: var(--text2)
}

.pw-wrap {
  position: relative
}

.pw-wrap input {
  padding-right: 36px
}

.pw-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text3);
  padding: 0;
  display: flex;
  align-items: center
}

.pw-toggle svg {
  width: 15px;
  height: 15px
}

/* â”€â”€ INPUTS / SELECTS â”€â”€ */
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 8px 10px;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-bg)
}

select {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23A8A59E' stroke-width='2'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 13px;
  padding-right: 30px;
  cursor: pointer
}

/* â”€â”€ APP SHELL â”€â”€ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  overflow-x: hidden;
  transition: grid-template-columns .22s ease
}

.app.sb-collapsed {
  grid-template-columns: var(--sidebar-w-collapsed) 1fr
}

/* â”€â”€ SIDEBAR â”€â”€ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
  transition: width .22s ease;
  z-index: 30;
  overflow: hidden
}

.sidebar.collapsed {
  width: var(--sidebar-w-collapsed)
}

.sidebar .sb-overflow {
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column
}

.sb-brand {
  padding: 13px 14px 11px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  min-height: 50px
}

.sb-brand-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  min-width: 0
}

.sb-icon {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  background: var(--teal);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0
}

.sb-icon svg {
  width: 12px;
  height: 12px;
  color: #fff
}

.sb-brand-text {
  overflow: hidden;
  transition: opacity .15s ease, width .22s ease;
  white-space: nowrap
}

.logo-mark {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.3px
}

.logo-mark span {
  color: var(--teal)
}

.logo-sub {
  font-size: 10px;
  color: var(--text3);
  font-family: 'DM Mono', monospace;
  margin-top: 1px
}

.sb-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  color: var(--text3);
  border-radius: var(--r);
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center
}

.sb-toggle:hover {
  background: var(--surface2);
  color: var(--text)
}

.sb-toggle svg {
  width: 14px;
  height: 14px;
  display: block;
  transition: transform .22s ease
}

.sidebar.collapsed .sb-toggle svg {
  transform: rotate(180deg)
}

.sidebar.collapsed .sb-brand-text,
.sidebar.collapsed .brand-logout-form,
.sidebar.collapsed .role-card,
.sidebar.collapsed .nav-sec,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .sb-footer .user-name,
.sidebar.collapsed .sb-footer .user-role {
  opacity: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
  transition: opacity .12s ease
}

.sidebar.collapsed .nav-badge {
  right: 2px;
  top: 4px;
  transform: none;
  font-size: 8px;
  padding: 1px 3px
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 8px 0;
  margin: 0 4px 1px;
  width: calc(100% - 8px)
}

.sidebar.collapsed .sb-footer {
  padding: 10px 0;
  display: flex;
  justify-content: center
}

.sidebar.collapsed .sb-user {
  justify-content: center
}

.nav-item {
  position: relative
}

.sidebar.collapsed .nav-item::after {
  content: attr(data-label);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--text);
  color: #fff;
  font-size: 12px;
  padding: 5px 9px;
  border-radius: var(--r);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s ease;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15)
}

.sidebar.collapsed .nav-item:hover::after {
  opacity: 1
}

.sidebar-close, .sidebar-logout {
  display: none !important;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text3);
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.sidebar-close:hover, .sidebar-logout:hover {
  color: var(--text);
  transform: scale(1.05);
}

.role-card {
  margin: 9px 9px 4px;
  padding: 10px;
  border-radius: var(--r-lg);
  background: var(--surface2);
  border: 1px solid var(--border);
  transition: opacity .15s ease, margin .22s ease
}

.role-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px
}

.role-lbl {
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .5px
}

.role-badge {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--text);
  color: #fff;
  font-weight: 500
}

.role-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
  min-height: 40px;
}

.role-stat .k {
  font-size: 10px;
  color: var(--text3)
}

.role-stat .v {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.3px;
  min-height: 20px;
  line-height: 20px;
}

.nav-sec {
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .8px;
  padding: 10px 12px 3px;
  font-weight: 500;
  transition: opacity .12s ease, height .22s ease, padding .22s ease;
  white-space: nowrap;
  overflow: hidden
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--r);
  font-size: 13px;
  color: var(--text2);
  cursor: pointer;
  margin: 0 5px 1px;
  border: none;
  background: none;
  width: calc(100% - 10px);
  text-align: left;
  transition: background var(--transition), color var(--transition), padding .22s ease, margin .22s ease
}

.nav-item:hover {
  background: var(--surface2);
  color: var(--text)
}

.nav-item.active {
  background: var(--text);
  color: #fff;
  font-weight: 500
}

.nav-item svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: .75
}

.nav-item.active svg {
  opacity: 1
}

.nav-badge {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  font-weight: 600;
  transition: all .22s ease
}

.sb-footer {
  padding: 11px 13px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  transition: padding .22s ease
}

.sb-user {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--teal-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--teal-dark);
  flex-shrink: 0
}

.user-name {
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.user-role {
  font-size: 10px;
  color: var(--text3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.sb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .35);
  z-index: 29;
  backdrop-filter: blur(2px)
}

/* Sidebar del proyecto Spring Boot (clases distintas al Doc1) */
.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 10px 10px 13px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  min-height: 50px
}

.sidebar .brand .brand-os {
  color: var(--teal)
}

.sb-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--r);
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text3);
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition)
}

.sb-collapse-btn:hover {
  background: var(--surface2);
  color: var(--text)
}

.sb-collapse-btn svg {
  transition: transform .22s ease
}

.sidebar.collapsed .sb-collapse-btn svg {
  transform: rotate(180deg)
}

.brand-logout-form {
  flex-shrink: 0
}

.brand-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  color: var(--text3);
  transition: background var(--transition), color var(--transition)
}

.brand-logout-btn:hover {
  background: var(--red-bg);
  color: var(--red)
}

.sidebar .brand .logo {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  background: var(--teal);
  flex-shrink: 0;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16' stroke='white' stroke-width='1.8'%3e%3cpath d='M8 1L1 6v9h5v-5h4v5h5V6z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 13px
}

.sidebar .brand .text h1 {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2
}

.sidebar .brand .text p {
  font-size: 10px;
  color: var(--text3);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.sidebar .nav {
  flex: 1;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow-y: auto
}

.sidebar .nav a,
.sidebar .nav>button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: var(--r);
  font-size: 13px;
  color: var(--text2);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: background var(--transition), color var(--transition);
  text-decoration: none
}

.sidebar .nav a:hover,
.sidebar .nav>button:hover {
  background: var(--surface2);
  color: var(--text)
}

.sidebar .nav a.active,
.sidebar .nav>button.active {
  background: var(--text);
  color: #fff;
  font-weight: 500
}

.sidebar .nav svg {
  flex-shrink: 0;
  opacity: .8
}

.sidebar .nav a.active svg,
.sidebar .nav>button.active svg {
  opacity: 1
}

.nav-group {
  display: flex;
  flex-direction: column
}

.nav-group-toggle {
  display: flex !important;
  align-items: center;
  gap: 8px;
  padding: 7px 9px !important;
  border-radius: var(--r) !important;
  font-size: 13px;
  color: var(--text2);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: background var(--transition), color var(--transition)
}

.nav-group-toggle:hover {
  background: var(--surface2) !important;
  color: var(--text) !important
}

.nav-group-chevron {
  margin-left: auto;
  transition: transform .2s ease;
  opacity: .5
}

.nav-group.open .nav-group-chevron {
  transform: rotate(180deg)
}

.nav-submenu {
  display: none;
  flex-direction: column;
  gap: 1px;
  padding: 2px 0 2px 20px
}

.nav-group.open .nav-submenu {
  display: flex
}

.nav-submenu a {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px !important;
  border-radius: var(--r);
  font-size: 12.5px;
  color: var(--text3);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), color var(--transition)
}

.nav-submenu a:hover {
  background: var(--surface2);
  color: var(--text2)
}

.nav-submenu a.active {
  background: var(--surface2);
  color: var(--text);
  font-weight: 500
}

.nav-logout-form {
  padding: 6px 6px 4px
}

.nav-logout-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: var(--r);
  font-size: 13px;
  color: var(--text3);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: background var(--transition), color var(--transition)
}

.nav-logout-btn:hover {
  background: var(--red-bg);
  color: var(--red)
}

.nav-logout-btn svg {
  flex-shrink: 0
}

.sidebar-foot {
  font-size: 10px;
  color: var(--text3);
  line-height: 1.6;
  padding: 10px 13px 14px;
  border-top: 1px solid var(--border)
}

/* â”€â”€ MAIN â”€â”€ */
.main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  overflow-x: hidden
}

.topbar {
  min-height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 18px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 20;
  gap: 12px;
  flex-wrap: nowrap;
  min-height: var(--topbar-h)
}

.topbar h2 {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.topbar p,
.topbar #headerSubtitle {
  font-size: 11px;
  color: var(--text3);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.topbar .actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 310px
}

.menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--text2);
  flex-shrink: 0;
  border-radius: var(--r);
  transition: background var(--transition)
}

.menu-btn svg {
  width: 20px;
  height: 20px;
  display: block
}

.menu-btn:hover {
  background: var(--surface2)
}

.page-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.page-sub {
  font-size: 11px;
  color: var(--text3);
  margin-top: 1px
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0
}

.status-tag,
.topbar .tag {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--text3);
  padding: 4px 8px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: #ffffff
}

.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  animation: pulse 1.8s infinite;
  flex-shrink: 0;
  display: inline-block
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(29, 158, 117, .4)
  }

  70% {
    box-shadow: 0 0 0 7px rgba(29, 158, 117, 0)
  }

  100% {
    box-shadow: 0 0 0 0 rgba(29, 158, 117, 0)
  }
}

.global-search-wrap {
  position: relative;
  flex: 1;
  max-width: 300px;
  min-width: 160px
}

.global-search-inp {
  padding: 6px 10px 6px 32px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  outline: none;
  transition: var(--transition);
  width: 100%;
  font-size: 12.5px
}

.global-search-inp:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-bg);
  background: var(--surface)
}

.global-search-icon {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  pointer-events: none
}

.global-search-icon svg {
  width: 13px;
  height: 13px
}

.global-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .1);
  z-index: 100;
  max-height: 320px;
  overflow-y: auto;
  display: none
}

.global-results.show {
  display: block
}

.gr-section {
  padding: 6px 0
}

.gr-label {
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 4px 12px;
  font-weight: 500
}

.gr-item {
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background var(--transition)
}

.gr-item:hover {
  background: var(--teal-bg)
}

.gr-item-title {
  font-size: 12.5px;
  font-weight: 500
}

.gr-item-sub {
  font-size: 11px;
  color: var(--text3)
}

.gr-empty {
  padding: 16px 12px;
  font-size: 12.5px;
  color: var(--text3);
  text-align: center
}

.gr-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--surface2);
  color: var(--text3);
  white-space: nowrap;
  margin-left: auto
}

.content {
  padding: 16px 18px;
  flex: 1;
  min-width: 0;
  overflow-x: hidden
}

.section {
  display: none;
  animation: fadeIn .15s ease;
  min-width: 0
}

.section.active {
  display: block
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

/* â”€â”€ ERROR BOX â”€â”€ */
#errorBox {
  margin: 12px 18px 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-radius: var(--r-lg);
  border: 1px solid rgba(163, 45, 45, .35);
  background: var(--red-bg);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text)
}

#errorBox .font-semibold {
  font-weight: 600;
  color: var(--red)
}

#errorBox .flex-1 {
  flex: 1
}

#errorBox button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text3);
  padding: 2px
}

#errorBox button:hover {
  color: var(--text)
}

/* â”€â”€ BUTTONS â”€â”€ */
.btn {
  padding: 6px 12px;
  border-radius: var(--r);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  transition: var(--transition);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none
}

.btn:hover {
  background: var(--surface)
}

.btn:active {
  transform: scale(.98)
}

.btn-primary,
.btn.primary {
  background: var(--text);
  color: #fff;
  border-color: var(--text)
}

.btn-primary:hover,
.btn.primary:hover {
  background: #2d2c29
}

.btn-secondary,
.btn.secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text2)
}

.btn-secondary:hover,
.btn.secondary:hover {
  background: var(--surface3)
}

.btn-sm {
  padding: 5px 9px;
  font-size: 12px
}

.btn-teal {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal)
}

.btn-teal:hover {
  background: var(--teal-dark)
}

.btn-danger {
  background: var(--red-bg);
  color: var(--red);
  border-color: #f5c4c4
}

.btn-danger:hover {
  background: #f8d7d7
}

.btn-ghost {
  background: transparent;
  border-color: var(--border)
}

.btn-ghost:hover {
  background: var(--surface2)
}

.btn-icon {
  width: 30px;
  height: 30px;
  padding: 0;
  justify-content: center;
  flex-shrink: 0
}

.btn-icon svg {
  width: 14px;
  height: 14px
}

.btn svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0
}

/* â”€â”€ BADGES â”€â”€ */
.badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 500;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px
}

.badge-ok {
  background: var(--teal-bg);
  color: var(--teal-dark)
}

.badge-warn {
  background: var(--amber-bg);
  color: var(--amber)
}

.badge-danger {
  background: var(--red-bg);
  color: var(--red)
}

.badge-gray {
  background: var(--surface2);
  color: var(--text2)
}

.badge-blue {
  background: var(--blue-bg);
  color: var(--blue)
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0
}

/* â”€â”€ CARDS â”€â”€ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-bottom: 12px
}

.card-head {
  padding: 12px 15px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0
}

.card-head-left {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0
}

.card-head h3 {
  font-size: 13px;
  font-weight: 600
}

.card-sub {
  font-size: 11px;
  color: var(--text3)
}

.card-head-right {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0
}

.card-body {
  padding: 13px 15px
}

/* â”€â”€ KPIs â”€â”€ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 13px 15px;
  cursor: default;
  transition: border-color var(--transition), box-shadow var(--transition)
}

.kpi-card:hover {
  border-color: var(--border2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .05)
}

.kpi-label {
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 5px
}

.kpi-value {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -.5px
}

.kpi-delta {
  font-size: 11px;
  color: var(--text3);
  margin-top: 4px
}

.spark {
  height: 24px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  margin-top: 7px
}

.spark span {
  flex: 1;
  border-radius: 2px 2px 0 0;
  background: var(--surface3)
}

.spark span.hi {
  background: var(--teal)
}

.kpi-danger .kpi-value {
  color: var(--red)
}

.kpi-warn .kpi-value {
  color: var(--amber)
}

.kpi-ok .kpi-value {
  color: var(--teal)
}

/* â”€â”€ LAYOUT â”€â”€ */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px
}

.grid-hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 12px
}

.split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 12px
}

.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px
}

/* â”€â”€ TOOLBAR â”€â”€ */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px
}

.toolbar-l,
.toolbar-r {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap
}

.search-inp {
  padding: 6px 10px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: var(--transition);
  min-width: 140px;
  max-width: 100%;
  font-size: 12.5px
}

.search-inp:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-bg)
}

.search-wrap {
  position: relative;
  display: inline-block;
  min-width: 0;
  max-width: 100%
}

.search-wrap .search-ico {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  pointer-events: none
}

.search-wrap .search-ico svg {
  width: 12px;
  height: 12px
}

.flt-sel {
  padding: 5px 28px 5px 9px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text2);
  font-size: 12px;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23A8A59E' stroke-width='2'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px
}

.flt-sel:focus {
  border-color: var(--teal)
}

.view-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden
}

.view-btn {
  padding: 5px 8px;
  background: var(--surface);
  border: none;
  cursor: pointer;
  color: var(--text3);
  transition: var(--transition)
}

.view-btn.active {
  background: var(--surface2);
  color: var(--text)
}

.view-btn svg {
  width: 13px;
  height: 13px;
  display: block
}

/* â”€â”€ TABLE â”€â”€ */
.tbl-wrap {
  overflow-x: auto;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  -webkit-overflow-scrolling: touch
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 420px
}

th,
td {
  padding: 9px 11px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 12.5px;
  vertical-align: middle
}

th {
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .4px;
  font-weight: 500;
  background: var(--surface2);
  position: sticky;
  top: 0;
  z-index: 2;
  white-space: nowrap
}

tr:last-child td {
  border-bottom: none
}

tr.row-clickable {
  cursor: pointer
}

tr.row-clickable:hover td {
  background: var(--teal-bg)
}

tr.row-selected td {
  background: var(--teal-bg);
}
tr.row-selected td:first-child {
  border-left: 2px solid var(--teal);
}

.col-sort {
  cursor: pointer;
  user-select: none
}

/* â”€â”€ CARD VIEW â”€â”€ */
.cards-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
  min-width: 0
}

.cv-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px;
  cursor: pointer;
  transition: var(--transition)
}

.cv-card:hover {
  border-color: var(--border2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
  transform: translateY(-1px)
}

.cv-card.selected {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-bg)
}

.cv-card-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px
}

.cv-card-sub {
  font-size: 11.5px;
  color: var(--text3);
  margin-bottom: 10px
}

.cv-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px
}

.cv-stat .k {
  font-size: 10px;
  color: var(--text3)
}

.cv-stat .v {
  font-size: 13px;
  font-weight: 600
}

/* â”€â”€ ITEMS â”€â”€ */
.item-list {
  display: grid;
  gap: 7px
}

.item {
  background: var(--surface2);
  border-radius: var(--r);
  padding: 11px 13px;
  border: 1px solid var(--border);
  transition: border-color var(--transition)
}

.item:hover {
  border-color: var(--border2)
}

.item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px
}

.item-title {
  font-size: 12.5px;
  font-weight: 500
}

.item-meta {
  font-size: 11.5px;
  color: var(--text3);
  line-height: 1.5
}

/* â”€â”€ BARS â”€â”€ */
.bar-list {
  display: grid;
  gap: 9px
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(60px, 100px) 1fr 54px;
  gap: 7px;
  align-items: center;
  min-width: 0
}

.bar-lbl {
  font-size: 11.5px;
  color: var(--text2);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.bar-track {
  height: 5px;
  background: var(--surface3);
  border-radius: 4px;
  overflow: hidden
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--teal);
  transition: width .7s ease
}

.bar-val {
  font-size: 11px;
  color: var(--text3);
  font-family: 'DM Mono', monospace
}

/* â”€â”€ DETAIL BOX â”€â”€ */
.detail-box {
  background: var(--surface2);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  padding: 14px;
  min-height: 160px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center
}

.empty-state svg {
  width: 32px;
  height: 32px;
  color: var(--surface3)
}

.empty-state p {
  font-size: 12.5px;
  color: var(--text3)
}

/* â”€â”€ METRIC CHIPS â”€â”€ */
.metric-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 8px 0
}

.metric-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 9px 11px
}

.metric-chip .k {
  font-size: 10px;
  color: var(--text3);
  margin-bottom: 2px
}

.metric-chip .v {
  font-size: 14px;
  font-weight: 600;
  word-break: break-all
}

/* â”€â”€ DONUT â”€â”€ */
.donut-wrap {
  display: grid;
  place-items: center;
  padding: 10px 0
}

.donut {
  --val: 75;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle closest-side, var(--surface) 69%, transparent 70% 100%), conic-gradient(var(--teal) calc(var(--val)*1%), var(--surface3) 0);
  display: flex;
  align-items: center;
  justify-content: center
}

.donut-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  line-height: 1
}

.donut .num {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -.5px;
  line-height: 1
}

.donut .lbl {
  font-size: 10px;
  color: var(--text3);
  line-height: 1;
  white-space: nowrap
}

/* â”€â”€ CALENDAR â”€â”€ */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 9px;
  min-width: 0
}

.cal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 12px;
  transition: var(--transition)
}

.cal-card:hover {
  border-color: var(--border2);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .05)
}

.cal-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 7px;
  gap: 8px
}

.cal-title {
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.3
}

.cal-meta {
  font-size: 11px;
  color: var(--text3);
  line-height: 1.55
}

/* â”€â”€ TIMELINE â”€â”€ */
.tl-list {
  display: grid;
  gap: 7px
}

.tl-row {
  display: grid;
  grid-template-columns: 64px 1fr auto auto;
  gap: 8px;
  align-items: start;
  padding: 9px 11px;
  border-radius: var(--r);
  background: var(--surface2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  min-width: 0
}

.tl-row:hover {
  border-color: var(--border2);
  background: var(--surface)
}

.tl-row.selected {
  border-color: var(--teal);
  background: var(--teal-bg)
}

.tl-date {
  font-size: 10.5px;
  color: var(--text3);
  font-family: 'DM Mono', monospace;
  padding-top: 2px;
  white-space: nowrap
}

/* â”€â”€ TABS â”€â”€ */
.tabs {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 11px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px
}

.tabs::-webkit-scrollbar {
  display: none
}

.tab-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  transition: var(--transition);
  white-space: nowrap
}

.tab-btn.active,
.tab-btn:hover {
  background: var(--text);
  color: #fff;
  border-color: var(--text)
}

/* â”€â”€ PROGRESS â”€â”€ */
.progress {
  height: 5px;
  background: var(--surface3);
  border-radius: 4px;
  overflow: hidden;
  margin: 4px 0
}

.progress span {
  display: block;
  height: 100%;
  background: var(--teal);
  border-radius: 4px;
  transition: width .5s ease
}

/* â”€â”€ CHART â”€â”€ */
.chart-wrap {
  position: relative;
  height: 200px
}

.chart-card {
  background: var(--surface2);
  border-radius: var(--r);
  padding: 11px;
  border: 1px solid var(--border)
}

.chart-title {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 9px
}

/* â”€â”€ MODAL â”€â”€ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(26, 25, 22, .4);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
  backdrop-filter: blur(2px)
}

.modal.show {
  display: flex
}

.modal-card {
  width: min(840px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: 0 8px 36px rgba(0, 0, 0, .12);
  animation: modalIn .18s ease
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(.98)
  }

  to {
    opacity: 1;
    transform: none
  }
}

.modal-head {
  padding: 13px 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  gap: 10px
}

.modal-head-left strong {
  font-size: 13.5px;
  font-weight: 600
}

.modal-sub {
  font-size: 11px;
  color: var(--text3);
  margin-top: 1px
}

.modal-body {
  padding: 17px
}

.modal-foot {
  padding: 0 17px 15px;
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px
}

.confirm-modal .modal-card {
  max-width: 400px
}

.confirm-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--red-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px
}

.confirm-icon svg {
  width: 20px;
  height: 20px;
  color: var(--red)
}

.confirm-title {
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 6px
}

.confirm-msg {
  font-size: 13px;
  color: var(--text2);
  text-align: center;
  line-height: 1.5
}

/* Logout modal */
#logoutModal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .6);
  backdrop-filter: blur(2px)
}

#logoutModal:not(.hidden) {
  display: flex
}

#logoutModal>div {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  width: min(360px, 90%);
  text-align: center;
  box-shadow: 0 8px 48px rgba(0, 0, 0, .15)
}

#logoutModal h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text)
}

#logoutModal p {
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 20px;
  line-height: 1.5
}

#logoutModal .flex {
  display: flex;
  gap: 10px;
  justify-content: center
}

#logoutModal button {
  padding: 8px 20px;
  border-radius: var(--r);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  transition: var(--transition);
  font-family: 'DM Sans', sans-serif
}

#logoutModal button:last-child {
  background: #ff6b6b;
  color: #fff;
  border-color: #ff6b6b;
  font-weight: 600
}

#logoutModal button:hover {
  opacity: .88
}

/* Modal backdrops */
#modalBackdrop {
  background: rgba(0, 0, 0, .4)
}

#confirmModalContainer {
  display: none
}

#confirmModalContainer.show {
  display: flex !important
}

/* â”€â”€ TOAST â”€â”€ */
.toast-stack {
  position: fixed;
  right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--r);
  font-size: 12.5px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .15);
  animation: toastIn .2s ease;
  pointer-events: all;
  min-width: 200px;
  max-width: 320px;
  background: var(--text);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .1)
}

.toast.toast-ok {
  background: var(--teal-dark);
  border-color: rgba(255, 255, 255, .15)
}

.toast.toast-warn {
  background: #7a4e10;
  border-color: rgba(255, 255, 255, .15)
}

.toast.toast-error {
  background: var(--red);
  border-color: rgba(255, 255, 255, .15)
}

.toast-icon {
  flex-shrink: 0
}

.toast-icon svg {
  width: 14px;
  height: 14px
}

.toast-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, .6);
  cursor: pointer;
  padding: 0;
  margin-left: auto;
  flex-shrink: 0
}

.toast-close svg {
  width: 12px;
  height: 12px
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(20px)
  }

  to {
    opacity: 1;
    transform: none
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: none
  }

  to {
    opacity: 0;
    transform: translateX(20px)
  }
}

/* â”€â”€ DROPDOWN â”€â”€ */
.dropdown {
  position: relative
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .1);
  z-index: 40;
  min-width: 160px;
  display: none;
  overflow: hidden
}

.dropdown-menu.show {
  display: block
}

.dd-item {
  padding: 9px 14px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text2);
  transition: var(--transition)
}

.dd-item:hover {
  background: var(--surface2);
  color: var(--text)
}

.dd-item svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0
}

/* â”€â”€ SKELETON â”€â”€ */
.skeleton {
  background: linear-gradient(90deg, var(--surface2) 25%, var(--surface3) 50%, var(--surface2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 4px
}

@keyframes shimmer {
  0% {
    background-position: 200% 0
  }

  100% {
    background-position: -200% 0
  }
}

/* â”€â”€ MOBILE NAV â”€â”€ */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--mobile-nav-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 30;
  padding-bottom: env(safe-area-inset-bottom)
}

.mobile-nav-inner {
  display: flex;
  align-items: stretch;
  height: 100%;
  width: 100%
}

.mob-nav-item {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--text3);
  transition: color var(--transition), background var(--transition);
  position: relative;
  font-size: 0;
  border-radius: 10px;
  margin: 4px 3px
}

.mob-nav-item.active {
  color: var(--teal)
}

.mob-nav-item.active::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: var(--teal-bg);
  z-index: 0
}

.mob-nav-item svg,
.mob-nav-item .mob-nav-label {
  position: relative;
  z-index: 1
}

.mob-nav-item svg {
  width: 20px;
  height: 20px
}

.mob-nav-label {
  font-size: 10px;
  font-family: 'DM Sans', sans-serif
}

.mob-nav-dot {
  position: absolute;
  top: 4px;
  right: calc(50% - 14px);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  border: 1.5px solid var(--surface)
}

/* â”€â”€ MISC â”€â”€ */
.mini {
  font-size: 11.5px;
  color: var(--text3)
}

.mono {
  font-family: 'DM Mono', monospace;
  font-size: 11px
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 10px 0
}

.section-gap {
  height: 14px
}

.detail-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px
}

.tag-list {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 6px
}

.tag {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text3)
}

/* â”€â”€ OVERVIEW â”€â”€ */
.ov-kpi-row {
  display: grid;
  gap: 10px;
  margin-bottom: 10px
}

.ov-kpi-primary {
  grid-template-columns: repeat(3, 1fr)
}

.ov-kpi-secondary {
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 14px
}

.ov-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: border-color var(--transition), box-shadow var(--transition);
  min-width: 0;
  overflow: hidden
}

.ov-kpi:hover {
  border-color: var(--border2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .05)
}

.ov-kpi-sm {
  padding: 11px 14px;
  gap: 10px;
  align-items: center
}

.ov-kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0
}

.ov-kpi-icon svg {
  width: 16px;
  height: 16px
}

.ov-kpi-icon-sm {
  width: 28px;
  height: 28px;
  border-radius: 7px
}

.ov-kpi-icon-sm svg {
  width: 13px;
  height: 13px
}

.ov-kpi-body {
  flex: 1;
  min-width: 0
}

.ov-kpi-label {
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.ov-kpi-value {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -.6px;
  line-height: 1
}

.ov-kpi-value-sm {
  font-size: 18px
}

.ov-kpi-delta {
  font-size: 11px;
  color: var(--text3);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.ov-kpi-spark {
  width: 60px;
  flex-shrink: 0;
  height: 40px
}

.ov-kpi-spark canvas {
  width: 100% !important;
  height: 100% !important;
  display: block
}

.ov-kpi-spark-dot {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  flex-wrap: wrap;
  width: 32px;
  align-content: center;
  align-self: center
}

.ov-kpi-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: block;
  backface-visibility: hidden
}

.ov-body {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 14px;
  align-items: start
}

.ov-main {
  display: flex;
  flex-direction: column;
  min-width: 0
}

.ov-side {
  display: flex;
  flex-direction: column;
  min-width: 0
}

.ov-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px
}

.ov-actions-grid .item {
  margin: 0
}

.ov-asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  width: 100%;
}

.ov-asset-card {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 13px;
  cursor: pointer;
  transition: var(--transition);
  background: var(--surface2);
  position: relative;
  overflow: hidden;
  min-width: 0
}

.ov-asset-card:hover {
  border-color: var(--teal);
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .06)
}

.ov-asset-card-name {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.ov-asset-card-city {
  font-size: 11px;
  color: var(--text3);
  margin-bottom: 10px
}

.ov-asset-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  min-width: 0
}

.ov-asset-stat .k {
  font-size: 9.5px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .3px
}

.ov-asset-stat .v {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -.2px
}

.ov-asset-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--surface3)
}

.ov-asset-bar-fill {
  height: 100%;
  transition: width .7s ease
}

.ov-donut-wrap {
  display: flex;
  align-items: center;
  gap: 16px
}

.ov-health-metrics {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 7px
}

.ov-health-metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px
}

.ov-health-metric-label {
  font-size: 11.5px;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.ov-health-metric-val {
  font-size: 12px;
  font-weight: 600;
  font-family: 'DM Mono', monospace;
  flex-shrink: 0
}

.ov-occ-bars {
  display: grid;
  gap: 8px
}

.ov-occ-row {
  display: grid;
  grid-template-columns: minmax(70px, 110px) 1fr 38px;
  gap: 8px;
  align-items: center;
  min-width: 0
}

.ov-occ-label {
  font-size: 11.5px;
  color: var(--text2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.ov-occ-track {
  height: 6px;
  background: var(--surface3);
  border-radius: 4px;
  overflow: hidden;
  min-width: 0
}

.ov-occ-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .7s ease
}

.ov-occ-pct {
  font-size: 11px;
  color: var(--text3);
  font-family: 'DM Mono', monospace;
  text-align: right
}

/* â”€â”€ UTILITIES â”€â”€ */
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mt-5 { margin-top: 32px; }

.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mb-5 { margin-bottom: 32px; }

/* â”€â”€ RESPONSIVE â”€â”€ */
@media(max-width:1100px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr)
  }

  .grid-hero {
    grid-template-columns: 1fr
  }

  .split {
    grid-template-columns: 1fr
  }
}

@media(max-width:1024px) {
  .ov-body {
    grid-template-columns: 1fr
  }

  .ov-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px
  }

  .ov-side .card:last-child {
    grid-column: span 2
  }

  .ov-donut-wrap {
    justify-content: flex-start
  }
}

@media(max-width:1024px) {
  :root {
    --sidebar-w: 0px
  }

  .app {
    grid-template-columns: 1fr
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 260px;
    transform: translateX(-100%);
    box-shadow: none;
    transition: transform .25s ease, box-shadow .25s ease;
    z-index: 30
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0, 0, 0, .12)
  }

  .sb-overlay.show {
    display: block
  }

  .sidebar-close, .sidebar-logout {
    display: flex !important;
  }

  .desktop-logout-form {
    display: none !important;
  }

  .sb-toggle {
    display: none
  }

  .menu-btn {
    display: flex
  }

  .topbar {
    padding: 0 14px
  }

  .content {
    padding: 12px 14px;
    padding-bottom: calc(12px + var(--mobile-nav-h))
  }

  .mobile-nav {
    display: flex
  }

  /* Phase 1 & 2: Responsive tables with horizontal scroll */
  .tbl-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  
  .tbl-wrap table {
    min-width: 650px; /* Forces scroll if screen is narrower */
  }
  
  .tbl-wrap table th,
  .tbl-wrap table td {
    padding: 14px 16px !important; /* Better padding on mobile */
    white-space: nowrap; /* Prevents text wrapping/compression */
  }

  .global-search-wrap {
    max-width: 180px
  }

  .status-tag {
    display: none
  }

  .grid-2 {
    grid-template-columns: minmax(0, 1fr)
  }

  .form-grid {
    grid-template-columns: 1fr 1fr
  }
}

@media(max-width:800px) {
  .ov-kpi-primary {
    grid-template-columns: repeat(3, 1fr)
  }

  .ov-kpi-secondary {
    grid-template-columns: repeat(3, 1fr)
  }

  .ov-actions-grid {
    grid-template-columns: minmax(0, 1fr)
  }

  .ov-side {
    grid-template-columns: minmax(0, 1fr)
  }

  .ov-side .card:last-child {
    grid-column: span 1
  }
}

@media(max-width:700px) {
  .global-search-wrap {
    display: none
  }

  .search-inp {
    min-width: 0 !important;
    width: 100%
  }

  .search-wrap {
    width: 100%
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch
  }

  .toolbar-l,
  .toolbar-r {
    width: 100%
  }

  .toolbar-r {
    justify-content: flex-start
  }
}

@media(max-width:600px) {
  .login-card {
    grid-template-columns: 1fr
  }

  .login-hero {
    display: none
  }

  .kpi-grid {
    grid-template-columns: 1fr 1fr
  }

  .form-grid {
    grid-template-columns: 1fr
  }

  .tl-row {
    grid-template-columns: 1fr
  }

  .bar-row {
    grid-template-columns: 80px 1fr 46px
  }

  table {
    min-width: 360px
  }

  .topbar {
    padding: 0 12px
  }

  .content {
    padding: 10px 12px;
    padding-bottom: calc(10px + var(--mobile-nav-h))
  }

  .modal {
    padding: 6px
  }

  .modal-card {
    border-radius: 12px;
    max-height: 95vh
  }

  .modal-body {
    padding: 12px
  }

  .modal-foot {
    padding: 0 12px 12px
  }

  .ov-kpi-primary {
    grid-template-columns: 1fr
  }

  .ov-kpi-primary .ov-kpi:last-child {
    grid-column: span 1
  }

  .ov-kpi-secondary {
    grid-template-columns: 1fr
  }

  .ov-occ-row {
    grid-template-columns: 80px 1fr 32px;
    gap: 6px
  }

  .ov-donut-wrap {
    flex-direction: column;
    align-items: flex-start
  }
}

@media(max-width:420px) {
  .kpi-grid {
    grid-template-columns: 1fr
  }

  .metric-row {
    grid-template-columns: 1fr 1fr
  }

  .ov-kpi-primary {
    grid-template-columns: 1fr
  }

  .ov-kpi-primary .ov-kpi:last-child {
    grid-column: span 1
  }

  .ov-kpi-secondary {
    grid-template-columns: 1fr
  }
}

/* â”€â”€ DARK MODE â€” desactivado (modo claro forzado siempre) â”€â”€ */
/* Los bloques [data-theme="dark"] quedan aquÃ­ por compatibilidad
   pero nunca se activarÃ¡n ya que no aÃ±adimos data-theme="dark" al HTML */

/* â”€â”€ DARK MODE OVERRIDES â”€â”€ */
[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background-color: var(--surface2);
  border-color: var(--border);
  color: var(--text)
}

[data-theme="dark"] select,
[data-theme="dark"] .flt-sel {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23E8EAED' stroke-width='2'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 13px;
}

[data-theme="dark"] .btn.secondary {
  background-color: var(--surface2);
  border-color: var(--border);
}

[data-theme="dark"] .sidebar .sidebar .brand {
  background: var(--surface);
  border-color: var(--border)
}

[data-theme="dark"] .sb-collapse-btn {
  background: var(--surface2);
  border-color: var(--border);
  color: var(--text3)
}

[data-theme="dark"] .topbar {
  background: var(--surface);
  border-color: var(--border)
}

[data-theme="dark"] .card {
  background: var(--surface)
}

[data-theme="dark"] .card-head {
  border-color: var(--border)
}

[data-theme="dark"] .kpi-card,
[data-theme="dark"] .ov-kpi {
  background: var(--surface)
}

[data-theme="dark"] .kpi-card:hover,
[data-theme="dark"] .ov-kpi:hover {
  box-shadow: 0 2px 12px rgba(0, 0, 0, .3)
}

[data-theme="dark"] .btn {
  background: var(--surface2);
  border-color: var(--border);
  color: var(--text)
}

[data-theme="dark"] .btn:hover {
  background: var(--surface3)
}

[data-theme="dark"] .btn-primary .btn.primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text)
}

[data-theme="dark"] .btn-ghost {
  background: transparent;
  border-color: var(--border)
}

[data-theme="dark"] .btn-ghost:hover {
  background: var(--surface2)
}

[data-theme="dark"] .btn-secondary .btn.secondary {
  background: var(--surface2);
  border-color: var(--border)
}

[data-theme="dark"] th {
  background: var(--surface3);
  color: var(--text3)
}

[data-theme="dark"] td {
  border-color: var(--border)
}

[data-theme="dark"] tr.row-clickable:hover td {
  background: rgba(32, 176, 127, .07)
}

[data-theme="dark"] tr.row-selected td {
  background: var(--teal-bg);
}
[data-theme="dark"] tr.row-selected td:first-child {
  border-left-color: var(--teal);
}

[data-theme="dark"] .tbl-wrap {
  border-color: var(--border)
}

[data-theme="dark"] .item {
  background: var(--surface2)
}

[data-theme="dark"] .detail-box {
  background: var(--surface2)
}

[data-theme="dark"] .metric-chip {
  background: var(--surface2)
}

[data-theme="dark"] .chart-card {
  background: var(--surface2)
}

[data-theme="dark"] .cal-card {
  background: var(--surface);
  border-color: var(--border)
}

[data-theme="dark"] .cal-card:hover {
  box-shadow: 0 2px 12px rgba(0, 0, 0, .3)
}

[data-theme="dark"] .cv-card {
  background: var(--surface)
}

[data-theme="dark"] .cv-card:hover {
  box-shadow: 0 2px 12px rgba(0, 0, 0, .3)
}

[data-theme="dark"] .tl-row {
  background: var(--surface2)
}

[data-theme="dark"] .tl-row:hover {
  background: var(--surface3)
}

[data-theme="dark"] .tl-row.selected {
  background: rgba(32, 176, 127, .1)
}

[data-theme="dark"] .tab-btn {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text2)
}

[data-theme="dark"] .tab-btn.active {
  background: var(--text);
  color: #fff
}

[data-theme="dark"] .view-btn {
  background: var(--surface);
  color: var(--text3)
}

[data-theme="dark"] .view-btn.active {
  background: var(--surface3);
  color: var(--text)
}

[data-theme="dark"] .view-toggle {
  border-color: var(--border)
}

[data-theme="dark"] .search-inp {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text)
}

[data-theme="dark"] .flt-sel {
  background-color: var(--surface);
  color: var(--text2);
  border-color: var(--border)
}

[data-theme="dark"] .global-search-inp {
  background: var(--surface2);
  border-color: var(--border);
  color: var(--text)
}

[data-theme="dark"] .global-results {
  background: var(--surface);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .4)
}

[data-theme="dark"] .gr-item:hover {
  background: var(--surface2)
}

[data-theme="dark"] .modal-card {
  background: var(--surface);
  box-shadow: 0 8px 48px rgba(0, 0, 0, .5)
}

[data-theme="dark"] .modal-head {
  border-color: var(--border)
}

[data-theme="dark"] #logoutModal>div {
  background: var(--surface)
}

[data-theme="dark"] .dropdown-menu {
  background: var(--surface)
}

[data-theme="dark"] .dd-item:hover {
  background: var(--surface2)
}

[data-theme="dark"] .mobile-nav {
  background: var(--surface);
  border-color: var(--border)
}

[data-theme="dark"] .status-tag,
[data-theme="dark"] .topbar .tag {
  background: var(--surface2);
  border-color: var(--border);
  color: var(--text3)
}

[data-theme="dark"] .divider {
  background: var(--border)
}

[data-theme="dark"] .progress {
  background: var(--surface3)
}

[data-theme="dark"] .bar-track {
  background: var(--surface3)
}

[data-theme="dark"] .spark span {
  background: var(--surface3)
}

[data-theme="dark"] .ov-asset-card {
  background: var(--surface2)
}

[data-theme="dark"] .ov-asset-card:hover {
  background: var(--surface)
}

[data-theme="dark"] .ov-occ-track {
  background: var(--surface3)
}

[data-theme="dark"] .ov-asset-bar {
  background: var(--surface3)
}

[data-theme="dark"] .sidebar .nav a:hover,
[data-theme="dark"] .sidebar .nav>button:hover {
  background: var(--surface2)
}

[data-theme="dark"] .nav-item.active,
[data-theme="dark"] .sidebar .nav a.active,
[data-theme="dark"] .sidebar .nav>button.active {
  background: #1C202C !important;
  color: #ffffff !important;
}

[data-theme="dark"] .nav-item.active svg,
[data-theme="dark"] .sidebar .nav a.active svg,
[data-theme="dark"] .sidebar .nav>button.active svg {
  color: #ffffff;
  stroke: currentColor;
}

[data-theme="dark"] .role-badge {
  background: #1C202C !important;
  color: #ffffff !important;
}

[data-theme="dark"] .nav-group-toggle:hover {
  background: var(--surface2) !important
}

[data-theme="dark"] .nav-submenu a:hover {
  background: var(--surface2)
}

[data-theme="dark"] .sidebar-foot {
  border-color: var(--border)
}

[data-theme="dark"] .login-hero {
  background: #0d1117
}

[data-theme="dark"] .login-card {
  background: var(--surface);
  box-shadow: 0 4px 32px rgba(0, 0, 0, .4)
}

[data-theme="dark"] .login-form-wrap {
  background: var(--surface)
}

[data-theme="dark"] .login-chip {
  background: var(--surface2);
  border-color: var(--border)
}

[data-theme="dark"] .role-card {
  background: var(--surface2)
}

/* â”€â”€ TOPBAR FIXES â”€â”€ */
.topbar {
  gap: 16px;
}

.topbar .global-search-wrap {
  flex: 1;
  max-width: 320px;
  min-width: 180px;
}

.topbar .global-search-wrap input#globalSearch {
  background: var(--surface2) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
  padding: 6px 10px 6px 32px !important;
}

.topbar .global-search-wrap input#globalSearch:focus {
  background: var(--surface) !important;
  border-color: var(--teal) !important;
  box-shadow: 0 0 0 3px var(--teal-bg) !important;
}

  /* --- USER REQUESTED MODAL CSS --- */
  .form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 11px;
  }

  .field {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }

  .field label {
    font-size: 11.5px;
    color: var(--text2);
    font-weight: 500;
  }

  .modal {
    position: fixed;
    inset: 0;
    background: rgba(26, 25, 22, .4);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 50;
    backdrop-filter: blur(2px);
  }

  .modal.show {
    display: flex;
  }

  .modal-card {
    width: min(840px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: 0 8px 36px rgba(0, 0, 0, .12);
  }

  /* --- MODERN THEME REDESIGN OVERRIDES --- */
  .tableWrap {
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
  }

  .tableWrap table th {
    color: var(--text3);
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    background: var(--surface2);
  }

  .tableWrap table td {
    padding: 16px 14px;
    border-bottom: 1px solid var(--border);
    background: transparent;
  }

  .detailBox,
  .detail-box {
    padding: 24px;
    border-radius: 12px;
    background: var(--surface2) !important;
    border: 1px solid var(--border);
  }

  .metricRow,
  .metric-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
  }

  .metricChip,
  .metric-chip {
    padding: 16px !important;
    border-radius: 8px !important;
    border: 1px solid var(--border) !important;
    background: var(--surface) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02) !important;
  }

  .metricChip .k,
  .metric-chip .k {
    font-size: 12px;
    color: var(--text3);
  }

  .metricChip .v,
  .metric-chip .v {
    font-size: 20px;
    margin-top: 6px;
    color: var(--text);
  }

  .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
  }

  .badge.badge-ok {
    background-color: var(--teal-bg);
    color: var(--teal);
  }

  .badge.badge-warn {
    background-color: rgba(245, 158, 11, 0.15);
    color: #d97706;
  }

  .badge.badge-danger {
    background-color: rgba(239, 68, 68, 0.15);
    color: #ef4444;
  }

  .btn.secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
  }

  .btn.danger {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #ef4444 !important;
    border-color: rgba(239, 68, 68, 0.2) !important;
  }

  /* --- INTL-TEL-INPUT DARK MODE FIXES --- */
  [data-theme="dark"] .iti__country-list {
    background-color: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  }
  
  [data-theme="dark"] .iti__country-list .iti__country:hover,
  [data-theme="dark"] .iti__country-list .iti__country.iti__highlight {
    background-color: var(--surface2);
  }
  
  [data-theme="dark"] .iti__country-list .iti__divider {
    border-bottom: 1px solid var(--border);
  }
  
  [data-theme="dark"] .iti__country-list .iti__dial-code {
    color: var(--text3);
  }

/* â”€â”€ ASSETS GRID VIEW â”€â”€ */
.assets-grid {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.assets-grid.active {
    display: grid;
}
.asset-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 18px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.asset-card:hover {
    border-color: var(--teal);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.asset-card.row-selected,
.asset-card.selected {
    border-color: var(--teal);
    box-shadow: 0 0 0 1px var(--teal);
}
.ac-head strong {
    font-size: 14px;
    color: var(--text);
    display: block;
    margin-bottom: 4px;
}
.ac-sub {
    font-size: 12px;
    color: var(--text3);
}
.ac-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
}
.ac-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.ac-label {
    font-size: 11px;
    color: var(--text3);
}
.ac-val {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}
.split.grid-mode {
    grid-template-columns: 1fr;
}
.split.grid-mode .detail-box {
    display: none;
}

/* â”€â”€ MOBILE RESPONSIVENESS OVERRIDES (iPHONE 13) â”€â”€ */
@media(max-width: 600px) {
  /* Modals & Forms */
  .modal-card {
    width: 100% !important;
    margin: 0 !important;
    border-radius: 12px !important;
    max-height: 98vh !important;
  }
  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }
  .modal-body {
    padding: 16px !important;
  }
  
  /* Topbar Adjustments */
  .topbar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
  }
  .topbar .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    width: 100%;
    justify-content: flex-end;
  }
  .topbar .user-email,
  .topbar .tag,
  .topbar .btn-label {
    display: none !important;
  }
  #loadDataBtn {
    font-size: 0 !important; 
    padding: 8px !important;
  }
  #loadDataBtn svg {
    margin: 0;
  }
  #exportBtn {
    padding: 8px !important;
  }
  
  /* Tables & Split view */
  .split {
    grid-template-columns: 1fr !important;
  }
  .detailBox, .detail-box {
    margin-top: 16px;
  }
  .tbl-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .tbl-wrap table th, .tbl-wrap table td {
    white-space: nowrap;
  }
  
  /* Hide non-essential columns on mobile */
  table th:nth-child(4),
  table td:nth-child(4),
  table th:nth-child(5),
  table td:nth-child(5) {
    display: none;
  }
  
  /* Ensure intl-tel-input fits */
  .iti {
    width: 100%;
  }
  
  /* FullCalendar Adjustments */
  .fc-header-toolbar {
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center !important;
  }
  .fc-toolbar-title {
    font-size: 1.2rem !important;
    text-align: center;
    width: 100%;
    order: -1; /* Move title to the top on mobile */
  }
  .fc-toolbar-chunk {
    display: flex;
    justify-content: center;
  }
  .fc-view-harness {
    min-height: 400px;
  }
}

/* â”€â”€ Switch Component â”€â”€ */
.switch input:checked + .slider {
    background-color: var(--teal) !important;
}
.switch input:checked + .slider .knob {
    transform: translateX(20px);
}
.switch input:focus + .slider {
    box-shadow: 0 0 1px var(--teal);
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   FASE 2 â€” RESPONSIVE MÃ“VIL: Sidebar, Topbar, Mobile-Nav
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* â”€â”€ sb-overlay: fondo oscuro cuando sidebar abierto en mÃ³vil â”€â”€ */
.sb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 29;
  backdrop-filter: blur(2px);
}

/* â”€â”€ Topbar: compacto en tablet (< 768px) â”€â”€ */
@media (max-width: 768px) {
  .topbar {
    padding: 0 12px;
    gap: 8px;
    min-height: 52px;
  }

  /* Ocultar elementos de baja prioridad en topbar */
  .user-email,
  .topbar .tag,
  .topbar .status-tag,
  .btn-label {
    display: none !important;
  }

  #exportBtn {
    padding: 7px !important;
  }

  #loadDataBtn {
    padding: 7px !important;
    font-size: 0 !important;
  }

  #loadDataBtn svg {
    margin: 0;
  }

  /* BÃºsqueda global mÃ¡s pequeÃ±a */
  .global-search-wrap {
    max-width: 160px;
  }

  /* Contenido con padding inferior para no tapar con mobile-nav */
  .content {
    padding-bottom: calc(var(--mobile-nav-h, 56px) + 12px);
  }

  /* FASE 5: TÃ¡ctil y Legibilidad */
  .input, .search-inp, .flt-sel, textarea, select, .btn:not(.btn-icon) {
    font-size: 14px !important;
    min-height: 44px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  
  .btn-icon {
    width: 44px;
    height: 44px;
  }
  
  .btn-icon svg {
    width: 18px;
    height: 18px;
  }

  /* SeparaciÃ³n mÃ­nima entre controles (8-12px) */
  .toolbar-l, .toolbar-r, .actions, .form-grid {
    gap: 12px !important;
  }
}

/* â”€â”€ Topbar: ultra compacto en mÃ³vil (< 480px) â”€â”€ */
@media (max-width: 480px) {
  .topbar {
    padding: 10px;
    gap: 10px;
    min-height: 48px;
    height: auto !important;
    flex-wrap: wrap !important;
  }

  /* BÃºsqueda global oculta en < 480px */
  .global-search-wrap {
    display: none !important;
  }

  .topbar-left {
    max-width: 100%;
    flex: 1;
  }

  .page-title {
    font-size: 13px;
  }

  /* Solo iconos en topbar */
  .topbar .actions {
    gap: 8px;
    width: 100%;
    justify-content: flex-end;
  }

  .content {
    padding: 10px 10px;
    padding-bottom: calc(var(--mobile-nav-h, 56px) + 10px);
  }

  /* Filtros no desbordan en mÃ³vil */
  .flt-sel {
    max-width: 100%;
  }

  /* Para el calendario y otras cards con controles en la cabecera */
  .card-head {
    flex-wrap: wrap;
    gap: 12px;
  }
  .card-head-right {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
    justify-content: flex-start !important;
  }
  .card-head-right::-webkit-scrollbar {
    height: 4px;
  }
  .card-head-right::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
  }
}

/* â”€â”€ Mobile-nav: visible en < 768px â”€â”€ */
@media (max-width: 768px) {
  .mobile-nav {
    display: flex;
  }

  /* Asegurar que el sidebar en mÃ³vil tiene buen z-index por encima del overlay */
  .sidebar {
    z-index: 31;
  }

  /* El sb-overlay se activa vÃ­a JS aÃ±adiendo clase .show */
  .sb-overlay.show {
    display: block;
  }
}

/* â”€â”€ Ajuste fino de mobile-nav en pantallas muy pequeÃ±as â”€â”€ */
@media (max-width: 360px) {
  .mob-nav-label {
    display: none;
  }

  .mob-nav-item {
    padding: 8px 2px;
  }
}

/* â”€â”€ OrientaciÃ³n horizontal en mÃ³vil â”€â”€ */
@media (max-height: 500px) and (orientation: landscape) {
  .mobile-nav {
    --mobile-nav-h: 44px;
  }

  .mob-nav-item {
    gap: 1px;
    padding: 4px;
  }

  .mob-nav-label {
    display: none;
  }

  .content {
    padding-bottom: calc(44px + 8px);
  }

  /* Topbar mÃ¡s compacto en landscape */
  .topbar {
}
.switch input:checked + .slider .knob {
    transform: translateX(20px);
}
.switch input:focus + .slider {
    box-shadow: 0 0 1px var(--teal);
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   FASE 2 â€” RESPONSIVE MÃ“VIL: Sidebar, Topbar, Mobile-Nav
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* â”€â”€ sb-overlay: fondo oscuro cuando sidebar abierto en mÃ³vil â”€â”€ */
.sb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 29;
  backdrop-filter: blur(2px);
}

/* â”€â”€ Topbar: compacto en tablet (< 768px) â”€â”€ */
@media (max-width: 768px) {
  .topbar {
    padding: 0 12px;
    gap: 8px;
    min-height: 52px;
  }

  /* Ocultar elementos de baja prioridad en topbar */
  .user-email,
  .topbar .tag,
  .topbar .status-tag,
  .btn-label {
    display: none !important;
  }

  #exportBtn {
    padding: 7px !important;
  }

  #loadDataBtn {
    padding: 7px !important;
    font-size: 0 !important;
  }

  #loadDataBtn svg {
    margin: 0;
  }

  /* BÃºsqueda global mÃ¡s pequeÃ±a */
  .global-search-wrap {
    max-width: 160px;
  }

  /* Contenido con padding inferior para no tapar con mobile-nav */
  .content {
    padding-bottom: calc(var(--mobile-nav-h, 56px) + 12px);
  }

  /* FASE 5: TÃ¡ctil y Legibilidad */
  .input, .search-inp, .flt-sel, textarea, select, .btn:not(.btn-icon) {
    font-size: 14px !important;
    min-height: 44px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  
  .btn-icon {
    width: 44px;
    height: 44px;
  }
  
  .btn-icon svg {
    width: 18px;
    height: 18px;
  }

  /* SeparaciÃ³n mÃ­nima entre controles (8-12px) */
  .toolbar-l, .toolbar-r, .actions, .form-grid {
    gap: 12px !important;
  }
}

/* â”€â”€ Topbar: ultra compacto en mÃ³vil (< 480px) â”€â”€ */
@media (max-width: 480px) {
  .topbar {
    padding: 10px;
    gap: 10px;
    min-height: 48px;
    height: auto !important;
    flex-wrap: wrap !important;
  }

  /* BÃºsqueda global oculta en < 480px */
  .global-search-wrap {
    display: none !important;
  }

  .topbar-left {
    max-width: 100%;
    flex: 1;
  }

  .page-title {
    font-size: 13px;
  }

  /* Solo iconos en topbar */
  .topbar .actions {
    gap: 8px;
    width: 100%;
    justify-content: flex-end;
  }

  .content {
    padding: 10px 10px;
    padding-bottom: calc(var(--mobile-nav-h, 56px) + 10px);
  }

  /* Filtros no desbordan en mÃ³vil */
  .flt-sel {
    max-width: 100%;
  }

  /* Para el calendario y otras cards con controles en la cabecera */
  .card-head {
    flex-wrap: wrap;
    gap: 12px;
  }
  .card-head-right {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
    justify-content: flex-start !important;
  }
  .card-head-right::-webkit-scrollbar {
    height: 4px;
  }
  .card-head-right::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
  }
}

/* â”€â”€ Mobile-nav: visible en < 768px â”€â”€ */
@media (max-width: 768px) {
  .mobile-nav {
    display: flex;
  }

  /* Asegurar que el sidebar en mÃ³vil tiene buen z-index por encima del overlay */
  .sidebar {
    z-index: 31;
  }

  /* El sb-overlay se activa vÃ­a JS aÃ±adiendo clase .show */
  .sb-overlay.show {
    display: block;
  }
}

/* â”€â”€ Ajuste fino de mobile-nav en pantallas muy pequeÃ±as â”€â”€ */
@media (max-width: 360px) {
  .mob-nav-label {
    display: none;
  }

  .mob-nav-item {
    padding: 8px 2px;
  }
}

/* â”€â”€ OrientaciÃ³n horizontal en mÃ³vil â”€â”€ */
@media (max-height: 500px) and (orientation: landscape) {
  .mobile-nav {
    --mobile-nav-h: 44px;
  }

  .mob-nav-item {
    gap: 1px;
    padding: 4px;
  }

  .mob-nav-label {
    display: none;
  }

  .content {
    padding-bottom: calc(44px + 8px);
  }

  /* Topbar mÃ¡s compacto en landscape */
  .topbar {
    min-height: 44px;
  }

  /* Reducir altura del chart en landscape */
  .chart-wrap {
    height: 180px !important;
  }
}

/* =========================================
   MARQUESINA PARA SUBTÃTULO EN MÃ“VIL
   ========================================= */
@media (max-width: 768px) {
  .subtitle-marquee {
    overflow: hidden;
    white-space: nowrap;
    width: 100%;
  }
  .topbar #headerSubtitle {
    display: inline-block;
    margin: 0;
    padding-left: 0;
    animation: none;
    text-overflow: clip;
    will-change: transform;
  }
  .topbar #headerSubtitle.marquee-active {
    animation: marquee-pingpong 6s ease-in-out infinite alternate;
  }
}

@keyframes marquee-pingpong {
  0%, 15% { transform: translateX(0); }
  85%, 100% { transform: translateX(var(--scroll-diff, 0px)); }
}

[data-theme="dark"] .fc-theme-standard .fc-scrollgrid, [data-theme="dark"] .fc-theme-standard td, [data-theme="dark"] .fc-theme-standard th { border-color: rgba(255, 255, 255, 0.1); } [data-theme="dark"] .fc { background: var(--bg-card); color: var(--text-color); } [data-theme="dark"] .fc-button-primary { background-color: var(--teal) !important; border-color: var(--teal) !important; } [data-theme="dark"] .fc-list-day-cushion { background: rgba(255, 255, 255, 0.05) !important; } [data-theme="dark"] .fc-list-event:hover td { background: rgba(255, 255, 255, 0.02) !important; }

/* Parte de Mantenimiento / ResoluciÃ³n */
.maintenance-report,
.incident-resolution {
    background: #f9f9f9;
    border: 1px solid #ddd;
    color: var(--text);
}

[data-theme="dark"] .maintenance-report,
[data-theme="dark"] .incident-resolution,
body.dark-mode .maintenance-report,
body.dark-mode .incident-resolution {
    background: var(--surface2);
    border-color: var(--border2);
    color: var(--text);
}

[data-theme="dark"] .maintenance-report strong,
[data-theme="dark"] .maintenance-report p,
[data-theme="dark"] .maintenance-report span,
[data-theme="dark"] .incident-resolution strong,
[data-theme="dark"] .incident-resolution p,
[data-theme="dark"] .incident-resolution span {
    color: var(--text);
}

[data-theme="dark"] .maintenance-report .label,
[data-theme="dark"] .incident-resolution .label {
    color: var(--text2);
}

[data-theme="dark"] .resolution-modal input,
[data-theme="dark"] .resolution-modal textarea,
[data-theme="dark"] .resolution-modal select {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

/* Filtros de calendario */
.calendar-filter {
    padding: 4px 8px;
    border-radius: 6px;
    background: #ffffff;
    color: #1a1916;
    border: 1px solid #e0ddd8;
    font-size: 0.85em;
    width: auto;
    max-width: 100%;
    cursor: pointer;
    outline: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

[data-theme="dark"] .calendar-filter,
body.dark-mode .calendar-filter {
    background-color: var(--surface2);
    color: var(--text);
    border: 1px solid var(--border2);
    color-scheme: dark;
}

[data-theme="dark"] .calendar-filter option,
body.dark-mode .calendar-filter option {
    background-color: var(--surface2);
    color: var(--text);
}

[data-theme="dark"] .calendar-filter option:checked,
body.dark-mode .calendar-filter option:checked {
    background-color: var(--teal);
    color: #ffffff;
}

[data-theme="dark"] .calendar-filter:focus,
body.dark-mode .calendar-filter:focus {
    border-color: var(--teal);
    outline: none;
    box-shadow: 0 0 0 2px rgba(32, 176, 127, 0.2);
}

@media (max-width: 768px) {
    .calendar-filter {
        width: 100%;
        min-height: 42px;
    }
}

/* Selects del modal de Nuevo Evento en modo oscuro */
[data-theme="dark"] #eventModal select,
body.dark-mode #eventModal select {
    background-color: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    color-scheme: dark;
}

[data-theme="dark"] #eventModal select option,
body.dark-mode #eventModal select option {
    background-color: var(--surface);
    color: var(--text);
}

[data-theme="dark"] #eventModal select option:checked,
body.dark-mode #eventModal select option:checked {
    background-color: var(--teal);
    color: #ffffff;
}

/* Compatibilidad general para componentes nativos en modo oscuro */
[data-theme="dark"], body.dark-mode {
    color-scheme: dark;
}
/* Resolucion de incidencias */
.incident-resolution-report,
.resolution-history,
.resolution-text,
.resolution-field-value,
.maintenance-report,
.parte-resolucion {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;

    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.incident-resolution-report p,
.incident-resolution-report div,
.incident-resolution-report span,
.resolution-history p,
.resolution-history div,
.resolution-history span,
.maintenance-report p,
.maintenance-report div,
.maintenance-report span,
.parte-resolucion p,
.parte-resolucion div,
.parte-resolucion span {
    max-width: 100%;
    min-width: 0;

    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.incident-resolution-grid,
.resolution-report-grid,
.maintenance-report-grid {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.incident-resolution-grid > *,
.resolution-report-grid > *,
.maintenance-report-grid > * {
    min-width: 0;
    max-width: 100%;
}

.resolution-modal textarea,
.resolve-incident-form textarea,
.incident-resolution-form textarea {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 90px;
    box-sizing: border-box;

    resize: vertical;

    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

@media (max-width: 768px) {
    .incident-resolution-report,
    .resolution-history,
    .maintenance-report,
    .parte-resolucion {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
    }

    .incident-resolution-grid,
    .resolution-report-grid,
    .maintenance-report-grid {
        grid-template-columns: 1fr;
    }

    .incident-resolution-report *,
    .resolution-history *,
    .maintenance-report *,
    .parte-resolucion * {
        max-width: 100%;
        min-width: 0;
    }
}

[data-theme="dark"] .resolution-modal input,
[data-theme="dark"] .resolution-modal textarea,
[data-theme="dark"] .resolve-incident-form input,
[data-theme="dark"] .resolve-incident-form textarea,
body.dark-mode .resolution-modal input,
body.dark-mode .resolution-modal textarea {
    background-color: #171b26;
    color: #f5f7fb;
    border-color: #3a4255;
}

[data-theme="dark"] .resolution-modal input::placeholder,
[data-theme="dark"] .resolution-modal textarea::placeholder,
body.dark-mode .resolution-modal input::placeholder,
body.dark-mode .resolution-modal textarea::placeholder {
    color: #8f98aa;
}

/* â”€â”€ Incident Video Attachments â”€â”€ */
.incident-attachment-video {
    width: 100%;
    max-width: 400px;
    border-radius: 6px;
    margin-bottom: 8px;
    display: block;
}

.video-thumbnail {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ddd;
    display: inline-block;
    position: relative;
    background: #000;
    text-align: center;
    line-height: 40px;
    color: #fff;
    text-decoration: none;
}

.video-thumbnail:hover {
    color: #fff;
    opacity: 0.9;
}

@media (max-width: 768px) {
    .incident-attachment-video {
        max-width: 100%;
    }
}

/* â”€â”€ PaginaciÃ³n â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem 0 0.5rem 0;
    margin-top: 0.5rem;
    border-top: 1px solid var(--border);
    width: 100%;
}

.pagination-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.page-numbers {
    display: flex;
    gap: 4px;
    align-items: center;
}

.page-btn {
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--text-2);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.page-btn:hover:not(.disabled) {
    background: var(--bg-hover);
    color: var(--text);
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.page-btn.active {
    background: var(--teal);
    color: #fff;
    border-color: var(--teal);
    box-shadow: 0 2px 6px rgba(13,148,136,0.3);
}

.page-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: transparent;
    border-color: transparent;
}

.page-num {
    padding: 6px 10px;
    min-width: 34px;
    text-align: center;
}

.page-dots {
    color: var(--text-3);
    padding: 0 4px;
    font-weight: 600;
}

 
 / *   R e s p o n s i v e   U t i l i t y   C l a s s e s   * / 
 
 @ m e d i a ( m i n - w i d t h :   1 0 2 5 p x )   {   . d - d e s k t o p - n o n e   {   d i s p l a y :   n o n e   ! i m p o r t a n t ;   }   } 

/* Responsive Utility Classes */
@media(min-width: 1025px) { .d-desktop-none { display: none !important; } }
@media(max-width: 1024px) { .d-mobile-none { display: none !important; } }

/* -- DASHBOARD ALERTS SCROLL -- */

.dashboard-alerts-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    max-height: 520px; /* Adapted for 5-7 cards */
    overflow: hidden;
}

.dashboard-alerts-header {
    flex-shrink: 0;
}

.dashboard-alerts-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #b7bcc5 transparent;
}

.dashboard-alerts-scroll::-webkit-scrollbar {
    width: 7px;
}

.dashboard-alerts-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.dashboard-alerts-scroll::-webkit-scrollbar-thumb {
    background: #b7bcc5;
    border-radius: 999px;
}

[data-theme="dark"] .dashboard-alerts-scroll,
body.dark-mode .dashboard-alerts-scroll {
    scrollbar-color: #4b5568 transparent;
}

[data-theme="dark"] .dashboard-alerts-scroll::-webkit-scrollbar-thumb,
body.dark-mode .dashboard-alerts-scroll::-webkit-scrollbar-thumb {
    background: #4b5568;
}

.dashboard-alerts-scroll .item {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.dashboard-alerts-scroll .item,
.dashboard-alerts-scroll .item * {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.dashboard-alerts-scroll:has(.empty-state) {
    overflow-y: visible;
}

.dashboard-side-column, .ov-side {
    align-self: start;
    min-width: 0;
}

@media (max-width: 768px) {
    .dashboard-alerts-card {
        max-height: 400px;
    }
    .dashboard-alerts-scroll {
        -webkit-overflow-scrolling: touch;
    }
}

