:root {
    --bg: #FFFEF2;
    --card: #F7F5E6;
    /* Slightly darker than bg */
    --input-bg: #EFEDDB;
    /* Slightly darker than card */
    --table-header-bg: #EBE9D6;
    /* Even darker for contrast */
    --subtle-bg: #F0EEE2;
    --sidebar-bg: #F7F5E6;
    --accent: #FF7F50;
    --hover-bg: rgba(255, 127, 80, 0.1);
    --success: #10b981;
    --border: #E0DEC8;
    --text: #2D2D2D;
    --text-muted: #7A7A7A;
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;
    --danger: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
}

body.erp-body {
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Login Overlay */
.login-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--bg);
    z-index: 9999;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 3rem;
    background: var(--card);
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.04);
}

.login-card h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.login-card h1 span {
    color: var(--accent);
}

/* Main Layout */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    background: transparent;
}

/* 📱 Top Header Bar */
.sidebar-pill {
    width: 100%;
    height: 80px;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0 2rem;
    justify-content: space-between;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    border-bottom: 1px solid var(--border);
}

.desktop-branding {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text);
    user-select: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

.desktop-branding span {
    color: var(--accent);
}

@media screen and (max-width: 768px) {
    .desktop-branding {
        display: none;
    }
}

/* --- Desktop/Mobile Visibility --- */
.desktop-only {
    display: flex !important;
}
.mobile-only {
    display: none !important;
}

@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
    .mobile-only {
        display: flex !important;
    }
}

.top-row-mobile {
    display: none; /* Ascuns pe desktop pentru a evita duplicarea elementelor mobile */
}

/* 👤 Profile User Icon */
.profile-dropdown-container {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    height: 100%;
    order: 2;
}

.profile-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--bg);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 600;
    border: 1px solid var(--border);
    transition: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.profile-dropdown-container:hover .profile-circle {
    background: var(--hover-bg);
    border-color: var(--accent);
    color: var(--accent);
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    display: none;
    z-index: 2000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    min-width: 150px;
    animation: fadeInScale 0.2s ease forwards;
}

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

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

.profile-dropdown.show {
    display: block;
}

.dropdown-item {
    background: transparent;
    color: var(--text);
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    width: 100%;
    text-align: left;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    transition: 0.2s;
}

/* Logout is dangerous, keep it red but specialized if needed */
#logout-btn {
    color: var(--danger);
}

.dropdown-item:hover {
    background: var(--bg);
}

#logout-btn:hover {
    background: #fef2f2;
    color: var(--danger);
}

/* 🗄️ Projekts Navigation Logic - Responsive Compacting */
#projects-mobile-trigger {
    display: none;
}

.mobile-projects-wrapper {
    display: contents;
}

.mobile-projects-menu {
    display: contents;
}

/* 🏢 Desktop Compact Mode (769px - 1440px) */
@media screen and (min-width: 769px) and (max-width: 1440px) {
    #projects-mobile-trigger {
        display: flex; /* Arătăm butonul de trigger */
    }

    .mobile-projects-wrapper {
        display: block; /* Nu mai este contents pentru a permite dropdown absolut */
        position: relative;
    }

    .mobile-projects-menu {
        display: none; /* Ascundem sub-taburile inițial */
        position: absolute;
        top: calc(100% + 10px);
        left: 50%;
        transform: translateX(-50%);
        background: var(--card);
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
        flex-direction: column;
        padding: 0.5rem;
        z-index: 1000;
        min-width: 180px;
    }

    .mobile-projects-menu.show {
        display: flex;
        animation: slideInDown 0.2s ease-out;
    }

    .mobile-projects-menu .side-tab {
        width: 100%;
        justify-content: flex-start;
        padding: 0.75rem 1rem;
        flex-direction: row; /* Revenim la orizontal în dropdown */
        gap: 0.75rem;
    }

    .mobile-projects-menu .nav-icon {
        margin-bottom: 0;
    }
}

@keyframes slideInDown {
    from { opacity: 0; transform: translate(-50%, -10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* Stil standard pentru iconițele noi */
.nav-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    margin-bottom: 2px;
}



.side-nav {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    position: relative;
    isolation: isolate;
}

@media screen and (max-width: 1200px) {
    .side-nav {
        gap: 0.25rem;
    }
}



.side-tab {
    padding: 0.5rem 1.1rem;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: none;
}

@media screen and (max-width: 1200px) {
    .side-tab {
        padding: 0.5rem 0.75rem;
    }
}

.side-tab:hover {
    color: var(--text);
}

.side-tab.active {
    color: var(--accent);
    font-weight: 600;
}

.full-container {
    width: 100%;
    max-width: 95%;
    /* Lărgit pentru monitoare mari */
    margin: 0 auto;
    padding: 1rem;
}

/* 💎 Dashboard Main Area */
.dashboard-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    overflow-y: auto;
    background: transparent;
}

/* --- 🌟 TOP BAR LAYOUT (Desktop) --- */
.top-bar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    /* Esențial pentru mobil */
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    /* Împinge restul elementelor spre dreapta */
}

