/* =========================================================
   VillaVibe Premium Admin Shell
   Sidebar + Navbar + User dropdown
   Gotowe do wklejenia
   ========================================================= */

@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

:root {
    --vv-font: "Plus Jakarta Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    --vv-sidebar-w: 292px;
    --vv-topbar-h: 76px;

    --vv-bg: #f6f8fc;
    --vv-white: #ffffff;

    --vv-navy-950: #061124;
    --vv-navy-925: #07162d;
    --vv-navy-900: #0a1933;
    --vv-navy-850: #102241;

    --vv-text: #0f172a;
    --vv-text-soft: #334155;
    --vv-muted: #64748b;
    --vv-muted-light: #94a3b8;
    --vv-border: #e5eaf3;

    --vv-primary: #5b4df6;
    --vv-primary-2: #766aff;
    --vv-primary-3: #493de0;
    --vv-primary-dark: #372fc7;

    --vv-green: #10b981;
    --vv-green-dark: #047857;
    --vv-danger: #ef4444;

    --vv-shadow-sidebar: 24px 0 70px rgba(15, 23, 42, 0.10);
    --vv-shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.08);
    --vv-shadow-popover: 0 28px 80px rgba(15, 23, 42, 0.18);
}

/* =========================================================
   Base reset
   ========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

html {
    background: var(--vv-bg);
}

body {
    min-height: 100vh;
    background:
            radial-gradient(circle at 88% -10%, rgba(91, 77, 246, 0.075), transparent 420px),
            var(--vv-bg);
    color: var(--vv-text);
    font-family: var(--vv-font);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
    letter-spacing: -0.018em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: geometricPrecision;
}

button,
input,
select,
textarea,
table {
    font-family: var(--vv-font);
}

a {
    color: inherit;
}

/* =========================================================
   Layout shell
   ========================================================= */
.app-topbar-left h1 {
    margin: 0;
    color: #0b1220;
    font-size: 31px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.075em;
    white-space: nowrap;
    transform: translateX(40%);
}
.admin-shell {
    min-height: 100vh;
    display: flex;
    background: var(--vv-bg);
}

.admin-content-shell {
    width: calc(100% - var(--vv-sidebar-w));
    min-height: 100vh;
    margin-left: var(--vv-sidebar-w);
    background: var(--vv-bg);
}

.app-main.admin-main {
    min-height: calc(100vh - var(--vv-topbar-h));
    padding: 32px;
}

/* jeĂ„Ä…Ă„Ëťeli masz jeszcze stary brand w topbarze, ukryj go */
.has-admin-sidebar .app-topbar > .app-brand {
    display: none !important;
}

/* =========================================================
   Sidebar
   ========================================================= */

.admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 100;
    width: var(--vv-sidebar-w);
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0 18px 22px;
    overflow: hidden;
    background:
            radial-gradient(circle at 44px 42px, rgba(124, 108, 255, 0.30), transparent 180px),
            radial-gradient(circle at 78% 28%, rgba(91, 77, 246, 0.12), transparent 260px),
            linear-gradient(180deg, #061124 0%, #07162d 48%, #081832 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--vv-shadow-sidebar);
}

.admin-sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.048), transparent 120px),
            linear-gradient(90deg, rgba(255, 255, 255, 0.025), transparent 50%);
}

.admin-sidebar::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: var(--vv-topbar-h);
    height: 1px;
    background: rgba(255, 255, 255, 0.07);
}

/* Logo */

.admin-sidebar-brand {
    position: relative;
    z-index: 1;
    height: var(--vv-topbar-h);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 6px;
    color: #ffffff;
    text-decoration: none;
}

.admin-sidebar-brand-mark {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 52px;
    border-radius: 16px;
    background:
            radial-gradient(circle at 30% 18%, rgba(255, 255, 255, 0.40), transparent 24px),
            linear-gradient(145deg, #7d70ff 0%, #5a4df3 52%, #20c6ee 145%);
    color: #ffffff;
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.08em;
    box-shadow:
            0 18px 34px rgba(91, 77, 246, 0.38),
            inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.admin-sidebar-brand > span:last-child {
    color: #ffffff;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.065em;
    line-height: 1;
}

/* Navigation */

.admin-sidebar-nav {
    position: relative;
    z-index: 1;
    margin-top: 24px;
}

.admin-sidebar-nav ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.admin-sidebar-nav li {
    margin: 0;
    padding: 0;
}

.admin-sidebar-nav a {
    position: relative;
    min-height: 60px;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 0 18px;
    border-radius: 12px;
    color: rgba(226, 232, 240, 0.88);
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1;
    transition:
            color 160ms ease,
            background 160ms ease,
            box-shadow 160ms ease,
            transform 160ms ease;
}

.admin-sidebar-nav a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.065);
}

