/* ===== Dashboard shell ===== */
.dash-body {
  background: var(--bg-soft);
}
.dash-shell {
  display: grid;
  grid-template-columns: 256px 1fr;
  min-height: 100vh;
}

/* ===== Sidebar ===== */
.dash-sidebar {
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.dash-sidebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 19px;
  font-weight: 700;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
}

.dash-nav {
  flex: 1;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}
.dash-nav-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 16px 12px 6px;
}
.dash-nav-label:first-child { padding-top: 4px; }

.dash-nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #475569;
  transition: background 0.15s ease, color 0.15s ease;
}
.dash-nav-link svg { flex-shrink: 0; opacity: 0.85; }
.dash-nav-link:hover {
  background: var(--bg-soft);
  color: var(--text-dark);
}
.dash-nav-link.active {
  background: var(--blue-pale-2);
  color: var(--blue);
  font-weight: 600;
}
.dash-nav-link.active svg { opacity: 1; }

.dash-nav-sub {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 2px 0 4px 34px;
  border-left: 1.5px solid var(--border);
  padding-left: 14px;
}
.dash-nav-sub a {
  font-size: 13px;
  color: var(--text-muted);
  padding: 6px 0;
}
.dash-nav-sub a:hover { color: var(--blue); }
.dash-nav-sub a.active { color: var(--blue); font-weight: 600; }

.dash-sidebar-footer {
  padding: 14px 14px 18px;
  border-top: 1px solid var(--border);
}
.dash-upgrade-card {
  background: var(--blue-pale-2);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 4px;
}
.dash-upgrade-card h4 {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 4px;
}
.dash-upgrade-card p {
  font-size: 11.5px;
  color: var(--text-body);
  line-height: 1.5;
  margin-bottom: 10px;
}
.dash-upgrade-card a {
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
}
.dash-upgrade-card a:hover { text-decoration: underline; }

/* ===== Main area ===== */
.dash-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dash-topbar {
  height: 64px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 20;
  gap: 16px;
}

.dash-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text-dark);
  flex-shrink: 0;
  cursor: pointer;
}
.dash-menu-btn:hover { background: var(--bg-soft); }

.dash-topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.dash-topbar-left h1 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-dark);
}
.dash-breadcrumb {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 1px;
}
.dash-breadcrumb a { color: var(--text-muted); }
.dash-breadcrumb a:hover { color: var(--blue); }

.dash-topbar-right {
  display: flex;
  align-items: center;
  gap: 18px;
}
.dash-icon-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  transition: background 0.15s ease;
}
.dash-icon-btn:hover { background: var(--bg-soft); }
.dash-icon-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  border: 1.5px solid #fff;
}
.dash-user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-left: 14px;
  border-left: 1px solid var(--border);
}
.dash-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dash-user-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dark);
}
.dash-user-role {
  font-size: 11.5px;
  color: var(--text-muted);
}

.dash-content {
  flex: 1;
  padding: 28px;
  max-width: 1280px;
}

/* ===== Stat cards ===== */
.dash-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}
.dash-stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
}
.dash-stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dash-stat-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--blue-pale-2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.dash-stat-delta {
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}
.dash-stat-delta-up { color: #15803d; background: #dcfce7; }
.dash-stat-delta-flat { color: #64748b; background: #f1f5f9; }
.dash-stat-num {
  display: block;
  font-size: 24px;
  font-weight: 800;
  color: var(--text-dark);
  margin-top: 14px;
}
.dash-stat-label {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===== Generic card / panel ===== */
.dash-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 24px;
}
.dash-card + .dash-card { margin-top: 20px; }
.dash-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.dash-card-head h2 {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-dark);
}
.dash-card-head-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}
.dash-card-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
}
.dash-card-link:hover { text-decoration: underline; }

.dash-grid-2 {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
}