.top-bar-branding {
    display: none;
    /* Ascuns pe desktop */
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-main);
}

.top-bar-branding .accent-text {
    color: var(--accent);
}

.search-wrapper {
    position: relative;
    width: 300px;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    pointer-events: none;
    /* Ca să poți da click prin iconiță pe input */
}

#global-search {
    padding-left: 2.8rem;
    width: 100%;
}

.welcome-text h1 {
    font-size: 2.25rem;
    font-weight: 500;
    color: var(--text);
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.welcome-text p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 0;
}

/* 📈 Stats & Cards */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.standard-card {
    background: var(--card);
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.03);
    padding: 2rem;
    overflow: hidden;
}


.stat-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.03);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    opacity: 0.6;
}

.stat-card h3 {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card p {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.stat-card p.highlight {
    color: var(--accent);
}

/* 📊 Mid Section (Charts) */
.mid-row-single {
    margin-bottom: 2rem;
}

.chart-box {
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.03);
    padding: 1.5rem;
    height: 450px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chart-container {
    flex: 1;
    position: relative;
    width: 100%;
    min-height: 0;
}

/* --- 📊 SALES CHART STYLES --- */
.chart-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
    padding: 0.5rem;
}



.highlight {
    color: var(--accent);
}

.profit-positive {
    color: var(--success);
    font-weight: 600;
}

.profit-negative {
    color: var(--danger);
    font-weight: 600;
}

h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1.5rem;
}

input,
select,
textarea {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border);
    padding: 0 1.25rem;
    border-radius: 100px;
    height: 48px;
    color: var(--text);
    outline: none;
    font-size: 0.95rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}


/* 🗑️ Butoane Ștergere/Destructive */
.btn-remove-row,
.btn-remove-img,
.btn-delete {
    color: #ef4444 !important;
    transition: opacity 0.2s ease;
}

.btn-remove-row:hover,
.btn-remove-img:hover,
.btn-delete:hover {
    opacity: 0.7;
}

/* ❌ Enhanced Remove Row Button */
/* ❌ Minimalist Remove Row - Just a simple X */
.material-row {
    position: relative;
    padding-right: 5px;
}

.btn-remove-row {
    position: absolute;
    top: -8px; 
    right: 0;
    background: transparent;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 1.6rem;
    line-height: 1;
    transition: all 0.2s ease;
    z-index: 10;
    padding: 0;
    opacity: 0.5;
}

.btn-remove-row:hover {
    background: transparent;
    opacity: 1 !important;
    transform: scale(1.2);
}

.btn-remove-row:active {
    transform: scale(0.9);
}

[data-theme="dark"] .btn-remove-row {
    background: transparent;
    color: #f87171; /* Slightly lighter red for dark mode */
}


.text-danger {
    color: #ef4444 !important;
}

/* 📋 Stock Log Button Text */
.btn-log-fil {
    color: #facc15 !important;
    /* Yellow-400 */
    font-weight: 600 !important;
}

input[type="file"] {
    padding-top: 10px;
    /* Aliniere manuală pt textul nativ al browserului */
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    background: var(--input-bg);
    box-shadow: 0 0 0 4px rgba(255, 127, 80, 0.1);
}

