/* Dashboard Styles - uses --navbar-height from globals.css */

/* Navbar */
body.has-sidebar .navbar {
  height: var(--navbar-height);
  min-height: var(--navbar-height);
  max-height: var(--navbar-height);
}

body.has-sidebar .navbar-brand {
  min-height: var(--navbar-height);
}

.main-content {
  flex: 1;
  min-height: calc(100vh - var(--navbar-height));
}

.main-content.is-flex-column {
  display: flex;
  flex-direction: column;
}

.dashboard-section {
  --bulma-section-padding: 2rem 0.75rem;
  --bulma-section-padding-desktop: 2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.main-content.is-flex-column .dashboard-section {
  overflow-y: auto;
}

/* Dashboard navbar on mobile - ensure proper alignment */
@media screen and (max-width: 1023px) {
  body.has-sidebar .navbar-brand {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  body.has-sidebar .mobile-sidebar-toggle {
    margin-left: 0.5rem;
    margin-right: 0;
    order: -1;
  }

  body.has-sidebar .navbar-brand .navbar-item {
    margin-left: 0;
    padding-left: 0.25rem;
  }

  body.has-sidebar .navbar-brand-end {
    margin-left: auto;
    display: flex;
    align-items: center;
  }
}

/* ==========================================================================
   Profile
   ========================================================================== */

/* ==========================================================================
   End Profile
   ========================================================================== */

/* ==========================================================================
   Account / Team Members
   ========================================================================== */



.member-card:last-child {
  margin-bottom: 0 !important;
}

.member-card .member-avatar-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-weight: 600;
  font-size: 0.875rem;
}

.member-card .member-info {
  min-width: 0;
}

.member-card .member-info p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-card .role-form {
  margin: 0;
}

/* Responsive adjustments for member cards */
@media screen and (max-width: 768px) {
  .member-card .is-flex {
    flex-direction: column;
    align-items: flex-start !important;
  }

  .member-actions {
    width: 100%;
    justify-content: flex-start;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
  }

  .member-info p {
    white-space: normal;
  }
}

/* ==========================================================================
    End Account / Team Members
    ========================================================================== */

/* Admin Stats Boxes - Light mode */
.box.stat-box-info {
  background-color: #eff5fb;
  color: #296fa8;
}

.box.stat-box-danger {
  background-color: #feecf0;
  color: #cc0f35;
}

.box.stat-box-warning {
  background-color: #fffaeb;
  color: #946c00;
}

.box.stat-box-success {
  background-color: #effaf5;
  color: #257953;
}
.box.stat-box-primary {
  background-color: #f3f0ff;
  color: #6b46c1;
}

/* Admin Stats Boxes - Dark mode */
[data-theme="dark"] .box.stat-box-info {
  background-color: #1a3a52;
  color: #8fc4e8;
  border-color: #8fc4e8;
}

[data-theme="dark"] .box.stat-box-danger {
  background-color: #4a1e28;
  color: #ff6b8a;
  border-color: #ff6b8a;
}

[data-theme="dark"] .box.stat-box-warning {
  background-color: #4a3a1a;
  color: #ffe08a;
  border-color: #ffe08a;
}

[data-theme="dark"] .box.stat-box-success {
  background-color: #1a4a2e;
  color: #72dda4;
  border-color: #72dda4;
}

[data-theme="dark"] .box.stat-box-primary {
  background-color: #2d1b4e;
  color: #a78bfa;
  border-color: #a78bfa;
}

/* Ensure text is readable in stat boxes */
.box.stat-box-info .heading,
.box.stat-box-danger .heading,
.box.stat-box-warning .heading,
.box.stat-box-success .heading {
  opacity: 0.8;
}

[data-theme="dark"] .box.stat-box-info .title,
[data-theme="dark"] .box.stat-box-danger .title,
[data-theme="dark"] .box.stat-box-warning .title,
[data-theme="dark"] .box.stat-box-success .title {
  color: inherit;
}

/* Clickable stat boxes */
.clickable-stat-box {
  text-decoration: none;
  display: block;
}

.clickable-stat-box .box {
  cursor: pointer;
}

/* Country dropdown */
.country-dropdown-menu .dropdown-content {
  overflow-y: auto;
}

.country-dropdown .dropdown-menu {
  display: flex;
  width: 100%;
}

.country-dropdown-menu .dropdown-item {
  font-size: 1.1rem;
}

.country-dropdown .button > span {
  font-size: 1.1rem;
}

.country-dropdown .dropdown-trigger {
  display: flex;
  width: 100%;
}

div.dropdown.country-dropdown {
  display: flex;
  width: 100%;
}

.country-dropdown .dropdown-trigger .button {
  flex: 1;
  width: 100%;
  min-width: 0;
  text-align: left;
  justify-content: flex-start;
}

/* ==========================================================================
   Dashboard Home Page
   ========================================================================== */

/* ── Welcome / Empty State ── */

.dashboard-welcome {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 6rem;
}

.dashboard-welcome-card {
  text-align: center;
  max-width: 480px;
}

.dashboard-welcome-icon {
  width: 88px;
  height: 88px;
  margin: 0 auto 1.75rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--bulma-size-large);
  color: white;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

[data-theme="dark"] .dashboard-welcome-icon {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.25);
}

