@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Plus Jakarta Sans", sans-serif;
    background: #eef3f8;
    color: #132033;
}

a { color: inherit; text-decoration: none; }
code { display: inline-block; background: #eaf0f8; padding: 0.15rem 0.35rem; border-radius: 0.35rem; font-family: "JetBrains Mono", monospace; }

.login-screen {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    background: hsl(220 20% 7%);
    color: hsl(210 20% 92%);
}

.login-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(hsl(220 13% 18% / 0.5) 1px, transparent 1px),
        linear-gradient(90deg, hsl(220 13% 18% / 0.5) 1px, transparent 1px);
    background-size: 66px 66px;
}

.login-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, hsl(210 100% 56% / 0.08), transparent 72%);
}

.login-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem;
}

.login-card {
    width: min(27.5rem, 100%);
    padding: 2.15rem 2.2rem 1.9rem;
    border-radius: 1rem;
    border: 1px solid hsl(220 13% 18%);
    background: linear-gradient(180deg, hsl(220 18% 12%), hsl(220 18% 10%));
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
}

.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
    text-align: center;
}

.login-logo {
    width: 3.25rem;
    height: 3.25rem;
    display: grid;
    place-items: center;
    border-radius: 1rem;
    background: linear-gradient(135deg, hsl(210 100% 56%), hsl(220 100% 65%));
    box-shadow: 0 0 40px -10px hsl(210 100% 56% / 0.3);
}

.login-logo svg {
    width: 1.6rem;
    height: 1.6rem;
    fill: hsl(0 0% 100%);
}

.login-brand h1 {
    margin: 1rem 0 0;
    font-size: 2rem;
    line-height: 1.15;
    font-weight: 700;
    color: hsl(210 20% 92%);
}