textarea {
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

/* 📜 Tables */
.table-responsive {
    margin-top: 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow-x: auto !important;
    /* Permite scroll orizontal pe tablete */
    -webkit-overflow-scrolling: touch;
    position: relative;
}

table {
    width: 100%;
    border-collapse: separate;
    /* Permite rotunjirea individuală a colțurilor th */
    border-spacing: 0;
}

th {
    text-align: left;
    padding: 1.25rem 1.5rem;
    background: var(--table-header-bg);
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

/* Rotunjirea specifică pentru capul de tabel */
table thead tr:first-child th:first-child {
    border-top-left-radius: var(--radius-lg);
}

table thead tr:first-child th:last-child {
    border-top-right-radius: var(--radius-lg);
}

td {
    text-align: left;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
    color: var(--text);
}

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

.row-anulat td:not(:last-child) {
    opacity: 0.5;
    text-decoration: line-through;
    color: var(--text-muted);
}

.row-anulat td:last-child {
    text-decoration: none !important;
    opacity: 1 !important;
}



/* 📦 Sections Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-content.active.grid-center {
    display: grid !important;
    place-items: center;
    align-content: center;
    min-height: 80vh;
    padding: 2rem 0;
}

.grid-center {
    place-items: center;
    padding: 2rem 0;
}

.centered-container {
    width: 100%;
    max-width: 600px;
}

.centered-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.03);
    padding: 3rem;
}

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

.summary-box {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--subtle-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.summary-line {
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.summary-line span:first-child {
    color: var(--text-muted);
}

.summary-value-wrapper {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-left: auto;
    font-weight: 600;
}

.summary-currency {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
    min-width: 30px;
    text-align: right;
}

.summary-line.total {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border);
}

/* 폼 (Forms) */
.form-group {
    margin-bottom: 0;
}

label {
    display: block;
    font-size: 0.85rem;
    color: var(--text);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    height: 48px;
    padding: 0 2rem;
    border-radius: 100px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

/* 🖥️ Desktop Specific Table Optimizations */
@media (min-width: 769px) {

    th,
    td {
        text-align: center !important;
        vertical-align: middle !important;
    }

    /* Ellipsis for long columns to prevent horizontal scroll */
    .dashboard-main td:not(:last-child) {
        max-width: 150px;
        /* Redus de la 200px pentru a lăsa loc pe ecrane intermediare */
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Exceptions for potentially short numeric columns if needed */
    .dashboard-main td[data-label="Profit"],
    .dashboard-main td[data-label="Total"],
    .dashboard-main td[data-label="Cantitate"] {
        max-width: 100px;
    }

    .dashboard-main .table-actions {
        display: flex !important;
        justify-content: center !important;
        width: 100%;
    }
}

.table-actions {
    display: inline-flex;
    gap: 0.5rem;
    justify-content: center !important;
    align-items: center;
    vertical-align: middle;
    width: 100%;
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--input-bg);
    color: var(--text);
    border: 1px solid var(--border);
    height: 48px;
    padding: 0 2rem;
    border-radius: 100px;
    font-weight: 600;
    cursor: pointer;
}

.full-width {
    width: 100%;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.btn-text {
    background: transparent;
    color: var(--accent);
    border: none;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn-icon {
    padding: 0.5rem 1rem;
    border-radius: 100px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
}

.btn-icon:hover {
    background: var(--subtle-bg);
}

.btn-del-fil,
.btn-del-hist,
.btn-del-exp {
    color: var(--danger) !important;
}

/* 🏔️ Dashboard Areas */
.dashboard-scroll-area {
    width: 100%;
    margin-top: 0;
    padding-bottom: 4rem;
    position: relative;
}

/* 🏢 Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 3rem;
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}

.modal-footer {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: flex-end;
}

.inner-standard-box {
    background: var(--subtle-bg);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

@media (max-width: 768px) {

    /* 🔒 KILL ALL HORIZONTAL SCROLL */
    html,
    body,
    body.erp-body,
    .app-container,
    .dashboard-main {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }

    /* --- 📱 TOP BAR LAYOUT (Mobile) --- */
    .top-bar {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 1rem 1rem 0.5rem 1rem;
    }

    .top-bar-left {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: flex-start; /* Aliniere la stânga pe mobil */
        text-align: left;
        gap: 0.2rem;
        position: relative;
    }

    .welcome-text h1 {
        font-size: 1.6rem !important;
        font-weight: 500;
        opacity: 0.8;
    }

    .top-bar-branding {
        display: block;
        font-family: var(--font-main);
        font-size: 1.6rem;
        font-weight: 800;
        letter-spacing: -0.02em;
        margin: 0;
        text-transform: uppercase;
        color: var(--text);
    }

    .top-row-mobile {
        display: flex;
        width: 100%;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0.5rem;
    }

    .mobile-menu-btn#hamburger-btn {
        display: none !important;
    }

    .profile-dropdown-container.mobile-only {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        display: flex !important;
        z-index: 10001;
    }

    .profile-dropdown {
        min-width: 200px; /* Prevenim wrap-ul la Dark Mode */
        right: 0;
        left: auto;
    }

    .dropdown-item {
        white-space: nowrap !important;
        font-size: 0.95rem;
    }

    .search-wrapper {
        order: 3;
        /* Cade automat pe rândul al doilea */
        width: 100% !important;
        /* Lățime completă pe telefon */
        margin-top: 0.5rem;
    }

    .subtitle-mobile-hide {
        display: none;
        /* Ascundem subtextul ca să aliniem frumos butonul cu litera A de textul Bună */
    }

    /* PHASE 1: Bottom Navigation Bar (App Native) */
    .bento-sidebar {
        display: none !important;
        /* Hide right sidebar completely */
    }

    .app-container {
        padding-bottom: calc(70px + env(safe-area-inset-bottom));
        /* Make room for bottom nav */
    }

    .sidebar-pill {
        position: fixed;
        bottom: 0;
        top: auto;
        left: 0;
        width: 100%;
        height: calc(70px + env(safe-area-inset-bottom));
        padding: 0 0.5rem env(safe-area-inset-bottom) 0.5rem;
        flex-direction: row;
        justify-content: space-around;
        background: var(--sidebar-bg);
        border-top: 1px solid var(--border);
        border-bottom: none;
        z-index: 9999;
        /* Remove desktop scrolling shadow */
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
    }

    [data-theme="dark"] .sidebar-pill {
        background: var(--sidebar-bg);
    }

    .nav-cursor {
        display: none !important;
    }

    .side-nav {
        flex-direction: row;
        width: 100%;
        justify-content: space-between;
        overflow: visible !important;
        /* Permite popup-ului să iasă din bară */
        padding: 0 0.5rem;
    }

    .side-nav::-webkit-scrollbar {
        display: none;
    }

    .side-tab {
        flex: 1;
        /* Împart spațiul la 5 egal */
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 0.5rem 0;
        font-size: 0.65rem;
        border-radius: var(--radius-sm);
        white-space: normal;
        text-align: center;
        line-height: 1.1;
        gap: 0;
        transition: none !important;
        transform: none !important;
    }

    .side-tab:hover,
    .side-tab:active {
        transform: none !important;
    }

    /* Afișăm iconițele pe mobil */
    .nav-icon {
        display: block;
    }

    .nav-text {
        line-height: 1.1;
    }

    .side-tab.active {
        background: transparent;
        color: var(--accent);
        font-weight: 700;
    }

    /* --- 🛠️ Popup Meniu Proiecte --- */
    #projects-mobile-trigger {
        display: flex;
    }

    .mobile-projects-wrapper {
        position: relative;
        flex: 1;
        display: flex;
        justify-content: center;
    }

    .mobile-projects-menu {
        position: absolute;
        bottom: calc(100% + 15px);
        /* Apare deasupra barei */
        left: 50%;
        transform: translateX(-50%) translateY(20px);
        background: var(--card);
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.15);
        display: flex;
        flex-direction: column;
        padding: 0.5rem;
        opacity: 0;
        pointer-events: none;
        transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        z-index: 10000;
        min-width: 160px;
    }

    /* Când meniul e deschis */
    .mobile-projects-menu.show {
        opacity: 1;
        pointer-events: auto;
        transform: translateX(-50%) translateY(0);
    }

    /* Stilul butoanelor din interiorul popup-ului */
    .side-tab.sub-tab {
        flex-direction: row;
        justify-content: flex-start;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        width: 100%;
        color: var(--text);
    }

    /* Small dot for active tab - ONLY for main navbar items */
    .side-tab.active:not(.sub-tab)::after {
        content: '';
        display: block;
        width: 4px;
        height: 4px;
        background: var(--accent);
        border-radius: 50%;
        margin-top: 2px;
    }

    /* Move profile icon up into the dashboard - revealed for v.37 */
    .profile-dropdown-container {
        display: flex; /* Ensure it is visible */
    }

    /* Rest of the Dashboard Area spacing */
    .dashboard-main {
        padding: 1rem;
    }

    /* PHASE 2: Dashboard & Stats (Vertical Stack) */
    .stats-row {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        width: 100%;
        margin-bottom: 1.5rem;
        overflow: hidden;
    }

    .stat-card {
        width: 100%;
        padding: 1.5rem;
    }

    .dashboard-bento,
    .dashboard-split-row {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .chart-box,
    .standard-card {
        padding: 1.25rem;
        width: 100%;
    }

    .ongoing-list-container {
        grid-template-columns: 1fr;
    }

    /* PHASE 3: Kanban Board (Vertical Stack) */
    .kanban-board {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        width: 100%;
        overflow: hidden;
        min-height: auto;
    }

    .kanban-column {
        flex: none;
        width: 100%;
        min-width: 0;
    }

    .kanban-card {
        cursor: default;
        /* Disable drag pointer on mobile */
    }

    /* PHASE 4: Tables (Card Style) */
    .table-responsive {
        border: none;
        background: transparent;
        padding: 0;
        border-radius: 0;
        box-shadow: none;
        overflow: visible;
    }

    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
        width: 100%;
    }

    thead {
        display: none;
        /* Hide standard headers */
    }

    tr {
        background: var(--card);
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        margin-bottom: 1rem;
        padding: 1.25rem;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    td {
        display: flex;
        flex-direction: column;
        border: none !important;
        padding: 0 !important;
        text-align: left !important;
        font-size: 0.95rem;
    }

    /* Add labels using data-label attribute */
    td::before {
        content: attr(data-label);
        font-size: 0.7rem;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.05em;
        font-weight: 600;
        margin-bottom: 0.25rem;
        display: block;
    }

    td.col-main {
        font-size: 1.1rem;
        font-weight: 600;
        margin-bottom: 0.5rem;
    }

    td.col-main::before {
        display: none;
        /* Don't label the main title column */
    }

    .table-actions {
        flex-direction: column;
        margin-top: 0.5rem;
        gap: 0.5rem;
    }

    .btn-icon,
    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    /* PHASE 5: Modals (Native Bottom Sheet) */
    .modal {
        align-items: flex-end;
        /* Align to bottom */
        padding: 0;
    }

    .modal-content {
        position: relative;
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: 90vh;
        /* Don't cover entire screen */
        border-radius: 24px 24px 0 0;
        /* Only top corners rounded */
        margin: 0;
        padding: 2rem 1.5rem calc(1.5rem + env(safe-area-inset-bottom));
        background: var(--card);
        /* Pop animation override for sliding up */
        animation: bottomSheetUp 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards !important;
    }

    /* Visual Drag Handle for Bottom Sheet */
    .modal-content::before {
        content: '';
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: var(--border);
        border-radius: 4px;
    }

    @keyframes bottomSheetUp {
        from {
            transform: translateY(100%);
            opacity: 1;
        }

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

    /* General Refinements */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

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

    .centered-card {
        padding: 1.5rem;
    }
}

/* ⚠️ Alert Box */
.alert-box {
    padding: 1rem 1.5rem;
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    font-size: 0.9rem;
    font-weight: 500;
}

.alert-item {
    margin: 0.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 🔍 Custom Dropdown (Autocomplete) */
.dropdown-wrapper {
    position: relative;
}

.dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-height: 150px;
    overflow-y: auto;
    margin-top: 5px;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text);
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: var(--bg);
    color: var(--primary);
}

.material-row .form-group {
    margin-bottom: 0;
}

/* 🖱️ Clickable History Rows */
#sales-list tr {
    cursor: pointer;
    transition: background 0.2s;
}



/* ⚠️ Real-time Stock Warnings */
.stock-warning-box {
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    display: none;
    margin-top: 1rem;
}

.warning-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.warning-low {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border: 1px solid #f59e0b;
}

/* 🖼️ Project Detail Image */
.detail-image {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    background: var(--input-bg);
}

/* 🖼️ Project Detail Gallery */
.detail-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.gallery-image {
    width: 100%;
    height: 400px;
    /* Înălțime fixă pentru carusel */
    object-fit: contain;
    /* Previne tăierea sau distorsionarea */
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: transform 0.2s;
    background: #000;
    /* Fundal negru pentru carusel tip cinema */
    border: 1px solid var(--border);
}

.carousel-container {
    position: relative;
    width: 100%;
    margin-bottom: 2rem;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    padding: 1rem 0.5rem;
    cursor: pointer;
    font-size: 1.5rem;
    border-radius: var(--radius-sm);
    z-index: 10;
}

.carousel-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.carousel-prev {
    left: 10px;
}

.carousel-next {
    right: 10px;
}

.gallery-image:hover {
    transform: scale(1.05);
}

/* 🏷️ Status Styles (Shared for Buttons & Selects) */
.btn-icon.btn-status-trigger,
.status-select {
    min-width: 100px;
    letter-spacing: 0.2px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-transform: none;
    /* Eliminat uppercase */
}

/* Culori Status Optimizate - Paletă Profesională */
.status-ofertare {
    background-color: rgba(59, 130, 246, 0.1) !important;
    /* Blue */
    color: #3b82f6 !important;
    border: 1px solid rgba(59, 130, 246, 0.2) !important;
}

.status-acceptata {
    background-color: rgba(14, 165, 233, 0.1) !important;
    /* Sky */
    color: #0ea5e9 !important;
    border: 1px solid rgba(14, 165, 233, 0.2) !important;
}

.status-printing {
    background-color: rgba(255, 127, 80, 0.1) !important;
    /* Theme Orange */
    color: #FF7F50 !important;
    border: 1px solid rgba(255, 127, 80, 0.2) !important;
}

.status-gata {
    background-color: rgba(16, 185, 129, 0.1) !important;
    /* Green */
    color: #10b981 !important;
    border: 1px solid rgba(16, 185, 129, 0.2) !important;
}

.status-livrata {
    background-color: rgba(99, 102, 241, 0.1) !important;
    /* Indigo */
    color: #6366f1 !important;
    border: 1px solid rgba(99, 102, 241, 0.2) !important;
}

.status-anulata {
    background-color: rgba(107, 114, 128, 0.1) !important;
    /* Gray */
    color: #6b7280 !important;
    border: 1px solid rgba(107, 114, 128, 0.2) !important;
}

/* Adaptare Status pentru Dark Mode */
[data-theme="dark"] .status-ofertare,
[data-theme="dark"] .status-acceptata,
[data-theme="dark"] .status-printing,
[data-theme="dark"] .status-gata,
[data-theme="dark"] .status-livrata,
[data-theme="dark"] .status-anulata {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    font-size: 0.9rem;
}

.detail-item {
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.02);
    border-radius: var(--radius-sm);
}