/* ── Stats Row ── */

.dashboard-stats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.dashboard-stat-card {
  flex: 1;
  min-width: 160px;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: white;
  border-radius: 10px;
  padding: 1.15rem 1.25rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.dashboard-stat-card:hover {
  border-color: #d1d5db;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .dashboard-stat-card {
  background: #1f2937;
  border-color: #374151;
}

[data-theme="dark"] .dashboard-stat-card:hover {
  border-color: #4b5563;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25), 0 2px 4px rgba(0, 0, 0, 0.15);
}

.dashboard-stat-card .stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--bulma-size-medium);
  flex-shrink: 0;
}

.dashboard-stat-card.is-servers .stat-icon {
  background: #eff6ff;
  color: #3b82f6;
}

.dashboard-stat-card.is-ips .stat-icon {
  background: #f5f3ff;
  color: #7c3aed;
}

.dashboard-stat-card.is-tickets .stat-icon {
  background: #fffbeb;
  color: #f59e0b;
}

.dashboard-stat-card.is-tickets-clear .stat-icon {
  background: #f5f5f5;
  color: #9ca3af;
}

.dashboard-stat-card.is-invoices .stat-icon {
  background: #fef2f2;
  color: #ef4444;
}

.dashboard-stat-card.is-invoices-clear .stat-icon {
  background: #ecfdf5;
  color: #10b981;
}

[data-theme="dark"] .dashboard-stat-card.is-servers .stat-icon {
  background: #1e3a5f;
  color: #60a5fa;
}

[data-theme="dark"] .dashboard-stat-card.is-ips .stat-icon {
  background: #2e1065;
  color: #a78bfa;
}

[data-theme="dark"] .dashboard-stat-card.is-tickets .stat-icon {
  background: #451a03;
  color: #fbbf24;
}

[data-theme="dark"] .dashboard-stat-card.is-tickets-clear .stat-icon {
  background: #1f1f1f;
  color: #6b7280;
}

[data-theme="dark"] .dashboard-stat-card.is-invoices .stat-icon {
  background: #450a0a;
  color: #f87171;
}

[data-theme="dark"] .dashboard-stat-card.is-invoices-clear .stat-icon {
  background: #064e3b;
  color: #34d399;
}

.dashboard-stat-card .stat-info {
  display: flex;
  flex-direction: column;
}

.dashboard-stat-card .stat-value {
  font-size: var(--bulma-size-large);
  font-weight: 700;
  line-height: 1.1;
  color: #111827;
}

[data-theme="dark"] .dashboard-stat-card .stat-value {
  color: #f3f4f6;
}

.dashboard-stat-card .stat-label {
  font-size: var(--bulma-size-small);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  font-weight: 500;
  margin-top: 0.15rem;
}

[data-theme="dark"] .dashboard-stat-card .stat-label {
  color: #9ca3af;
}

/* ── Detail Cards ── */

.dashboard-card {
  background: white;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

[data-theme="dark"] .dashboard-card {
  background: #1f2937;
  border-color: #374151;
}

.dashboard-card-header {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  border-bottom: 1px solid #f3f4f6;
}

[data-theme="dark"] .dashboard-card-header {
  border-color: #374151;
}

.dashboard-card-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--bulma-size-medium);
  font-weight: 600;
  color: #1f2937;
}