.admin-sidebar-nav a.is-active,
.admin-sidebar-nav li.is-active > a,
.admin-sidebar-nav a.active,
.admin-sidebar-nav a[aria-current="page"] {
    color: #ffffff;
    background:
            linear-gradient(135deg, #7a6eff 0%, #5b4df6 54%, #493de0 100%);
    box-shadow:
            0 18px 38px rgba(67, 56, 202, 0.38),
            inset 0 1px 0 rgba(255, 255, 255, 0.23);
}

.admin-sidebar-nav a.is-active::after,
.admin-sidebar-nav li.is-active > a::after,
.admin-sidebar-nav a.active::after,
.admin-sidebar-nav a[aria-current="page"]::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -18px;
    width: 4px;
    height: 34px;
    border-radius: 999px;
    background: #b9c2ff;
    transform: translateY(-50%);
    box-shadow: 0 0 20px rgba(185, 194, 255, 0.95);
}

.admin-sidebar-icon {
    width: 23px;
    height: 23px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 23px;
    color: currentColor;
    font-size: 20px;
    line-height: 1;
    opacity: 0.96;
}

.admin-sidebar-icon svg {
    width: 23px;
    height: 23px;
    stroke-width: 2;
}

/* Bottom */

.admin-sidebar-bottom {
    position: relative;
    z-index: 1;
    margin-top: auto;
}

.admin-sidebar-help {
    margin: 0 2px;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.105);
    background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.078), rgba(255, 255, 255, 0.034));
    box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.08),
            0 18px 38px rgba(0, 0, 0, 0.14);
}

.admin-sidebar-help-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, #7568ff, #4f46e5);
    color: #ffffff;
    font-size: 21px;
    font-weight: 700;
    box-shadow: 0 14px 28px rgba(79, 70, 229, 0.34);
}

.admin-sidebar-help strong {
    display: block;
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.025em;
}

.admin-sidebar-help p {
    margin: 8px 0 15px;
    color: rgba(226, 232, 240, 0.70);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.45;
    letter-spacing: -0.015em;
}

.admin-sidebar-help a {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 15px;
    border-radius: 10px;
    border: 1px solid rgba(124, 108, 255, 0.44);
    background: rgba(91, 77, 246, 0.24);
    color: #dedaff;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: -0.015em;
}

.admin-sidebar-help a:hover {
    color: #ffffff;
    background: rgba(91, 77, 246, 0.35);
}

.admin-sidebar-footer {
    position: relative;
    margin: 22px 2px 0;
    padding: 20px 44px 0 2px;
    border-top: 1px solid rgba(255, 255, 255, 0.085);
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: rgba(226, 232, 240, 0.75);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: -0.015em;
}

.admin-sidebar-footer::after {
    content: "Ä‚ËĂ˘â€šÂ¬Ă„â€¦";
    position: absolute;
    right: 0;
    top: 15px;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: linear-gradient(135deg, #5145e7, #3f36c9);
    color: #ffffff;
    font-size: 22px;
    line-height: 1;
    box-shadow: 0 12px 25px rgba(67, 56, 202, 0.32);
}

/* =========================================================
   Topbar
   ========================================================= */

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 90;
    height: var(--vv-topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    background: rgba(255, 255, 255, 0.955);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.92);
}

.app-topbar-left,
.app-topbar-center {
    height: 100%;
    display: flex;
    align-items: center;
    min-width: 0;
}

.app-topbar-left {
    gap: 30%;
}

.app-topbar-center {
    flex: 1;
}

/* JeĂ„Ä…Ă„Ëťeli w HTML nie masz app-topbar-left, ten blok wyrĂ„â€šÄąâ€šwnuje stare app-topbar-center */
.app-topbar > .app-topbar-center:first-child {
    gap: 28px;
}

/* Grid icon */

.app-grid-button {
    width: 34px;
    height: 34px;
    display: grid;
    grid-template-columns: repeat(2, 4px);
    grid-template-rows: repeat(2, 4px);
    place-content: center;
    gap: 5px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
}

.app-grid-button span {
    width: 4px;
    height: 4px;
    border-radius: 2px;
    background: #101827;
}

.app-grid-button:hover {
    background: #f1f5f9;
}