.detail-label {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.25rem;
}

/* 🍞 Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 11000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--card);
    color: var(--text);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--accent);
    font-weight: 500;
    animation: slideInRight 0.3s ease forwards;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 250px;
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.success {
    border-left-color: var(--success);
}

.toast.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

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

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(10px);
    }
}

/* 🛑 Custom Confirm Modal */
#custom-confirm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 12000;
    justify-content: center;
    align-items: center;
}

#custom-confirm-overlay.active {
    display: flex;
}

.confirm-box {
    background: var(--card);
    padding: 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.confirm-box h3 {
    margin-bottom: 1.5rem;
    color: var(--text);
}

.confirm-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* 🌙 Dark Mode Theme */
[data-theme="dark"] {
    --bg: #1C1C1E;
    --card: #2C2C2E;
    --input-bg: #161618;
    --table-header-bg: #252527;
    --subtle-bg: #1C1C1E;
    --sidebar-bg: #2C2C2E;
    --accent: #FF7F50;
    --hover-bg: rgba(255, 127, 80, 0.15);
    --border: #3A3A3C;
    --text: #E5E5E7;
    --text-muted: #9CA3AF;
}

/* Ajustări specifice pentru Dark Mode */
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: var(--input-bg);
    color: var(--text);
    border-color: var(--border);
}

