/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #000000;
  --bg-secondary: #0f172a;
  --bg-tertiary: #1e293b;
  --bg-card: rgba(15, 23, 42, 0.5);
  --border-color: rgba(71, 85, 105, 0.5);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --cyan-500: #06b6d4;
  --cyan-400: #22d3ee;
  --blue-500: #3b82f6;
  --blue-400: #60a5fa;
  --purple-500: #a855f7;
  --purple-400: #c084fc;
  --green-500: #22c55e;
  --green-400: #4ade80;
  --amber-500: #f59e0b;
  --red-500: #ef4444;
}

body.light-theme {
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #e2e8f0;
  --bg-card: rgba(248, 250, 252, 0.8);
  --border-color: rgba(203, 213, 225, 0.8);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(to bottom right, var(--bg-primary), var(--bg-secondary));
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

.particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.3;
  pointer-events: none;
  z-index: 0;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s, visibility 0.5s;
}

.loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.loading-spinner {
  position: relative;
  width: 96px;
  height: 96px;
}

.spinner-ring {
  position: absolute;
  border-radius: 50%;
  border: 4px solid transparent;
}

.ring-1 {
  inset: 0;
  border-color: rgba(6, 182, 212, 0.3);
  animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.ring-2 {
  inset: 8px;
  border-top-color: var(--cyan-500);
  animation: spin 1s linear infinite;
}

.ring-3 {
  inset: 16px;
  border-right-color: var(--purple-500);
  animation: spin-slow 3s linear infinite;
}

.ring-4 {
  inset: 24px;
  border-bottom-color: var(--blue-500);
  animation: spin-slower 6s linear infinite;
}

.ring-5 {
  inset: 32px;
  border-left-color: var(--green-500);
  animation: spin 1s linear infinite;
}

.loading-text {
  margin-top: 1rem;
  color: var(--cyan-500);
  font-family: "Courier New", monospace;
  font-size: 0.875rem;
  letter-spacing: 0.1em;
}

@keyframes ping {
  75%,
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes spin-slow {
  to {
    transform: rotate(360deg);
  }
}

@keyframes spin-slower {
  to {
    transform: rotate(-360deg);
  }
}

.container {
  max-width: 1920px;
  margin: 0 auto;
  padding: 1rem;
  position: relative;
  z-index: 10;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-icon {
  font-size: 2rem;
  color: var(--cyan-500);
}

.logo-text {
  font-size: 1.25rem;
  font-weight: bold;
  background: linear-gradient(to right, var(--cyan-400), var(--blue-500));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  padding: 0.5rem 0.75rem;
  backdrop-filter: blur(10px);
}

.search-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.875rem;
  width: 160px;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.header-buttons {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-icon {
  background: transparent;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.2s;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  color: var(--text-primary);
}

.sidebar-trigger-btn {
  background: transparent;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.2s;
  position: relative;
  display: none;
  align-items: center;
  justify-content: center;
}

.sidebar-trigger-btn:hover {
  color: var(--text-primary);
}

@media (max-width: 1023px) {
  .sidebar-trigger-btn {
    display: flex;
  }
}

.notification-dot {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  width: 0.5rem;
  height: 0.5rem;
  background: var(--cyan-500);
  border-radius: 50%;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.user-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan-500);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
}

.icon {
  font-size: 1.25rem;
  color: currentColor;
}

.icon-small {
  font-size: 1rem;
}

.icon-cyan {
  color: var(--cyan-500);
}
.icon-blue {
  color: var(--blue-500);
}
.icon-purple {
  color: var(--purple-500);
}
.icon-green {
  color: var(--green-500);
}
.icon-amber {
  color: var(--amber-500);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 200px 1fr;
  }
}

@media (min-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 200px 1fr 320px;
  }
}

.sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  backdrop-filter: blur(10px);
  height: fit-content;
}

.sidebar-content {
  padding: 1rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: transparent;
  border: none;
  border-radius: 0.375rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.875rem;
  text-align: left;
  width: 100%;
}

.nav-item:hover {
  background: rgba(15, 23, 42, 0.7);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(15, 23, 42, 0.7);
  color: var(--cyan-400);
}

.sidebar-status {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.status-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: "Courier New", monospace;
  margin-bottom: 0.5rem;
}

