@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #667085;
  --line: #dfe5ef;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
  --sidebar: #101828;
  --sidebar-soft: #1d2939;
  --radius: 8px;
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 260px;
  display: flex;
  flex-direction: column;
  padding: 24px 18px 18px;
  background: var(--sidebar);
  color: #ffffff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-bottom: 22px;
  font-weight: 700;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav a,
.nav-link,
.ghost-button {
  display: block;
  width: 100%;
  padding: 11px 12px;
  border-radius: 8px;
  color: #ffffff;
  background: transparent;
  text-align: left;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.nav a:hover,
.nav-link:hover,
.ghost-button:hover {
  background: var(--sidebar-soft);
}

.nav a.active,
.nav-link.active {
  background: var(--primary);
  font-weight: 600;
}

.brand-text {
  font-size: 14px;
  line-height: 1.3;
}

.sidebar-isp-name {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin: 8px 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sidebar-isp-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.logout-form {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.content {
  margin-left: 260px;
  padding: 28px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.page-header h1 {
  margin: 4px 0 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel,
.stat-card,
.login-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.panel {
  padding: 18px;
  margin-bottom: 18px;
}

.panel h2 {
  margin: 0 0 16px;
  font-size: 18px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 32px;
}

.finance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.finance-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
  border-left-width: 4px;
  border-left-style: solid;
}

.finance-card:hover {
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.finance-all {
  border-left-color: var(--primary);
}
.finance-paid {
  border-left-color: #067647;
}
.finance-unpaid {
  border-left-color: #b54708;
}
.finance-expired {
  border-left-color: var(--danger);
}
.finance-count {
  border-left-color: #7c3aed;
}
.finance-free {
  border-left-color: #2563eb;
}

.finance-card span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.finance-card strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.finance-paid strong {
  color: #067647;
}
.finance-unpaid strong {
  color: #b54708;
}
.finance-expired strong {
  color: #b42318;
}
.finance-free strong {
  color: #2563eb;
}

.status-pending {
  background: #fffaeb;
  color: #b54708;
}

.status-muted {
  background: #f2f4f7;
  color: var(--muted);
}

.table-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.table-link:hover {
  text-decoration: underline;
}

.panel-hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.panel-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.panel-heading-row h2 {
  margin: 0;
}

/* ── Shared data tables (profiles, pppoe, logs, …) ── */
.table-wrap {
  padding: 4px 2px 8px;
}

table.data-table,
.data-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 8px 6px;
}

.data-table th {
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: #f8fafc;
  border-bottom: 2px solid var(--line);
  text-align: left;
  white-space: nowrap;
  box-sizing: border-box;
}

.data-table td {
  padding: 11px 12px;
  font-size: 13.5px;
  line-height: 1.5;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  box-sizing: border-box;
}

.data-table tbody tr {
  transition: background 0.15s ease;
}

.data-table tbody tr:hover td {
  background: #f8fafc;
}

.data-table td.cell-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.filter-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-toolbar .filter-form {
  margin-bottom: 0;
}

.page-content {
  max-width: 1200px;
}

/* ── Dashboard ── */
.dashboard-page {
  max-width: 1200px;
}

.dashboard-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  margin-bottom: 18px;
  background: linear-gradient(135deg, #ffffff 0%, #f0f6ff 100%);
  border: 1px solid var(--line);
}

.dashboard-hero h1 {
  margin: 4px 0 8px;
}

.dashboard-subtitle {
  margin: 0;
  max-width: 520px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.dashboard-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.dash-stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  text-decoration: none;
  color: inherit;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.dash-stat-card:hover {
  border-color: #bfd4ff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12);
  transform: translateY(-2px);
}

.dash-stat-highlight {
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
  border-color: #bfdbfe;
}

.dash-stat-icon {
  flex: 0 0 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.dash-icon-blue {
  background: #dbeafe;
  color: #1d4ed8;
}
.dash-icon-purple {
  background: #ede9fe;
  color: #6d28d9;
}
.dash-icon-teal {
  background: #ccfbf1;
  color: #0f766e;
}
.dash-icon-green {
  background: #d1fae5;
  color: #067647;
}
.dash-icon-gray {
  background: #f2f4f7;
  color: #475467;
}
.dash-icon-primary {
  background: #2563eb;
  color: #fff;
}

.dash-stat-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dash-stat-body strong {
  display: block;
  margin-top: 4px;
  font-size: 26px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.dash-stat-link-text {
  font-size: 15px !important;
  color: var(--primary);
}

.dashboard-finance-panel h2 {
  margin: 0;
}

.dashboard-revenue-bar {
  margin-bottom: 16px;
}

.dashboard-revenue-trend {
  align-items: end;
  gap: 12px;
  min-height: 112px;
  margin: 0 0 18px;
  padding: 14px 16px 10px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
}

.dashboard-revenue-trend-item {
  display: flex;
  flex: 0 0 52px;
  flex-direction: column;
  align-items: center;
  justify-content: end;
  gap: 6px;
  min-width: 52px;
}

.dashboard-revenue-trend-bar {
  width: 34px;
  max-height: 88px;
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, #22c55e 0%, #0f766e 100%);
  box-shadow: inset 0 -10px 16px rgba(15, 118, 110, 0.18);
}

.dashboard-revenue-trend-item small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
}

.dashboard-finance-grid {
  margin-top: 4px;
}

.dashboard-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.dashboard-steps .step-item {
  display: flex;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fafbfc;
}

.dashboard-steps .step-item span {
  flex: 0 0 30px;
  height: 30px;
  border-radius: 999px;
  background: #e8f0ff;
  color: var(--primary);
  font-weight: 700;
  display: grid;
  place-items: center;
  font-size: 13px;
}

.dashboard-steps .step-item strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.dashboard-steps .step-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

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

.quick-link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.quick-link-card {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fafbfc;
  text-decoration: none;
  color: inherit;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.quick-link-card:hover {
  border-color: #bfd4ff;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.1);
}

.quick-link-card strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.quick-link-card span {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.4;
}

.quick-link-primary {
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
  border-color: #bfdbfe;
}

.quick-link-primary strong {
  color: var(--primary);
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.steps div {
  display: flex;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.steps span {
  display: inline-grid;
  place-items: center;
  flex: 0 0 28px;
  height: 28px;
  border-radius: 999px;
  background: #e8f0ff;
  color: var(--primary);
  font-weight: 700;
}

.steps p {
  margin: 4px 0 0;
  color: var(--muted);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 14px;
  align-items: end;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid #cfd7e6;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
}

input:focus,
select:focus {
  outline: 2px solid #bfdbfe;
  border-color: var(--primary);
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}

.checkbox-line input {
  width: 16px;
  min-height: 16px;
}

.inline-form {
  display: inline-block;
  margin-left: 6px;
}

.filter-form {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.filter-form label {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.filter-form select {
  width: auto;
  min-width: 200px;
}

.toolbar-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-form input,
.search-input {
  width: 220px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #cfd7e6;
  border-radius: 6px;
  background: #fff;
}

.table-sub {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
}



.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #ecfdf3;
  color: #067647;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-ok {
  background: #ecfdf3;
  color: #067647;
}

.status-bad {
  background: #fef3f2;
  color: #b42318;
}

.notice {
  padding: 10px 12px;
  margin-bottom: 14px;
  border-radius: 8px;
  background: #ecfdf3;
  color: #067647;
  font-weight: 700;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.detail-grid div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.detail-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.detail-grid strong {
  overflow-wrap: anywhere;
}

.table-wrap {
  overflow-x: auto;
}

.servers-table-wrap {
  padding: 4px 6px 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 13px;
}

/* ── Servers table ── */
#serversTable {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 8px 6px;
}

#serversTable th:nth-child(1),
#serversTable td:nth-child(1) {
  width: 18%;
  min-width: 100px;
}

#serversTable th:nth-child(2),
#serversTable td:nth-child(2) {
  width: 22%;
  min-width: 110px;
}

#serversTable th:nth-child(3),
#serversTable td:nth-child(3) {
  width: 8%;
  min-width: 56px;
}

#serversTable th:nth-child(4),
#serversTable td:nth-child(4) {
  width: 16%;
  min-width: 88px;
}

#serversTable th:nth-child(5),
#serversTable td:nth-child(5) {
  width: 16%;
  min-width: 100px;
}

#serversTable th:nth-child(6),
#serversTable td:nth-child(6) {
  width: 12%;
  min-width: 88px;
}

#serversTable th {
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #f8fafc;
  border-bottom: 2px solid var(--line);
  box-sizing: border-box;
}

#serversTable td {
  padding: 11px 12px;
  font-size: 13.5px;
  line-height: 1.5;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  box-sizing: border-box;
}

#serversTable tbody tr {
  transition: background 0.15s ease;
}

#serversTable tbody tr:hover td {
  background: #f8fafc;
}