[data-theme="dark"] th {
    background: var(--table-header-bg);
    color: #e5e7eb;
}



[data-theme="dark"] .inner-standard-box,
[data-theme="dark"] .summary-box {
    background: var(--subtle-bg);
}

/* 🦴 Loading Skeletons */
.skeleton {
    background: linear-gradient(90deg, var(--bg) 25%, var(--border) 50%, var(--bg) 75%);
    background-size: 200% 100%;
    animation: skeletonLoading 1.5s infinite linear;
    border-radius: var(--radius-sm);
}

@keyframes skeletonLoading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
    width: 100%;
}

.skeleton-title {
    height: 1.5rem;
    margin-bottom: 1.5rem;
    width: 50%;
    margin-left: auto;
    margin-right: auto;
}

.skeleton-image {
    height: 200px;
    width: 100%;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-md);
}

/* ⚡ Butoane Acțiuni Rapide (Soft Style) */
.btn-quick-action {
    background: rgba(255, 127, 80, 0.08);
    color: var(--accent);
    border: 1px solid rgba(255, 127, 80, 0.15);
    height: 48px;
    width: 100%;
    margin-bottom: 0.75rem;
    border-radius: 100px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.btn-quick-action svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.5;
}

.btn-quick-action:hover {
    background: rgba(255, 127, 80, 0.12);
    transform: translateY(-1px);
}

