:root {
    --primary-color: #2563eb;
    /* Royal Blue */
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    /* Slate */
    --bg-body: #f1f5f9;
    /* Light Gray */
    --bg-sidebar: #0f172a;
    /* Dark Slate */
    --text-main: #1e293b;
    --text-muted: #64748b;
    --white: #ffffff;
    --border-color: #e2e8f0;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 0.5rem;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    outline: none;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-body);
    color: var(--text-main);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    color: var(--white);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: all 0.3s;
}

.logo {
    padding: 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo svg {
    fill: var(--primary-color);
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    white-space: nowrap;
}

.brand-title {
    font-size: 1.1rem;
    font-weight: bold;
}

.brand-subtitle {
    font-size: 0.75rem;
    font-weight: normal;
    opacity: 0.8;
    letter-spacing: 0.5px;
}

.nav-menu {
    list-style: none;
    padding: 1rem 0;
    flex: 1;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 500;
    cursor: pointer;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border-right: 4px solid var(--primary-color);
}

.nav-link svg {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.user-profile {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 36px;
    height: 36px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.user-info small {
    display: block;
    color: #94a3b8;
    font-size: 0.75rem;
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    /* Removed padding to allow sticky elements to hit top */
    position: relative;
}

.section {
    display: none;
    padding: 2rem;
    /* Added padding to compensate for main-content removal */
    animation: fadeIn 0.3s ease-in-out;
}



.section.active {
    display: block;
}

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

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

.header-title {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    font-weight: 600;
}

/* Dashboard Cards */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-widgets {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (min-width: 1024px) {
    .dashboard-widgets {
        grid-template-columns: 1fr 1fr;
    }
}


.metric-card {
    padding: 0;
    /* Remove padding from main card so banner hits edges */
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    /* Ensure banner corners clip */
    transition: transform 0.2s;
    background: white;
    border: 1px solid #e2e8f0;
    position: relative;
    /* Context for absolute bg */
}

/* Pseudo-element for Background Image with Opacity */
.metric-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0.4;
    /* Visible opacity */
    z-index: 0;
    /* Behind content */
    pointer-events: none;
}

/* Content needs z-index to sit above bg */
.metric-title,
.metric-value {
    position: relative;
    z-index: 1;
}

.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.metric-value {
    padding: 1.5rem;
    /* Content body padding */
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    /* Dark Slate */
}

/* Color Variants - Banners & Images */
.card-blue .metric-title {
    background-color: #3b82f6;
    /* Blue 500 */
}

.card-blue::before {
    background-image: url('../bg_cars.png');
    background-size: 300px;
    /* Pattern size */
    background-repeat: repeat;
}

.card-green .metric-title {
    background-color: #22c55e;
    /* Green 500 */
}

.card-green::before {
    background-image: url('../bg_speedometer.png');
    background-size: 80%;
    background-repeat: no-repeat;
    background-position: center 60%;
}

.card-orange .metric-title {
    background-color: #f97316;
    /* Orange 500 */
}

.card-orange::before {
    background-image: url('../bg_gift.png');
    background-size: 60%;
    background-repeat: no-repeat;
    background-position: center 60%;
}

.metric-title {
    padding: 1rem 1.5rem;
    /* Add padding here for header feel */
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    color: white !important;
    /* Force white text on banner */
}

/* Forms */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 2rem;
}

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

.form-full {
    grid-column: span 2;
}

.form-grid-dense {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1rem;
}

.form-grid-dense .form-full {
    grid-column: span 12;
}

@media (max-width: 768px) {
    .form-grid-dense {
        grid-template-columns: 1fr;
    }

    .form-grid-dense>div {
        grid-column: span 1 !important;
    }

    .form-grid-dense .section-header {
        grid-column: span 1 !important;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

input,
select,
textarea {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.2s;
    background-color: #f8fafc;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-color);
    background-color: var(--white);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-success {
    background-color: var(--success);
    color: var(--white);
}

.btn-success:hover {
    background-color: #059669;
}

/* Tables */
.table-container {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    background-color: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
    padding: 1rem 1.5rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

tr:last-child td {
    border-bottom: none;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-disponivel {
    background-color: #dcfce7;
    color: #166534;
}

.status-reservado {
    background-color: #fef3c7;
    color: #92400e;
}

.status-vendido {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-concluido {
    background-color: #dbeafe;
    /* Blue 100 */
    color: #1e40af;
    /* Blue 800 */
}

/* Utilities */
.mt-4 {
    margin-top: 1rem;
}

.text-right {
    text-align: right;
}

.text-red-500 {
    color: var(--danger);
}

@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }

    .sidebar span:not(.icon) {
        display: none;
    }

    /* Fix Logo Visibility on Mobile */
    .logo {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }

    .logo-text {
        display: none;
        /* Hide text container completely to remove gap */
    }

    .logo svg {
        flex-shrink: 0;
        /* Prevent shrinking */
    }

    .user-info {
        display: none;
    }

    .nav-link {
        justify-content: center;
        padding: 1rem;
    }

    .nav-link svg {
        margin: 0;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-full {
        grid-column: span 1;
    }
}

.action-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    margin-right: 0.25rem;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid transparent;
    font-weight: 600;
}

.action-reservar {
    background-color: #fef3c7;
    color: #92400e;
    border-color: #fcd34d;
}

.action-reservar:hover {
    background-color: #fcd34d;
}

.action-vender {
    background-color: #dcfce7;
    color: #166534;
    border-color: #86efac;
}

.action-vender:hover {
    background-color: #86efac;
}

.action-editar {
    background-color: #e0f2fe;
    color: #0369a1;
    border-color: #7dd3fc;
}

.action-editar:hover {
    background-color: #7dd3fc;
}

/* Modal Receipt */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: flex-start;
    /* Alinhamento ao topo para permitir scroll */
    overflow-y: auto;
    /* Habilita rolagem vertical */
    padding: 2rem 1rem;
    /* Margem de segurança nas bordas */
}

.modal.active {
    display: flex;
}

.receipt-card {
    background: white;
    width: 100%;
    max-width: 500px;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    position: relative;
    margin: 0 auto;
    /* Centraliza horizontalmente */
}

.receipt-header {
    text-align: center;
    border-bottom: 2px dashed var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

/* Input Group with Prefix */
.input-with-prefix {
    /* padding-left: 35px !important; REMOVED PREFIX PADDING */
    padding-left: 0.75rem !important;
    width: 100%;
    flex: 1;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-prefix {
    position: absolute;
    left: 10px;
    color: var(--text-muted);
    font-weight: 500;
    pointer-events: none;
}

.receipt-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-main);
}

.receipt-body p {
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
    /* Permite quebra de linha */
    word-break: break-word;
    /* Quebra palavras longas */
}

.receipt-body p strong {
    flex-shrink: 0;
    /* Evita que o label encolha */
    max-width: 40%;
    /* Limita largura do label */
}

.receipt-body p span {
    flex: 1;
    /* Ocupa espaço restante */
    text-align: right;
    /* Alinha valor à direita */
    min-width: 0;
    /* Permite encolhimento */
    overflow-wrap: break-word;
    /* Quebra palavras longas */
}

.receipt-footer {
    margin-top: 2rem;
    text-align: center;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.close-modal:hover {
    color: var(--danger);
}

.sinesp-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem;
    margin-top: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    animation: fadeIn 0.5s ease-in-out;
    position: relative;
}

.sinesp-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-regular {
    background-color: #dcfce7;
    color: #166534;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background-color: #fef9c3;
    color: #854d0e;
}

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

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

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Tabs Styling */
.tab-bar {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
    overflow-x: auto;

    /* Sticky Config */
    position: sticky;
    top: 0;
    z-index: 90;
    background: var(--white);

    /* Full width within card & adjustment */
    margin: -2rem -2rem 1.5rem -2rem;
    padding: 1rem 2rem 0 2rem;
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-bar {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
    overflow-x: auto;

    /* Sticky Config */
    position: sticky;
    top: 0;
    z-index: 90;
    background: var(--white);

    /* Full width within card & adjustment */
    margin: -2rem -2rem 1.5rem -2rem;
    padding: 1rem 2rem 0 2rem;

    /* Hide Scrollbar */
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.tab-bar::-webkit-scrollbar {
    display: none;
}

.form-full {
    grid-column: 1 / -1;
}

.form-full input,
.form-full select,
.form-full textarea {
    width: 100%;
}

.section-header {
    grid-column: 1 / -1;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f1f5f9;
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.5rem;
    background: #f8fafc;
    border-radius: var(--radius);
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
    width: 1.2em;
    height: 1.2em;
    cursor: pointer;
}

/* DESKTOP SIDEBAR COLLAPSE BEHAVIOR */
@media (min-width: 1024px) {
    .sidebar {
        width: 80px;
        /* Collapsed Width */
        transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow: hidden;
        white-space: nowrap;
        position: fixed;
        /* Fix to left to allow overlay expansion */
        height: 100vh;
        z-index: 100;
        left: 0;
        top: 0;
    }

    /* Push main content */
    .main-content {
        margin-left: 80px;
        width: calc(100% - 80px);
        /* Explicit width management */
    }

    .sidebar:hover {
        width: max-content;
        /* Dynamic width based on content */
        min-width: 230px;
        /* Fallback min width */
        padding-right: 20px;
        /* "uns 10px" breathing room after longest text */
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
        /* Shadow to separate from content */
    }

    /* Hide Text Elements by Default */
    .sidebar .logo-text,
    .sidebar .nav-link span,
    .sidebar .user-info {
        opacity: 0;
        visibility: hidden;
        transform: translateX(-10px);
        transition: all 0.2s;
        position: relative;
        visibility: visible;
    }

    /* Hide Text Elements Completely by Default (Collapsed) */
    .sidebar:not(:hover) .logo-text,
    .sidebar:not(:hover) .nav-link span,
    .sidebar:not(:hover) .user-info {
        display: none;
        opacity: 0;
    }

    /* Show on Hover */
    .sidebar:hover .logo-text,
    .sidebar:hover .nav-link span,
    .sidebar:hover .user-info {
        opacity: 1;
        animation: fadeInSide 0.3s forwards;
    }

    .sidebar:hover .logo-text {
        display: flex;
    }

    .sidebar:hover .nav-link span,
    .sidebar:hover .user-info {
        display: block;
    }

    @keyframes fadeInSide {
        from {
            opacity: 0;
            transform: translateX(-10px);
        }

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

    /* Centering adjustments for Collapsed State */
    .logo,
    .nav-link,
    .user-profile {
        padding-left: 0;
        padding-right: 0;
        justify-content: center;
        /* Center icons */
    }

    /* Logo Specific - Ensure SVG is visible and centered */
    .sidebar:not(:hover) .logo svg {
        display: block;
        width: 28px;
        height: 28px;
        min-width: 28px;
        /* FORCE NO SHRINK */
        margin: 0 auto;
        fill: var(--primary-color);
        flex-shrink: 0;
    }

    .sidebar:not(:hover) .logo {
        gap: 0;
        /* Remove gap when text is hidden */
    }

    /* Nav Icons - Force visibility */
    .sidebar:not(:hover) .nav-link svg {
        margin: 0;
        width: 24px;
        height: 24px;
        min-width: 24px;
        /* FORCE NO SHRINK */
        flex-shrink: 0;
    }

    .nav-link svg {
        margin-right: 0;
        /* Remove margin when collapsed/centered */
    }

    /* Re-apply spacing on Hover/Expansion */
    .sidebar:hover .logo,
    .sidebar:hover .nav-link,
    .sidebar:hover .user-profile {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
        justify-content: flex-start;
        /* Align left */
    }

    .sidebar:hover .nav-link svg {
        margin-right: 12px;
    }
}

.tab-bar::-webkit-scrollbar {
    display: none;
}

.form-full {
    grid-column: 1 / -1;
}

.form-full input,
.form-full select,
.form-full textarea {
    width: 100%;
}

.section-header {
    grid-column: 1 / -1;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f1f5f9;
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.5rem;
    background: #f8fafc;
    border-radius: var(--radius);
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
    width: 1.2em;
    height: 1.2em;
    cursor: pointer;
}

/* DESKTOP SIDEBAR COLLAPSE BEHAVIOR */
@media (min-width: 1024px) {
    .sidebar {
        width: 80px;
        /* Collapsed Width */
        transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow: hidden;
        white-space: nowrap;
        position: fixed;
        /* Fix to left to allow overlay expansion */
        height: 100vh;
        z-index: 100;
        left: 0;
        top: 0;
    }

    /* Push main content */
    .main-content {
        margin-left: 80px;
        width: calc(100% - 80px);
        /* Explicit width management */
    }

    .sidebar:hover {
        width: max-content;
        /* Dynamic width based on content */
        min-width: 230px;
        /* Fallback min width */
        padding-right: 20px;
        /* "uns 10px" breathing room after longest text */
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
        /* Shadow to separate from content */
    }

    /* Hide Text Elements by Default */
    .sidebar .logo-text,
    .sidebar .nav-link span,
    .sidebar .user-info {
        opacity: 0;
        visibility: hidden;
        transform: translateX(-10px);
        transition: all 0.2s;
        position: relative;
        visibility: visible;
    }

    /* Hide Text Elements Completely by Default (Collapsed) */
    .sidebar:not(:hover) .logo-text,
    .sidebar:not(:hover) .nav-link span,
    .sidebar:not(:hover) .user-info {
        display: none;
        opacity: 0;
    }

    /* Show on Hover */
    .sidebar:hover .logo-text,
    .sidebar:hover .nav-link span,
    .sidebar:hover .user-info {
        opacity: 1;
        animation: fadeInSide 0.3s forwards;
    }

    .sidebar:hover .logo-text {
        display: flex;
    }

    .sidebar:hover .nav-link span,
    .sidebar:hover .user-info {
        display: block;
    }

    @keyframes fadeInSide {
        from {
            opacity: 0;
            transform: translateX(-10px);
        }

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

    /* Centering adjustments for Collapsed State */
    .logo,
    .nav-link,
    .user-profile {
        padding-left: 0;
        padding-right: 0;
        justify-content: center;
        /* Center icons */
    }

    /* Logo Specific - Ensure SVG is visible and centered */
    .sidebar:not(:hover) .logo svg {
        display: block;
        width: 28px;
        height: 28px;
        min-width: 28px;
        /* FORCE NO SHRINK */
        margin: 0 auto;
        fill: var(--primary-color);
        flex-shrink: 0;
    }

    .sidebar:not(:hover) .logo {
        gap: 0;
        /* Remove gap when text is hidden */
    }

    /* Nav Icons - Force visibility */
    .sidebar:not(:hover) .nav-link svg {
        margin: 0;
        width: 24px;
        height: 24px;
        min-width: 24px;
        /* FORCE NO SHRINK */
        flex-shrink: 0;
    }

    .nav-link svg {
        margin-right: 0;
        /* Remove margin when collapsed/centered */
    }

    /* Re-apply spacing on Hover/Expansion */
    /* Re-apply spacing on Hover/Expansion */
    .sidebar:hover .logo,
    .sidebar:hover .nav-link,
    .sidebar:hover .user-profile {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
        justify-content: flex-start !important;
        /* Align left */
    }

    .sidebar:hover .nav-link svg {
        margin-right: 12px;
        width: 20px !important;
        height: 20px !important;
        margin-left: 0 !important;
    }

    /*--- SIDEBAR PINNING LOGIC ---*/

    /* When sidebar is pinned, force expanded styles regardless of hover */
    .sidebar.pinned {
        width: 260px !important;
        /* Full width */
        padding-right: 0 !important;
        /* Prevent hover padding shift */
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
    }

    /* Override collapsed hiding rules when pinned */
    .sidebar.pinned .logo-text,
    .sidebar.pinned .nav-link span,
    .sidebar.pinned .user-info {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
    }

    .sidebar.pinned .logo-text {
        display: flex !important;
    }

    /* Force left alignment and padding when pinned */
    .sidebar.pinned .logo,
    .sidebar.pinned .nav-link,
    .sidebar.pinned .user-profile {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
        justify-content: flex-start !important;
    }

    /* Restore gap/margins for icons when pinned */
    .sidebar.pinned .logo {
        gap: 10px;
    }

    .sidebar.pinned .nav-link svg {
        margin-right: 12px;
        /* Ensure size stays constant */
        width: 20px !important;
        height: 20px !important;
        margin-left: 0 !important;
        /* Prevent centering auto margins */
    }

    .sidebar.pinned .logo svg {
        /* Ensure size stays constant */
        width: 28px !important;
        height: 28px !important;
        margin: 0 !important;
        /* Reset auto margins */
    }

    /* Show/Hide Pin Button */
    /* By default (collapsed) hide it */
    .sidebar:not(:hover):not(.pinned) #sidebar-pin-btn {
        display: none !important;
    }

    /* Show on hover */
    .sidebar:hover #sidebar-pin-btn {
        display: block !important;
    }

    /* Always show if pinned */
    .sidebar.pinned #sidebar-pin-btn {
        display: block !important;
        transform: rotate(0deg);
        /* Straight pin when active */
        color: var(--primary-color) !important;
    }

    /* Adjust main content margin when pinned */
    body.sidebar-pinned .main-content {
        margin-left: 260px;
        width: calc(100% - 260px);
    }
}