[data-theme="dark"] .dashboard-card-header-left {
  color: #f3f4f6;
}

.dashboard-card-header-left .icon {
  color: #6b7280;
}

[data-theme="dark"] .dashboard-card-header-left .icon {
  color: #9ca3af;
}

.dashboard-card-title {
  font-weight: 600;
  font-size: var(--bulma-size-medium);
  margin: 0;
  color: #1f2937;
}

[data-theme="dark"] .dashboard-card-title {
  color: #f3f4f6;
}

/* ── Count Badge (matches vm-count-badge exactly) ── */

.dashboard-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #e5e7eb;
  color: #6b7280;
  font-weight: 600;
  font-size: var(--bulma-size-small);
  padding: 0 0.4rem;
}

[data-theme="dark"] .dashboard-count-badge {
  background: #374151;
  color: #9ca3af;
}

.dashboard-card-body {
  padding: 1.25rem;
  flex: 1;
}

.dashboard-card-body.is-paddingless {
  padding: 0;
}

.dashboard-card-footer {
  padding: 0.625rem 1.25rem;
  border-top: 1px solid #f3f4f6;
  background: #fafafa;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: var(--bulma-size-normal);
  color: #6b7280;
}

[data-theme="dark"] .dashboard-card-footer {
  border-color: #374151;
  background: #1a1f2e;
  color: #6b7280;
}

.dashboard-card-footer a {
  color: #6b7280;
  text-decoration: none;
}

.dashboard-card-footer a:hover {
  color: #3b82f6;
}

[data-theme="dark"] .dashboard-card-footer a {
  color: #9ca3af;
}

[data-theme="dark"] .dashboard-card-footer a:hover {
  color: #60a5fa;
}

/* ── VM Rows (Servers Section) ── */

.dashboard-vm-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  transition: background-color 0.12s ease;
}

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

.dashboard-vm-row:hover {
  background-color: #f9fafb;
}

[data-theme="dark"] .dashboard-vm-row {
  border-color: #374151;
}

[data-theme="dark"] .dashboard-vm-row:hover {
  background-color: #263044;
}

.dashboard-vm-os {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dashboard-vm-os img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

[data-theme="dark"] .dashboard-vm-os img[alt="OpenBSD"] {
  filter: invert(1);
}

.dashboard-vm-os .fa-server {
  font-size: var(--bulma-size-normal);
  color: #9ca3af;
}

[data-theme="dark"] .dashboard-vm-os .fa-server {
  color: #6b7280;
}

.dashboard-vm-info {
  flex: 1;
  min-width: 100px;
}

.dashboard-vm-name {
  font-weight: 600;
  font-size: var(--bulma-size-normal);
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

[data-theme="dark"] .dashboard-vm-name {
  color: #f3f4f6;
}

.dashboard-vm-status {
  flex-shrink: 0;
  padding-right: 0.5rem;
}

/* ── Billing Rows ── */

.dashboard-billing-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--bulma-size-normal);
  color: #374151;
  line-height: 1.5;
}

[data-theme="dark"] .dashboard-billing-row {
  color: #d1d5db;
}

.dashboard-billing-row .icon {
  flex-shrink: 0;
  width: 1.25rem;
  text-align: center;
}