/* Adaptare pentru Dark Mode */
[data-theme="dark"] .btn-quick-action {
    background: rgba(255, 127, 80, 0.1);
    color: var(--accent);
    border-color: rgba(255, 127, 80, 0.2);
}

[data-theme="dark"] .btn-quick-action:hover {
    background: rgba(255, 127, 80, 0.15);
}

/* 🍱 Bento Dashboard Layout */
.dashboard-bento {
    display: grid;
    grid-template-columns: 2.2fr 1fr;
    gap: 2rem;
    align-items: start;
}

.bento-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.quick-actions-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

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

/* 🔄 Update Proiecte in Lucru (Dashboard) - Grid Layout */
.ongoing-list-container {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    flex: 1;
    /* Ocupă spațiul rămas */
    overflow-y: auto;
    /* Activează scroll-ul intern doar dacă e nevoie */
    align-content: start;
    padding-right: 0.5rem;
    /* Lasă spațiu pentru scrollbar */
    max-height: 100%;
}

.ongoing-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1rem;
    /* Mai compacte */
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    animation: slideUpFade 0.4s ease forwards;
    opacity: 0;
    cursor: pointer;
}

@media (max-width: 768px) {
    .ongoing-list-container {
        grid-template-columns: 1fr;
        /* Revine la 1 coloană pe telefon */
    }
}

/* 🎨 Custom Scrollbar for Horizontal Lists (Desktop) */
.ongoing-list-container::-webkit-scrollbar {
    height: 8px;
    /* Slightly thicker for visibility */
}

.ongoing-list-container::-webkit-scrollbar-track {
    background: var(--input-bg);
    border-radius: 10px;
    margin: 0 0.5rem;
}

.ongoing-list-container::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
    border: 2px solid var(--input-bg);
    /* Padding effect */
}

.ongoing-list-container::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

.ongoing-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.06);
    border-color: var(--accent);
}

[data-theme="dark"] .ongoing-item {
    background: var(--input-bg);
}

.ongoing-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 65%;
}

.ongoing-badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
    border-radius: 100px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Animație în cascadă (apar pe rând) */
.ongoing-item:nth-child(1) {
    animation-delay: 0.05s;
}

.ongoing-item:nth-child(2) {
    animation-delay: 0.1s;
}

.ongoing-item:nth-child(3) {
    animation-delay: 0.15s;
}

.ongoing-item:nth-child(4) {
    animation-delay: 0.2s;
}

.ongoing-item:nth-child(5) {
    animation-delay: 0.25s;
}

.ongoing-item:nth-child(n+6) {
    animation-delay: 0.3s;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

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

/* 📐 Split Row pentru Grafic și Lista de Proiecte */
.dashboard-split-row {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2rem;
    align-items: stretch;
    /* Aceasta forțează ambele carduri la înălțime egală */
}

/* Forțăm cardurile să flexeze pe toată înălțimea disponibilă */
.dashboard-split-row>.standard-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 380px;
}

