@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;
}

html, body {
    min-height: 100%;
}

:root {
    --safe-top: env(safe-area-inset-top, 0px);
}

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-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 1rem;
}

.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-captcha-question {
    padding: 0.8rem 0.95rem;
    border: 1px solid hsl(220 13% 18%);
    border-radius: 0.85rem;
    background: hsl(220 16% 16%);
    color: hsl(210 20% 92%);
    font-weight: 600;
}

.login-captcha-wrap {
    display: flex;
    justify-content: center;
    padding: 0.9rem;
    border: 1px solid hsl(220 13% 18%);
    border-radius: 0.85rem;
    background: hsl(220 16% 16%);
    overflow-x: auto;
}

.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-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0.9rem;
}

.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;
    padding: 1.5rem 1.75rem;
    background: linear-gradient(180deg, hsl(220 18% 12%), hsl(220 18% 10%));
    border: 1px solid hsl(220 13% 18%);
    border-radius: 1rem;
    position: relative;
    overflow: hidden;
}

.admin-page-intro::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, hsl(210 100% 56%), hsl(187 89% 52%));
}

.admin-page-intro h1 {
    margin: 0;
    font-size: 1.75rem;
    line-height: 1.12;
    font-weight: 700;
    color: hsl(210 20% 92%);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-page-intro h1 .page-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, hsl(210 100% 56% / 0.15), hsl(187 89% 52% / 0.1));
    border-radius: 10px;
}

.admin-page-intro h1 .page-icon svg {
    width: 20px;
    height: 20px;
    color: hsl(210 100% 68%);
}

.admin-page-intro p {
    margin: 0.6rem 0 0;
    font-size: 0.95rem;
    color: hsl(215 12% 50%);
    line-height: 1.5;
    max-width: 600px;
}

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

/* Dashboard animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 0 0 hsl(210 100% 56% / 0.3);
    }
    50% {
        box-shadow: 0 0 20px 5px hsl(210 100% 56% / 0.15);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.admin-stat-card {
    animation: fadeInUp 0.4s ease-out forwards;
    opacity: 0;
}

.admin-stat-card:nth-child(1) { animation-delay: 0.05s; }
.admin-stat-card:nth-child(2) { animation-delay: 0.1s; }
.admin-stat-card:nth-child(3) { animation-delay: 0.15s; }
.admin-stat-card:nth-child(4) { animation-delay: 0.2s; }
.admin-stat-card:nth-child(5) { animation-delay: 0.25s; }
.admin-stat-card:nth-child(6) { animation-delay: 0.3s; }

.admin-dashboard-card {
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
    animation-fill-mode: both;
}

/* Stagger animations for dashboard cards */
.admin-dashboard-grid > .admin-dashboard-card:nth-child(1) { animation-delay: 0.35s; }
.admin-dashboard-grid > .admin-dashboard-card:nth-child(2) { animation-delay: 0.4s; }
.admin-dashboard-grid > .admin-dashboard-card:nth-child(3) { animation-delay: 0.45s; }
.admin-dashboard-grid > .admin-dashboard-card:nth-child(4) { animation-delay: 0.5s; }

/* Glow effect for important cards */
.admin-stat-card.highlight {
    position: relative;
}

.admin-stat-card.highlight::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 1rem;
    background: linear-gradient(135deg, hsl(210 100% 56% / 0.2), hsl(187 89% 52% / 0.1));
    z-index: -1;
    animation: pulse-glow 3s ease-in-out infinite;
}

/* Quick action buttons */
.admin-quick-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.admin-quick-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.1rem;
    background: linear-gradient(135deg, hsl(210 100% 56% / 0.1), hsl(187 89% 52% / 0.05));
    border: 1px solid hsl(220 13% 18%);
    border-radius: 0.75rem;
    color: hsl(210 20% 92%);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-quick-action-btn:hover {
    background: linear-gradient(135deg, hsl(210 100% 56% / 0.2), hsl(187 89% 52% / 0.1));
    border-color: hsl(210 100% 56% / 0.3);
    transform: translateY(-1px);
}