#serversTable td.cell-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.servers-actions-cell {
  white-space: nowrap;
}

.servers-action-btn {
  padding: 5px 10px;
  border-radius: var(--radius);
  background: #eef4ff;
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
}

.servers-table-hint {
  margin: 10px 4px 0;
  color: var(--muted);
  font-size: 12.5px;
}

.action-dropdown-form {
  margin: 0;
  padding: 0;
}

.action-dropdown-form .action-dropdown-item {
  width: 100%;
  border-radius: 6px;
}

.action-dropdown {
  position: relative;
  display: inline-block;
}

.action-menu {
  display: none;
  position: absolute;
  right: 0;
  left: auto;
  top: 100%;
  z-index: 100;
  min-width: 180px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  padding: 6px;
}

.action-menu.show { display: block; }

.action-menu-btn,
.action-menu-link {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: none;
  text-align: left;
  color: var(--ink);
  text-decoration: none;
  font-size: 13.5px;
  border-radius: 6px;
  cursor: pointer;
}

.action-menu-btn:hover,
.action-menu-link:hover {
  background: #f8fafc;
}

.action-menu form { margin: 0; }

.action-menu-btn-danger { color: var(--danger); }

.action-menu-divider {
  height: 1px;
  background: var(--line);
  margin: 6px 8px;
}

