:root {
  --xp-blue: #0a246a;
  --xp-blue-2: #3a6ea5;
  --xp-face: #ece9d8;
  --xp-border-light: #fff;
  --xp-border-dark: #7b7b7b;
  --xp-green: #2f8f3a;
  --xp-red: #b8342b;
  --xp-text: #1a1a1a;
}

* { box-sizing: border-box; }

body.xp-body {
  margin: 0;
  min-height: 100vh;
  padding: 28px;
  font-family: Tahoma, "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  color: var(--xp-text);
  background:
    radial-gradient(circle at 20% 10%, #7fb7e8 0, #4a8bd0 28%, #1f5fa8 60%, #0d3f78 100%);
}

.xp-frame {
  max-width: 1120px;
  margin: 0 auto;
  background: var(--xp-face);
  border: 1px solid #0831d9;
  border-radius: 7px 7px 4px 4px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
  overflow: hidden;
}

.xp-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 4px 6px 4px 10px;
  color: #fff;
  font-weight: 700;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, .45);
  background: linear-gradient(#3f8fe0 0%, #1d6dc4 8%, #0a4fa8 45%, #0b5fc1 90%, #3f8fe0 100%);
  border-bottom: 1px solid #0831d9;
}
.xp-title-icon { font-size: 16px; }
.xp-title-text { flex: 1; font-size: 13px; }
.xp-title-buttons { display: flex; gap: 3px; }
.xp-title-buttons span {
  display: grid; place-items: center;
  width: 22px; height: 21px;
  border-radius: 3px;
  font-size: 12px;
  background: linear-gradient(#6ba8e6, #2d6fbf);
  border: 1px solid #0b3d91;
  box-shadow: inset 0 1px rgba(255,255,255,.55);
}
.xp-title-buttons .close { background: linear-gradient(#e88a7d, #c73a2b); }

.xp-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px 10px;
  background: linear-gradient(#fdfdfb, #ece9d8 70%, #ddd8c3);
  border-bottom: 1px solid #b6b2a4;
  flex-wrap: wrap;
}
.xp-toolbar a {
  padding: 4px 10px;
  color: #123c7a;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 3px;
}
.xp-toolbar a:hover { background: #dbe8f7; border-color: #8fb6e2; }
.xp-toolbar .who { color: #444; font-size: 12px; }
.spacer { flex: 1; }

.xp-content { padding: 18px; background: var(--xp-face); min-height: 420px; }

.xp-statusbar {
  display: flex;
  gap: 10px;
  padding: 5px 10px;
  font-size: 11px;
  color: #333;
  background: #ece9d8;
  border-top: 1px solid #b6b2a4;
}

.xp-alert {
  margin: 0 18px 12px;
  padding: 8px 12px;
  border: 1px solid #b6b2a4;
  background: #fffbe0;
}
.xp-alert.error { background: #ffe3e0; border-color: #c98a84; color: #7a1710; }
.xp-alert.info { background: #e8f2ff; border-color: #8fb6e2; }

.xp-dialog {
  max-width: 460px;
  margin: 22px auto;
  background: var(--xp-face);
  border: 1px solid #0831d9;
  border-radius: 6px;
  box-shadow: 0 12px 28px rgba(0,0,0,.35);
  overflow: hidden;
}
.xp-dialog.wide { max-width: 600px; }
.xp-dialog-title {
  padding: 8px 12px;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(#3f8fe0, #0a4fa8 55%, #3f8fe0);
  text-shadow: 1px 1px #0831d9;
}
.xp-dialog-body { padding: 18px; }
.xp-banner {
  display: flex; gap: 12px; align-items: center;
  padding: 14px;
  margin-bottom: 16px;
  border: 1px solid #b6b2a4;
  background: #fff;
}
.xp-banner-logo {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border-radius: 6px;
  color: #fff; font: 700 28px Georgia, serif;
  background: linear-gradient(145deg, #4a9de8, #0a3f88);
}

.xp-form { display: grid; gap: 11px; }
.xp-form.compact { max-width: 460px; }
.xp-form label { display: grid; gap: 4px; font-weight: 600; }
.xp-form label.check { display: flex; align-items: center; gap: 7px; font-weight: 400; }
.xp-form .optional { font-weight: 400; color: #777; }
.xp-form input:not([type=checkbox]):not([type=radio]) {
  width: 100%;
  padding: 5px 7px;
  font: inherit;
  color: #111;
  background: #fff;
  border: 1px solid #7f9db9;
  box-shadow: inset 1px 1px 2px rgba(0,0,0,.18);
}
.xp-form input:disabled { background: #ece9d8; color: #555; }

.xp-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.xp-button {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 92px; min-height: 27px;
  padding: 4px 14px;
  font: inherit;
  color: #111;
  text-decoration: none;
  cursor: pointer;
  background: linear-gradient(#fff, #f1efe2 45%, #dcd8c4);
  border: 1px solid #7b7b7b;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px #fff;
}
.xp-button:hover { border-color: #3a6ea5; }
.xp-button:active { background: linear-gradient(#dcd8c4, #fff); }
.xp-button.primary { font-weight: 700; box-shadow: inset 0 0 0 1px #fff, 0 0 0 1px #f0c060; }
.xp-button.danger { color: #8c1d14; }
.xp-button.small { min-width: 0; min-height: 22px; padding: 2px 8px; font-size: 11px; }

.xp-hint { color: #555; font-size: 12px; }
.xp-table { width: 100%; border-collapse: collapse; background: #fff; font-size: 12px; }
.xp-table th, .xp-table td { padding: 6px 8px; border: 1px solid #d5d2c5; text-align: left; vertical-align: top; }
.xp-table th { background: #f1efe2; }
.xp-table .ua { max-width: 320px; overflow-wrap: anywhere; }
.badge { display: inline-block; padding: 1px 6px; border-radius: 8px; background: #d9ecd9; color: #225522; font-size: 10px; }

.xp-fieldset {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #b6b2a4;
  border-radius: 2px;
  background: #f7f5ea;
}
.xp-fieldset legend { padding: 0 5px; font-weight: 700; }

.xp-account { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: start; }
.xp-sidebar { background: linear-gradient(#6ba8e6, #1d6dc4 18%, #0a4fa8 60%, #5b9de0); border: 1px solid #0831d9; border-radius: 5px; padding: 10px; color: #fff; position: sticky; top: 12px; }
.xp-user-card { display: grid; gap: 4px; padding: 8px; margin-bottom: 12px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.35); border-radius: 4px; }
.xp-user-card span { font-size: 11px; overflow-wrap: anywhere; }
.xp-avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 4px; background: #fff; color: #0a4fa8; font: 700 24px Tahoma, sans-serif; text-transform: uppercase; }
.xp-side-links { display: grid; gap: 2px; margin-top: 10px; }
.xp-side-links a { padding: 5px 8px; color: #fff; text-decoration: none; border-radius: 3px; font-size: 12px; }
.xp-side-links a:hover, .xp-side-links a.active { background: rgba(255,255,255,.22); }
.xp-side-links.danger { margin-top: 20px; border-top: 1px solid rgba(255,255,255,.35); padding-top: 10px; }

.xp-main { display: grid; gap: 16px; }
.xp-section { padding: 14px; background: #fff; border: 1px solid #b6b2a4; border-radius: 3px; }
.xp-section h2 { margin: 0 0 10px; padding-bottom: 7px; font-size: 15px; color: #0a3b78; border-bottom: 1px solid #d5d2c5; }
.xp-section p { margin: 6px 0; }

.xp-service-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.xp-service { display: grid; grid-template-columns: 38px 1fr; grid-template-rows: auto auto; gap: 2px 10px; align-items: center; padding: 10px; color: #111; text-decoration: none; border: 1px solid #b6b2a4; border-radius: 3px; background: #f7f5ea; }
.xp-service:hover { border-color: #3a6ea5; background: #eef5ff; }
.xp-service .icon { grid-row: span 2; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 5px; color: #fff; font-size: 19px; background: linear-gradient(145deg, #6ba8e6, #0a4fa8); }
.xp-service .icon.mail { background: linear-gradient(145deg, #f0c060, #b46a12); }
.xp-service .icon.vpn { background: linear-gradient(145deg, #6cc47a, #1f6b2a); }
.xp-service .icon.pay { background: linear-gradient(145deg, #d98a6d, #8f2a1d); }
.xp-service small { color: #666; }

.danger-zone { border-color: #c98a84; }
.danger-zone h2 { color: #8c1d14; border-bottom-color: #e3c2be; }

.totp-qr { text-align: center; }
.totp-secret { text-align: center; }
.totp-secret code { display: inline-block; padding: 6px 10px; background: #fff; border: 1px solid #b6b2a4; letter-spacing: 1px; }

@media (max-width: 760px) {
  body.xp-body { padding: 8px; }
  .xp-account { grid-template-columns: 1fr; }
  .xp-sidebar { position: static; }
  .xp-content { padding: 10px; }
  .xp-title-buttons { display: none; }
}
