:root {
    --admin-bg: #f7f8fb;
    --admin-surface: #ffffff;
    --admin-surface-muted: #f8fafc;
    --admin-border: #e2e8f0;
    --admin-border-strong: #cbd5e1;
    --admin-text: #0f172a;
    --admin-muted: #64748b;
    --admin-soft-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 28px rgba(15, 23, 42, 0.05);
    --admin-focus-ring: 0 0 0 3px rgba(15, 23, 42, 0.10);
    --admin-radius: 18px;
}

html {
    background: var(--admin-bg);
}

.admin-shell {
    min-width: 0;
    background: var(--admin-bg) !important;
    color: var(--admin-text);
    letter-spacing: 0;
}

.admin-shell-frame,
.admin-main {
    min-width: 0;
}

.admin-mobile-menu-button,
.admin-mobile-overlay {
    display: none;
}

.admin-main {
    width: 100%;
    background:
        radial-gradient(circle at top left, rgba(226, 232, 240, 0.62), transparent 32rem),
        var(--admin-bg) !important;
    color: var(--admin-text);
    overflow-wrap: anywhere;
}

.admin-main > div {
    width: 100%;
}

.admin-main header {
    border-bottom: 1px solid rgba(226, 232, 240, 0.74);
    padding-bottom: 18px;
}

.admin-main header h1 {
    color: var(--admin-text);
    letter-spacing: 0;
}

.admin-main .tracking-tight {
    letter-spacing: 0 !important;
}

.admin-main header p {
    max-width: 70ch;
}

.admin-main .glass-card,
.admin-main section.rounded-2xl,
.admin-main section.rounded-3xl,
.admin-main div.rounded-2xl.border,
.admin-main div.rounded-3xl.border,
.admin-main form.rounded-3xl {
    border-color: var(--admin-border) !important;
    background: rgba(255, 255, 255, 0.96) !important;
    box-shadow: var(--admin-soft-shadow);
}

.admin-main .glass-card:hover {
    border-color: var(--admin-border-strong) !important;
}

.admin-main .rounded-3xl {
    border-radius: var(--admin-radius);
}

.admin-main .rounded-2xl {
    border-radius: 16px;
}

.admin-main label,
.admin-main .field label,
.admin-main .quick-field label {
    color: #475569;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.02em;
}

.admin-main .input,
.admin-main .quick-input,
.admin-main input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.admin-main select,
.admin-main textarea {
    border-color: var(--admin-border) !important;
    background-color: #fff !important;
    color: #1e293b;
    box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.02);
    transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.admin-main .input:focus,
.admin-main .quick-input:focus,
.admin-main input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
.admin-main select:focus,
.admin-main textarea:focus,
.admin-main button:focus-visible,
.admin-main a:focus-visible {
    border-color: #0f172a !important;
    box-shadow: var(--admin-focus-ring);
    outline: none;
}

.admin-main input::placeholder,
.admin-main textarea::placeholder {
    color: #94a3b8;
}

.admin-main input[readonly],
.admin-main input:disabled,
.admin-main select:disabled,
.admin-main textarea:disabled {
    background: var(--admin-surface-muted) !important;
    color: #64748b;
}