/* JeĂ„Ä…Ă„Ëťeli nie masz buttona app-grid-button, wygeneruj ikonÄ‚â€žĂ˘â€žË przed tabsami */
.app-topbar-center::before {
    content: "";
    width: 34px;
    height: 34px;
    display: inline-block;
    flex: 0 0 34px;
    margin-right: 24px;
    border-radius: 10px;
    background:
            radial-gradient(circle, #101827 2px, transparent 2.5px) 11px 11px / 11px 11px no-repeat,
            radial-gradient(circle, #101827 2px, transparent 2.5px) 22px 11px / 11px 11px no-repeat,
            radial-gradient(circle, #101827 2px, transparent 2.5px) 11px 22px / 11px 11px no-repeat,
            radial-gradient(circle, #101827 2px, transparent 2.5px) 22px 22px / 11px 11px no-repeat;
}

.app-topbar-left .app-topbar-center::before,
.app-topbar-left + .app-topbar-center::before {
    display: none;
}

/* Tabs */

.app-tabs {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-tabs a {
    position: relative;
    height: var(--vv-topbar-h);
    display: inline-flex;
    align-items: center;
    padding: 0 18px;
    color: #64748b;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.018em;
    line-height: 1;
}

.app-tabs a:hover {
    color: var(--vv-primary);
}

.app-tabs a.is-active,
.app-tabs a.active,
.app-tabs a[aria-current="page"] {
    color: #4f46e5;
    font-weight: 800;
}

.app-tabs a.is-active::after,
.app-tabs a.active::after,
.app-tabs a[aria-current="page"]::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 0;
    height: 3px;
    border-radius: 999px 999px 0 0;
    background: linear-gradient(90deg, var(--vv-primary), var(--vv-primary-2));
    box-shadow: 0 -5px 18px rgba(91, 77, 246, 0.25);
}

/* =========================================================
   User button
   ========================================================= */

.app-userbar {
    height: 100%;
    display: flex;
    align-items: center;
    margin-left: auto;
}

.app-status-dot {
    display: none !important;
}

.app-user-menu {
    position: relative;
}

.app-user-summary {
    position: relative;
    height: 54px;
    min-width: 214px;
    display: grid;
    grid-template-columns: 42px 1fr 12px;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 12px;
    padding: 6px 8px;
    border: 0;
    border-radius: 18px;
    background: transparent;
    color: var(--vv-text);
    cursor: pointer;
    text-align: left;
    appearance: none;
}

.app-user-summary:hover {
    background: #f8fafc;
}

/* avatar dla nowego HTML */
.app-user-summary-avatar {
    grid-row: 1 / span 2;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background:
            url("data:image/svg+xml,%3Csvg width='42' height='42' viewBox='0 0 42 42' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='42' height='42' rx='21' fill='%23EEF2FF'/%3E%3Cpath d='M21 21C23.7614 21 26 18.7614 26 16C26 13.2386 23.7614 11 21 11C18.2386 11 16 13.2386 16 16C16 18.7614 18.2386 21 21 21Z' stroke='%23594CF5' stroke-width='2'/%3E%3Cpath d='M12.5 31C13.7 26.9 16.7 24.8 21 24.8C25.3 24.8 28.3 26.9 29.5 31' stroke='%23594CF5' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E")
            center / cover no-repeat;
}

/* avatar dla starego HTML, gdzie button ma tylko span + small */
.app-user-summary:not(:has(.app-user-summary-avatar))::before {
    content: "";
    grid-row: 1 / span 2;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background:
            url("data:image/svg+xml,%3Csvg width='42' height='42' viewBox='0 0 42 42' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='42' height='42' rx='21' fill='%23EEF2FF'/%3E%3Cpath d='M21 21C23.7614 21 26 18.7614 26 16C26 13.2386 23.7614 11 21 11C18.2386 11 16 13.2386 16 16C16 18.7614 18.2386 21 21 21Z' stroke='%23594CF5' stroke-width='2'/%3E%3Cpath d='M12.5 31C13.7 26.9 16.7 24.8 21 24.8C25.3 24.8 28.3 26.9 29.5 31' stroke='%23594CF5' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E")
            center / cover no-repeat;
}

.app-user-summary-text {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-user-summary-text strong,
.app-user-summary > span:not(.app-user-summary-avatar):not(.app-user-summary-chevron) {
    grid-column: 2;
    display: block;
    color: #0f172a;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.025em;
    white-space: nowrap;
}

.app-user-summary-text small,
.app-user-summary > small {
    grid-column: 2;
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.012em;
    white-space: nowrap;
}

.app-user-summary-chevron {
    grid-column: 3;
    grid-row: 1 / span 2;
    width: 8px;
    height: 8px;
    border-right: 2px solid #94a3b8;
    border-bottom: 2px solid #94a3b8;
    transform: rotate(45deg) translateY(-2px);
}

/* chevron dla starego HTML */
.app-user-summary:not(:has(.app-user-summary-chevron))::after {
    content: "";
    grid-column: 3;
    grid-row: 1 / span 2;
    width: 8px;
    height: 8px;
    border-right: 2px solid #94a3b8;
    border-bottom: 2px solid #94a3b8;
    transform: rotate(45deg) translateY(-2px);
}

/* =========================================================
   User dropdown
   ========================================================= */

.app-user-panel {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    z-index: 200;
    width: 320px;
    max-height: min(560px, calc(100vh - 96px));
    padding: 12px;
    border-radius: 18px;
    border: 1px solid rgba(226, 232, 240, 0.96);
    background: rgba(255, 255, 255, 0.985);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow:
            0 28px 80px rgba(15, 23, 42, 0.18),
            0 4px 16px rgba(15, 23, 42, 0.05);
}

.app-user-panel.hidden {
    display: none;
}

.app-user-panel::before {
    content: "";
    position: absolute;
    top: -7px;
    right: 31px;
    width: 14px;
    height: 14px;
    background: rgba(255, 255, 255, 0.985);
    border-left: 1px solid rgba(226, 232, 240, 0.96);
    border-top: 1px solid rgba(226, 232, 240, 0.96);
    transform: rotate(45deg);
}

.app-user-profile {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 10px;
    padding: 2px 2px 10px;
    border-bottom: 1px solid var(--vv-border);
}

.app-user-avatar {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #eef2ff;
    color: var(--vv-primary);
    font-size: 13px;
    font-weight: 800;
}

.app-user-profile strong {
    display: block;
    color: #0f172a;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.app-user-profile span {
    display: block;
    margin-top: 3px;
    color: var(--vv-primary-3);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: -0.015em;
}

.app-user-profile small {
    display: block;
    margin-top: 3px;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: -0.012em;
}

.app-user-muted {
    display: block;
    margin-top: 3px;
    color: #64748b !important;
    font-size: 12px !important;
    font-weight: 600 !important;
}

/* Dropdown biznesĂ„â€šÄąâ€šw ze starego HTML */

.app-active-business {
    padding-top: 10px;
}

.app-active-business-card {
    padding: 9px 10px;
    border: 1px solid rgba(91, 77, 246, 0.13);
    border-radius: 12px;
    background: rgba(91, 77, 246, 0.055);
}

.app-active-business-head {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px;
}

.app-active-business-head strong {
    min-width: 0;
    overflow: hidden;
    color: #172033;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: -0.018em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-active-business-head em {
    padding: 4px 7px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.13);
    color: #047857;
    font-size: 10px;
    font-style: normal;
    font-weight: 900;
    text-transform: uppercase;
}

.app-business-picker {
    padding-top: 10px;
}

.app-business-picker label,
.app-panel-label {
    display: block;
    margin: 0 0 7px;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.app-business-picker input[type="search"] {
    width: 100%;
    height: 36px;
    margin-bottom: 8px;
    padding: 0 11px;
    border: 1px solid var(--vv-border);
    border-radius: 13px;
    outline: none;
    background: #f8fafc;
    color: #0f172a;
    font-size: 12px;
    font-weight: 600;
}

.app-business-picker input[type="search"]:focus {
    border-color: rgba(91, 77, 246, 0.55);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(91, 77, 246, 0.10);
}

.app-business-ul {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 300px;
    margin: 0;
    padding: 0;
    overflow: auto;
    list-style: none;
    scrollbar-color: rgba(91, 77, 246, 0.45) transparent;
    scrollbar-width: thin;
}

.app-business-ul::-webkit-scrollbar {
    width: 8px;
}

.app-business-ul::-webkit-scrollbar-track {
    background: transparent;
}

.app-business-ul::-webkit-scrollbar-thumb {
    border: 2px solid #ffffff;
    border-radius: 999px;
    background: rgba(91, 77, 246, 0.42);
}

.app-business-ul form {
    margin: 0;
}

.app-business-ul button {
    width: 100%;
    min-height: 38px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #172033;
    cursor: pointer;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.app-business-ul button:hover {
    background: #f8fafc;
}

.app-business-ul button.is-selected {
    color: var(--vv-primary-3);
    background: rgba(91, 77, 246, 0.065);
}

.app-business-ul button span {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.app-business-ul button strong {
    color: inherit;
    font-size: 11px;
    font-weight: 800;
}

.app-business-ul button small {
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
}

.app-business-ul button em {
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
}

.app-user-actions {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--vv-border);
}

.app-user-actions a {
    min-height: 36px;
    display: flex;
    align-items: center;
    padding: 0 9px;
    border-radius: 10px;
    color: #334155;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: -0.018em;
}

.app-logout-form {
    margin: 0;
}

.app-logout-form button {
    width: 100%;
    min-height: 36px;
    display: flex;
    align-items: center;
    padding: 0 9px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #334155;
    cursor: pointer;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: -0.018em;
}

.app-user-actions a:hover {
    background: #f8fafc;
    color: var(--vv-primary-3);
}

.app-user-actions a.is-danger,
.app-user-actions a[href*="logout"],
.app-logout-form button.is-danger {
    color: var(--vv-danger);
}

.app-user-actions a.is-danger:hover,
.app-user-actions a[href*="logout"]:hover,
.app-logout-form button.is-danger:hover {
    background: rgba(239, 68, 68, 0.08);
}

/* =========================================================
   Global toasts
   ========================================================= */

.vv-toast-stack {
    position: fixed;
    top: 92px;
    right: 24px;
    z-index: 9999;
    width: min(380px, calc(100vw - 32px));
    display: grid;
    gap: 12px;
    pointer-events: none;
}

.vv-toast {
    display: grid;
    grid-template-columns: 1fr 34px;
    align-items: center;
    gap: 12px;
    min-height: 58px;
    padding: 12px 12px 12px 16px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-left-width: 5px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 20px 55px rgba(15, 23, 42, 0.16), 0 3px 10px rgba(15, 23, 42, 0.06);
    color: #0f172a;
    opacity: 0;
    pointer-events: auto;
    transform: translate3d(18px, -6px, 0);
    transition: opacity 180ms ease, transform 180ms ease;
}

.vv-toast.is-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.vv-toast-message {
    font-size: 14px;
    font-weight: 750;
    line-height: 1.35;
    letter-spacing: -0.018em;
}

.vv-toast-close {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
}

.vv-toast-close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.vv-toast-notice {
    border-left-color: #4f46e5;
}

.vv-toast-success {
    border-left-color: #10b981;
}

.vv-toast-warning {
    border-left-color: #f59e0b;
}

.vv-toast-error {
    border-left-color: #ef4444;
}

/* =========================================================
   Global loader
   ========================================================= */

.vv-loader-lock {
    overflow: hidden;
}

.vv-loader-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: 24px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
}

.vv-loader-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.vv-loader-card {
    width: min(320px, 100%);
    min-height: 210px;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 12px;
    padding: 30px 26px;
    color: #ffffff;
    text-align: center;
    transform: translateY(10px) scale(0.97);
    transition: transform 180ms ease;
}

.vv-loader-overlay.is-visible .vv-loader-card {
    transform: translateY(0) scale(1);
}

.vv-loader-ring {
    width: 78px;
    height: 78px;
    display: inline-block;
    border-radius: 999px;
    border: 7px solid rgba(255, 255, 255, 0.14);
    border-top-color: #00e5ff;
    border-right-color: #7c5cff;
    box-shadow:
            0 0 32px rgba(0, 229, 255, 0.28),
            inset 0 0 18px rgba(124, 92, 255, 0.12);
    animation: vvLoaderSpin 850ms linear infinite;
}

.vv-loader-card strong {
    margin-top: 6px;
    color: #ffffff;
    font-size: 19px;
    font-weight: 900;
    letter-spacing: -0.035em;
}

.vv-loader-card small {
    color: rgba(226, 232, 240, 0.74);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.012em;
}

@keyframes vvLoaderSpin {
    to {
        transform: rotate(360deg);
    }
}

/* =========================================================
   Public mode fallback
   ========================================================= */

body:not(.has-admin-sidebar) .admin-content-shell {
    width: 100%;
    margin-left: 0;
}

body:not(.has-admin-sidebar) .app-topbar > .app-brand {
    display: flex !important;
    width: auto;
    min-width: 0;
    height: 100%;
    align-items: center;
    gap: 12px;
    color: #0f172a;
    text-decoration: none;
}

body:not(.has-admin-sidebar) .app-brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #7c6cff, #584cf4);
    color: #ffffff;
    font-weight: 800;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1180px) {
    :root {
        --vv-sidebar-w: 264px;
    }

    .admin-sidebar-brand > span:last-child {
        font-size: 24px;
    }

    .app-main.admin-main {
        padding: 26px;
    }
}

@media (max-width: 900px) {
    .admin-shell {
        display: block;
    }

    .admin-sidebar {
        position: relative;
        width: 100%;
        height: auto;
        min-height: 0;
        padding-bottom: 14px;
    }

    .admin-content-shell {
        width: 100%;
        margin-left: 0;
    }

    .admin-sidebar-nav ul {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 8px;
    }

    .admin-sidebar-nav a {
        min-width: max-content;
    }

    .admin-sidebar-nav a.is-active::after,
    .admin-sidebar-nav li.is-active > a::after,
    .admin-sidebar-nav a.active::after,
    .admin-sidebar-nav a[aria-current="page"]::after {
        display: none;
    }

    .admin-sidebar-bottom {
        display: none;
    }

    .app-topbar {
        padding: 0 16px;
    }

    .app-tabs {
        overflow-x: auto;
    }

    .app-tabs a {
        white-space: nowrap;
    }

    .app-user-panel {
        position: fixed;
        top: 82px;
        right: 14px;
        left: 14px;
        width: auto;
    }
}

@media (max-width: 580px) {
    .vv-toast-stack {
        top: 82px;
        right: 16px;
        left: 16px;
        width: auto;
    }

    .app-user-summary {
        min-width: 54px;
        grid-template-columns: 42px;
    }

    .app-user-summary > span:not(.app-user-summary-avatar):not(.app-user-summary-chevron),
    .app-user-summary > small,
    .app-user-summary-text,
    .app-user-summary-chevron,
    .app-user-summary::after {
        display: none !important;
    }
}


/* Business switcher - collapsed by default */
.app-business-switcher {
    padding-top: 10px;
}

.app-business-switcher .app-active-business-card {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px 11px;
    border: 1px solid rgba(91, 77, 246, 0.13);
    border-radius: 13px;
    background: rgba(91, 77, 246, 0.055);
    color: #172033;
    cursor: pointer;
    text-align: left;
    font: inherit;
}

.app-business-current {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.app-business-current small {
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.app-business-current strong {
    overflow: hidden;
    color: #172033;
    font-size: 13px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-business-switcher .app-active-business-card em {
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(91, 77, 246, .12);
    color: var(--vv-primary-3);
    font-size: 10px;
    font-style: normal;
    font-weight: 900;
    text-transform: uppercase;
}

.app-business-switcher.is-open .app-active-business-card {
    border-color: rgba(91, 77, 246, .38);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(91, 77, 246, .08);
}

.app-business-switcher .app-business-picker {
    padding-top: 8px;
}

.app-business-switcher .app-business-picker.hidden {
    display: none;
}
#menuContainer {
    width: 268px;
}

.villa-submenu {
    position: fixed;
    left: 0;
    top: 76px;
    bottom: 0;
    z-index: 30;
    width: 268px;
    box-sizing: border-box;
    padding: 16px;
    border-top: 1px solid rgba(16, 24, 40, .08);
    border-right: 1px solid rgba(16, 24, 40, .08);
    background: rgba(255, 255, 255, .96);
    box-shadow: 14px 0 42px rgba(15, 23, 42, .07);
}

#menuContainer + .container {
    width: calc(100% - 268px);
    height: calc(100vh - 76px);
    box-sizing: border-box;
    margin-left: 268px;
    padding: 64px;
    overflow: auto;
    background: #f6f8fc;
}

.app-main.admin-main {
    height: calc(100vh - 76px);
    padding: 0;
    overflow: hidden;
}

#menuContainer + .container h1 {
    margin: 0;
}

.villa-submenu-title {
    margin: 2px 8px 12px;
    color: #0f172a;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.villa-submenu ul {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.villa-submenu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    color: #334155;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
}

.villa-submenu a span {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 10px;
    background: #f1f5f9;
    color: #0f172a;
    font-size: 14px;
}

.villa-submenu li.active a,
.villa-submenu a:hover {
    color: #ffffff;
    background: #0f172a;
}

.villa-submenu li.active a span,
.villa-submenu a:hover span {
    background: rgba(255, 255, 255, .16);
    color: #ffffff;
}

