:root {
    --pb-primary: #008060;
    /* Shopify Green */
    --pb-primary-hover: #006e52;
    --pb-bg: #ffffff;
    /* Polaris Background */
    --pb-sidebar-bg: #F9FAFB;
    /* Refined Sidebar Gray */
    --pb-topbar-bg: #1A1C1D;
    /* Shopify Dark Topbar */
    --pb-card-bg: #FFFFFF;
    --pb-accent-bg: #EDEEEF;
    --pb-text-black: #202223;
    --pb-text-gray: #6D7175;
    --pb-border-light: #E1E3E5;
    --pb-border-medium: #8C9196;

    --pb-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* Base Styles */
body {
    background-color: var(--pb-bg) !important;
    color: var(--pb-text-black);
    font-family: var(--pb-font-sans);
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.011em;
}

h1,
h2,
h3 {
    letter-spacing: -0.02em;
    color: var(--pb-text-black);
}

/* Layout */
.pb-app-container {
    display: flex;
    min-height: 100vh;
}

.pb-sidebar {
    width: 260px;
    background: var(--pb-sidebar-bg);
    /* border-right: 1px solid var(--pb-border-light); */
    position: fixed;
    height: 100vh;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pb-sidebar-collapsed {
    width: 72px;
}

.pb-sidebar nav {
    padding: 1.5rem 0.75rem;
    flex: 1;
}

.pb-sidebar-nav-scroll::-webkit-scrollbar {
    width: 4px;
}
.pb-sidebar-nav-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.pb-sidebar-nav-scroll::-webkit-scrollbar-thumb {
    background: #E1E3E5;
    border-radius: 4px;
}
.pb-sidebar-nav-scroll::-webkit-scrollbar-thumb:hover {
    background: #C4C7C9;
}

.pb-sidebar-collapsed nav,
.pb-sidebar-collapsed .pt-4 {
    padding: 1.5rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pb-sidebar-collapsed .pb-logo-text,
.pb-sidebar-collapsed .pb-sidebar-tag,
.pb-sidebar-collapsed .text-\[9px\],
.pb-sidebar-collapsed .pb-nav-item span {
    display: none;
}

.pb-sidebar-collapsed .border-t {
    border-top: none !important;
}

.pb-sidebar-collapsed .pb-nav-item {
    width: 44px;
    height: 44px;
    justify-content: center;
    padding: 0;
    margin-bottom: 0.5rem;
}

.pb-sidebar-collapsed .pb-nav-item svg {
    margin: 0;
    width: 22px;
    height: 22px;
}

.pb-main-content {
    flex: 1;
    margin-left: 260px;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pb-sidebar-closed .pb-main-content {
    margin-left: 72px;
}

.pb-content-wrapper {
    padding: 2rem;
    max-width: 1400px;
}

/* Logo Section */
.pb-logo-container {
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    background: var(--pb-topbar-bg);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.pb-sidebar-collapsed .pb-logo-container {
    justify-content: center;
    padding: 0;
}

.pb-sidebar-collapsed .pb-logo-container button {
    display: flex;
    justify-content: center;
    width: 100%;
}

.pb-sidebar-collapsed .pb-logo-text-compact {
    display: none; /* Hide P when collapsed to prioritize the toggle button in the header bar */
}

.pb-logo-text {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: white;
}

.pb-logo-text-compact {
    font-size: 1.25rem;
    font-weight: 800;
    color: white;
}

/* Sidebar Nav */
.pb-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    color: var(--pb-text-black);
    font-weight: 500;
    text-decoration: none !important;
    transition: all 0.1s ease;
    font-size: 0.825rem;
}

.pb-nav-item svg {
    width: 20px;
    height: 20px;
    color: #5C5F62;
}

.pb-nav-item:hover {
    background: #E1E3E5;
}

.pb-nav-item.active {
    background: #FFFFFF;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    color: var(--pb-text-black);
    font-weight: 600;
}

.pb-nav-item.active svg {
    color: var(--pb-text-black);
}

.pb-nav-item-sub {
    padding-left: 2.25rem !important;
    font-size: 0.75rem !important;
    opacity: 0.8;
}

.pb-nav-item-sub svg {
    width: 16px !important;
    height: 16px !important;
}


/* Buttons */
.pb-btn {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid transparent;
}

.pb-btn-primary {
    background: var(--pb-primary);
    color: white !important;
    border-color: #006e52;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}

.pb-btn-primary:hover {
    background: var(--pb-primary-hover);
    border-color: #005e46;
}

.pb-btn-outline {
    border-color: var(--pb-border-medium);
    background: white;
    color: var(--pb-text-black);
}

.pb-btn-outline:hover {
    border-color: var(--pb-text-black);
}

/* Cards */
.pb-card-medium {
    background: white;
    border: 1px solid var(--pb-border-light);
    border-radius: 8px;
    padding: 2.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.pb-card-medium:hover {
    border-color: var(--pb-border-medium);
}

/* Top Bar */
.pb-top-bar {
    height: 56px;
    background: var(--pb-topbar-bg);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.pb-top-search {
    flex: 0 1 600px;
    margin-right: auto;
    position: relative;
    padding-left: 0.5rem;
}

.pb-top-search input {
    width: 100%;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    color: white;
    font-size: 0.85rem;
    outline: none;
    transition: all 0.2s;
}

.pb-top-search input:focus {
    background: white;
    color: var(--pb-text-black);
}

.pb-top-search svg {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.4);
}

.pb-top-search input:focus+svg {
    color: var(--pb-text-gray);
}

.pb-user-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Transitions */
.animate-in {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sidebar Custom Elements */
.pb-sidebar-tag {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #6D7175;
    letter-spacing: 0.05em;
    padding: 1.5rem 0.75rem 0.5rem;
}

@media (max-width: 1024px) {
    .pb-sidebar {
        transform: translateX(-100%);
    }

    .pb-main-content {
        margin-left: 0;
        padding: 2rem;
    }
}

/* Auth Overrides */
.pb-auth-wrapper {
    background: var(--pb-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.pb-auth-card {
    background: white;
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--pb-border-light);
}

.pb-auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--pb-text-black);
    text-align: center;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.pb-auth-subtitle {
    font-size: 0.9rem;
    color: var(--pb-text-gray);
    text-align: center;
    margin-bottom: 2rem;
}

.pb-polaris-input {
    width: 100%;
    border: 1px solid var(--pb-border-medium);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    color: var(--pb-text-black);
    background: white;
    outline: none;
    transition: border-color 0.15s;
}

.pb-polaris-input:focus {
    border-color: #008060;
    box-shadow: 0 0 0 2px rgba(0, 128, 96, 0.1);
}

.pb-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #202223;
    margin-bottom: 0.4rem;
}
/* Breadcrumbs */
.pb-breadcrumb-hub {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    background: transparent;
    padding: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
    margin-bottom: 1.5rem !important;
}
.pb-breadcrumb-hub::-webkit-scrollbar { display: none; }

.pb-breadcrumb-item {
    display: flex;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: #6D7175;
    text-decoration: none !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}
.pb-breadcrumb-item:hover {
    color: #008060;
}
.pb-breadcrumb-item:not(:last-child)::after {
    content: '';
    width: 14px;
    height: 14px;
    margin: 0 0.75rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23C1C4C7' stroke-width='2.5'%3E%3Cpath d='M9 5l7 7-7 7'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    display: inline-block;
}
.pb-breadcrumb-item svg {
    color: #5C5F62;
    flex-shrink: 0;
    margin-right: 0.5rem;
    transition: color 0.2s;
}
.pb-breadcrumb-item:hover svg {
    color: #008060;
}

/* Asset Show Page */
.pb-show-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    align-items: flex-start;
}
.pb-show-main {
    background: white;
    border: 1px solid var(--pb-border-light);
    border-radius: 8px;
    overflow: hidden;
}
.pb-show-header {
    padding: 2.5rem;
    border-bottom: 1px solid var(--pb-border-light);
}
.pb-show-content {
    padding: 2.5rem;
    font-size: 1rem;
    line-height: 1.8;
    color: #30373E;
}
.pb-show-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.pb-meta-card {
    background: white;
    border: 1px solid var(--pb-border-light);
    border-radius: 8px;
    padding: 1.25rem;
}
.pb-meta-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--pb-text-gray);
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    display: block;
}
.pb-meta-value {
    font-size: 0.85rem;
    color: var(--pb-text-black);
    font-weight: 500;
}