.login-brand p {
    margin: 0.45rem 0 0;
    font-size: 0.95rem;
    color: hsl(215 12% 50%);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.login-field > span {
    font-size: 0.95rem;
    color: hsl(215 12% 50%);
}

.login-field input {
    width: 100%;
    height: 2.85rem;
    padding: 0 1rem;
    border-radius: 0.85rem;
    border: 1px solid hsl(220 13% 18%);
    background: hsl(220 16% 18%);
    color: hsl(210 20% 92%);
    font-size: 0.95rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.login-field input::placeholder {
    color: hsl(215 12% 50%);
}

.login-field input:focus {
    outline: none;
    border-color: hsl(210 100% 56%);
    box-shadow: 0 0 0 3px hsl(210 100% 56% / 0.15);
}

.login-password-wrap {
    position: relative;
}

.login-password-wrap input {
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 0.85rem;
    transform: translateY(-50%);
    width: 1.75rem;
    height: 1.75rem;
    display: grid;
    place-items: center;
    border: 0;
    padding: 0;
    background: transparent;
    color: hsl(215 12% 50%);
    cursor: pointer;
}

.password-toggle svg {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
}

.login-submit {
    width: 100%;
    height: 2.85rem;
    margin-top: 0.1rem;
    border: 0;
    border-radius: 0.9rem;
    background: linear-gradient(135deg, hsl(210 100% 56%), hsl(210 90% 58%));
    color: hsl(0 0% 100%);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.16s ease, filter 0.16s ease;
}

.login-submit:hover {
    filter: brightness(1.04);
}

.login-submit:active {
    transform: translateY(1px);
}

.login-footer {
    margin: 1.55rem 0 0;
    text-align: center;
    font-size: 0.9rem;
    color: hsl(215 12% 50%);
}

.login-footer strong {
    color: hsl(210 20% 92%);
    font-weight: 700;
}

.login-alert {
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 0.85rem;
    border: 1px solid hsl(0 72% 51% / 0.35);
    background: hsl(0 40% 14% / 0.7);
    color: hsl(0 0% 100%);
    font-size: 0.92rem;
}

.hidden {
    display: none !important;
}

.eyebrow, .muted, .field-label { color: #526377; }

.portal-admin {
    background: hsl(220 20% 7%);
    color: hsl(210 20% 92%);
}

.portal-app {
    background: hsl(220 20% 7%);
    color: hsl(210 20% 92%);
}

.admin-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 268px 1fr;
    background: hsl(220 20% 7%);
}

.admin-sidebar {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: hsl(220 20% 8%);
    border-right: 1px solid hsl(220 13% 18%);
}

.admin-sidebar-brand {
    padding: 1.05rem 1.1rem;
    border-bottom: 1px solid hsl(220 13% 18%);
}

.admin-brand-lockup {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.admin-brand-icon {
    width: 2.25rem;
    height: 2.25rem;
    display: grid;
    place-items: center;
    border-radius: 0.9rem;
    background: linear-gradient(135deg, hsl(210 100% 56%), hsl(220 100% 65%));
}

.admin-brand-icon svg {
    width: 1.1rem;
    height: 1.1rem;
    fill: white;
}

.admin-brand-title-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.admin-brand-title {
    font-size: 1rem;
    font-weight: 700;
    color: hsl(210 20% 92%);
}

.admin-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.4rem;
    border-radius: 0.35rem;
    background: hsl(210 100% 56% / 0.18);
    color: hsl(210 100% 56%);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.admin-sidebar-section-label {
    padding: 2.8rem 1.1rem 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.74rem;
    color: hsl(215 12% 50%);
}

.admin-nav {
    padding: 0 0.55rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.admin-nav-link,
.admin-footer-link {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    width: 100%;
    padding: 0.82rem 0.8rem;
    border-radius: 0.9rem;
    color: hsl(215 12% 66%);
    transition: background-color 0.18s ease, color 0.18s ease;
}

.admin-nav-link:hover,
.admin-footer-link:hover {
    background: hsl(220 16% 14%);
    color: hsl(210 20% 92%);
}

.admin-nav-link.active {
    background: hsl(220 16% 18%);
    color: hsl(210 100% 56%);
    font-weight: 600;
}

.admin-nav-icon {
    width: 1rem;
    height: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.admin-nav-icon svg {
    width: 1rem;
    height: 1rem;
}

.admin-sidebar-footer {
    margin-top: auto;
    padding: 0.65rem 0.55rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.admin-footer-button {
    border: 0;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.admin-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
}

.admin-topbar {
    height: 3.9rem;
    display: flex;
    align-items: center;
    padding: 0 1.4rem;
    border-bottom: 1px solid hsl(220 13% 18%);
}

.admin-topbar-icon {
    width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;
    border: 0;
    background: transparent;
    color: hsl(210 20% 92%);
}

.admin-topbar-icon svg {
    width: 1rem;
    height: 1rem;
}

.admin-content {
    flex: 1;
    padding: 2rem 1.6rem 2.2rem;
    overflow: auto;
}

.admin-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid hsl(220 13% 18%);
    text-align: center;
    color: hsl(215 12% 50%);
    font-size: 0.84rem;
}

.admin-footer strong {
    color: hsl(210 20% 92%);
}

.admin-page-intro {
    max-width: 70rem;
    margin-bottom: 1.9rem;
}

.admin-page-intro h1 {
    margin: 0;
    font-size: 2.25rem;
    line-height: 1.12;
    font-weight: 700;
    color: hsl(210 20% 92%);
}

.admin-page-intro p {
    margin: 0.55rem 0 0;
    font-size: 1.05rem;
    color: hsl(215 12% 50%);
}

.admin-page-header {
    max-width: 70rem;
    margin-bottom: 1.8rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.admin-page-header-stack {
    justify-content: flex-start;
}

.admin-title-with-badge {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.admin-count-badge {
    width: 1.6rem;
    height: 1.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: hsl(210 100% 56% / 0.18);
    color: hsl(210 100% 56%);
    font-size: 0.76rem;
    font-weight: 700;
}

.admin-primary-button,
.admin-secondary-button {
    height: 2.7rem;
    padding: 0 1.15rem;
    border-radius: 0.85rem;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.16s ease, background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.admin-primary-button {
    background: linear-gradient(135deg, hsl(210 100% 56%), hsl(210 90% 58%));
    color: white;
}

.admin-primary-button:hover,
.admin-secondary-button:hover {
    transform: translateY(-1px);
}

.admin-secondary-button {
    background: hsl(220 16% 16%);
    border-color: hsl(220 13% 18%);
    color: hsl(210 20% 92%);
}

.admin-button-icon {
    width: 1rem;
    height: 1rem;
    display: inline-flex;
}

.admin-button-icon svg {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
}

.admin-stats-grid {
    max-width: 70rem;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.15rem;
    margin-bottom: 1.7rem;
}

.admin-stat-card,
.admin-summary-card {
    border: 1px solid hsl(220 13% 18%);
    background: linear-gradient(180deg, hsl(220 18% 12%), hsl(220 18% 10%));
    border-radius: 1rem;
    color: hsl(210 20% 92%);
}

.admin-stat-card {
    padding: 1.55rem 1.6rem;
}

.admin-stat-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    color: hsl(215 12% 50%);
    font-size: 0.95rem;
}

.admin-stat-icon {
    color: hsl(215 12% 58%);
}

.admin-stat-icon svg {
    width: 1.05rem;
    height: 1.05rem;
}

.admin-stat-card strong {
    display: block;
    margin-top: 0.95rem;
    font-size: 3rem;
    line-height: 1;
    font-weight: 700;
}

.admin-stat-card p {
    margin: 0.6rem 0 0;
    color: hsl(215 12% 50%);
    font-size: 0.95rem;
}

.admin-summary-card {
    max-width: 70rem;
    padding: 1.7rem 1.6rem;
}

.admin-summary-card h2 {
    margin: 0 0 1.35rem;
    font-size: 1.15rem;
    font-weight: 700;
}

.admin-summary-lines {
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
    color: hsl(215 12% 50%);
    font-size: 0.98rem;
}

.admin-summary-lines p {
    margin: 0;
}

.admin-summary-lines code {
    background: transparent;
    color: hsl(210 20% 92%);
    padding: 0;
}

.admin-flash {
    max-width: 70rem;
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 0.85rem;
}

.admin-flash.success {
    background: hsl(142 45% 14%);
    color: hsl(142 71% 75%);
    border: 1px solid hsl(142 50% 22%);
}

.admin-flash.error {
    background: hsl(0 45% 14%);
    color: hsl(0 75% 78%);
    border: 1px solid hsl(0 52% 24%);
}

.admin-flash ul {
    margin: 0.5rem 0 0;
    padding-left: 1rem;
}

.admin-table-card {
    max-width: 70rem;
    border: 1px solid hsl(220 13% 18%);
    background: linear-gradient(180deg, hsl(220 18% 12%), hsl(220 18% 10%));
    border-radius: 1rem;
    overflow: hidden;
}

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

.admin-table thead th {
    padding: 1rem 1.15rem;
    border-bottom: 1px solid hsl(220 13% 18%);
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.76rem;
    font-weight: 500;
    color: hsl(215 12% 50%);
}

.admin-table tbody tr {
    transition: background-color 0.16s ease;
}

.admin-table tbody tr:hover {
    background: hsl(220 16% 14%);
}

.admin-table tbody td {
    padding: 1rem 1.15rem;
    border-bottom: 1px solid hsl(220 13% 18%);
    vertical-align: middle;
    color: hsl(215 12% 66%);
}

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

.admin-table-actions-head {
    text-align: right;
}

.admin-identity {
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
}

.admin-identity strong {
    color: hsl(210 20% 92%);
    font-size: 0.98rem;
    font-weight: 600;
}

.admin-identity span {
    color: hsl(215 12% 50%);
    font-size: 0.9rem;
}

.admin-mono {
    font-family: "JetBrains Mono", monospace;
    color: hsl(215 12% 60%);
    font-size: 0.92rem;
}

.admin-session-id {
    font-family: "JetBrains Mono", monospace;
    color: hsl(210 100% 56%);
    font-size: 0.92rem;
}

.admin-role-badge {
    display: inline-flex;
    align-items: center;
    min-height: 1.45rem;
    padding: 0.16rem 0.52rem;
    border-radius: 0.38rem;
    background: hsl(220 16% 18%);
    color: hsl(210 20% 92%);
    font-size: 0.77rem;
    font-weight: 600;
    text-transform: lowercase;
}

.admin-role-badge.is-admin {
    background: hsl(210 100% 56% / 0.18);
    color: hsl(210 100% 56%);
}

.admin-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    min-height: 1.55rem;
    padding: 0.18rem 0.58rem;
    border-radius: 999px;
    font-size: 0.82rem;
}

.admin-status-badge.is-active {
    background: hsl(142 45% 14%);
    color: hsl(142 71% 58%);
}

.admin-status-badge.is-inactive {
    background: transparent;
    color: hsl(215 12% 50%);
}

.admin-status-badge.is-offline {
    background: hsl(0 46% 16%);
    color: hsl(0 84% 60%);
}

.admin-status-dot {
    width: 0.42rem;
    height: 0.42rem;
    border-radius: 999px;
    background: currentColor;
    flex-shrink: 0;
}

.admin-desktop-list {
    color: hsl(215 12% 58%);
    font-size: 0.95rem;
}

.admin-row-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.45rem;
}

.admin-icon-button {
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    border-radius: 0.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: hsl(215 12% 58%);
    cursor: pointer;
    transition: background-color 0.16s ease, color 0.16s ease;
}

.admin-icon-button:hover {
    background: hsl(220 16% 16%);
    color: hsl(210 20% 92%);
}

.admin-icon-button.danger:hover {
    color: hsl(0 75% 72%);
}

.admin-icon-button svg {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
}

.admin-empty-state {
    text-align: center;
    color: hsl(215 12% 50%);
    padding: 2rem 1rem !important;
}

.admin-dialog {
    width: min(45rem, calc(100vw - 2rem));
    padding: 0;
    border: 0;
    background: transparent;
}

.admin-dialog::backdrop {
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(4px);
}

.admin-dialog-card {
    border: 1px solid hsl(220 13% 18%);
    background: linear-gradient(180deg, hsl(220 18% 12%), hsl(220 18% 10%));
    border-radius: 1rem;
    color: hsl(210 20% 92%);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
}

.admin-dialog-head {
    padding: 1.35rem 1.4rem 1rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid hsl(220 13% 18%);
}

.admin-dialog-head h2 {
    margin: 0;
    font-size: 1.15rem;
}

.admin-dialog-head p {
    margin: 0.4rem 0 0;
    color: hsl(215 12% 50%);
    font-size: 0.92rem;
}

.admin-dialog-close {
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 0.6rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: hsl(215 12% 58%);
    cursor: pointer;
}

.admin-dialog-close:hover {
    background: hsl(220 16% 16%);
    color: hsl(210 20% 92%);
}

.admin-dialog-close svg {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
}

.admin-dialog-form {
    padding: 1.35rem 1.4rem 1.4rem;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.admin-field {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin: 0 0 1rem;
}

.admin-field-full {
    margin-bottom: 0;
}

.admin-field span {
    color: hsl(215 12% 50%);
    font-size: 0.9rem;
}

.admin-field input,
.admin-field select,
.admin-field textarea {
    width: 100%;
    padding: 0.82rem 0.9rem;
    border-radius: 0.8rem;
    border: 1px solid hsl(220 13% 18%);
    background: hsl(220 16% 18%);
    color: hsl(210 20% 92%);
}

.admin-field input::placeholder {
    color: hsl(215 12% 50%);
}

.admin-field input:focus,
.admin-field select:focus,
.admin-field textarea:focus {
    outline: none;
    border-color: hsl(210 100% 56%);
    box-shadow: 0 0 0 3px hsl(210 100% 56% / 0.12);
}

.admin-field select[multiple] {
    min-height: 10rem;
}

.admin-dialog-actions {
    margin-top: 1.2rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.admin-assignment-grid {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.15rem;
}

.admin-assignment-option {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.8rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid hsl(220 13% 18%);
    border-radius: 0.85rem;
    background: hsl(220 16% 18%);
    cursor: pointer;
}

.admin-assignment-option input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: hsl(210 100% 56%);
}

.admin-assignment-body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.admin-assignment-title {
    color: hsl(210 20% 92%);
    font-size: 0.94rem;
    font-weight: 600;
}

.admin-assignment-subtitle {
    color: hsl(215 12% 50%);
    font-size: 0.84rem;
}

.admin-assignment-status {
    min-height: 1.4rem;
    padding: 0.16rem 0.5rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    white-space: nowrap;
}

.admin-assignment-status.is-active {
    background: hsl(142 45% 14%);
    color: hsl(142 71% 58%);
}

.admin-assignment-status.is-inactive {
    background: hsl(220 16% 14%);
    color: hsl(215 12% 58%);
}

.admin-assignment-empty {
    padding: 0.95rem 1rem;
    border: 1px dashed hsl(220 13% 18%);
    border-radius: 0.85rem;
    color: hsl(215 12% 50%);
    background: hsl(220 18% 10% / 0.55);
    font-size: 0.9rem;
}

.admin-license-card {
    max-width: 45.5rem;
    margin-bottom: 1.7rem;
    padding: 1.6rem;
    border: 1px solid hsl(220 13% 18%);
    background: linear-gradient(180deg, hsl(220 18% 12%), hsl(220 18% 10%));
    border-radius: 1rem;
}

.admin-license-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.3rem;
}

.admin-license-heading {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.admin-license-icon {
    width: 2.75rem;
    height: 2.75rem;
    display: grid;
    place-items: center;
    border-radius: 0.9rem;
    background: hsl(210 100% 56% / 0.12);
    color: hsl(210 100% 56%);
}

.admin-license-icon svg {
    width: 1.2rem;
    height: 1.2rem;
    fill: currentColor;
}

.admin-license-heading h2 {
    margin: 0;
    color: hsl(210 20% 92%);
    font-size: 1.12rem;
}

.admin-license-heading p {
    margin: 0.35rem 0 0;
    color: hsl(215 12% 50%);
    font-size: 0.9rem;
}

.admin-license-details {
    display: flex;
    flex-direction: column;
}

.admin-license-row {
    display: grid;
    grid-template-columns: 10rem 1fr;
    gap: 1rem;
    align-items: center;
    padding: 1.15rem 0;
    border-bottom: 1px solid hsl(220 13% 18%);
}

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

.admin-license-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: hsl(215 12% 50%);
    font-size: 0.98rem;
}

.admin-license-row-icon {
    width: 1rem;
    height: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.admin-license-row-icon svg {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
}

.admin-license-value {
    color: hsl(210 20% 92%);
    font-size: 0.98rem;
    font-weight: 500;
}

.admin-license-portal-card {
    max-width: 45.5rem;
    padding: 1.8rem 1.5rem;
    border: 1px dashed hsl(220 13% 18%);
    border-radius: 1rem;
    background: hsl(220 18% 10% / 0.55);
    text-align: center;
}

.admin-license-portal-card p {
    margin: 0 0 1rem;
    color: hsl(215 12% 50%);
    font-size: 0.98rem;
}

.admin-license-link {
    min-height: 2.6rem;
    padding: 0 1rem;
    border-radius: 0.85rem;
    border: 1px solid hsl(220 13% 18%);
    background: transparent;
    color: hsl(215 12% 58%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    font: inherit;
    text-decoration: none;
    transition: color 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}

.admin-license-link:hover {
    color: hsl(210 20% 92%);
    background: hsl(220 16% 14%);
}

.admin-license-link.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.admin-whmcs-stack {
    max-width: 70rem;
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
}

.admin-whmcs-card {
    padding: 1.6rem;
    border: 1px solid hsl(220 13% 18%);
    border-radius: 1rem;
    background: linear-gradient(180deg, hsl(220 18% 12%), hsl(220 18% 10%));
}

.admin-whmcs-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.35rem;
}

.admin-whmcs-card-head h2 {
    margin: 0;
    font-size: 1.15rem;
    color: hsl(210 20% 92%);
}

.admin-whmcs-card-head p {
    margin: 0.45rem 0 0;
    color: hsl(215 12% 50%);
    font-size: 0.95rem;
}

.admin-whmcs-form {
    display: flex;
    flex-direction: column;
}

.admin-whmcs-hint {
    margin-top: 0.15rem;
    color: hsl(215 12% 50%);
    font-size: 0.9rem;
}

.admin-whmcs-key-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(16rem, 0.8fr);
    gap: 1rem;
    align-items: stretch;
}

.admin-whmcs-key-block {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.admin-whmcs-key-label {
    color: hsl(215 12% 50%);
    font-size: 0.9rem;
}

.admin-whmcs-key-input {
    width: 100%;
    height: 3rem;
    padding: 0 0.95rem;
    border-radius: 0.85rem;
    border: 1px solid hsl(220 13% 18%);
    background: hsl(220 16% 18%);
    color: hsl(210 20% 92%);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.9rem;
}

.admin-whmcs-key-note {
    margin: 0;
    color: hsl(215 12% 50%);
    font-size: 0.88rem;
}

.admin-whmcs-meta-card {
    padding: 1rem 1.05rem;
    border: 1px solid hsl(220 13% 18%);
    border-radius: 0.9rem;
    background: hsl(220 16% 14%);
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
}

.admin-whmcs-meta-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.admin-whmcs-meta-row span {
    color: hsl(215 12% 50%);
    font-size: 0.85rem;
}

.admin-whmcs-meta-row strong {
    color: hsl(210 20% 92%);
    font-size: 0.95rem;
    font-weight: 600;
}

.admin-whmcs-notes {
    max-width: 70rem;
    text-align: left;
}

.admin-whmcs-notes-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    color: hsl(215 12% 58%);
    font-size: 0.95rem;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 264px 1fr;
    background: hsl(220 20% 7%);
}

.app-sidebar {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: hsl(220 20% 8%);
    border-right: 1px solid hsl(220 13% 18%);
}

.app-sidebar-brand {
    padding: 1.1rem 1rem;
    border-bottom: 1px solid hsl(220 13% 18%);
}

.app-brand-lockup {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.app-brand-icon {
    width: 2.25rem;
    height: 2.25rem;
    display: grid;
    place-items: center;
    border-radius: 0.9rem;
    background: linear-gradient(135deg, hsl(210 100% 56%), hsl(220 100% 65%));
}

.app-brand-icon svg {
    width: 1.1rem;
    height: 1.1rem;
    fill: white;
}

.app-brand-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: hsl(210 20% 92%);
}

.app-sidebar-section-label {
    padding: 2.8rem 1rem 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.74rem;
    color: hsl(215 12% 50%);
}

.app-nav {
    padding: 0 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.app-nav-link,
.app-footer-link {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.82rem 0.8rem;
    border-radius: 0.9rem;
    color: hsl(215 12% 66%);
    transition: background-color 0.18s ease, color 0.18s ease;
}

.app-nav-link:hover,
.app-footer-link:hover {
    background: hsl(220 16% 14%);
    color: hsl(210 20% 92%);
}

.app-nav-link.active {
    background: hsl(220 16% 18%);
    color: hsl(210 100% 56%);
    font-weight: 600;
}

.app-nav-icon {
    width: 1rem;
    height: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.app-nav-icon svg {
    width: 1rem;
    height: 1rem;
}

.app-sidebar-footer {
    margin-top: auto;
    padding: 0.75rem 0.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.app-footer-button {
    border: 0;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.app-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
}

.app-topbar {
    height: 3.9rem;
    display: flex;
    align-items: center;
    padding: 0 1.35rem;
    border-bottom: 1px solid hsl(220 13% 18%);
}

.app-topbar-icon {
    width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;
    border: 0;
    background: transparent;
    color: hsl(210 20% 92%);
}

.app-topbar-icon svg {
    width: 1rem;
    height: 1rem;
}

.app-content {
    flex: 1;
    padding: 2rem 1.6rem 2.2rem;
    overflow: auto;
}

.app-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid hsl(220 13% 18%);
    text-align: center;
    color: hsl(215 12% 50%);
    font-size: 0.84rem;
}

.app-footer strong {
    color: hsl(210 20% 92%);
}

.app-page-intro {
    max-width: 70rem;
    margin-bottom: 2rem;
}

.app-page-intro h1 {
    margin: 0;
    font-size: 2.25rem;
    line-height: 1.12;
    font-weight: 700;
    color: hsl(210 20% 92%);
}

.app-page-intro p {
    margin: 0.6rem 0 0;
    font-size: 1.05rem;
    color: hsl(215 12% 50%);
}

.app-desktop-grid {
    max-width: 70rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.1rem;
}

.app-desktop-card {
    border: 1px solid hsl(220 13% 18%);
    background: linear-gradient(180deg, hsl(220 18% 12%), hsl(220 18% 10%));
    border-radius: 1rem;
    padding: 1.45rem 1.35rem 1.3rem;
}

.app-desktop-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.app-desktop-ident {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.app-desktop-icon {
    width: 2.75rem;
    height: 2.75rem;
    display: grid;
    place-items: center;
    border-radius: 0.9rem;
    background: hsl(220 16% 18%);
    color: hsl(215 12% 58%);
}

.app-desktop-icon svg {
    width: 1.25rem;
    height: 1.25rem;
    fill: currentColor;
}

.app-desktop-ident h2 {
    margin: 0;
    color: hsl(210 20% 92%);
    font-size: 1rem;
}

.app-desktop-ident p {
    margin: 0.35rem 0 0;
    color: hsl(215 12% 50%);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.82rem;
}

.app-desktop-meta {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-top: 1.2rem;
    color: hsl(215 12% 58%);
    font-size: 0.94rem;
}

.app-desktop-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.app-desktop-meta-icon {
    width: 0.95rem;
    height: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.app-desktop-meta-icon svg {
    width: 0.95rem;
    height: 0.95rem;
    fill: currentColor;
}

.app-desktop-open {
    width: 100%;
    min-height: 2.8rem;
    margin-top: 1.35rem;
    border: 0;
    border-radius: 0.85rem;
    background: hsl(215 45% 16%);
    color: hsl(210 100% 56%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    font: inherit;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.16s ease, color 0.16s ease;
}

.app-desktop-open:hover {
    background: hsl(215 45% 20%);
}

.app-desktop-open.is-disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.app-desktop-open-icon {
    width: 1rem;
    height: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.app-desktop-open-icon svg {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
}

.app-empty-card {
    max-width: 70rem;
    padding: 1.4rem;
    border: 1px solid hsl(220 13% 18%);
    border-radius: 1rem;
    background: linear-gradient(180deg, hsl(220 18% 12%), hsl(220 18% 10%));
    color: hsl(215 12% 58%);
}

.app-account-stack {
    max-width: 46.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
}

.app-account-card {
    padding: 1.65rem 1.55rem;
    border: 1px solid hsl(220 13% 18%);
    background: linear-gradient(180deg, hsl(220 18% 12%), hsl(220 18% 10%));
    border-radius: 1rem;
}

.app-account-card h2 {
    margin: 0;
    color: hsl(210 20% 92%);
    font-size: 1.1rem;
}

.app-account-details {
    margin-top: 1.25rem;
    display: flex;
    flex-direction: column;
}

.app-account-row {
    display: grid;
    grid-template-columns: 10rem 1fr;
    gap: 1rem;
    align-items: center;
    padding: 1.1rem 0;
    border-bottom: 1px solid hsl(220 13% 18%);
}

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

.app-account-label {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: hsl(215 12% 50%);
    font-size: 0.98rem;
}

.app-account-row-icon {
    width: 1rem;
    height: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.app-account-row-icon svg {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
}

.app-account-value {
    color: hsl(210 20% 92%);
    font-size: 0.98rem;
    font-weight: 500;
}

.app-account-card-head {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1.35rem;
}

.app-account-lock-icon {
    width: 1.2rem;
    height: 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: hsl(215 12% 58%);
}

.app-account-lock-icon svg {
    width: 1.2rem;
    height: 1.2rem;
    fill: currentColor;
}

.app-account-form {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.app-account-field {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.app-account-field span {
    color: hsl(215 12% 50%);
    font-size: 0.96rem;
}

.app-account-field input {
    width: 100%;
    height: 2.95rem;
    padding: 0 0.95rem;
    border-radius: 0.8rem;
    border: 1px solid hsl(220 13% 18%);
    background: hsl(220 16% 18%);
    color: hsl(210 20% 92%);
}

.app-account-field input::placeholder {
    color: hsl(215 12% 50%);
}

.app-account-field input:focus {
    outline: none;
    border-color: hsl(210 100% 56%);
    box-shadow: 0 0 0 3px hsl(210 100% 56% / 0.12);
}

.app-account-submit {
    width: fit-content;
    min-width: 9.75rem;
    height: 2.75rem;
    padding: 0 1.15rem;
    border: 0;
    border-radius: 0.85rem;
    background: linear-gradient(135deg, hsl(210 100% 56%), hsl(210 90% 58%));
    color: white;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.app-viewer-shell {
    min-height: calc(var(--rdp-mobile-vh, 100dvh) - 11rem);
    display: flex;
    flex-direction: column;
    border: 1px solid hsl(220 13% 18%);
    border-radius: 0;
    background: hsl(220 18% 10%);
    overflow: hidden;
}

.app-viewer-shell:fullscreen {
    width: 100vw;
    height: 100vh;
    border: 0;
}

.app-viewer-toolbar {
    min-height: 3.55rem;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid hsl(220 13% 18%);
    background: hsl(220 18% 12%);
}

.app-viewer-toolbar-left {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.app-viewer-toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
}

.app-viewer-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: hsl(215 12% 58%);
    font-size: 0.98rem;
}

.app-viewer-separator {
    width: 1px;
    height: 1rem;
    background: hsl(220 13% 18%);
}

.app-viewer-title {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: hsl(210 20% 92%);
    font-size: 1rem;
    font-weight: 600;
    min-width: 0;
}

.app-viewer-inline-icon {
    width: 1rem;
    height: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: hsl(215 12% 58%);
    flex-shrink: 0;
}

.app-viewer-inline-icon.is-primary {
    color: hsl(210 100% 56%);
}

.app-viewer-inline-icon svg {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
}

.app-viewer-status {
    min-height: 1.6rem;
    padding: 0.18rem 0.68rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.84rem;
    font-weight: 500;
    white-space: nowrap;
}

.app-viewer-status.is-pending {
    background: hsl(210 100% 56% / 0.16);
    color: hsl(210 100% 56%);
}

.app-viewer-status.is-waiting {
    background: hsl(48 95% 17%);
    color: hsl(48 96% 58%);
}

.app-viewer-status.is-success {
    background: hsl(142 45% 14%);
    color: hsl(142 71% 58%);
}

.app-viewer-status.is-error {
    background: hsl(0 46% 16%);
    color: hsl(0 84% 60%);
}

.app-viewer-toolbar-button {
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: hsl(215 12% 58%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.app-viewer-toolbar-button:hover,
.app-viewer-toolbar-button.is-active {
    background: hsl(220 16% 16%);
    color: hsl(210 20% 92%);
    border-radius: 0.6rem;
}

.app-viewer-toolbar-button span:last-child {
    font-size: 0.8rem;
    font-weight: 600;
}

.app-viewer-frame {
    position: relative;
    flex: 1;
    min-height: 42rem;
    background: hsl(220 20% 5%);
    overflow: hidden;
}

.app-viewer-shell:fullscreen .app-viewer-frame {
    min-height: 0;
    height: auto;
}

.app-viewer-shell:fullscreen .app-mobile-orientation-hint {
    display: none !important;
}

.app-mobile-orientation-hint {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid hsl(220 13% 18%);
    background: linear-gradient(180deg, hsl(215 52% 17%), hsl(220 44% 13%));
}

.app-mobile-orientation-card {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
}

.app-mobile-orientation-icon {
    width: 2.2rem;
    height: 2.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    background: hsl(210 100% 56% / 0.14);
    color: hsl(210 100% 56%);
    flex-shrink: 0;
}

.app-mobile-orientation-icon svg {
    width: 1.2rem;
    height: 1.2rem;
    fill: currentColor;
}

.app-mobile-orientation-copy {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.app-mobile-orientation-copy strong {
    color: hsl(210 20% 92%);
    font-size: 0.92rem;
    font-weight: 700;
}

.app-mobile-orientation-copy span {
    color: hsl(215 12% 66%);
    font-size: 0.84rem;
    line-height: 1.45;
}

.app-viewer-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(hsl(220 13% 12% / 0.38) 1px, transparent 1px),
        linear-gradient(90deg, hsl(220 13% 12% / 0.38) 1px, transparent 1px);
    background-size: 44px 44px;
}

.app-viewer-viewport {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    touch-action: none;
}

.app-viewer-placeholder {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    color: hsl(215 12% 50%);
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.app-viewer-placeholder.is-live {
    opacity: 0;
    visibility: hidden;
}

.app-viewer-placeholder-icon {
    width: 4.5rem;
    height: 4.5rem;
    margin-bottom: 1.15rem;
    display: grid;
    place-items: center;
    border-radius: 1.25rem;
    background: hsl(210 100% 56% / 0.1);
    color: hsl(210 100% 56%);
    box-shadow: 0 0 40px -10px hsl(210 100% 56% / 0.28);
}

.app-viewer-placeholder-icon svg {
    width: 2rem;
    height: 2rem;
    fill: currentColor;
}

.app-viewer-placeholder-title {
    margin: 0;
    color: hsl(210 20% 92%);
    font-size: 1.15rem;
    font-weight: 600;
}

.app-viewer-placeholder-text {
    margin: 0.45rem 0 0;
    font-size: 0.98rem;
}

.app-viewer-placeholder-meta {
    margin: 1rem 0 0;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.82rem;
    color: hsl(215 12% 58%);
}

.app-viewer-placeholder-status {
    margin: 1rem 0 0;
    color: hsl(215 12% 66%);
    font-size: 0.92rem;
}

.app-mobile-keyboard {
    border-top: 1px solid hsl(220 13% 18%);
    background: hsl(220 18% 12%);
    padding: 0.85rem 1rem 1rem;
}

.app-mobile-keyboard-label {
    display: block;
    margin-bottom: 0.45rem;
    color: hsl(215 12% 50%);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.app-mobile-keyboard textarea {
    width: 100%;
    min-height: 4rem;
    resize: none;
    padding: 0.8rem 0.9rem;
    border-radius: 0.85rem;
    border: 1px solid hsl(220 13% 18%);
    background: hsl(220 16% 18%);
    color: hsl(210 20% 92%);
}

.app-mobile-keyboard textarea:focus {
    outline: none;
    border-color: hsl(210 100% 56%);
    box-shadow: 0 0 0 3px hsl(210 100% 56% / 0.12);
}

.shell { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }
.sidebar { display: flex; flex-direction: column; gap: 1.5rem; padding: 2rem 1.5rem; background: #10233f; color: #f5f8fc; }
.brand { font-size: 1.5rem; font-weight: 700; letter-spacing: 0.02em; }
.nav { display: flex; flex-direction: column; gap: 0.5rem; }
.nav a { padding: 0.8rem 0.95rem; border-radius: 0.8rem; color: rgba(245,248,252,0.86); }
.nav a.active, .nav a:hover { background: rgba(255,255,255,0.12); color: #fff; }

.content { padding: 2rem; display: flex; flex-direction: column; gap: 1.5rem; }
.page-header h1, .card h2, .desktop-card h2 { margin: 0; }
.card { background: #fff; border-radius: 1rem; padding: 1.4rem; box-shadow: 0 14px 35px rgba(16,35,63,0.08); }
.inset-card { background: #f7fafc; box-shadow: none; border: 1px solid #d9e3ef; }

.grid { display: grid; gap: 1rem; }
.grid-cards { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-two { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-three { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.field-grid { display: grid; gap: 1rem; }

label { display: flex; flex-direction: column; gap: 0.4rem; }
.checkbox-row { flex-direction: row; align-items: center; }
input, select, textarea, button { font: inherit; }
input, select, textarea { width: 100%; padding: 0.8rem 0.9rem; border: 1px solid #c8d5e6; border-radius: 0.75rem; background: #fff; }
select[multiple] { min-height: 8rem; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; border: 0; border-radius: 0.8rem; padding: 0.8rem 1rem; background: #1554c0; color: #fff; cursor: pointer; }
.button-ghost { background: #e7eef8; color: #17365f; }
.button-danger { background: #be2d40; }
.button-full { width: 100%; }

.flash { padding: 0.9rem 1rem; border-radius: 0.85rem; background: #e7eef8; color: #17365f; }
.flash.success { background: #def5e8; color: #13633e; }
.flash.error { background: #fde7eb; color: #8b1f31; }
.flash ul { margin: 0.6rem 0 0; padding-left: 1.1rem; }

.desktop-card-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.badge { display: inline-flex; align-items: center; padding: 0.3rem 0.6rem; border-radius: 999px; font-size: 0.8rem; background: #e7eef8; }
.badge-success { background: #def5e8; color: #13633e; }
.badge-muted { color: #526377; }

.rdp-viewport {
    min-height: 100%;
    overflow: hidden;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rdp-frame { background: transparent; border-radius: 0; overflow: hidden; }
.rdp-display { transform-origin: top left; display: inline-block; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.8rem 0.6rem; text-align: left; border-bottom: 1px solid #e2eaf3; }

@media (max-width: 960px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar { min-height: auto; }
    .app-shell { grid-template-columns: 1fr; }
    .app-sidebar { min-height: auto; }
    .admin-page-header { flex-direction: column; align-items: stretch; }
    .admin-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-form-grid { grid-template-columns: 1fr; }
    .app-desktop-grid { grid-template-columns: 1fr; }
    .shell { grid-template-columns: 1fr; }
    .admin-whmcs-key-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .admin-content { padding: 1.35rem 1rem 1.6rem; }
    .admin-stats-grid { grid-template-columns: 1fr; }
    .admin-page-intro h1 { font-size: 1.85rem; }
    .admin-license-card,
    .admin-license-portal-card {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .admin-license-head {
        flex-direction: column;
        align-items: flex-start;
    }
    .admin-license-row {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }
    .admin-table thead { display: none; }
    .admin-table tbody tr { display: block; padding: 0.2rem 0; }
    .admin-table tbody td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: 0.75rem 1rem;
    }
    .admin-table tbody td::before {
        content: attr(data-label);
        color: hsl(215 12% 50%);
        font-size: 0.76rem;
        text-transform: uppercase;
        letter-spacing: 0.06em;
    }
    .admin-table tbody td:first-child {
        align-items: flex-start;
    }
    .admin-table tbody td:first-child::before {
        margin-top: 0.15rem;
    }
    .admin-row-actions {
        width: 100%;
        justify-content: flex-end;
    }
    .admin-dialog {
        width: calc(100vw - 1rem);
    }
    .admin-dialog-form,
    .admin-dialog-head {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .app-content { padding: 1.35rem 1rem 1.6rem; }
    .app-page-intro h1 { font-size: 1.85rem; }
    .app-desktop-head { flex-direction: column; align-items: flex-start; }
    .app-desktop-meta { flex-wrap: wrap; gap: 0.85rem 1.15rem; }
    .app-account-card { padding-left: 1rem; padding-right: 1rem; }
    .app-account-row { grid-template-columns: 1fr; gap: 0.55rem; }
    .app-viewer-toolbar {
        padding-left: 0.9rem;
        padding-right: 0.9rem;
        padding-top: 0.7rem;
        padding-bottom: 0.7rem;
        min-height: auto;
        flex-wrap: wrap;
        align-items: flex-start;
    }
    .app-viewer-toolbar-left {
        gap: 0.6rem;
        flex-wrap: wrap;
        width: 100%;
    }
    .app-viewer-toolbar-right {
        width: 100%;
        justify-content: flex-end;
    }
    .app-viewer-title {
        font-size: 0.92rem;
    }
    .app-viewer-status {
        font-size: 0.76rem;
    }
    .app-viewer-frame {
        min-height: 24rem;
        height: calc(var(--rdp-mobile-vh, 100dvh) - 13.5rem);
    }
    .app-viewer-placeholder {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .app-mobile-orientation-hint {
        padding-left: 0.9rem;
        padding-right: 0.9rem;
    }
    .app-mobile-orientation-card {
        gap: 0.7rem;
    }
    .app-mobile-keyboard {
        padding-left: 0.9rem;
        padding-right: 0.9rem;
    }
    .app-mobile-keyboard textarea {
        min-height: 4.5rem;
        font-size: 16px;
    }

    .login-card {
        width: 100%;
        padding: 1.7rem 1.3rem 1.5rem;
    }

    .login-grid {
        background-size: 44px 44px;
    }
}

@media (min-width: 641px) {
    .app-mobile-orientation-hint {
        display: none !important;
    }
}