.admin-quick-action-btn svg {
    width: 16px;
    height: 16px;
    color: hsl(210 100% 68%);
}

/* Progress ring for stats */
.admin-stat-ring {
    position: relative;
    width: 64px;
    height: 64px;
    margin-bottom: 0.75rem;
}

.admin-stat-ring svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.admin-stat-ring circle {
    fill: none;
    stroke-width: 6;
    stroke-linecap: round;
}

.admin-stat-ring .ring-bg {
    stroke: hsl(220 13% 18%);
}

.admin-stat-ring .ring-progress {
    stroke: hsl(210 100% 56%);
    stroke-dasharray: 170;
    stroke-dashoffset: calc(170 - (170 * var(--progress, 0) / 100));
    transition: stroke-dashoffset 0.5s ease;
}

.admin-stat-ring .ring-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.95rem;
    font-weight: 700;
    color: hsl(210 20% 92%);
}

/* Activity timeline */
.admin-activity-timeline {
    position: relative;
    padding-left: 1.5rem;
}

.admin-activity-timeline::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: hsl(220 13% 18%);
    border-radius: 1px;
}

.admin-activity-item {
    position: relative;
    padding: 0.6rem 0;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.admin-activity-item::before {
    content: '';
    position: absolute;
    left: -1.25rem;
    top: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: hsl(210 100% 56%);
    border: 2px solid hsl(220 18% 12%);
}

.admin-activity-item.warning::before {
    background: hsl(45 93% 70%);
}

.admin-activity-content {
    flex: 1;
}

.admin-activity-title {
    color: hsl(210 20% 92%);
    font-size: 0.9rem;
    font-weight: 500;
}

.admin-activity-meta {
    color: hsl(215 12% 50%);
    font-size: 0.8rem;
    margin-top: 0.2rem;
}

/* Notification badges */
.admin-notification-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: hsl(350 80% 55%);
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
}
    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%);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.admin-stat-card {
    padding: 1.55rem 1.6rem;
    position: relative;
    overflow: hidden;
}

.admin-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, hsl(210 100% 56%), hsl(187 89% 52%));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.admin-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    border-color: hsl(220 13% 24%);
}

.admin-stat-card:hover::before {
    opacity: 1;
}

.admin-stat-card .stat-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, hsl(210 100% 56% / 0.15), hsl(187 89% 52% / 0.1));
}

.admin-stat-card .stat-icon-wrapper svg {
    width: 22px;
    height: 22px;
    color: hsl(210 100% 68%);
}

.admin-stat-card .stat-value {
    display: block;
    margin-top: 0.75rem;
    font-size: 2.5rem;
    line-height: 1;
    font-weight: 700;
    background: linear-gradient(135deg, hsl(210 20% 92%), hsl(210 100% 68%));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.admin-stat-card .stat-label {
    display: block;
    color: hsl(215 12% 50%);
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-stat-card .stat-description {
    margin: 0.6rem 0 0;
    color: hsl(215 12% 58%);
    font-size: 0.85rem;
    line-height: 1.5;
}

.admin-stat-card .stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.5rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
}

.admin-stat-card .stat-trend.up {
    color: hsl(150 60% 55%);
    background: hsl(150 60% 55% / 0.1);
}

.admin-stat-card .stat-trend.down {
    color: hsl(14 90% 60%);
    background: hsl(14 90% 60% / 0.1);
}

.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.warning {
    background: hsl(38 55% 15%);
    color: hsl(42 92% 74%);
    border: 1px solid hsl(35 58% 28%);
}

.admin-flash a {
    color: inherit;
    text-decoration: underline;
}

.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;
    flex-wrap: wrap;
}

.admin-inline-button {
    height: 2rem;
    padding: 0 0.8rem;
    font-size: 0.8rem;
    border-radius: 0.65rem;
}

.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-branding-grid {
    display: grid;
    grid-template-columns: minmax(14rem, 18rem) minmax(0, 1fr);
    gap: 1rem;
}

.admin-branding-preview-card,
.admin-branding-upload-card {
    padding: 1rem;
    border: 1px solid hsl(220 13% 18%);
    border-radius: 0.9rem;
    background: hsl(220 16% 14%);
}