/* ===== Server list (table-style rows) ===== */
.server-list {
  display: flex;
  flex-direction: column;
}
.server-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 4px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background 0.12s ease;
}
.server-row:last-child { border-bottom: none; }
.server-row:hover { background: var(--bg-soft); }
.server-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--blue-pale-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.server-row-main { flex: 1; min-width: 0; }
.server-row-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
}
.server-row-meta {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}
.server-row-specs {
  display: flex;
  gap: 18px;
  font-size: 12.5px;
  color: var(--text-body);
  flex-shrink: 0;
}
.server-row-specs span { white-space: nowrap; }
.server-row-status {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.status-running { color: #15803d; background: #dcfce7; }
.status-stopped { color: #b91c1c; background: #fee2e2; }
.status-rebooting { color: #b45309; background: #fef3c7; }
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status-running .status-dot {
  animation: dash-pulse 2s infinite;
}
@keyframes dash-pulse {
  0% { box-shadow: 0 0 0 0 rgba(21,128,61,0.5); }
  70% { box-shadow: 0 0 0 5px rgba(21,128,61,0); }
  100% { box-shadow: 0 0 0 0 rgba(21,128,61,0); }
}
.server-row-arrow {
  flex-shrink: 0;
  color: var(--text-muted);
}

/* ===== Filter / search bar ===== */
.dash-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.dash-search {
  position: relative;
  flex: 1;
  max-width: 320px;
}
.dash-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}
.dash-search input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  font-size: 13.5px;
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  outline: none;
}
.dash-search input:focus { border-color: var(--blue); }
.dash-filter-pills {
  display: flex;
  gap: 8px;
}
.dash-filter-pill {
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text-body);
  cursor: pointer;
}
.dash-filter-pill.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

/* ===== Usage meters (CPU/RAM/Disk bars) ===== */
.usage-meter { margin-bottom: 18px; }
.usage-meter:last-child { margin-bottom: 0; }
.usage-meter-head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 8px;
}
.usage-meter-label { font-weight: 600; color: var(--text-dark); }
.usage-meter-value { color: var(--text-muted); font-weight: 500; }
.usage-bar-track {
  height: 8px;
  border-radius: 5px;
  background: var(--border);
  overflow: hidden;
}
.usage-bar-fill {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--blue), #60a5fa);
}
.usage-bar-fill.usage-warn { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.usage-bar-fill.usage-danger { background: linear-gradient(90deg, #ef4444, #f87171); }

/* ===== Info grid (key-value pairs) ===== */
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 24px;
}
.info-item-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.info-item-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}
.info-item-value code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  background: var(--bg-soft);
  padding: 2px 8px;
  border-radius: 5px;
}
.copy-btn {
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  transition: color 0.15s ease;
}
.copy-btn:hover { color: var(--blue); }

/* ===== Action buttons row ===== */
.dash-action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.dash-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text-dark);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.dash-action-btn:hover { background: var(--bg-soft); }
.dash-action-btn.danger { color: #dc2626; border-color: #fecaca; }
.dash-action-btn.danger:hover { background: #fef2f2; }

/* ===== Tabs (server detail page) ===== */
.dash-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
}
.dash-tab {
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
}
.dash-tab.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

/* ===== Simple bar chart (CPU history) ===== */
.mini-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 70px;
}
.mini-chart-bar {
  flex: 1;
  border-radius: 2px 2px 0 0;
  background: var(--blue-pale);
}
.mini-chart-bar.peak { background: var(--blue); }

/* ===== Invoice / billing table ===== */
.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.dash-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 12px 12px;
  border-bottom: 1px solid var(--border);
}
.dash-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-body);
}
.dash-table tr:last-child td { border-bottom: none; }
.dash-table td.strong { color: var(--text-dark); font-weight: 600; }

