:root {
  color-scheme: light;
  font-family: Segoe UI, Roboto, Arial, sans-serif;
  background: #f7f8fa;
  color: #1f2937;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f7f8fa;
}

.topbar {
  background: #ffffff;
  border-bottom: 1px solid #e6e8ec;
  padding: 14px 18px;
}

.topbar h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
}

.api-target {
  margin-top: 4px;
  color: #7a818c;
  font-size: 13px;
}

.container {
  max-width: 1080px;
  margin: 18px auto;
  padding: 0 14px 26px;
  display: grid;
  gap: 10px;
}

.card {
  background: #fff;
  border: 1px solid #e7e9ee;
  border-radius: 10px;
  padding: 13px;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}

.auth-card {
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
}

.auth-form {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.remember-me {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #4b5563;
  font-size: 13px;
}

.remember-me input {
  margin: 0;
}

.auth-note {
  margin-top: 10px;
  border: 1px solid #f0d8aa;
  background: #fffbeb;
  color: #7a5c1e;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
}

.auth-status {
  margin-top: 8px;
  margin-bottom: 4px;
  min-height: 18px;
}

.auth-support {
  margin-top: 2px;
  margin-bottom: 0;
  font-size: 12px;
}

#dashboardCard {
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}

.sub-card {
  border: 1px solid #e7e9ee;
  border-radius: 8px;
  padding: 10px;
  margin-top: 10px;
  background: #fcfcfd;
}

.card h2, .card h3 {
  margin: 0 0 12px;
  font-weight: 600;
}

.grid-two {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #4b5563;
}

input {
  border: 1px solid #d8dde6;
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 14px;
  background: #fff;
}

select {
  border: 1px solid #d8dde6;
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 14px;
  background: #fff;
}

.btn {
  border: 1px solid #1f4f9d;
  background: #1f4f9d;
  color: #fff;
  border-radius: 8px;
  padding: 9px 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}

.btn.ghost {
  border-color: #d0d6df;
  background: #fff;
  color: #374151;
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.section-title-row.compact {
  margin-top: 6px;
  margin-bottom: 6px;
}

.section-title-row.compact h3 {
  margin-bottom: 0;
}

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

.auto-refresh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #4b5563;
  font-size: 13px;
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.tabs-row {
  display: flex;
  gap: 8px;
}

.tab-btn {
  border: 1px solid #d8dde6;
  background: #f9fafb;
  color: #4b5563;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}

.tab-btn.active {
  border-color: #1f4f9d;
  background: #1f4f9d;
  color: #fff;
}

.accounts-filters {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 10px;
  margin-bottom: 8px;
}

.dashboard-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.summary-box {
  border: 1px solid #e7e9ee;
  border-radius: 8px;
  padding: 10px;
  background: #fcfcfd;
  font-size: 13px;
  color: #374151;
}

.kpi-box {
  position: relative;
  overflow: hidden;
}

.kpi-box::after {
  content: "";
  position: absolute;
  right: -20px;
  bottom: -20px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(31, 79, 157, 0.06);
}

.kpi-label {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 6px;
}

.kpi-value {
  font-size: 22px;
  font-weight: 700;
  color: #1f2937;
}

.kpi-value.warn {
  color: #b7791f;
}

.kpi-value.danger {
  color: #c53030;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(300px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.insight-card {
  padding: 10px;
}

.insight-card h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.tile {
  border: 1px solid #e7e9ee;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.tile:hover {
  background: #f9fafc;
  border-color: #d6dbe4;
  transform: translateY(-1px);
}

.tile.active {
  border-color: #1f4f9d;
  background: #f5f8ff;
}

.tile-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
}

.tile-main {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
}

.tile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: #5b6470;
}

.server-tile-meta {
  display: grid;
  gap: 4px;
}

.server-disks-list {
  display: grid;
  gap: 2px;
  padding-left: 8px;
}

.detail-block {
  margin-top: 6px;
  border: 1px solid #e7e9ee;
  border-radius: 8px;
  padding: 10px;
  background: #fcfcfd;
}

.chart-box {
  position: relative;
  border: 1px solid #e7e9ee;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  margin-bottom: 12px;
  min-height: 220px;
}

.chart-svg {
  width: 100%;
  height: 220px;
  display: block;
}

.trend-point {
  cursor: pointer;
}

.chart-tooltip {
  position: fixed;
  z-index: 20;
  min-width: 320px;
  width: max-content;
  max-width: min(980px, calc(100vw - 16px));
  max-height: calc(100vh - 16px);
  overflow: auto;
  background: #ffffff;
  border: 1px solid #d8dde6;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(31, 41, 55, 0.16);
  pointer-events: none;
}

.tooltip-head {
  padding: 10px 12px 6px;
  border-bottom: 1px solid #eef1f5;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.tooltip-date {
  font-size: 12px;
  color: #4b5563;
  margin-bottom: 2px;
}

.tooltip-total {
  font-size: 14px;
  font-weight: 700;
  color: #1f2937;
}

.tooltip-kpi {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 12px;
  border-bottom: 1px solid #eef1f5;
  font-size: 12px;
  color: #4b5563;
}

.tooltip-list {
  overflow: visible;
}

.tooltip-row {
  display: grid;
  grid-template-columns: 90px 1fr 90px 110px;
  gap: 8px;
  align-items: start;
  padding: 7px 12px;
  border-bottom: 1px solid #f1f4f8;
  font-size: 12px;
}

.tooltip-row:last-child {
  border-bottom: 0;
}

.tooltip-row.ok .tooltip-balance {
  color: #2f855a;
}

