:root {
  --bg-deep: #0b0a09;
  --bg-card: rgba(34, 28, 23, 0.72);
  --bg-input: #110f0d;
  --border-subtle: rgba(255, 238, 205, 0.14);
  --border-hover: rgba(255, 238, 205, 0.26);
  --gold-cream: #fdf4c4;
  --gold-soft: #dfc280;
  --gold-main: #d8b74b;
  --gold-deep: #9e7b36;
  --emerald: #34d399;
  --amber: #d99b38;
  --danger: #e05252;
  --text-main: #f2efe9;
  --text-muted: #b0a89c;
  --text-dim: #736c62;
  --radius-xl: 20px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 9px;
  --shadow-card: 0 12px 32px rgba(0, 0, 0, 0.45);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-color: var(--bg-deep);
  background-image:
    radial-gradient(ellipse 80% 45% at 50% 0%, rgba(176, 130, 64, 0.16) 0%, transparent 72%),
    radial-gradient(ellipse 70% 50% at 50% 78%, rgba(154, 108, 52, 0.14) 0%, transparent 75%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', 'Noto Sans Myanmar', 'Pyidaungsu', 'Padauk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 32px 16px 52px;
}

.admin-container {
  max-width: 880px;
}

/* Header & Satin Gold HY Emblem */
.brand-header {
  text-align: center;
  margin-bottom: 24px;
}

.brand-logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  border-radius: 18px;
  background: linear-gradient(160deg, #1b1712 0%, #0e0c0a 100%);
  border: 1px solid rgba(223, 194, 128, 0.3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  margin-bottom: 12px;
}

.brand-logo-wrap svg {
  width: 50px;
  height: 50px;
}

.brand-title {
  margin: 0;
  font-size: 1.62rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: linear-gradient(180deg, #faf5e8 0%, #e4c887 55%, #b89246 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.35;
}

.brand-subtitle {
  margin: 4px 0 0;
  font-size: 0.86rem;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

/* Announcement Banner */
.notice-banner {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 15px;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
  background: rgba(201, 164, 92, 0.08);
  border: 1px solid rgba(255, 238, 205, 0.16);
  color: #e4ded3;
  font-size: 0.85rem;
  line-height: 1.65;
}

.notice-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Frosted Matte Cards */
.card {
  background: linear-gradient(180deg, rgba(46, 38, 30, 0.68) 0%, rgba(26, 22, 18, 0.82) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease;
}

.card:hover {
  border-color: var(--border-hover);
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 11px;
  flex-wrap: wrap;
}

.card-label {
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 7px;
}

/* Input Controls */
.key-input-wrapper {
  position: relative;
}

.key-textarea {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(14, 12, 10, 0.78);
  border: 1px solid rgba(255, 238, 205, 0.12);
  color: #ebe6dc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.83rem;
  line-height: 1.55;
  word-break: break-all;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.key-textarea::placeholder {
  font-family: 'Plus Jakarta Sans', 'Noto Sans Myanmar', 'Pyidaungsu', sans-serif;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.key-textarea:focus {
  border-color: rgba(223, 194, 128, 0.45);
  box-shadow: 0 0 0 3px rgba(201, 164, 92, 0.1);
}

.input-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.mini-btn-group {
  display: flex;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all 0.18s ease;
  text-decoration: none;
  line-height: 1.45;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-mini {
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  background: rgba(20, 17, 14, 0.75);
  border: 1px solid rgba(255, 238, 205, 0.14);
  color: #ded8cd;
}

.btn-mini:hover:not(:disabled) {
  background: rgba(38, 31, 24, 0.85);
  color: var(--gold-cream);
  border-color: rgba(253, 244, 196, 0.32);
}

.btn-primary {
  width: 100%;
  padding: 13px 18px;
  font-size: 0.94rem;
  font-weight: 600;
  color: #1a1408;
  background: linear-gradient(180deg, #e5c989 0%, #c69f4f 100%);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #ecd397 0%, #cfa859 100%);
  transform: translateY(-1px);
}

.btn-outline {
  padding: 10px 15px;
  font-size: 0.86rem;
  background: rgba(24, 20, 16, 0.8);
  border: 1px solid rgba(255, 238, 205, 0.22);
  color: var(--gold-cream);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--gold-soft);
  background: rgba(201, 164, 92, 0.12);
}

.btn-danger {
  padding: 7px 12px;
  font-size: 0.8rem;
  background: rgba(224, 82, 82, 0.12);
  border: 1px solid rgba(224, 82, 82, 0.28);
  color: #f09898;
}

.btn-danger:hover:not(:disabled) {
  background: rgba(224, 82, 82, 0.22);
  color: #ffffff;
}

/* Saved / Demo Key Chips */
.chips-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 238, 205, 0.08);
}

.chips-label {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.key-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(20, 17, 14, 0.75);
  border: 1px solid rgba(255, 238, 205, 0.16);
  color: #e2dcd0;
  font-size: 0.77rem;
  cursor: pointer;
  transition: all 0.16s ease;
}

.key-chip:hover {
  border-color: rgba(253, 244, 196, 0.4);
  color: var(--gold-cream);
}

.key-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1;
}

.key-chip-remove:hover {
  background: var(--danger);
  color: #fff;
}

/* Alert Boxes */
.alert-box {
  padding: 12px 15px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 0.85rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: fadeSlideUp 0.22s ease;
}

.alert-error {
  background: rgba(224, 82, 82, 0.1);
  border: 1px solid rgba(224, 82, 82, 0.28);
  color: #f4baba;
}

.alert-success {
  background: rgba(52, 211, 153, 0.09);
  border: 1px solid rgba(52, 211, 153, 0.25);
  color: #a7f3d0;
}

.alert-warning {
  background: rgba(201, 164, 92, 0.11);
  border: 1px solid rgba(255, 238, 205, 0.22);
  color: #ede0be;
}

/* Result Section */
.result-section {
  animation: fadeSlideUp 0.28s ease;
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.account-overview-card {
  padding: 18px 20px;
  margin-bottom: 14px;
}

.result-top-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 13px;
  border-bottom: 1px solid rgba(255, 238, 205, 0.08);
  margin-bottom: 13px;
  flex-wrap: wrap;
}

.account-title {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 700;
  color: #ffffff;
  word-break: break-word;
}

.meta-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.badge-server {
  background: rgba(216, 183, 75, 0.12);
  border: 1px solid rgba(253, 244, 196, 0.22);
  color: var(--gold-cream);
}

.badge-proto {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

.badge-online {
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: #6ee7b7;
}

.badge-offline {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

.badge-alert {
  background: rgba(224, 82, 82, 0.14);
  border: 1px solid rgba(248, 113, 113, 0.36);
  color: #f5a3a3;
}

.badge-device {
  background: rgba(216, 183, 75, 0.12);
  border: 1px solid rgba(253, 244, 196, 0.22);
  color: var(--gold-cream);
}

/* Connected Devices Frosted Glass Card */
.device-glass-card {
  background: linear-gradient(180deg, rgba(88, 71, 54, 0.56) 0%, rgba(56, 44, 34, 0.68) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 242, 214, 0.16);
  border-radius: var(--radius-xl);
  padding: 15px 18px;
  margin-bottom: 14px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.device-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.device-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(24, 17, 14, 0.68);
  border: 1px solid rgba(255, 238, 205, 0.14);
  color: var(--gold-cream);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.device-text-group {
  min-width: 0;
}

.device-card-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #f0ede6;
  letter-spacing: 0.04em;
  line-height: 1.35;
}

.device-card-sub {
  font-size: 0.78rem;
  color: #cdc6ba;
  line-height: 1.48;
  margin-top: 2px;
}

.device-card-right {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  border-radius: 13px;
  background: rgba(24, 17, 14, 0.72);
  border: 1px solid rgba(255, 238, 205, 0.12);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.device-card-right.is-connected {
  border-color: rgba(52, 211, 153, 0.35);
  box-shadow: 0 0 18px rgba(52, 211, 153, 0.08);
}

.device-card-right.is-overlimit {
  border-color: rgba(248, 113, 113, 0.45);
}

.device-card-right.is-inactive {
  border-color: rgba(248, 113, 113, 0.32);
}

.device-card-right.is-inactive .device-live-dot {
  background: #f87171;
  box-shadow: 0 0 7px rgba(248, 113, 113, 0.55);
}

.device-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.24);
  flex-shrink: 0;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.device-card-right.is-connected .device-live-dot {
  background: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.7);
}

.device-count-val {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(0.95rem, 3.3vw, 1.14rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--gold-cream);
  text-shadow: 0 2px 10px rgba(253, 244, 196, 0.18);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Status Banner */
.status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 13px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.86rem;
  flex-wrap: wrap;
}

.checked-time-text {
  font-size: 0.76rem;
  opacity: 0.82;
  font-weight: 500;
}

.status-active {
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.22);
  color: #86efac;
}

.status-expired, .status-depleted {
  background: rgba(224, 82, 82, 0.1);
  border: 1px solid rgba(224, 82, 82, 0.28);
  color: #f5a3a3;
}

.status-not_started {
  background: rgba(216, 183, 75, 0.1);
  border: 1px solid rgba(253, 244, 196, 0.22);
  color: var(--gold-cream);
}

.status-disabled {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

/* =========================================================
   3-Column Frosted Data Trio Cards (Matches Reference Image)
   ========================================================= */
.data-trio-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.glass-stat-card {
  background: linear-gradient(180deg, rgba(88, 71, 54, 0.56) 0%, rgba(56, 44, 34, 0.68) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 242, 214, 0.16);
  border-radius: var(--radius-xl);
  padding: 20px 10px 18px;
  text-align: center;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.glass-stat-card.is-depleted-card {
  border-color: rgba(248, 113, 113, 0.38);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.38), inset 0 0 22px rgba(224, 82, 82, 0.08);
}

.glass-stat-label {
  font-size: clamp(0.68rem, 2.5vw, 0.82rem);
  font-weight: 600;
  color: #f0ede6;
  letter-spacing: 0.04em;
  line-height: 1.45;
  margin-bottom: 8px;
}

.glass-stat-value {
  font-size: clamp(0.95rem, 3.8vw, 1.38rem);
  font-weight: 800;
  color: var(--gold-cream);
  text-shadow: 0 2px 12px rgba(253, 244, 196, 0.2);
  line-height: 1.2;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* =========================================================
   Expiration Date + 4-Tile Live Countdown Card
   ========================================================= */
.expiry-glass-card {
  background: linear-gradient(180deg, rgba(84, 65, 52, 0.56) 0%, rgba(52, 39, 31, 0.72) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 242, 214, 0.16);
  border-radius: var(--radius-xl);
  padding: 22px 18px 20px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.38);
}

.expire-on-header {
  text-align: center;
  font-size: clamp(0.88rem, 3.3vw, 1.04rem);
  margin-bottom: 18px;
  line-height: 1.4;
}

.expire-on-prefix {
  color: #ded9d0;
  font-weight: 500;
  margin-right: 4px;
}

.expire-on-date {
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.expire-sub-note {
  margin-top: 5px;
  font-size: clamp(0.76rem, 2.7vw, 0.84rem);
  color: #cdc6ba;
  font-weight: 500;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
}

.countdown-tile {
  background: rgba(24, 17, 14, 0.68);
  border: 1px solid rgba(255, 238, 205, 0.08);
  border-radius: 16px;
  padding: 16px 6px 14px;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.countdown-num {
  font-size: clamp(1.42rem, 5.2vw, 1.95rem);
  font-weight: 800;
  color: #ffffff;
  line-height: 1.12;
  font-variant-numeric: tabular-nums;
}

.countdown-unit {
  margin-top: 7px;
  font-size: clamp(0.64rem, 2.2vw, 0.75rem);
  font-weight: 700;
  color: var(--gold-main);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  line-height: 1;
}

@media (max-width: 420px) {
  .data-trio-grid {
    gap: 8px;
  }
  .glass-stat-card {
    padding: 15px 6px 14px;
    border-radius: 16px;
  }
  .expiry-glass-card {
    padding: 18px 12px 16px;
    border-radius: 18px;
  }
  .countdown-grid {
    gap: 8px;
  }
  .countdown-tile {
    padding: 14px 4px 12px;
    border-radius: 14px;
  }
}

/* Footer */
.site-footer {
  text-align: center;
  margin-top: 26px;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.site-footer strong {
  color: var(--text-muted);
  font-weight: 600;
}

/* Admin Panel Specific Styles */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

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

.form-group {
  margin-bottom: 13px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: #d6cfc2;
  margin-bottom: 6px;
}

.form-hint {
  font-size: 0.74rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.form-input, .form-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid rgba(255, 238, 205, 0.12);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
}

.form-input:focus, .form-select:focus {
  border-color: rgba(223, 194, 128, 0.48);
}

.server-item-card {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(14, 12, 10, 0.72);
  border: 1px solid rgba(255, 238, 205, 0.1);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.server-item-info h4 {
  margin: 0 0 3px;
  font-size: 0.96rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.server-item-url {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.server-item-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1b1713;
  border: 1px solid rgba(253, 244, 196, 0.34);
  color: var(--text-main);
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.65);
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s ease;
  z-index: 9999;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.hidden {
  display: none !important;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(26, 20, 8, 0.25);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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