/* Pe ecrane medii/mici, le punem la loc una sub alta */
@media (max-width: 1200px) {
    .dashboard-split-row {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   🌟 ANIMAȚII GLOBALE (FLUID TRANSITIONS) 
   ========================================= */

/* 1. Definim mișcarea: Glisare fină de jos în sus + Opacitate */
@keyframes smoothEnter {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 2. Animăm tot containerul paginii când dai click pe meniu */
.tab-content.active {
    animation: smoothEnter 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* 3. Pregătim cardurile interioare să plece invizibile */
.tab-content.active .stat-card,
.tab-content.active .standard-card,
.tab-content.active .centered-card {
    animation: smoothEnter 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* 4. Efectul "Stagger" (Apariție în cascadă pentru rândul de statistici) */
.tab-content.active .stats-row>.stat-card:nth-child(1) {
    animation-delay: 0.05s;
}

.tab-content.active .stats-row>.stat-card:nth-child(2) {
    animation-delay: 0.15s;
}

.tab-content.active .stats-row>.stat-card:nth-child(3) {
    animation-delay: 0.25s;
}

/* 5. Efectul "Stagger" pentru restul cardurilor de pe pagină */
.tab-content.active .dashboard-split-row>div:nth-child(1) {
    animation-delay: 0.2s;
}

.tab-content.active .dashboard-split-row>div:nth-child(2) {
    animation-delay: 0.3s;
}

/* Pentru paginile simple care au carduri stivuite unele sub altele */
.tab-content.active>.full-container>.standard-card:nth-child(1) {
    animation-delay: 0.1s;
}

.tab-content.active>.full-container>.standard-card:nth-child(2) {
    animation-delay: 0.2s;
}

.tab-content.active>.full-container>.standard-card:nth-child(3) {
    animation-delay: 0.3s;
}

/* 📐 PERFECT GRID ALIGNMENT (Uniformizare distanțe) */
.dashboard-bento,
.bento-main,
.bento-sidebar,
.dashboard-split-row,
.stats-row {
    gap: 1.5rem !important;
    /* Forțăm toate golurile să fie identice */
}

/* Eliminăm bara de scroll și lăsăm cardul curat */
.ongoing-list-container {
    overflow-y: hidden !important;
    padding-right: 0 !important;
}

/* 📐 RESET ROGUE MARGINS (Pentru modularitate și simetrie perfectă) */
.stats-row,
.dashboard-split-row,
.standard-card {
    margin-bottom: 0 !important;
    /* Elimină gap-ul dublu generat de margin-bottom */
}

.bento-main,
.bento-sidebar,
.dashboard-bento {
    gap: 1.5rem !important;
    /* Singura sursă de spațiere între carduri */
}

/* 🎯 CENTRARE PERFECTĂ GRAFIC */
.chart-container {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100%;
    margin: 0 auto;
}

canvas#statusChart {
    margin: 0 auto !important;
    /* Forțează canvas-ul pe centru */
    max-height: 280px !important;
    /* Îi dă o înălțime maximă ca să nu lungească aiurea cardul */
}

/* =========================================
   ✨ MICRO-INTERACȚIUNI & MODALE
   ========================================= */

/* 1. Efect Tactil (Apasare) pentru TOATE butoanele */
.btn-primary:active,
.btn-secondary:active,
.btn-icon:active,
.btn-quick-action:active,
.btn-text:active {
    transform: scale(0.95) !important;
    transition: transform 0.1s ease !important;
}

/* 2. Animație pentru Fundalul Modalelor (Fade-in) */
@keyframes modalBgFadeIn {
    from {
        background: rgba(0, 0, 0, 0);
    }

    to {
        background: rgba(0, 0, 0, 0.6);
    }
}

/* 3. Animație pentru Căsuța Modalului (Pop-up dinamic) */
@keyframes modalContentPop {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }

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

/* Aplicăm animațiile pe clasa .modal.active pe care o folosim deja */
.modal.active {
    animation: modalBgFadeIn 0.3s ease forwards;
}

.modal.active .modal-content {
    /* Folosim un cubic-bezier pentru un efect fin de "bouncing" la final */
    animation: modalContentPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* 🖼️ Miniaturi Poze în Editare Proiect */
#ep-existing-images {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.edit-img-wrap {
    position: relative;
    display: inline-block;
}

.edit-img-thumb {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.btn-remove-img {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.btn-remove-img:hover {
    transform: scale(1.1);
}

/* 🌙 FIX: Butoane pe Dark Mode */
.btn-secondary {
    background: var(--input-bg);
    color: var(--text);
    border: 1px solid var(--border);
}

[data-theme="dark"] .btn-secondary,
[data-theme="dark"] .btn-quick-action,
[data-theme="dark"] .pagination-btn {
    background: var(--card) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

/* Efectul de hover pe Dark Mode pentru aceste butoane */
[data-theme="dark"] .btn-secondary:hover,
[data-theme="dark"] .btn-quick-action:hover,
[data-theme="dark"] .pagination-btn:hover:not(:disabled) {
    background: #2c2c2c !important;
    /* Un gri ușor mai deschis pentru hover */
}

/* Fix pentru butoanele mici cu iconițe (ex: Edit/Delete) */
[data-theme="dark"] .btn-icon {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .btn-icon:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--text) !important;
}

/* 🛑 FIX: Browser Autofill & Datalist Background Override */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--card) inset !important;
    -webkit-text-fill-color: var(--text) !important;
    transition: background-color 5000s ease-in-out 0s !important;
    border-radius: var(--radius-sm);
    /* Păstrează colțurile rotunjite */
}

/* Extra fix: Dacă browserul aplică stiluri specifice pe listă în Dark Mode */
[data-theme="dark"] input:-webkit-autofill,
[data-theme="dark"] input:-webkit-autofill:hover,
[data-theme="dark"] input:-webkit-autofill:focus,
[data-theme="dark"] input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--card) inset !important;
    -webkit-text-fill-color: var(--text) !important;
}

/* 🛑 FIX: WebKit Autofill Background Override (Light & Global) */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    /* Forțăm fundalul să fie la fel ca restul cardurilor/inputurilor tale */
    -webkit-box-shadow: 0 0 0 50px var(--card) inset !important;
    /* Forțăm culoarea textului să respecte tema ta */
    -webkit-text-fill-color: var(--text) !important;
    /* Eliminăm orice margine ciudată pusă de browser */
    border: 1px solid var(--border) !important;
    /* Prevenim flash-ul de culoare albă */
    transition: background-color 5000s ease-in-out 0s !important;
}

/* 📋 KANBAN BOARD STYLES */
.kanban-board {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    align-items: flex-start;
    min-height: 60vh;
}

.kanban-column {
    flex: 1;
    min-width: 280px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    transition: background 0.2s;
}

.kanban-column.drag-over {
    background: rgba(37, 99, 235, 0.05);
    border: 1px dashed var(--primary);
}

[data-theme="dark"] .kanban-column.drag-over {
    background: rgba(255, 255, 255, 0.05);
}

.kanban-header {
    font-size: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
    text-align: center;
}

.kanban-cards {
    flex: 1;
    min-height: 150px;
    /* Ca să poți da drop chiar dacă coloana e goală */
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.kanban-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    cursor: grab;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.kanban-card:active {
    cursor: grabbing;
}

.kanban-card-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.kanban-card-detail {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

/* 📱 Buton Mobile Mutare Kanban */
.kanban-card {
    position: relative;
    /* Necesar pentru poziționarea butonului */
}

.kanban-move-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
    z-index: 2;
    /* Ca să nu se declanșeze dublu-click-ul de editare de dedesubt */
}

.kanban-move-btn:active {
    transform: scale(0.9);
    background: var(--border);
}

/* 📱 Responsive Additions */
@media screen and (min-width: 1024px) {
    #hamburger-btn {
        display: none !important;
    }

    .top-bar-left {
        gap: 0.5rem;
    }

    /* 🏢 Desktop Grid Layout for centering tabs */
    .sidebar-pill {
        display: grid !important;
        grid-template-columns: 180px minmax(0, 1fr) 180px; /* Use minmax to prevent overflow */
        align-items: center;
        gap: 1rem;
    }

    .desktop-branding {
        grid-column: 1;
        display: flex !important; /* Always show branding on desktop */
    }

    .sidebar-pill .side-nav {
        grid-column: 2;
        justify-self: center;
        min-width: 0; /* Allow shrinking */
    }

    .profile-dropdown-container {
        grid-column: 3;
        justify-self: end;
        display: flex !important; /* Always show profile on desktop */
    }

    .welcome-text h1 {
        font-weight: 500;
    }
}

@media screen and (max-width: 1023px) {
    .nav-header {
        display: none !important;
    }
}
/* 📊 Dashboard Integrated Filters */
.card-header-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 0.25rem;
}