.status-items {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.status-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.status-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.status-bar {
  height: 0.375rem;
  background: var(--bg-tertiary);
  border-radius: 9999px;
  overflow: hidden;
}

.status-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.3s;
}

.status-cyan {
  background: linear-gradient(to right, var(--cyan-500), var(--blue-500));
}
.status-green {
  background: linear-gradient(to right, var(--green-500), #10b981);
}
.status-blue {
  background: linear-gradient(to right, var(--blue-500), #6366f1);
}

.status-value {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  backdrop-filter: blur(10px);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  font-size: 1rem;
}

.card-content {
  padding: 1.5rem;
}

.card-content.no-padding {
  padding: 0;
}

.card-footer {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid;
}

.badge-live {
  background: rgba(6, 182, 212, 0.1);
  color: var(--cyan-400);
  border-color: rgba(6, 182, 212, 0.5);
}

.badge-info {
  background: rgba(59, 130, 246, 0.1);
  color: var(--blue-400);
  border-color: rgba(59, 130, 246, 0.5);
}

.badge-success {
  background: rgba(34, 197, 94, 0.1);
  color: var(--green-400);
  border-color: rgba(34, 197, 94, 0.5);
}

.badge-primary {
  background: rgba(34, 197, 94, 0.1);
  color: var(--green-400);
  border-color: rgba(34, 197, 94, 0.5);
}

.badge-warning {
  background: rgba(234, 57, 8, 0.79);
  color: var(--amber-500);
  border-color: rgba(239, 53, 2, 0.895);
}

.pulse-dot {
  width: 0.375rem;
  height: 0.375rem;
  background: var(--cyan-500);
  border-radius: 50%;
  margin-right: 0.25rem;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.metrics-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (min-width: 640px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .metrics-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.metric-card {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid;
  border-radius: 0.5rem;
  padding: 1rem;
  position: relative;
  overflow: hidden;
}

.metric-cyan {
  border-color: rgba(6, 182, 212, 0.3);
}
.metric-purple {
  border-color: rgba(168, 85, 247, 0.3);
}
.metric-blue {
  border-color: rgba(59, 130, 246, 0.3);
}
.metric-red {
  border-color: rgba(247, 47, 47, 0.3);
}
.metric-violet {
  border-color: rgba(168, 85, 247, 0.3);
}

.metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.metric-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.metric-value {
  font-size: 2rem;
  font-weight: bold;
  line-height: 1;
  margin-bottom: 0.25rem;
  background: linear-gradient(to right, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.metric-detail {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.metric-trend {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
}

.icon-trend-up {
  color: var(--amber-500);
}
.icon-trend-down {
  color: var(--green-500);
  /* transform: rotate(180deg); */
}
.icon-trend-stable {
  color: var(--blue-500);
}

.tabs {
  margin-top: 2rem;
}

.tabs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.tabs-list {
  display: flex;
  background: rgba(30, 41, 59, 0.5);
  padding: 0.25rem;
  border-radius: 0.375rem;
  gap: 0.25rem;
}

.tab-trigger {
  padding: 0.5rem 1rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
  border-radius: 0.25rem;
  transition: all 0.2s;
}

.tab-trigger:hover {
  color: var(--text-primary);
}

.tab-trigger.active {
  background: var(--bg-tertiary);
  color: var(--cyan-400);
}

.chart-legend {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.legend-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
}

.legend-cyan {
  background: var(--cyan-500);
}
.legend-purple {
  background: var(--purple-500);
}
.legend-blue {
  background: var(--blue-500);
}

.tab-content {
  display: none;
  min-height: fit-content;
  max-height: max-content !important;
}

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

.chart-container {
  height: 16rem;
  width: 100%;
  background: rgba(30, 41, 59, 0.3);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  overflow: hidden;
  position: relative;
}

#performance-chart {
  width: 100%;
  height: 100%;
}

.table-container {
  background: rgba(30, 41, 59, 0.3);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  overflow: hidden;
}

.table-header {
  display: grid;
  grid-template-columns: 1fr 4fr 2fr 2fr 2fr 1fr;
  gap: 0.5rem;
  padding: 0.75rem;
  background: rgba(30, 41, 59, 0.5);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.table-body {
  max-height: 20rem;
  overflow-y: auto;
}

.table-row {
  display: grid;
  grid-template-columns: 1fr 4fr 2fr 2fr 2fr 1fr;
  gap: 0.5rem;
  padding: 0.75rem;
  font-size: 0.875rem;
  transition: background 0.2s;
  align-items: center;
}

.table-row:hover {
  background: rgba(30, 41, 59, 0.5);
}

.table-col-1 {
  grid-column: span 1;
}
.table-col-2 {
  grid-column: span 2;
}
.table-col-4 {
  grid-column: span 4;
}

.text-cyan {
  color: var(--cyan-400);
}
.text-purple {
  color: var(--purple-400);
}
.text-blue {
  color: var(--blue-400);
}
.text-muted {
  color: var(--text-muted);
}

.storage-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .storage-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.storage-item {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  padding: 0.75rem;
}

.storage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.storage-name {
  font-size: 0.875rem;
  color: var(--text-primary);
}

.storage-info {
  margin-bottom: 0.75rem;
}

.storage-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.storage-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.btn-text {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  transition: color 0.2s;
}

.btn-text:hover {
  color: var(--text-primary);
}

.progress-bar {
  height: 0.375rem;
  background: var(--bg-tertiary);
  border-radius: 9999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.3s;
}

.progress-cyan {
  background: var(--cyan-500);
}
.progress-purple {
  background: linear-gradient(to right, var(--purple-500), #ec4899);
}
.progress-blue {
  background: linear-gradient(to right, var(--blue-500), #6366f1);
}
.progress-success {
  background: var(--cyan-500);
}
.progress-warning {
  background: var(--amber-500);
}
.progress-danger {
  background: var(--red-500);
}
.progress-gradient-green {
  background: linear-gradient(to right, var(--green-500), var(--cyan-500));
}

.two-column-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

@media (min-width: 768px) {
  .two-column-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.security-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.security-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
}

.security-label {
  color: var(--text-secondary);
}

.security-update {
  color: var(--cyan-400);
  font-size: 0.875rem;
}

.security-level {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.security-level-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.alert-item {
  display: flex;
  gap: 0.75rem;
}

.alert-icon {
  flex-shrink: 0;
  margin-top: 0.125rem;
  padding: 0.25rem;
  border-radius: 9999px;
  border: 1px solid;
}

.alert-icon-info {
  color: var(--blue-500);
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
}

.alert-icon-warning {
  color: var(--amber-500);
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
}

.alert-icon-success {
  color: var(--green-500);
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
}

.alert-icon-update {
  color: var(--cyan-500);
  background: rgba(6, 182, 212, 0.1);
  border-color: rgba(6, 182, 212, 0.3);
}

.alert-content {
  flex: 1;
}

.alert-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.alert-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

.alert-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.alert-description {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.messages-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.message-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: 0.375rem;
  position: relative;
}

.message-unread {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--border-color);
}

.message-avatar {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan-500);
  font-weight: 600;
  font-size: 0.875rem;
}

.message-content {
  flex: 1;
  min-width: 0;
}

.message-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.message-sender {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

.message-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.message-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.message-indicator {
  flex-shrink: 0;
  width: 0.5rem;
  height: 0.5rem;
  background: var(--cyan-500);
  border-radius: 50%;
  align-self: center;
}

.message-input {
  flex: 1;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s;
}

.message-input:focus {
  border-color: var(--cyan-500);
}

.message-input::placeholder {
  color: var(--text-muted);
}

.btn-primary {
  background: var(--blue-500);
}

.btn-primary:hover {
  background: #2563eb;
}

.btn-secondary {
  color: var(--text-primary);
  background: var(--cyan-500);
}

.btn-secondary:hover {
  background: #0891b2;
}

.right-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
}

@media (max-width: 1023px) {
  .sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: 320px;
    max-width: 85vw;
    background: var(--bg-secondary);
    z-index: 1000;
    transition: right 0.3s ease;
    overflow-y: auto;
    padding: 1rem;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.5);
  }

  .sidebar.active {
    right: 0;
  }
}

.user-dropdown {
  display: none; 
  position: absolute; 
  top: 8%; 
  right: 0; 
  background-color: #fff; 
  border: 1px solid #ddd; 
  border-radius: 4px; 
  box-shadow: 0 2px 8px rgba(0,0,0,0.1); 
  min-width: 150px; 
  z-index: 1000; 
  list-style: none; 
  padding: 0; 
  margin: 0;
  cursor: pointer;
}

.user-list {
  display: block; 
  padding: 10px 15px; 
  color: #333; 
  text-decoration: none; 
  font-size: 14px;
}

.sidebar-close-btn {
  display: none;
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
  z-index: 10;
}

.sidebar-close-btn:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

/* Modal styles: replace the JS-style config with CSS rules */
.receipt-modal {
  position: relative;
  z-index: 10000;
  position:fixed;
  top:0;
  left:0;
  width:100%;
  height:100%;
  z-index:2147483647;
  background:rgba(0,0,0,0.6);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:1rem;
}

/* overlay (backdrop) for modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-dialog{
  max-width:720px;
  width:50%;
  margin:0;
  position:relative; 
  background:#fff !important; 
  color:#000 !important; 
  box-shadow: 0 8px 24px rgba(0,0,0,0.25); 
  border-radius:6px; 
  overflow:hidden;
}

/* modal content */
.modal-content {
  position: absolute;
  top: 40px;
  left: 40px;
  right: 40px;
  bottom: 40px;
  border: 1px solid #ccc;
  background: #fff;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 4px;
  outline: none;
  padding: 20px;
}

@media (max-width: 1023px) {
  .sidebar-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .modal-dialog {
    width: 90% !important;
  }
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

.time-display {
  background: linear-gradient(to bottom right, var(--bg-tertiary), var(--bg-secondary));
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  text-align: center;
}

.time-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: "Courier New", monospace;
  margin-bottom: 0.25rem;
}

.time-value {
  font-size: 1.875rem;
  font-family: "Courier New", monospace;
  color: var(--cyan-400);
  margin-bottom: 0.25rem;
}

.date-value {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.time-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  padding: 1rem;
}

.time-detail-item {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  padding: 0.75rem;
}

.detail-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.detail-value {
  font-size: 0.875rem;
  font-family: "Courier New", monospace;
  color: var(--text-primary);
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.action-btn {
  height: auto;
  padding: 0.75rem;
  border: 1px solid var(1fr);
  gap: 0.75rem;
}

.action-btn {
  height: auto;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  background: rgba(30, 41, 59, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background 0.2s;
  color: var(--text-primary);
}

.action-btn:hover {
  background: rgba(51, 65, 85, 0.5);
}

.action-btn .icon {
  color: var(--cyan-500);
}

.action-btn span {
  font-size: 0.75rem;
}

.resource-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.resource-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.resource-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
}

.resource-label {
  color: var(--text-secondary);
}

.resource-value {
  font-size: 0.75rem;
}

.resource-priority {
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color);
}

.priority-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.priority-label {
  color: var(--text-secondary);
}

.priority-value {
  font-weight: 500;
}

.priority-slider {
  width: 100%;
  height: 0.375rem;
  border-radius: 9999px;
  background: var(--bg-tertiary);
  outline: none;
  -webkit-appearance: none;
}

.priority-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--cyan-500);
  cursor: pointer;
}

.priority-slider::-moz-range-thumb {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--cyan-500);
  cursor: pointer;
  border: none;
}

.controls-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

.control-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 2.5rem;
  height: 1.25rem;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  transition: 0.3s;
  border-radius: 9999px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 0.875rem;
  width: 0.875rem;
  left: 0.125rem;
  bottom: 0.125rem;
  background-color: var(--text-muted);
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: var(--cyan-500);
  border-color: var(--cyan-500);
}

input:checked + .toggle-slider:before {
  transform: translateX(1.25rem);
  background-color: white;
}

.main-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@media (max-width: 768px) {
  .search-box {
    display: none;
  }

  .table-header,
  .table-row {
    grid-template-columns: 1fr 3fr 2fr;
  }

  .table-col-2:nth-child(4),
  .table-col-2:nth-child(5) {
    display: none;
  }

  .chart-legend {
    font-size: 0.625rem;
    gap: 0.5rem;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0.5rem;
  }

  .header {
    padding: 0.5rem 0;
  }

  .card-content {
    padding: 1rem;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }
  .message-input {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s;
  }
}

.hidden {
  display: none !important;
}

body {
  transition: background 0.3s ease, color 0.3s ease;
}

.card,
.sidebar,
.right-sidebar,
.metric-card,
.storage-item,
.table-container,
.chart-container {
  transition: background 0.3s ease, border-color 0.3s ease;
}
