.add-items-dashboard {
    padding: 2rem 0;
    background-color: #f4f6f9;
    width: 100%;
    overflow: hidden; /* Prevent any overflow issues */
}

.dashboard-return-link {
    display: inline-block;
    margin: 15px;
    padding: 10px 15px;
    background-color: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.dashboard-return-link:hover {
    background-color: #2980b9;
    color: white;
}

.dashboard-return-link i {
    margin-right: 8px;
}

.add-items-dashboard .row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;          /* Space between cards */
    padding: 15px;
    width: 100%;
    overflow-x: visible; /* Ensure no horizontal scrolling */
    margin: 0 !important;          /* Override Bootstrap negative margins */
    white-space: normal !important; /* Prevent nowrap behavior */
    max-width: 100%; /* Ensure the row doesn't exceed its container */
}

.container-fluid.add-items-dashboard {
    padding-left: 15px;
    padding-right: 15px;
    max-width: 100%;
    overflow-x: hidden;
}

.branch-card {
    margin-bottom: 15px;
    display: block; /* Ensure proper display */
    box-sizing: border-box; /* Include padding and border in the element's width */
    width: 100%; /* Take full width of grid cell */
    min-width: 0; /* Prevent overflow issues */
}

/* Force specific branches to start on a new line */
.branch-card.new-line {
    break-before: always; /* Modern browsers */
    page-break-before: always; /* Older browsers */
    -webkit-column-break-before: always; /* Safari/Chrome */
    clear: left; /* Fallback */
}

.add-items-dashboard .card-hover {
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: white;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.add-items-dashboard .card {
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: white;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.add-items-dashboard .card-hover:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.add-items-dashboard .card-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    padding: 1.5rem;
    flex-grow: 1;
}

.add-items-dashboard .card-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    font-weight: bold;
    color: #2c3e50;
}

.add-items-dashboard .card-text {
    color: #7f8c8d;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.add-items-dashboard .branch-btn {
    margin-top: auto;
    width: 100%;
    background-color: #2ecc71;
    border-color: #2ecc71;
    color: white;
    transition: background-color 0.3s ease;
}

.add-items-dashboard .branch-btn:hover {
    background-color: #27ae60;
    border-color: #27ae60;
}

/* Scrollbar styling for horizontal scroll */
.add-items-dashboard .row::-webkit-scrollbar {
    height: 8px;
}

.add-items-dashboard .row::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.add-items-dashboard .row::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .add-items-dashboard .row {
        padding: 0 15px;  /* Add some side padding on mobile */
    }
}