.dashboard-billing-row.is-success .icon { color: #10b981; }
.dashboard-billing-row.is-warning .icon { color: #f59e0b; }
.dashboard-billing-row.is-danger  .icon { color: #ef4444; }

[data-theme="dark"] .dashboard-billing-row.is-success .icon { color: #34d399; }
[data-theme="dark"] .dashboard-billing-row.is-warning .icon { color: #fbbf24; }
[data-theme="dark"] .dashboard-billing-row.is-danger  .icon { color: #f87171; }

.dashboard-billing-divider {
  height: 1px;
  background: #f3f4f6;
  margin: 0.75rem 0;
}

[data-theme="dark"] .dashboard-billing-divider {
  background: #374151;
}

.dashboard-billing-invoice {
  border-radius: 6px;
  padding: 0.5rem;
  margin: -0.5rem;
  margin-top: 0.25rem;
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.dashboard-billing-invoice:hover {
  background-color: #f9fafb;
}

[data-theme="dark"] .dashboard-billing-invoice:hover {
  background-color: #263044;
}

.dashboard-billing-invoice-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: var(--bulma-size-normal);
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 0.35rem;
}

[data-theme="dark"] .dashboard-billing-invoice-header {
  color: #9ca3af;
}

.dashboard-billing-invoice-details {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: var(--bulma-size-normal);
  color: #6b7280;
}

[data-theme="dark"] .dashboard-billing-invoice-details {
  color: #9ca3af;
}

.dashboard-billing-invoice-details code {
  background: #f3f4f6;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  font-size: var(--bulma-size-small);
  color: #374151;
}

[data-theme="dark"] .dashboard-billing-invoice-details code {
  background: #374151;
  color: #d1d5db;
}

.dashboard-billing-invoice-total {
  font-size: var(--bulma-size-medium);
  font-weight: 700;
  color: #111827;
  margin-top: 0.25rem;
}

[data-theme="dark"] .dashboard-billing-invoice-total {
  color: #f3f4f6;
}

/* ── Ticket Rows ── */

.dashboard-ticket-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  transition: background-color 0.12s ease;
}

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

.dashboard-ticket-row:hover {
  background-color: #f9fafb;
}

[data-theme="dark"] .dashboard-ticket-row {
  border-color: #374151;
}

[data-theme="dark"] .dashboard-ticket-row:hover {
  background-color: #263044;
}

.dashboard-ticket-number {
  background: #f3f4f6;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: var(--bulma-size-small);
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  white-space: nowrap;
  color: #374151;
  flex-shrink: 0;
}

[data-theme="dark"] .dashboard-ticket-number {
  background: #374151;
  color: #d1d5db;
}

.dashboard-ticket-subject {
  flex: 1;
  min-width: 0;
  font-size: var(--bulma-size-normal);
  color: #374151;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-theme="dark"] .dashboard-ticket-subject {
  color: #d1d5db;
}

.dashboard-ticket-status {
  flex-shrink: 0;
}

/* ── Column Layouts ── */

.dashboard-left-column {
  display: flex;
  flex-direction: column;
}

.dashboard-right-column {
  display: flex;
  flex-direction: column;
}

.dashboard-card-grow {
  flex: 1;
}

/* ── VM Resources (spec tags in server rows) ── */

.dashboard-vm-resources {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ── Action Links (widget-style, replaces standard buttons) ── */

.dashboard-action-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  font-size: var(--bulma-size-small);
  font-weight: 500;
  color: #3b82f6;
  background: #eff6ff;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.dashboard-action-link:hover {
  background: #dbeafe;
  color: #2563eb;
}

[data-theme="dark"] .dashboard-action-link {
  color: #60a5fa;
  background: #1e3a5f;
}

[data-theme="dark"] .dashboard-action-link:hover {
  background: #1e40af;
  color: #93bbfd;
}

/* ── Overview Layout (flex column to fill viewport) ── */

.dashboard-overview {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.dashboard-overview > .columns {
  flex: 3;
}

.dashboard-overview > .dashboard-card {
  flex: 2;
}


/* ── Servers Empty State ── */

.dashboard-servers-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.25rem;
}

.dashboard-servers-empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #eff6ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--bulma-size-medium);
  color: #3b82f6;
  margin-bottom: 0.75rem;
}

[data-theme="dark"] .dashboard-servers-empty-icon {
  background: #1e3a5f;
  color: #60a5fa;
}

.dashboard-servers-empty-text {
  font-size: var(--bulma-size-normal);
  color: #6b7280;
}

[data-theme="dark"] .dashboard-servers-empty-text {
  color: #9ca3af;
}

/* ── Tickets Empty State ── */

.dashboard-tickets-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.25rem;
}

.dashboard-tickets-empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #ecfdf5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--bulma-size-medium);
  color: #10b981;
  margin-bottom: 0.75rem;
}

[data-theme="dark"] .dashboard-tickets-empty-icon {
  background: #064e3b;
  color: #34d399;
}

.dashboard-tickets-empty-text {
  font-size: var(--bulma-size-normal);
  color: #6b7280;
}

[data-theme="dark"] .dashboard-tickets-empty-text {
  color: #9ca3af;
}

/* ── Responsive ── */

@media screen and (max-width: 1350px) {
  .dashboard-vm-resources {
    display: none;
  }
}

@media screen and (max-width: 768px) {
  .dashboard-welcome {
    padding-top: 4rem;
  }
}