.admin-main button,
.admin-main [role="button"],
.admin-main a.rounded-lg,
.admin-main a.rounded-xl {
    transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.admin-main button:hover:not(:disabled),
.admin-main a.rounded-lg:hover,
.admin-main a.rounded-xl:hover {
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.admin-main button:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.admin-main button[class*="bg-slate-900"],
.admin-main button[class*="bg-slate-950"],
.admin-main a[class*="bg-slate-900"],
.admin-main a[class*="bg-slate-950"] {
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.admin-main .admin-danger-action,
.admin-main button[class*="bg-red"],
.admin-main button[class*="text-red"] {
    border-color: #fecaca !important;
}

.admin-main .admin-danger-action,
.admin-main button[class*="bg-red"] {
    box-shadow: 0 8px 18px rgba(220, 38, 38, 0.10);
}

.admin-main .admin-danger-action:hover:not(:disabled),
.admin-main button[class*="bg-red"]:hover:not(:disabled),
.admin-main button[class*="text-red"]:hover:not(:disabled) {
    border-color: #f87171 !important;
}

.admin-main .admin-caution-action,
.admin-main button[class*="text-orange"],
.admin-main button[class*="text-amber"] {
    border-color: #fed7aa !important;
    background-color: #fff7ed !important;
}

.admin-main .admin-tab-strip {
    position: sticky;
    top: 0;
    z-index: 15;
    margin-bottom: 22px;
    border: 1px solid var(--admin-border) !important;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.94);
    padding: 8px;
    box-shadow: var(--admin-soft-shadow);
    overflow-x: auto;
    scrollbar-gutter: stable;
}

.admin-main .admin-tab-strip > * {
    white-space: nowrap;
}

.admin-main .admin-tab-control,
.admin-main [data-lms-tab],
.admin-main [data-products-tab],
.admin-main .product-section-tab,
.admin-main .plugin-plan-tab {
    min-height: 38px;
    border: 1px solid transparent;
    line-height: 1.2;
}

.admin-main .admin-tab-control.bg-slate-950,
.admin-main [data-lms-tab].bg-slate-950,
.admin-main [data-products-tab].bg-slate-950,
.admin-main .product-section-tab.is-active,
.admin-main .plugin-plan-tab.is-active {
    border-color: #0f172a !important;
    background: #0f172a !important;
    color: #fff !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14);
}

.admin-main .admin-table-scroll {
    border-radius: 16px;
    scrollbar-gutter: stable;
}

.admin-main table {
    border-collapse: separate;
    border-spacing: 0;
}

.admin-main thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8fafc;
    color: #475569;
    font-weight: 900;
    letter-spacing: 0.03em;
}

.admin-main tbody tr {
    transition: background-color 120ms ease;
}

.admin-main tbody tr:hover {
    background-color: #f8fafc;
}

.admin-main td,
.admin-main th {
    vertical-align: middle;
}

.admin-main [id$="message"],
.admin-main [id$="status"],
.admin-main [id$="feedback"],
.admin-main .save-feedback {
    line-height: 1.5;
}

.admin-main [class*="border-dashed"] {
    background: linear-gradient(180deg, #fff, #f8fafc);
}

.admin-main pre,
.admin-main code,
.admin-main .font-mono {
    word-break: break-word;
}

.admin-sidebar-managed {
    display: flex !important;
    flex-direction: column;
    min-height: 0;
    background: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 1px 0 0 rgba(226, 232, 240, 0.85);
}

.admin-sidebar-header {
    justify-content: space-between;
    gap: 12px;
}

.admin-sidebar-reorder-toggle {
    display: inline-flex;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--admin-border);
    border-radius: 10px;
    background: #fff;
    color: #475569;
    transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.admin-sidebar-reorder-toggle:hover,
.admin-sidebar-reorder-toggle[aria-pressed="true"] {
    border-color: #0f172a;
    background: #0f172a;
    color: #fff;
}

.admin-sidebar-managed .admin-nav {
    display: flex !important;
    flex: 1 1 auto;
    min-height: 0;
    flex-direction: column;
    overflow-y: auto;
}

.admin-sidebar-managed .admin-nav-middle {
    margin-top: 4px;
}

.admin-sidebar-managed .admin-nav-other-bucket {
    margin-top: auto;
}

.admin-nav-other-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-radius: 0.5rem;
    padding: 0.625rem 0.75rem;
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 700;
    transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.admin-sidebar-managed .admin-nav-item,
.admin-nav-other-toggle,
.admin-nav-home {
    min-height: 40px;
}

.admin-sidebar-managed .admin-nav-item:hover,
.admin-nav-home:hover {
    background: #f8fafc;
    color: #0f172a;
}

.admin-sidebar-managed .admin-nav-item.bg-slate-100,
.admin-sidebar-managed .admin-nav-home.bg-slate-100 {
    background: #eef2f7 !important;
    color: #0f172a !important;
    box-shadow: inset 3px 0 0 #0f172a;
}

.admin-nav-other-toggle:hover,
.admin-nav-other-bucket.is-active .admin-nav-other-toggle {
    background: #f1f5f9;
    color: #0f172a;
}

.admin-nav-other-chevron {
    font-size: 10px;
    transition: transform 160ms ease;
}

.admin-nav-other-toggle[aria-expanded="true"] .admin-nav-other-chevron {
    transform: rotate(180deg);
}

.admin-nav-other-list {
    margin-top: 4px;
    display: grid;
    gap: 4px;
    padding-left: 10px;
}

.admin-nav-other-list.hidden {
    display: none;
}

.admin-sidebar-managed.is-reorder-mode .admin-nav-other-bucket {
    border-radius: 12px;
    outline: 1px dashed transparent;
    outline-offset: 2px;
}

.admin-sidebar-managed.is-reorder-mode .admin-nav-other-bucket.is-drop-target {
    background: #f8fafc;
    outline-color: #0f172a;
}

.admin-sidebar-managed .admin-user-panel {
    position: static !important;
    width: auto !important;
    flex: 0 0 auto;
}

.admin-sidebar-managed.is-reorder-mode .admin-nav-middle .admin-nav-item,
.admin-sidebar-managed.is-reorder-mode .admin-nav-other-list .admin-nav-item[draggable="true"] {
    cursor: grab;
}

.admin-sidebar-managed.is-reorder-mode .admin-nav-middle .admin-nav-item:active,
.admin-sidebar-managed.is-reorder-mode .admin-nav-other-list .admin-nav-item[draggable="true"]:active {
    cursor: grabbing;
}

.admin-sidebar-managed .admin-nav-dragging {
    opacity: 0.45;
}

.admin-nav-other-restore {
    display: none;
    justify-self: end;
    margin: -2px 4px 4px 0;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
    padding: 2px 8px;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
}

.admin-sidebar-managed.is-reorder-mode .admin-nav-other-restore {
    display: inline-flex;
}

.admin-main table,
.admin-main pre,
.admin-main code,
.admin-main input,
.admin-main textarea {
    overflow-wrap: anywhere;
}

@media (max-width: 1024px) {
    .admin-main header {
        align-items: stretch !important;
    }

    .admin-main header > div,
    .admin-main header > button,
    .admin-main header > .flex {
        max-width: 100%;
    }

    .admin-main .admin-tab-strip {
        position: static;
    }
}

@media (max-width: 767px) {
    .admin-shell {
        display: block !important;
        height: auto !important;
        min-height: 100vh;
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }

    .admin-shell-frame {
        display: block !important;
        height: auto !important;
        min-height: 100vh;
        overflow: visible !important;
    }

    .admin-sidebar {
        position: fixed !important;
        inset: 0 auto 0 0;
        z-index: 80 !important;
        display: flex !important;
        width: min(86vw, 21rem) !important;
        max-width: 100vw;
        height: 100dvh;
        overflow-y: auto;
        transform: translateX(-105%);
        transition: transform 180ms ease;
        box-shadow: 20px 0 40px rgba(15, 23, 42, 0.16);
    }

    .admin-drawer-open .admin-sidebar {
        transform: translateX(0);
    }

    .admin-mobile-menu-button {
        position: fixed;
        left: 12px;
        top: 12px;
        z-index: 70;
        display: inline-flex;
        width: 44px;
        height: 44px;
        align-items: center;
        justify-content: center;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.96);
        color: #0f172a;
        box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
    }

    .admin-mobile-overlay {
        position: fixed;
        inset: 0;
        z-index: 75;
        display: block;
        background: rgba(15, 23, 42, 0.36);
        opacity: 0;
        pointer-events: none;
        transition: opacity 180ms ease;
    }

    .admin-drawer-open .admin-mobile-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    .admin-mobile-hidden {
        display: none !important;
    }

    .admin-main {
        width: 100% !important;
        min-width: 0 !important;
        padding: 72px 14px 24px !important;
        overflow-x: hidden !important;
    }

    .admin-main > * {
        max-width: 100%;
    }

    .admin-main .rounded-3xl {
        border-radius: 1rem;
    }

    .admin-main .glass-card,
    .admin-main section.rounded-2xl,
    .admin-main section.rounded-3xl,
    .admin-main form.rounded-3xl {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .admin-main h1 {
        font-size: 1.75rem;
        line-height: 2.1rem;
    }

    .admin-main input,
    .admin-main textarea,
    .admin-main select,
    .admin-main button {
        max-width: 100%;
    }

    .admin-main header {
        margin-bottom: 24px !important;
    }

    .admin-main .admin-tab-strip {
        margin-left: -2px;
        margin-right: -2px;
        padding: 6px;
    }

    .admin-main [data-lms-tab],
    .admin-main [data-products-tab],
    .admin-main .admin-tab-control {
        min-height: 40px;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .admin-main table {
        font-size: 12px;
    }
}