.invoice-badge {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}
.invoice-paid { color: #15803d; background: #dcfce7; }
.invoice-due { color: #b45309; background: #fef3c7; }
.invoice-overdue { color: #b91c1c; background: #fee2e2; }

/* ===== Payment method card ===== */
.payment-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
}
.payment-card-icon {
  width: 42px;
  height: 30px;
  border-radius: 6px;
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.payment-card-info { flex: 1; }
.payment-card-number {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dark);
  font-family: 'JetBrains Mono', monospace;
}
.payment-card-expiry {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===== Ticket list ===== */
.ticket-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 4px;
  border-bottom: 1px solid var(--border);
}
.ticket-row:last-child { border-bottom: none; }
.ticket-priority {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.priority-high { background: #ef4444; }
.priority-medium { background: #f59e0b; }
.priority-low { background: #94a3b8; }
.ticket-row-main { flex: 1; min-width: 0; }
.ticket-row-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
}
.ticket-row-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}
.ticket-status {
  flex-shrink: 0;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 11px;
  border-radius: 20px;
}
.ticket-open { color: #b45309; background: #fef3c7; }
.ticket-resolved { color: #15803d; background: #dcfce7; }
.ticket-progress { color: #1d4ed8; background: var(--blue-pale-2); }

/* ===== Settings form sections ===== */
.settings-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.settings-row:last-child { border-bottom: none; }
.settings-row-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
}
.settings-row-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 3px;
  max-width: 360px;
}

.dash-form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.dash-form-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
}
.dash-form-field input,
.dash-form-field select,
.dash-form-field textarea {
  padding: 10px 13px;
  font-size: 13.5px;
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  outline: none;
}
.dash-form-field input:focus,
.dash-form-field select:focus,
.dash-form-field textarea:focus { border-color: var(--blue); }
.dash-form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ===== Toggle switch (reuse pattern) ===== */
.dash-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 20px;
  background: var(--border);
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s ease;
}
.dash-toggle.on { background: var(--blue); }
.dash-toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  transition: transform 0.2s ease;
}
.dash-toggle.on .dash-toggle-knob { transform: translateX(20px); }

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .dash-stats-row { grid-template-columns: repeat(2, 1fr); }
  .dash-grid-2 { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .dash-shell { grid-template-columns: 1fr; }

  .dash-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 272px;
    max-width: 82vw;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 0 0 0 0 rgba(0,0,0,0);
  }
  .dash-sidebar.open {
    transform: translateX(0);
    box-shadow: 20px 0 50px -20px rgba(15,23,42,0.25);
  }

  .dash-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.45);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  .dash-sidebar-overlay.open {
    opacity: 1;
    pointer-events: auto;
  }

  .dash-menu-btn {
    display: flex;
  }

  .server-row-specs { display: none; }
}

@media (min-width: 901px) {
  .dash-menu-btn { display: none; }
  .dash-sidebar-overlay { display: none; }
}

@media (max-width: 600px) {
  .dash-stats-row { grid-template-columns: 1fr; }
  .dash-content { padding: 18px; }
  .dash-form-row-2 { grid-template-columns: 1fr; }
  .settings-row { flex-direction: column; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .status-running .status-dot { animation: none; }
  .dash-sidebar, .dash-sidebar-overlay { transition: none; }
}

.graph-timeframe{
    padding:6px 10px;
    border:1px solid #dbe2ea;
    border-radius:8px;
    background:#fff;
    font-size:13px;
    font-weight:500;
    cursor:pointer;
    outline:none;
}

#snackbar-container{
    position:fixed;
    right:20px;
    bottom:20px;
    display:flex;
    flex-direction:column;
    gap:12px;
    z-index:999999;
    pointer-events:none;
}

@media (max-width:768px){

#snackbar-container{
    right:12px;
    left:12px;
    bottom:20px;
}
}

.snackbar{

    display:flex;
    align-items:center;
    gap:14px;

    min-width:300px;
    max-width:420px;

    padding:14px 18px;

    border-radius:14px;

    background:#fff;

    box-shadow:0 12px 30px rgba(0,0,0,.15);

    animation:snackIn .25s ease;

    pointer-events:auto;
}

@media(max-width:768px){

.snackbar{

    min-width:0;
    width:100%;
}

}

.snack-icon{

    width:42px;
    height:42px;

    border-radius:999px;

    display:flex;
    align-items:center;
    justify-content:center;

    color:#fff;

    flex:none;
}

.snack-text{

    flex:1;

    font-size:14px;
    font-weight:600;
    color:#222;
}

.snackbar.hide{

    animation:snackOut .25s forwards;
}

@keyframes snackIn{

from{

transform:translateY(25px);
opacity:0;

}

to{

transform:none;
opacity:1;

}

}

@keyframes snackOut{

to{

transform:translateY(25px);
opacity:0;

}

}