/* ── Server detail page ── */
.server-detail-page {
  max-width: 1100px;
}

.server-detail-header {
  align-items: flex-start;
}

.server-back-link {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.server-back-link:hover {
  text-decoration: underline;
}

.server-detail-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.server-detail-stats .stat-card {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.server-detail-stats .stat-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.server-detail-stats .stat-card > strong:not(.stat-value-text) {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.server-detail-stats .stat-value-text {
  display: block;
  margin-top: 8px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-detail-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

.server-detail-list {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.server-detail-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
}

.server-detail-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.server-detail-item dt {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.server-detail-item dd {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.server-detail-list-compact {
  margin-top: 16px;
}

.server-code {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  background: #f2f4f7;
  font-size: 13px;
  font-family: ui-monospace, Consolas, monospace;
}

.server-error-box {
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid #fecdca;
  background: #fef3f2;
}

.server-error-label {
  display: block;
  margin-bottom: 6px;
  color: var(--danger);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.server-error-text {
  margin: 0;
  color: #912018;
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.server-no-error {
  margin: 0 0 4px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
}

.server-detail-actions .panel h2,
.server-detail-actions h2 {
  margin: 0 0 14px;
}

.server-action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.server-action-form {
  margin: 0;
}

.server-action-form-danger {
  margin-left: auto;
}


@media (max-width: 900px) {
  .server-detail-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .server-detail-columns {
    grid-template-columns: 1fr;
  }

  .server-detail-item {
    grid-template-columns: 1fr;
    gap: 4px;
    align-items: start;
  }

  .server-action-form-danger {
    margin-left: 0;
  }
}

.empty-state {
  color: var(--muted);
  text-align: center;
}

.login-page {
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-card {
  width: min(100%, 400px);
  padding: 28px 28px 24px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
  border: 1px solid var(--line);
}

.login-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.login-heading h1 {
  margin: 0;
  font-size: 22px;
}

.login-card form {
  display: grid;
  gap: 12px;
}

.alert {
  padding: 10px 12px;
  margin-bottom: 14px;
  border-radius: 8px;
  background: #fee2e2;
  color: #991b1b;
  font-weight: 700;
}

.app-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
}

.app-modal {
  width: min(100% - 32px, 520px);
  max-height: 85vh;
  border-radius: var(--radius);
  background: var(--panel);
  display: flex;
  flex-direction: column;
}

.app-modal-lg {
  width: min(100% - 32px, 720px);
}

.app-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.app-modal-header h2,
.app-modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.app-modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  background: none;
  border: none;
  color: var(--muted);
  font-size: 22px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  cursor: pointer;
  line-height: 1;
  transition: all 0.15s;
}

.app-modal-close:hover {
  background: #f1f5f9;
  color: var(--ink);
}

/* Padding wrapper untuk form di dalam modal */
.app-modal > .settings-form {
  padding: 20px 24px;
  overflow-y: auto;
}

.close-button {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  background: none;
  color: var(--muted);
  font-size: 22px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.close-button:hover {
  background: #f1f5f9;
  color: var(--ink);
}

.app-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.app-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}

.app-modal-body > .loading-spinner:not(.loading) {
  text-align: center;
  padding: 40px;
  color: var(--muted);
}

.revenue-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 12px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--line);
}
.revenue-item {
  display: flex;
  flex-direction: column;
  min-width: 160px;
  flex: 1;
}
.revenue-label {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 2px;
}
.revenue-value {
  font-size: 18px;
  font-weight: 700;
}
.revenue-value.success {
  color: #067647;
}
.revenue-value.danger {
  color: #b42318;
}
.revenue-value.muted {
  color: var(--muted);
}
.revenue-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

@media (max-width: 900px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .sidebar {
    position: static;
    width: auto;
  }

  .content {
    margin-left: 0;
    padding: 18px;
  }

  .stats-grid,
  .steps,
  .form-grid,
  .detail-grid,
  .dashboard-stat-grid,
  .dashboard-bottom-grid,
  .quick-link-grid {
    grid-template-columns: 1fr;
  }

  .page-header,
  .dashboard-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .finance-grid,
  .dashboard-finance-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Confirmation Toast ── */
.confirm-toast-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.2s;
}

.confirm-toast {
  background: #fff;
  border: 1px solid #dce5ef;
  border-radius: 18px;
  padding: 22px;
  max-width: 460px;
  width: 90%;
  text-align: left;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  animation: scaleIn 0.2s;
}

.confirm-toast-heading {
  display: flex;
  align-items: flex-start;
  gap: 13px;
}

.confirm-toast-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 50%;
  background: #fef3c7;
  color: #b45309;
  font-size: 20px;
  font-weight: 900;
}

.confirm-toast h3 {
  margin: 1px 0 5px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
}

.confirm-toast p {
  margin: 0;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.5;
}

.confirm-toast-detail {
  margin: 15px 0 0 51px;
  padding: 10px 12px;
  border: 1px solid #e5eaf0;
  border-radius: 9px;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  line-height: 1.55;
}

.confirm-toast-danger .confirm-toast-icon {
  background: #fee2e2;
  color: #b91c1c;
}

.confirm-toast-info .confirm-toast-icon {
  background: #dbeafe;
  color: #1d4ed8;
}

.confirm-toast-success .confirm-toast-icon {
  background: #dcfce7;
  color: #15803d;
}

.confirm-toast-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.confirm-toast-actions button {
  min-width: 90px;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: 0;
  cursor: pointer;
}

.confirm-toast-actions .btn-yes {
  background: var(--primary);
  color: #fff;
}

.confirm-toast-actions .btn-no {
  background: #f0f2f5;
  color: var(--ink);
}

.confirm-toast-actions .btn-yes:hover {
  filter: brightness(.92);
}

.confirm-toast-actions .btn-no:hover {
  background: #e2e5ea;
}

.confirm-toast-danger .confirm-toast-actions .btn-yes {
  background: var(--danger);
}

@media (max-width: 520px) {
  .confirm-toast {
    width: calc(100% - 24px);
    padding: 18px;
  }

  .confirm-toast-detail {
    margin-left: 0;
  }

  .confirm-toast-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .confirm-toast-actions button {
    min-width: 0;
  }
}

/* ── Action Dropdown ── */
.action-dropdown {
  position: relative;
  display: inline-block;
}

.action-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  left: auto;
  margin-top: 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  min-width: 200px;
  z-index: 100;
  display: none;
  overflow: hidden;
  padding: 4px;
}

.action-dropdown-menu.show {
  display: block;
  animation: fadeIn 0.12s;
}

.action-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
  border: 0;
  background: none;
  width: 100%;
  text-align: left;
  color: var(--ink);
  border-radius: 8px;
  white-space: nowrap;
}

.action-dropdown-item:hover {
  background: #f0f2f5;
}

.action-dropdown-item.danger {
  color: var(--danger);
}

.action-dropdown-divider {
  height: 1px;
  background: var(--line);
  margin: 4px 8px;
}

.action-dropdown-item .item-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.item-dot-green {
  background: #16a34a;
}
.item-dot-red {
  background: #dc2626;
}
.item-dot-orange {
  background: #ea580c;
}
.item-dot-blue {
  background: #2563eb;
}
.item-dot-gray {
  background: #6b7280;
}

/* ── Inline Masa Aktif Edit ── */
.masa-aktif-edit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.masa-aktif-edit input[type="datetime-local"] {
  font-size: 13px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.edit-masa-btn {
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 15px;
  padding: 2px 5px;
  border-radius: 4px;
  opacity: 0.4;
  line-height: 1;
  vertical-align: middle;
  transition: opacity 0.15s;
}

.edit-masa-btn:hover {
  opacity: 1;
  background: #f0f2f5;
}

.edit-masa-save {
  background: var(--primary);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 5px 14px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 600;
}

.edit-masa-cancel {
  background: #f0f2f5;
  color: var(--ink);
  border: 0;
  border-radius: 6px;
  padding: 5px 14px;
  font-size: 12px;
  cursor: pointer;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    transform: scale(0.92);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ── Loading Animation ── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.25s ease-in-out;
  backdrop-filter: blur(2px);
}

.loading-modal {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 48px 32px;
  background: var(--panel);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  min-width: 280px;
  max-width: 400px;
  animation: scaleIn 0.3s ease-out;
}

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

.loading-spinner-container > .app-loading-ring {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  padding: 0;
  border: 3px solid #e5e7eb;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-spinner-container > .app-loading-ring::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 2px solid transparent;
  border-right-color: var(--primary);
  border-bottom-color: var(--primary);
  border-radius: 50%;
  animation: spin 1.2s linear infinite reverse;
  opacity: 0.6;
}

/* DaisyUI button spinners must stay inline; never inherit overlay positioning. */
.loading.loading-spinner {
  position: static !important;
  inset: auto !important;
  display: inline-block !important;
  width: 1rem !important;
  height: 1rem !important;
  min-width: 1rem !important;
  padding: 0 !important;
  flex: 0 0 1rem !important;
}

.loading-text {
  text-align: center;
}

.loading-text h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}

.loading-text p {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.loading-dots {
  display: inline-flex;
  gap: 4px;
}

.loading-dot {
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  animation: bounce 1.4s infinite;
}

.loading-dot:nth-child(1) {
  animation-delay: 0s;
}
.loading-dot:nth-child(2) {
  animation-delay: 0.2s;
}
.loading-dot:nth-child(3) {
  animation-delay: 0.4s;
}

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

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.6;
  }
  50% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

/* Global blue dashboard refresh */
:root {
  --bg: #eaf1fb;
  --panel: #ffffff;
  --ink: #10213f;
  --muted: #64748b;
  --line: #d7e2f0;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
  --sidebar: #0f2557;
  --sidebar-soft: #173b80;
  --radius: 18px;
}

body {
  background:
    radial-gradient(circle at 18% 10%, rgba(37, 99, 235, 0.18), transparent 26%),
    linear-gradient(180deg, #f8fbff 0, var(--bg) 170px);
  color: var(--ink);
}

.sidebar {
  inset: 14px auto 14px 14px;
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(15, 37, 87, 0.24);
}

.brand-mark,
.nav a.active,
.nav-link.active {
  background: var(--primary);
  color: #ffffff;
}

.nav a,
.nav-link,
.ghost-button {
  border-radius: 14px;
}

.sidebar-isp-name {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
}

.content {
  margin-left: 288px;
  padding: 30px clamp(18px, 3vw, 40px);
}

.page-header,
.dashboard-hero {
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 26px;
  background: linear-gradient(135deg, rgba(255,255,255,0.96), rgba(239,246,255,0.92));
  box-shadow: 0 18px 45px rgba(15, 37, 87, 0.1);
}

.page-header h1,
.dashboard-hero h1 {
  color: #0f2f6b;
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.panel,
.stat-card,
.login-card,
.dash-stat-card,
.finance-card,
.quick-link-card,
.dashboard-steps .step-item,
.server-detail-stats .stat-card {
  border-color: rgba(255, 255, 255, 0.78);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 16px 35px rgba(15, 37, 87, 0.08);
}

.panel {
  padding: 22px;
}

.dash-stat-card,
.finance-card,
.quick-link-card {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.dash-stat-card:hover,
.finance-card:hover,
.quick-link-card:hover {
  transform: translateY(-2px);
  border-color: #bfdbfe;
  box-shadow: 0 22px 42px rgba(15, 37, 87, 0.14);
}

.dash-stat-highlight,
.quick-link-primary,
.dashboard-steps .step-item,
.steps div,
.revenue-bar {
  background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
  border-color: #bfdbfe;
}

.dash-icon-purple,
.dash-icon-teal,
.dash-icon-green,
.dash-icon-blue,
.dash-icon-gray {
  background: #dbeafe;
  color: var(--primary-dark);
}

.dash-icon-primary {
  background: var(--primary);
  color: #ffffff;
}

.finance-count {
  border-left-color: #1d4ed8;
}

.finance-paid,
.finance-free,
.finance-all {
  border-left-color: var(--primary);
}

.finance-paid strong,
.finance-free strong,
.dash-stat-link-text,
.quick-link-primary strong,
.table-link {
  color: var(--primary);
}

.status-pill,
.status-ok {
  background: #eff6ff;
  color: var(--primary-dark);
}

.notice {
  background: #eff6ff;
  color: var(--primary-dark);
}

.data-table th,
#serversTable th {
  background: #f4f8ff;
  border-bottom: none;
}

.data-table td,
#serversTable td {
  border-bottom: none;
}

.data-table tbody tr:hover td,
#serversTable tbody tr:hover td {
  background: #f8fbff;
}

.data-table thead th:first-child,
#serversTable thead th:first-child {
  border-radius: 14px 0 0 14px;
}

.data-table thead th:last-child,
#serversTable thead th:last-child {
  border-radius: 0 14px 14px 0;
}