.admin-branding-preview-label {
    display: block;
    margin-bottom: 0.75rem;
    color: hsl(215 12% 58%);
    font-size: 0.88rem;
}

.admin-branding-preview-frame {
    min-height: 9rem;
    padding: 1rem;
    border-radius: 0.85rem;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, hsl(220 18% 12%), hsl(220 18% 10%));
    border: 1px dashed hsl(220 13% 24%);
}

.admin-branding-preview-frame img {
    max-width: 100%;
    max-height: 8rem;
    object-fit: contain;
}

.admin-branding-preview-empty {
    color: hsl(215 12% 50%);
    font-size: 0.9rem;
}

.admin-checkbox-row {
    margin-top: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: hsl(210 20% 92%);
}

.admin-checkbox-row input {
    width: auto;
}

.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-security-subhead {
    margin-bottom: 1rem;
}

.admin-security-subhead h3 {
    margin: 0;
    font-size: 1rem;
    color: hsl(210 20% 92%);
}

.admin-security-subhead p {
    margin: 0.4rem 0 0;
    color: hsl(215 12% 50%);
    font-size: 0.9rem;
}

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

.admin-captcha-provider-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.admin-provider-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem;
    border: 1px solid hsl(220 13% 18%);
    border-radius: 0.95rem;
    background: hsl(220 16% 14%);
    cursor: pointer;
    transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.admin-provider-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.admin-provider-card:hover,
.admin-provider-card.is-selected {
    border-color: hsl(210 100% 56% / 0.68);
    background: hsl(220 16% 16%);
    box-shadow: 0 0 0 3px hsl(210 100% 56% / 0.1);
}

.admin-provider-card-icon {
    width: 2.9rem;
    height: 2.9rem;
    border-radius: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.admin-provider-card-icon svg {
    width: 1.5rem;
    height: 1.5rem;
    fill: currentColor;
}

.admin-provider-card-icon-neutral {
    background: hsl(220 16% 18%);
    color: hsl(215 12% 58%);
}

.admin-provider-card-icon-google {
    background: hsl(0 0% 100%);
    color: hsl(221 83% 53%);
}

.admin-provider-card-icon-cloudflare {
    background: hsl(24 100% 52% / 0.15);
    color: hsl(24 100% 58%);
}

.admin-provider-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
    min-width: 0;
}

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

.admin-provider-card-text {
    color: hsl(215 12% 50%);
    font-size: 0.85rem;
    line-height: 1.4;
}

.admin-captcha-config {
    margin-top: 0.35rem;
}

.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-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0.9rem;
}

.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-sidebar-user {
    margin-bottom: 0.35rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid hsl(220 13% 18%);
    border-radius: 0.8rem;
    background: hsl(220 16% 15%);
    min-width: 0;
    overflow: hidden;
}