.btn-card-toggle {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
}

.btn-card-toggle:hover {
    background: rgba(255, 122, 0, 0.1);
    color: var(--accent);
    border-color: var(--accent);
}

.stat-card.expanded .btn-card-toggle {
    transform: rotate(90deg);
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.card-filter-shelf {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-wrap: nowrap;
    gap: 0.4rem;
    width: 100%;
}

.stat-card.expanded .card-filter-shelf {
    max-height: 150px;
    opacity: 1;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.card-filter-shelf select {
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
    flex: 1;
    min-width: 0;
}

.card-filter-shelf select:hover {
    border-color: var(--accent);
}

.card-filter-shelf .filter-group {
    display: flex;
    gap: 0.4rem;
    flex: 2;
}

@media (max-width: 768px) {
    .card-filter-shelf {
        flex-wrap: nowrap;
    }
}

/* ═══════════════════════════════════════════════════════════════
   🖨️ PRINTURI AUTO-DETECTATE (Recent Prints from Bambu)
   ═══════════════════════════════════════════════════════════════ */

.recent-prints-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.print-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    border-left: 4px solid var(--success);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.print-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

.print-card.failed {
    border-left-color: var(--danger);
}

.print-card-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    word-break: break-word;
}

.print-card-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.print-card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.print-card-status {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 100px;
}

.print-card-status.success {
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
}

.print-card-status.fail {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
}

.print-card-timestamp {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.7;
}

.print-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.btn-print-action {
    flex: 1;
    min-width: 0;
    padding: 0.5rem 0.75rem;
    border-radius: 12px;
    border: none;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: opacity 0.2s ease, transform 0.1s ease;
}

.btn-print-action:hover {
    opacity: 0.85;
}

.btn-print-action:active {
    transform: scale(0.97);
}

.btn-print-project {
    background: var(--accent);
    color: white;
}

.btn-print-personal {
    background: var(--input-bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-print-dismiss {
    background: transparent;
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
    flex: 0;
    min-width: auto;
    padding: 0.5rem;
}

.btn-print-dismiss:hover {
    background: rgba(239, 68, 68, 0.08);
}

@media (max-width: 768px) {
    .recent-prints-grid {
        grid-template-columns: 1fr;
    }
    
    .print-card-actions {
        flex-wrap: nowrap;
    }
}
