/* Hide sidebar and menu icon when on Branches page */
body.branches-page-active .grid-container {
    grid-template-columns: 1fr;
    grid-template-areas:
        "header"
        "main";
}
body.branches-page-active #sidebar {
    display: none !important;
}
body.branches-page-active .menu-icon {
    display: none !important;
}

.branches-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.branches-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.branches-logo {
    display: block;
    margin-right: 20px;
    height: auto;
}

.branches-header-titles {
    text-align: right;
}

.branches-header h5 {
    margin: 0;
}

.branches-company-line {
    font-size: 0.95rem;
    font-weight: 600;
    color: #374151;
    margin-top: 6px;
}

.branches-welcome {
    font-size: 0.95rem;
    color: #374151;
    line-height: 1.55;
    margin: 0 0 18px;
    padding: 14px 16px;
    background: #f8fafc;
    border-radius: 10px;
    border-left: 4px solid #4169E1;
}

.branches-welcome a {
    color: #3151B8;
    font-weight: 500;
}

.branches-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 280px;
    flex-direction: column;
    gap: 15px;
}

.branches-loading-text {
    color: #666;
    font-size: 16px;
    margin: 0;
}

.branches-container {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-start;
}

/* Creative add card: first card is "Add new branch" */
.branch-card {
    border-radius: 12px;
    padding: 18px 20px;
    min-width: 260px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.branch-card-add {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8eeff 100%);
    border: 2px dashed #4169E1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}

.branch-card-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(65, 105, 225, 0.2);
    border-color: #3151B8;
}

.branch-add-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #4169E1;
}

.branch-add-icon {
    font-size: 28px;
    opacity: 0.9;
}

.branch-add-label {
    font-weight: 500;
    font-size: 15px;
}

.branch-add-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.branch-name-input {
    border-radius: 8px;
    padding: 10px 14px;
}

.branch-add-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* Branch item cards */
.branch-card-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.branch-card-item:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.branch-item-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    cursor: pointer;
}

.branch-item-content:hover .branch-item-name {
    color: #0d6efd;
}

.branch-item-name {
    flex: 1;
    min-width: 120px;
    font-weight: 500;
    font-size: 15px;
}

.branch-item-date {
    color: #6c757d;
    font-size: 13px;
}

.branch-item-actions {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

.branch-btn-edit,
.branch-btn-delete {
    padding: 4px 10px;
}

.branch-item-edit {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.branch-edit-input {
    border-radius: 8px;
    padding: 8px 12px;
}

.branch-edit-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

#branchList {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