.data-table tbody td:first-child,
#serversTable tbody td:first-child {
  border-radius: 14px 0 0 14px;
}

.data-table tbody td:last-child,
#serversTable tbody td:last-child {
  border-radius: 0 14px 14px 0;
}

input,
select,
.search-form input,
.search-input {
  border-color: #d7e2f0;
  border-radius: 999px;
}

input:focus,
select:focus {
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.16);
}

input[type="checkbox"],
input[type="checkbox"]:focus,
input[type="checkbox"]:focus-visible {
  min-height: auto;
  padding: 0;
  border-radius: 4px;
  outline: none !important;
  box-shadow: none !important;
}

.btn-primary,
.primary-button,
.edit-masa-save {
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #ffffff !important;
  border-radius: 999px !important;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.24);
}

.btn-primary:hover,
.primary-button:hover,
.edit-masa-save:hover {
  background-color: var(--primary-dark) !important;
  border-color: var(--primary-dark) !important;
}

.btn-outline.btn-primary {
  background-color: transparent !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
  border-radius: 999px !important;
}

.btn-outline.btn-primary:hover {
  background-color: var(--primary) !important;
  color: #ffffff !important;
}

.app-modal,
.confirm-toast,
.loading-modal {
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(15, 37, 87, 0.22);
}

