:root {
  --bg-base: #0f1218;
  --bg-sidebar: #1d222a;
  --bg-main: #121722;
  --bg-panel: #1f2733;
  --text-primary: #e8eaf6;
  --text-secondary: #98a3b5;
  --text-muted: #7d8ba0;
  --border: #2b3450;
  --accent-green: #34d399;
  --accent-green-dark: #2da27d;
  --accent-white: #f6f8ff;
  --radius: 16px;
  --shadow-soft: 0 9px 26px rgba(0, 0, 0, 0.35);
  --transition: 260ms cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; width: 100%; height: 100%; background: radial-gradient(circle at 20% 10%, #1f2733 0%, #0e121a 55%, #07090f 100%); color: var(--text-primary); font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
body { min-height: 100vh; }

.auth-bg {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    min-height: 100vh;
}
.auth-container {
    max-width: 400px;
    margin: 60px auto;
    background: #1e1e1e;
    border-radius: 18px;
    box-shadow: 0 6px 32px 0 rgba(0,0,0,0.50);
    padding: 40px 32px 32px 32px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    border: 1px solid #333;
}
.auth-container h2 {
    margin-bottom: 10px;
    font-weight: 600;
    color: #e0e0e0;
}
.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 18px;
}
.form-group label {
    margin-bottom: 6px;
    font-size: 15px;
    color: #b0b0b0;
}
.form-group input {
    padding: 10px 12px;
    border: 1px solid #444;
    border-radius: 8px;
    font-size: 16px;
    background: #2a2a2a;
    color: #e0e0e0;
    transition: border 0.2s;
}
.form-group input:focus {
    border-color: #1db954;
    outline: none;
}
.btn {
    padding: 12px 0;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.btn-primary {
    background: #1db954;
    color: #fff;
    box-shadow: 0 2px 8px 0 rgba(30,185,84,0.30);
}
.btn-primary:hover {
    background: #159c43;
}
.btn-logout {
    background: #333;
    color: #e0e0e0;
}
.btn-logout:hover {
    background: #444;
}
.alert {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 15px;
}
.alert-error {
    background: #2a1a1a;
    color: #ff6b6b;
    border: 1px solid #5a2a2a;
}
.form-footer {
    margin-top: 10px;
    text-align: center;
}
.form-footer a {
    color: #1db954;
    text-decoration: none;
    font-size: 15px;
}
.form-footer a:hover {
    text-decoration: underline;
}

.app-shell { display: flex; min-height: 100vh; width: 100%; transition: background var(--transition); }

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 280px;
  height: 100vh;
  background: linear-gradient(180deg, #1a202b 0%, #141a23 100%);
  border-right: 1px solid rgba(139, 152, 183, 0.22);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: hidden;
  z-index: 100;
}

.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.brand-icon { width: 50px; height: 50px; border-radius: 14px; background: linear-gradient(135deg, #2dba8f, #1f9269); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 22px; box-shadow: 0 8px 16px rgba(15, 55, 70, 0.35); }
.brand-text { font-size: 24px; color: #f8fbff; font-weight: 800; text-shadow: 0 1px 5px rgba(0,0,0,0.45); }

.menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  color: var(--text-secondary);
  font-size: 15px;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all var(--transition);
}

.menu-item:hover {
  color: var(--accent-white);
  background: rgba(52, 211, 153, 0.18);
  border-color: rgba(52, 211, 153, 0.35);
  transform: translateX(2px);
}

.menu-item.active {
  color: var(--accent-white);
  background: rgba(52, 211, 153, 0.28);
  border-left: 4px solid var(--accent-green);
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.3);
}

.menu-icon { width: 22px; text-align: center; }
.section-title { color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; margin-top: 14px; margin-bottom: 8px; }

.balance-box {
  margin-top: auto;
  background: linear-gradient(135deg, rgba(32, 40, 61, 0.95), rgba(41, 52, 78, 0.95));
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(64, 199, 143, 0.28);
  box-shadow: 0 14px 26px rgba(4, 8, 15, 0.45);
}
.balance-title { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; }
.balance-amount { font-size: 16px; font-weight: 700; color: #fff; margin-bottom: 10px; }
.balance-box button {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 10px;
  font-weight: 700;
  cursor: pointer;
  color: #0e2318;
  background: linear-gradient(135deg, #2dd89f, #22a179);
  transition: transform var(--transition), filter var(--transition);
}
.balance-box button:hover { transform: translateY(-2px); filter: brightness(1.03); }

.main-content {
  margin-left: 280px;
  flex: 1;
  background: linear-gradient(180deg, var(--bg-main), #0f141f 90%);
  padding: 26px;
  display:flex;
  flex-direction: column;
  overflow-y: auto;
  height: 100vh;
}

.dashboard-section { display: none; }
.dashboard-section.active { display: block; }

.dashboard-header { margin-bottom: 24px; }
.dashboard-header h1 { font-size: 34px; margin: 0 0 8px 0; letter-spacing: 0.02em; }
.dashboard-header p { color: var(--text-secondary); max-width: 920px; line-height: 1.6; }

.card-overview { margin-top: 8px; display: flex; flex-direction: column; gap: 18px; }
.server-card.no-server {
  text-align: center;
  color: var(--text-secondary);
}

.server-card.no-server p {
  margin: 10px 0;
  font-size: 16px;
}

.server-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.service-item {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(113, 128, 172, 0.15);
  border-radius: 12px;
  padding: 16px;
}

.service-item h4 {
  margin: 0 0 10px 0;
  color: #ffffff;
  font-size: 18px;
  font-weight: 600;
}

.service-item ul {
  list-style: none;
  margin: 0;
  padding: 0;
  color: #e0e0e0;
}

.service-item ul li {
  margin: 4px 0;
  font-size: 14px;
  color: #d0d0d0;
}

.server-title { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; font-size: 20px; font-weight: 700; }
.server-title span { background: rgba(255,255,255,0.08); padding: 8px; border-radius: 9px; }

.server-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.server-stats div { color: var(--text-secondary); font-size: 14px; line-height: 1.45; }
.server-stats b { color: var(--text-primary); }
.status-online { color: var(--accent-green); font-weight: 700; }

.btn-primary {
  width: fit-content;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-green), var(--accent-green-dark));
  border: none;
  color: #fff;
  font-weight: 700;
  padding: 11px 16px;
  cursor:pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(30, 160, 120, 0.42); }

.info-boxes {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.info-box {
  border-radius: 14px;
  border: 1px solid rgba(111, 131, 156, 0.26);
  background: linear-gradient(135deg, #141c27, #1a2534);
  padding: 16px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.info-box:hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(0,0,0,0.35); }
.info-box h3 { margin: 0 0 6px 0; color: var(--text-primary); }
.info-box p { margin: 0; color: var(--text-secondary); }

.package-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 18px;
}
.package-card {
  background: radial-gradient(circle at top, #0b2516 0%, #0f2f1d 62%, #0a2116 100%);
  border: 1px solid rgba(50, 104, 78, 0.45);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 18px 24px rgba(0,0,0,0.36);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background var(--transition);
}
.package-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 28px rgba(0,0,0,0.45);
  border-color: rgba(46, 161, 98, 0.8);
  background: radial-gradient(circle at top, #123c27 0%, #163c29 64%, #102d20 100%);
}
.package-card.recommend {
  border-color: rgba(81, 182, 115, 0.95);
  box-shadow: 0 18px 36px rgba(20, 110, 90, 0.3);
  background: radial-gradient(circle at top, #122f22 0%, #163b2a 50%, #113424 100%);
}
.card-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.package-name { font-size: 28px; font-weight: 900; color: #e8ffe8; margin: 0; line-height: 1.1; text-shadow: 0 0 16px rgba(180, 255, 201, 0.45); }
.package-number { font-size: 44px; font-weight: 900; color: #35d187; text-shadow: 0 0 24px rgba(73, 218, 159, 0.75); }
.package-text { margin: 12px 0 16px 0; color: #ccf8d2; font-size: 14px; line-height: 1.5; }
.package-specs-list { list-style: none; margin: 0; padding: 0; color: #f8f9ff; font-size: 14px; }
.package-specs-list li { margin: 6px 0; display: flex; justify-content: flex-start; background: transparent; border-radius: 0; padding: 3px 0; gap: 8px; }
.package-specs-list li span { color: #70f2b0; font-weight: 800; }
.package-specs-list li strong { margin-left: 2px; color: #9ffff2; }

@media (min-width: 1024px) {
  .package-grid { grid-template-columns: repeat(4, minmax(220px, 1fr)); }
}

@media (max-width: 1023px) {
  .package-grid { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
}

@media (max-width: 700px) {
  .package-grid { grid-template-columns: 1fr; }
}
.package-price-row { display: flex; align-items: baseline; gap: 12px; margin-top: 16px; }
.price-old { font-size: 20px; font-weight: 700; color: rgba(255,255,255,0.4); text-decoration: line-through; }
.price-large { font-size: 32px; font-weight: 900; color: #fff; }
.package-cycle { font-size: 16px; font-weight: 700; color: #d6d9f2; margin-bottom: 12px; }
.package-status { margin-bottom: 12px; display: inline-block; background: #10b981; border-radius: 999px; color: white; font-size: 11px; font-weight: 800; padding: 6px 13px; text-transform: uppercase; letter-spacing: 0.5px; box-shadow: 0 3px 12px rgba(16, 185, 129, 0.35); }
.package-status-earn { background: #059669; box-shadow: 0 3px 14px rgba(5, 150, 105, 0.5); }

.package-specs-list li::before { content: "✅"; margin-right: 8px; }
.package-specs-list li { color: #e3ffe8; }
.package-specs-list li span { color: #8fffc4; font-weight: 700; }
.package-price-row .price-large { color: #d4ffe5; }

.service-item {
  background: linear-gradient(180deg, #08121d 0%, #0f1d2b 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
  padding: 22px;
  margin-bottom: 18px;
}
.service-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.service-header h4 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #f4fbff;
}
.service-header h4 a {
  color: #d7f0ff;
  text-decoration: none;
}
.service-header h4 a:hover {
  color: #9cd5ff;
}
.service-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.btn-panel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  min-width: 210px;
  background: linear-gradient(135deg, #22c55e 0%, #166534 100%);
  color: #ffffff;
  border-radius: 999px;
  border: 1px solid rgba(34, 197, 94, 0.35);
  text-decoration: none;
  font-weight: 700;
  transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
}
.btn-panel:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 14px 26px rgba(34, 197, 94, 0.22);
}
.service-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 14px;
}
.service-meta-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 14px 16px;
}
.service-meta-item strong {
  display: block;
  margin-bottom: 8px;
  color: #b7d4ff;
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.service-meta-item span {
  color: #eef8ff;
  font-size: 14px;
}
.status-online { color: #7bf3b3; }
.status-offline { color: #f4b26d; }
.service-renew {
  display: flex;
  justify-content: flex-end;
  padding-top: 14px;
  color: #dde4ff;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.service-renew strong {
  color: #ffffff;
  margin-left: 6px;
}
@media (max-width: 900px) {
  .service-meta { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
  .service-actions { width: 100%; justify-content: flex-start; }
  .service-renew { justify-content: flex-start; }
}
@media (max-width: 640px) {
  .service-header { flex-direction: column; align-items: stretch; }
  .service-actions { align-items: stretch; }
  .service-meta { grid-template-columns: 1fr; }
}

.package-card { background: radial-gradient(circle at top left, #0f2819 0%, #102e1d 45%, #0b1d13 100%); border: 1px solid rgba(16, 185, 129, 0.35); }
.package-card:hover { border-color: rgba(16, 185, 129, 0.6); background: radial-gradient(circle at top left, #154130 0%, #143a2c 30%, #0e271c 100%); }
.package-card.recommend { border-color: #22c55e; background: radial-gradient(circle at top left, #123923 0%, #0f3a23 40%, #102a19 100%); box-shadow: 0 0 20px rgba(16, 185, 129, 0.3); }


.package-card { background: linear-gradient(150deg, #0f131f 0%, #12162b 40%, #141930 100%); border: 1px solid rgba(140, 70, 229, 0.25); }
.package-card.recommend { border-color: #ff5b29; background: linear-gradient(150deg, #23161f 0%, #2f1717 30%, #1c1124 100%); }

.btn-full { background: linear-gradient(135deg, #7d3cf5, #ba26ff); }
.btn-full:hover { background: linear-gradient(135deg, #a45ef0, #d051ff); }


.package-title { margin: 0 0 10px 0; color: #ecfffa; font-weight: 500; font-size: 18px; line-height: 1.35; }
.package-desc { margin: 0 0 14px 0; color: #c9f1e8; font-size: 14px; }
.package-specs p {
  margin: 6px 0;
  color: #d2f4e6;
  font-size: 14px;
  font-weight: 400;
  padding-left: 24px;
  position: relative;
}
.package-specs p::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: #3bf2a5;
  font-weight: 700;
}
.package-specs strong { color: #ecfffa; font-weight: 400; }

.package-price { display: flex; align-items: baseline; gap: 8px; margin: 14px 0; }
.price-large { font-size: 34px; font-weight: 900; color: #f6f9fb; }
.price-old { font-size: 20px; font-weight: 700; color: rgba(255,255,255,0.4); text-decoration: line-through; }
.price-small { font-size: 14px; color: #a6b8d9; text-transform: uppercase; }
.price-badge { font-size: 12px; color: #fff; background: #ff5f6d; border-radius: 999px; padding: 3px 10px; font-weight: 700; text-transform: uppercase; }

.btn-full {
  width: 100%;
  padding: 14px 0;
  font-size: 16px;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, #10b981, #059669);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  box-shadow: 0 10px 22px rgba(16, 185, 129, 0.5);
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
  letter-spacing: 0.05em;
  transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
}
.btn-full:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(16, 185, 129, 0.65);
  filter: brightness(1.05);
}

@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1150px) {
  .info-boxes { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
}

@media (max-width: 820px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    margin-bottom: 10px;
    overflow-y: visible;
  }
  .main-content {
    margin-left: 0;
    height: auto;
  }
  .sidebar { width: 100%; min-width: auto; border-right: none; border-bottom: 1px solid rgba(139, 152, 183, 0.22); overflow-y: visible; }
  .main-content { padding: 18px; margin-left: 0; height: auto; }
  .menu-item { justify-content: center; }
  .menu-item span:nth-child(2) { display: none; }
  .service-item { justify-content: center; }
  .info-boxes { grid-template-columns: 1fr; }
}


.wallet-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.wallet-card {
  background: linear-gradient(135deg, #2d5a3d 0%, #1f3f2f 100%);
  border: 1px solid rgba(52, 211, 153, 0.4);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 9px 26px rgba(0, 0, 0, 0.35);
}

.wallet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.wallet-header h3 {
  margin: 0;
  color: #e8eaf6;
  font-size: 18px;
}

.wallet-balance {
  font-size: 32px;
  font-weight: 800;
  color: #34d399;
  margin: 10px 0 20px 0;
  text-shadow: 0 0 12px rgba(52, 211, 153, 0.3);
}

.wallet-balance.positive {
  color: #34d399;
}

.wallet-balance.negative {
  color: #ef4444;
}

.wallet-transactions {
  background: linear-gradient(135deg, #2d3a4d 0%, #1f2a3f 100%);
  border: 1px solid rgba(105, 125, 156, 0.3);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 9px 26px rgba(0, 0, 0, 0.35);
}

.transactions-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.transaction-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(139, 152, 183, 0.2);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all var(--transition);
}

.transaction-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(139, 152, 183, 0.35);
}

.transaction-item.income {
  border-left: 4px solid #34d399;
}

.transaction-item.expense {
  border-left: 4px solid #ef4444;
}

.transaction-item.reset {
  border-left: 4px solid #f59e0b;
}

.transaction-info {
  flex: 1;
}

.transaction-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 14px;
}

.transaction-type {
  color: #e8eaf6;
  font-weight: 500;
}

.transaction-date {
  color: #98a3b5;
  font-size: 12px;
}

.transaction-amount {
  font-weight: 700;
  font-size: 16px;
  margin-top: 4px;
}

.transaction-amount.income {
  color: #34d399;
}


.stat-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
  border: 1px solid rgba(139, 152, 183, 0.1);
}

.stat-bar-inner {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease, background 0.4s ease;
  background: linear-gradient(to right, #22c55e 0%, #f59e0b 60%, #ef4444 100%);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.3);
}

.stat-bar-inner.warning {
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

.stat-bar-inner.critical {
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
  animation: pulse-critical 1.5s ease-in-out infinite;
}

@keyframes pulse-critical {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.limit-exceeded {
  color: #ef4444;
  font-weight: 700;
  animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.transaction-amount.expense {
  color: #ef4444;
}

.transaction-amount.reset {
  color: #f59e0b;
}

.transaction-id {
  color: #7d8ba0;
  font-size: 11px;
  font-weight: 500;
  margin-left: 12px;
}

.no-transactions {
  text-align: center;
  color: #7d8ba0;
  padding: 20px;
  font-size: 14px;
}

.loading {
  text-align: center;
  color: #7d8ba0;
  padding: 20px;
  font-size: 14px;
}

@media (max-width: 900px) {
  .wallet-info {
    grid-template-columns: 1fr;
  }
}


.lockout-widget {
    margin: 14px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.lockout-ring {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 4px solid #444;
    position: relative;
    box-sizing: border-box;
}
.lockout-ring::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid #1db954;
    transform: rotate(var(--lockout-progress, 0deg));
    transform-origin: center;
    transition: transform 0.3s linear;
}
.lockout-text {
    font-size: 15px;
    color: #ff6b6b;
    font-weight: 700;
}