.tooltip-row.danger .tooltip-balance {
  color: #c53030;
}

.tooltip-account {
  font-weight: 700;
  color: #1f2937;
}

.tooltip-name {
  color: #374151;
}

.tooltip-operator {
  color: #6b7280;
}

.tooltip-balance {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.tooltip-empty {
  padding: 10px 12px;
  color: #7a818c;
  font-size: 12px;
}

.chart-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #5b6470;
  margin-top: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.chart-empty {
  color: #7a818c;
  font-size: 13px;
  padding: 8px;
}

.service-charts-list {
  display: grid;
  gap: 10px;
}

.service-chart-card {
  border: 1px solid #e7e9ee;
  border-radius: 8px;
  padding: 10px;
  background: #fcfcfd;
}

.service-chart-head {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
}

.service-chart-head h4 {
  margin: 0;
  font-size: 14px;
  color: #1f2937;
}

.service-chart-meta {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: #5b6470;
}

.service-chart-box {
  margin-bottom: 0;
  min-height: 120px;
}

.service-chart-svg {
  height: 120px;
}

.period-switch {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.period-label {
  font-size: 12px;
  color: #5b6470;
}

.period-select {
  min-width: 150px;
  border: 1px solid #d8dde6;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  background: #fff;
  color: #374151;
}

.simcards-table-wrap {
  border: 1px solid #e7e9ee;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  margin-bottom: 12px;
}

.simcards-table-scroll {
  width: 100%;
  overflow-x: auto;
}

.simcards-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid #edf1f5;
  background: #fcfcfd;
}

.simcards-filter {
  border: 1px solid #d8dde6;
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 12px;
  background: #fff;
  color: #374151;
}

.simcards-filter-reset {
  align-self: stretch;
}

.simcards-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  color: #374151;
}

.simcards-table th,
.simcards-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #edf1f5;
  text-align: left;
  vertical-align: top;
}

.simcards-table th {
  background: #f8fafc;
  color: #4b5563;
  font-weight: 600;
  white-space: nowrap;
}

.simcards-table th.sortable {
  cursor: pointer;
  user-select: none;
}

.simcards-table tbody tr:last-child td {
  border-bottom: 0;
}

.commands-row-main {
  cursor: pointer;
}

.commands-row-detail td {
  font-family: Consolas, "Courier New", monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.simcards-table-money {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.period-btn {
  border: 1px solid #d8dde6;
  background: #fff;
  color: #4b5563;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}

.period-btn.active {
  border-color: #1f4f9d;
  background: #1f4f9d;
  color: #fff;
}

.filter-btn {
  border: 1px solid #d8dde6;
  background: #fff;
  color: #4b5563;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.filter-btn.active {
  border-color: #1f4f9d;
  background: #1f4f9d;
  color: #fff;
}

.small {
  font-size: 12px;
  margin-bottom: 8px;
}

.muted {
  color: #7a818c;
}

.servers-list, .list {
  display: grid;
  gap: 8px;
}

.server-item, .list-item {
  border: 1px solid #e7e9ee;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.server-item:hover {
  background: #f9fafc;
  border-color: #d6dbe4;
}

.server-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
}

.badge {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #fff;
}

.mini-issues-list {
  display: grid;
  gap: 8px;
}

.mini-issue-item {
  border: 1px solid #e7e9ee;
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  font-size: 12px;
  color: #374151;
}

.mini-issue-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.mini-issue-text {
  color: #5b6470;
}

.status-ok { background: #2f855a; }
.status-warning { background: #b7791f; }
.status-critical { background: #c53030; }

.server-meta {
  color: #5b6470;
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.meta-grid div {
  border: 1px solid #e7e9ee;
  border-radius: 8px;
  padding: 8px;
  font-size: 13px;
  background: #fff;
}

.meta-grid .local-disk-tile {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.local-disk-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.local-disk-free {
  border: 1px solid #d8dde6;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  color: #4b5563;
  white-space: nowrap;
}

.local-disk-meta {
  display: grid;
  gap: 4px;
  color: #374151;
}

.local-disk-label {
  color: #5b6470;
}

.local-disk-members-title {
  font-size: 12px;
  font-weight: 600;
  color: #4b5563;
  margin-top: 2px;
}

.local-disk-members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 6px;
}

.local-disk-member-tile {
  border: 1px solid #e7e9ee;
  border-radius: 8px;
  padding: 8px;
  font-size: 12px;
  background: #fcfcfd;
}

.local-disk-member-title {
  font-size: 12px;
  font-weight: 600;
  color: #1f2937;
}

.local-disk-member-summary {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
}

.local-disk-member-summary::-webkit-details-marker {
  display: none;
}

.local-disk-member-sn {
  color: #5b6470;
  font-size: 12px;
  white-space: nowrap;
}

.local-disk-member-body {
  margin-top: 6px;
  display: grid;
  gap: 3px;
}

.meta-grid .physical-disk-tile {
  border: 1px solid #e7e9ee;
  border-radius: 8px;
  padding: 8px;
  background: #fcfcfd;
}

.physical-disk-summary {
  cursor: pointer;
  list-style: none;
  color: #4b5563;
  font-size: 12px;
  font-weight: 600;
}

.physical-disk-summary::-webkit-details-marker {
  display: none;
}

.physical-disk-body {
  margin-top: 6px;
  display: grid;
  gap: 3px;
  font-size: 12px;
}

@media (max-width: 700px) {
  .grid-two {
    grid-template-columns: 1fr;
  }

  .section-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .accounts-filters {
    grid-template-columns: 1fr;
  }

  .dashboard-summary {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

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