.revenue-value.success,
.item-dot-green {
  color: var(--primary) !important;
}

.item-dot-green {
  background: var(--primary) !important;
}

.bi {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  vertical-align: -0.125em;
}

.bi.w-3.h-3 { font-size: 0.75rem; }
.bi.w-4.h-4 { font-size: 1rem; }
.bi.w-5.h-5 { font-size: 1.25rem; }
.bi.w-6.h-6 { font-size: 1.5rem; }
.bi.w-7.h-7 { font-size: 1.75rem; }

@media (max-width: 900px) {
  .sidebar {
    position: sticky;
    z-index: 900;
    inset: 0 auto auto 0;
    width: 100%;
    margin: 0;
    padding: 8px 10px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    border-radius: 0 0 18px 18px;
    box-shadow: 0 10px 28px rgba(15, 37, 87, 0.2);
  }

  .content {
    width: 100%;
    min-width: 0;
    margin-left: 0;
    padding: 14px;
  }

  .sidebar .brand {
    min-height: 38px;
    margin: 0;
  }

  .sidebar .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }

  .sidebar .brand-text,
  .sidebar .sidebar-isp-name,
  .sidebar .ws-status-container {
    display: none;
  }

  .sidebar .nav {
    min-width: 0;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 2px;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
  }

  .sidebar .nav::-webkit-scrollbar {
    display: none;
  }

  .sidebar .nav a,
  .sidebar .nav-link {
    width: auto;
    min-width: max-content;
    min-height: 38px;
    padding: 8px 11px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 11px;
    font-size: 12px;
    white-space: nowrap;
  }

  .sidebar .logout-form {
    margin: 0;
    padding: 0;
    border: 0;
  }

  .sidebar .logout-form .ghost-button {
    width: 38px;
    height: 38px;
    padding: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: transparent;
    font-size: 0;
  }

  .sidebar .logout-form .ghost-button svg,
  .sidebar .logout-form .ghost-button i {
    color: #fff;
    font-size: 16px;
  }

  .page-header,
  .dashboard-hero {
    padding: 18px;
    border-radius: 20px;
  }

  .panel {
    padding: 17px;
    border-radius: 19px;
  }

  .form-grid {
    gap: 12px;
  }

  .filter-toolbar,
  .filter-form,
  .search-form,
  .toolbar-row {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .filter-form label {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .filter-form select,
  .search-form input,
  .search-input {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 560px) {
  .content {
    padding: 10px;
  }

  .sidebar {
    padding-inline: 8px;
  }

  .sidebar .nav a span,
  .sidebar .nav-link span {
    display: none;
  }

  .sidebar .nav a,
  .sidebar .nav-link {
    min-width: 40px;
    width: 40px;
    padding: 0;
  }

  .page-header h1,
  .dashboard-hero h1 {
    font-size: 27px;
  }

  .app-modal,
  .app-modal-lg {
    width: calc(100% - 16px);
    max-height: calc(100dvh - 16px);
  }

  .app-modal-header,
  .app-modal-body,
  .app-modal-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .app-modal-footer {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .app-modal-footer .btn {
    width: 100%;
  }
}
