/* 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-package-limit {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1d4ed8;
    margin-top: 6px;
}

.branches-package-limit.is-at-limit {
    color: #b45309;
}

.branches-company-line {
    font-size: 0.95rem;
    font-weight: 600;
    color: #374151;
    margin-top: 6px;
}

.branch-card-add.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.branch-card-add.is-disabled .branch-add-label {
    color: #6b7280;
}

.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;
}

/* -----------------------------------------------------------------
   Terms & Conditions modal (shown on first vendor/admin login).
----------------------------------------------------------------- */
.terms-modal .terms-modal-content {
    border: none;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
}

.terms-modal .terms-modal-header {
    background: linear-gradient(135deg, #4169E1 0%, #3151B8 100%);
    color: #fff;
    border-bottom: none;
    padding: 18px 24px;
}

.terms-modal .terms-modal-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin: 0;
}

.terms-modal .terms-modal-body {
    padding: 22px 24px 18px;
}

.terms-modal .terms-modal-intro {
    color: #374151;
    font-size: 0.95rem;
    line-height: 1.55;
    margin: 0 0 18px;
}

.terms-modal .terms-modal-check {
    margin-top: 8px;
    padding: 12px 14px;
    background: #f0f4ff;
    border: 1px solid #d6dffb;
    border-radius: 10px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.terms-modal .terms-modal-check .form-check-input {
    margin-top: 2px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.terms-modal .terms-modal-check .form-check-label {
    cursor: pointer;
    color: #1f2937;
    font-weight: 500;
    margin: 0;
    line-height: 1.45;
}

.terms-modal .terms-modal-link {
    color: #3151B8;
    font-weight: 600;
    text-decoration: underline;
}

.terms-modal .terms-modal-link:hover,
.terms-modal .terms-modal-link:focus {
    color: #1e3a8a;
}

.terms-modal .terms-modal-footer {
    border-top: 1px solid #e5e7eb;
    padding: 14px 24px;
    gap: 8px;
}

.terms-modal #termsAcceptBtn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