.app-sidebar-user-label {
    color: hsl(215 12% 58%);
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.app-sidebar-user-name {
    margin-top: 0.2rem;
    color: hsl(210 20% 92%);
    font-size: 0.94rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.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;
    padding-top: var(--safe-top);
    border-bottom: 1px solid hsl(220 13% 18%);
    box-sizing: content-box;
    background: hsl(220 20% 7%);
}

.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-pagination-shell {
    max-width: 70rem;
    margin-top: 1.35rem;
    padding: 1rem 1.1rem;
    border: 1px solid hsl(220 13% 18%);
    border-radius: 1rem;
    background: linear-gradient(180deg, hsl(220 18% 12%), hsl(220 18% 10%));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.app-pagination-summary {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: hsl(210 20% 92%);
    font-size: 0.95rem;
}

.app-pagination-summary strong {
    color: hsl(210 100% 68%);
    font-weight: 700;
}

.app-pagination-summary-label {
    color: hsl(215 12% 50%);
}

.app-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.app-pagination-pages {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.app-pagination-link {
    min-width: 2.6rem;
    height: 2.6rem;
    padding: 0 0.95rem;
    border-radius: 0.85rem;
    border: 1px solid hsl(220 13% 18%);
    background: hsl(220 18% 13%);
    color: hsl(210 20% 92%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.app-pagination-link:hover {
    background: hsl(220 18% 16%);
    border-color: hsl(220 13% 24%);
    transform: translateY(-1px);
}

.app-pagination-link.is-active {
    background: linear-gradient(135deg, hsl(210 100% 56%), hsl(210 90% 58%));
    border-color: transparent;
    color: white;
}

.app-pagination-link.is-disabled {
    opacity: 0.45;
    pointer-events: none;
}

.app-pagination-ellipsis {
    min-width: 2rem;
    text-align: center;
    color: hsl(215 12% 50%);
    font-size: 1rem;
    letter-spacing: 0.1em;
}

.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-subtext {
    margin: 0.3rem 0 0;
    color: hsl(215 12% 50%);
    font-size: 0.94rem;
}

.app-two-factor-panel {
    position: relative;
    overflow: hidden;
    border-color: hsl(220 14% 24%);
    background:
        radial-gradient(circle at top right, hsl(210 90% 56% / 0.14), transparent 30%),
        radial-gradient(circle at bottom left, hsl(190 86% 44% / 0.12), transparent 28%),
        linear-gradient(180deg, hsl(220 18% 12%), hsl(220 18% 10%));
}

.app-two-factor-panel::after {
    content: "";
    position: absolute;
    inset: auto -3rem -4rem auto;
    width: 12rem;
    height: 12rem;
    border-radius: 999px;
    background: hsl(210 100% 56% / 0.08);
    filter: blur(10px);
    pointer-events: none;
}

.app-two-factor-hero {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(16rem, 0.85fr);
    gap: 1.25rem;
    align-items: start;
}

.app-two-factor-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 1.7rem;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    background: hsl(210 100% 56% / 0.14);
    color: hsl(210 100% 68%);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.app-two-factor-copy h2 {
    margin-top: 0.85rem;
}

.app-two-factor-copy > p {
    max-width: 42rem;
    margin: 0.7rem 0 0;
    color: hsl(215 12% 62%);
    font-size: 1rem;
    line-height: 1.7;
}

.app-two-factor-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 1rem;
}

.app-two-factor-chip {
    display: inline-flex;
    align-items: center;
    min-height: 1.9rem;
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    border: 1px solid hsl(220 14% 22%);
    background: hsl(220 18% 14%);
    color: hsl(210 20% 90%);
    font-size: 0.84rem;
}

.app-two-factor-state-card {
    position: relative;
    z-index: 1;
    padding: 1.15rem 1.1rem;
    border: 1px solid hsl(220 13% 18%);
    border-radius: 1rem;
    background: hsl(220 18% 13% / 0.92);
    box-shadow: 0 18px 40px rgb(0 0 0 / 0.18);
}

.app-two-factor-state-label {
    display: block;
    color: hsl(215 12% 50%);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.app-two-factor-state-card strong {
    display: block;
    margin-top: 0.45rem;
    color: hsl(210 20% 95%);
    font-size: 1.45rem;
    line-height: 1.2;
}

.app-two-factor-state-card p {
    margin: 0.55rem 0 0.95rem;
    color: hsl(215 12% 60%);
    line-height: 1.65;
}

.app-two-factor-enabled-grid,
.app-two-factor-setup-grid {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 1rem;
    margin-top: 1.35rem;
}

.app-two-factor-enabled-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.app-two-factor-setup-grid {
    grid-template-columns: minmax(16rem, 0.9fr) minmax(0, 1.2fr);
}

.app-two-factor-info-card,
.app-two-factor-qr-card,
.app-two-factor-manual-card,
.app-two-factor-form-card {
    position: relative;
    z-index: 1;
    padding: 1.2rem;
    border: 1px solid hsl(220 13% 18%);
    border-radius: 1rem;
    background: hsl(220 18% 13% / 0.95);
}

.app-two-factor-info-card h3,
.app-two-factor-qr-card h3,
.app-two-factor-manual-card h3,
.app-two-factor-form-head h3 {
    margin: 0;
    color: hsl(210 20% 94%);
    font-size: 1.02rem;
}

.app-two-factor-info-card p,
.app-two-factor-muted,
.app-two-factor-form-head p {
    margin: 0.55rem 0 0;
    color: hsl(215 12% 58%);
    line-height: 1.65;
}

.app-two-factor-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.9rem;
}

.app-two-factor-card-label,
.app-two-factor-card-badge {
    display: inline-flex;
    align-items: center;
    min-height: 1.55rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.app-two-factor-card-label {
    margin-bottom: 0.5rem;
    background: hsl(220 16% 18%);
    color: hsl(215 12% 62%);
}

.app-two-factor-card-badge {
    background: hsl(142 45% 14%);
    color: hsl(142 71% 70%);
}

.app-two-factor-qr-frame {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 1rem;
    background:
        linear-gradient(135deg, hsl(210 100% 99%), hsl(210 33% 96%));
    min-height: 15.25rem;
    display: grid;
    place-items: center;
}

.app-two-factor-qr-canvas {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
}

.app-two-factor-qr-image {
    display: block;
    width: 220px;
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    background: white;
}

.app-two-factor-qr-fallback {
    color: hsl(220 16% 24%);
    font-size: 0.92rem;
    line-height: 1.6;
    text-align: center;
}

.app-two-factor-steps {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-top: 1rem;
}

.app-two-factor-step-item {
    display: grid;
    grid-template-columns: 2rem 1fr;
    gap: 0.75rem;
    align-items: start;
}

.app-two-factor-step-item span {
    width: 2rem;
    height: 2rem;
    border-radius: 0.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: hsl(210 100% 56% / 0.12);
    color: hsl(210 100% 68%);
    font-weight: 700;
}

.app-two-factor-step-item p {
    margin: 0.15rem 0 0;
    color: hsl(215 12% 60%);
    line-height: 1.6;
}

.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-two-factor-form-card {
    margin-top: 1rem;
}

.app-two-factor-form-head {
    margin-bottom: 0.15rem;
}

.app-two-factor-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 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 textarea {
    width: 100%;
    min-height: 7rem;
    padding: 0.9rem 0.95rem;
    border-radius: 0.8rem;
    border: 1px solid hsl(220 13% 18%);
    background: hsl(220 16% 18%);
    color: hsl(210 20% 92%);
    resize: vertical;
    font: inherit;
}

.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-field textarea: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-account-submit.danger {
    background: linear-gradient(135deg, hsl(0 74% 52%), hsl(10 80% 54%));
}

.app-account-security-state {
    margin-bottom: 1.1rem;
}

.app-two-factor-setup {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.app-two-factor-step {
    padding: 1rem;
    border: 1px solid hsl(220 13% 18%);
    border-radius: 0.9rem;
    background: hsl(220 16% 14%);
}

.app-two-factor-step strong {
    display: block;
    margin-bottom: 0.35rem;
    color: hsl(210 20% 92%);
}

.app-two-factor-step p {
    margin: 0;
    color: hsl(215 12% 58%);
}

.app-secret-block {
    margin-top: 0.8rem;
    padding: 0.9rem 1rem;
    border-radius: 0.85rem;
    border: 1px solid hsl(220 13% 18%);
    background: hsl(220 20% 10%);
    color: hsl(210 100% 68%);
    font-family: "JetBrains Mono", monospace;
    letter-spacing: 0.08em;
    word-break: break-word;
}

.app-account-textarea {
    margin-top: 0.8rem;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.88rem;
}

.login-secondary-action {
    margin-top: 1.1rem;
    text-align: center;
    color: hsl(215 12% 58%);
    font-size: 0.92rem;
}

.login-secondary-action a {
    color: hsl(215 12% 58%);
    text-decoration: none;
}

.login-secondary-action a:hover {
    color: hsl(210 100% 68%);
}

@media (max-width: 1040px) {
    .app-two-factor-hero,
    .app-two-factor-enabled-grid,
    .app-two-factor-setup-grid,
    .app-two-factor-form-grid {
        grid-template-columns: 1fr;
    }
}

.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(214 26% 88%);
    font-size: 0.98rem;
    padding: 0.48rem 0.75rem;
    border: 1px solid hsl(218 18% 24%);
    border-radius: 0.7rem;
    background: hsl(221 18% 16%);
    text-decoration: none;
    box-shadow: inset 0 1px 0 hsl(0 0% 100% / 0.03);
}

.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: 2.35rem;
    height: 2.35rem;
    padding: 0;
    border: 1px solid hsl(218 18% 24%);
    background: linear-gradient(180deg, hsl(221 18% 18%), hsl(221 16% 14%));
    color: hsl(214 26% 88%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 0.7rem;
    box-shadow: inset 0 1px 0 hsl(0 0% 100% / 0.04);
}

.app-viewer-toolbar-link {
    width: auto;
    min-width: 2rem;
    padding: 0 0.65rem;
    gap: 0.45rem;
    border-radius: 0.6rem;
    text-decoration: none;
}

.app-viewer-toolbar-button-label {
    width: auto;
    min-width: 2.35rem;
    min-height: 2.35rem;
    padding: 0 0.78rem;
    gap: 0.45rem;
    border-radius: 0.6rem;
}

.app-viewer-toolbar-desktop-text {
    display: inline;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1;
}

.app-viewer-back:hover,
.app-viewer-back:focus-visible,
.app-viewer-toolbar-button:hover,
.app-viewer-toolbar-button.is-active,
.app-viewer-toolbar-button:focus-visible {
    background: linear-gradient(180deg, hsl(214 64% 22%), hsl(214 58% 18%));
    color: hsl(210 40% 97%);
    border-color: hsl(210 80% 42%);
    border-radius: 0.7rem;
    outline: none;
}

.app-viewer-toolbar-button:disabled {
    opacity: 0.42;
    cursor: not-allowed;
    pointer-events: none;
}

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

.app-viewer-toolbar-button-compact {
    min-width: 2.35rem;
    padding-left: 0.65rem;
    padding-right: 0.65rem;
}

.app-viewer-zoom-value {
    min-width: 2.85rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.portal-viewer-window {
    min-height: 100vh;
    background: hsl(220 18% 10%);
    overflow: hidden;
}

.viewer-window-main {
    min-height: 100vh;
}

.viewer-window-main .app-viewer-shell {
    min-height: var(--rdp-mobile-vh, 100dvh);
    height: var(--rdp-mobile-vh, 100dvh);
    border: 0;
}

.viewer-window-main .app-viewer-frame {
    min-height: calc(var(--rdp-mobile-vh, 100dvh) - 3.55rem - var(--safe-top));
    height: calc(var(--rdp-mobile-vh, 100dvh) - 3.55rem - var(--safe-top));
}

.viewer-window-main .app-viewer-toolbar {
    position: sticky;
    top: 0;
    z-index: 10;
    padding-top: calc(0.8rem + var(--safe-top));
    background: hsl(220 18% 10%);
}

.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-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: pan-x pan-y pinch-zoom;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: 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-viewport.is-mobile-zoomed {
    overflow: auto;
    align-items: flex-start;
    justify-content: flex-start;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
.rdp-frame { background: transparent; border-radius: 0; overflow: hidden; }
.rdp-display { transform-origin: top left; display: inline-block; }
.rdp-display,
.rdp-display * {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
.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; }
    .admin-captcha-provider-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 { 
        padding: 1rem 1.25rem; 
    }
    .admin-page-intro h1 { 
        font-size: 1.5rem; 
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .admin-page-intro h1 .page-icon {
        display: none;
    }
    .admin-stat-card { padding: 1.25rem; }
    .admin-stat-card .stat-value { font-size: 2rem; }
    .admin-stat-card .stat-icon-wrapper {
        width: 40px;
        height: 40px;
    }
    .admin-stat-card .stat-icon-wrapper svg {
        width: 18px;
        height: 18px;
    }
    .admin-quick-actions { flex-direction: column; }
    .admin-quick-action-btn { width: 100%; justify-content: center; }
    .admin-dashboard-grid { grid-template-columns: 1fr; }
    .admin-activity-timeline { padding-left: 1rem; }
    .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-two-factor-card-head { flex-direction: column; }
    .app-two-factor-qr-frame { min-height: 13rem; }
    .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-start;
        flex-wrap: wrap;
        gap: 0.55rem;
    }
    .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);
    }
    .viewer-window-main .app-viewer-frame {
        min-height: calc(var(--rdp-mobile-vh, 100dvh) - 4.85rem - var(--safe-top));
        height: calc(var(--rdp-mobile-vh, 100dvh) - 4.85rem - var(--safe-top));
    }
    .viewer-window-main .app-viewer-shell {
        min-height: var(--rdp-mobile-vh, 100dvh);
        height: var(--rdp-mobile-vh, 100dvh);
    }
    .viewer-window-main .app-viewer-toolbar {
        padding-top: calc(0.55rem + var(--safe-top));
        padding-bottom: 0.55rem;
    }
    .app-viewer-toolbar-link span:last-child,
    .app-viewer-toolbar-button-label span:last-child {
        font-size: 0.74rem;
    }
    .app-viewer-toolbar-link,
    .app-viewer-toolbar-button-label {
        min-height: 2rem;
        padding-left: 0.55rem;
        padding-right: 0.55rem;
    }
    .app-viewer-toolbar-desktop-text {
        display: none;
    }
    .viewer-window-main .app-viewer-back span:last-child {
        font-size: 0.9rem;
    }
    .app-viewer-placeholder {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .app-mobile-keyboard {
        padding-left: 0.9rem;
        padding-right: 0.9rem;
    }
    .app-mobile-keyboard textarea {
        min-height: 4.5rem;
        font-size: 16px;
        -webkit-user-select: text;
        user-select: text;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Improve mobile viewport touch experience */
    .rdp-viewport canvas {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
        -webkit-touch-callout: none;
        -webkit-user-drag: none;
    }
    
    /* Better mobile toolbar buttons */
    .app-viewer-toolbar-button {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
        tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
    
    /* Prevent zoom on double-tap */
    .app-viewer-viewport {
        -webkit-text-size-adjust: none;
        text-size-adjust: none;
    }
    
    /* Keyboard-aware styles */
    :root {
        --keyboard-height: 0px;
    }
    
    /* Adjust viewport when keyboard is visible */
    body.keyboard-visible .app-viewer-frame {
        height: calc(var(--rdp-mobile-vh, 100dvh) - 13.5rem - var(--keyboard-height, 0px)) !important;
        min-height: calc(24rem - var(--keyboard-height, 0px)) !important;
    }
    
    body.keyboard-visible .viewer-window-main .app-viewer-frame {
        height: calc(var(--rdp-mobile-vh, 100dvh) - 4.85rem - var(--safe-top) - var(--keyboard-height, 0px)) !important;
        min-height: calc(var(--rdp-mobile-vh, 100dvh) - 4.85rem - var(--safe-top) - var(--keyboard-height, 0px)) !important;
    }
    
    /* Fix mobile keyboard panel positioning */
    .app-mobile-keyboard {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        transition: transform 0.3s ease, opacity 0.3s ease;
        transform: translateY(100%);
        opacity: 0;
        pointer-events: none;
    }
    
    .app-mobile-keyboard:not(.hidden) {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }
    
    /* Adjust keyboard panel when keyboard is visible */
    body.keyboard-visible .app-mobile-keyboard:not(.hidden) {
        bottom: var(--keyboard-height, 0px);
    }
    
    body.keyboard-visible {
        overflow: hidden;
    }
    
    body.keyboard-visible #rdp-shell {
        overflow: hidden;
    }
    
    body.keyboard-visible .app-viewer-frame {
        height: calc(100vh - 3.55rem - var(--keyboard-height, 0px)) !important;
        min-height: calc(100vh - 3.55rem - var(--keyboard-height, 0px)) !important;
        max-height: calc(100vh - 3.55rem - var(--keyboard-height, 0px)) !important;
    }

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

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