.companies-page {
    padding: 70px 0;
    background: #f6f8fb;
    direction: rtl;
    min-height: 700px;
}

.companies-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    padding: 34px;
    margin-bottom: 25px;
    border-radius: 22px;
    color: #ffffff;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.97), rgba(30, 64, 175, 0.88));
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.14);
}

.companies-eyebrow {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    opacity: 0.78;
}

.companies-title {
    margin: 0 0 10px;
    color: #ffffff;
    font-size: 31px;
    font-weight: 800;
}

.companies-description {
    max-width: 650px;
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 14px;
    line-height: 2;
}

.companies-total {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 135px;
    min-height: 110px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(10px);
}

.companies-total-number {
    font-size: 29px;
    font-weight: 900;
}

.companies-total-label {
    margin-top: 4px;
    font-size: 12px;
    opacity: 0.8;
}

.companies-filter-card {
    padding: 24px 24px 8px;
    margin-bottom: 22px;
    border: 1px solid #e7ebf1;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.companies-filter-label {
    display: block;
    margin-bottom: 8px;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}

.companies-filter-card .form-control {
    height: 46px;
    border: 1px solid #dce2ea;
    border-radius: 11px;
    font-size: 13px;
    background: #ffffff;
}

.companies-filter-card .form-control:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

.companies-search-wrapper {
    position: relative;
}

.companies-search-wrapper > i {
    position: absolute;
    top: 50%;
    right: 16px;
    z-index: 2;
    color: #94a3b8;
    transform: translateY(-50%);
}

.companies-search-wrapper .form-control {
    padding-right: 44px;
}

.companies-filter-actions {
    gap: 8px;
}

.companies-search-btn,
.companies-reset-btn {
    min-height: 46px;
    padding: 0 20px;
    border-radius: 11px;
    font-size: 13px;
    font-weight: 700;
}

.companies-search-btn {
    flex: 1;
    border-color: #1e3a8a;
    color: #ffffff;
    background: #1e3a8a;
}

.companies-search-btn:hover {
    color: #ffffff;
    background: #172e70;
}

.companies-reset-btn {
    border: 1px solid #dce2ea;
    color: #64748b;
    background: #ffffff;
}

.companies-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.companies-result-count {
    color: #64748b;
    font-size: 13px;
}

.companies-result-count strong {
    color: #0f172a;
}

.companies-view-switcher {
    display: flex;
    gap: 7px;
    padding: 5px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
}

.companies-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 15px;
    border-radius: 8px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.companies-view-btn:hover {
    color: #1e3a8a;
}

.companies-view-btn.active {
    color: #ffffff;
    background: #1e3a8a;
}

/* Table */

.companies-table-card {
    overflow: hidden;
    border: 1px solid #e5eaf0;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.companies-table {
    vertical-align: middle;
    font-size: 13px;
    text-align: center;
}

.companies-table thead th {
    padding: 17px 14px;
    border: 0;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    background: #f8fafc;
}

.companies-table tbody td {
    padding: 15px 14px;
    border-color: #eef2f6;
    color: #475569;
}

.companies-table tbody tr:hover {
    background: #fafcff;
}

.companies-table-index {
    color: #94a3b8 !important;
    font-weight: 700;
}

.companies-table-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.companies-table-logo img,
.companies-logo-placeholder {
    width: 54px;
    height: 54px;
    border: 1px solid #e5eaf0;
    border-radius: 12px;
    object-fit: contain;
    background: #ffffff;
}

.companies-logo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 22px;
    background: #f8fafc;
}

.companies-table-name {
    padding: 0;
    border: 0;
    color: #0f172a;
    font-size: 13px;
    font-weight: 800;
    text-align: right;
    background: transparent;
}

.companies-table-name:hover {
    color: #1e40af;
}

.companies-table-subtitle {
    margin-top: 5px;
    color: #94a3b8;
    font-size: 11px;
}

.companies-type-badge {
    display: inline-flex;
    padding: 5px 10px;
    border-radius: 999px;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    background: #f1f5f9;
}

.companies-status {
    display: inline-flex;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.companies-status.active {
    color: #047857;
    background: #d1fae5;
}

.companies-status.suspended {
    color: #b45309;
    background: #fef3c7;
}

.companies-status.cancelled {
    color: #b91c1c;
    background: #fee2e2;
}

.companies-status.unknown {
    color: #64748b;
    background: #e2e8f0;
}

.companies-details-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 11px;
    border: 0;
    border-radius: 8px;
    color: #1e40af;
    font-size: 11px;
    font-weight: 700;
    background: #eff6ff;
}

.companies-details-btn:hover {
    color: #ffffff;
    background: #1e40af;
}

/* Grid */

.companies-grid {
    align-items: stretch;
}

.company-logo-card {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 360px;
    padding: 0;
    overflow: hidden;
    flex-direction: column;
    border: 1px solid #e5eaf0;
    border-radius: 18px;
    text-align: right;
    background: #ffffff;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.05);
    transition: 0.25s ease;
}

.company-logo-card:hover {
    border-color: #bfdbfe;
    box-shadow: 0 20px 40px rgba(30, 64, 175, 0.12);
    transform: translateY(-5px);
}

.company-logo-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 16px 0;
}

.company-card-arrow {
    display: flex;
    width: 31px;
    height: 31px;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    color: #64748b;
    background: #f1f5f9;
}

.company-logo-box {
    display: flex;
    min-height: 145px;
    padding: 22px;
    align-items: center;
    justify-content: center;
}

.company-logo-image {
    width: 100%;
    max-width: 155px;
    height: 105px;
    object-fit: contain;
}

.company-logo-empty {
    display: flex;
    width: 120px;
    height: 105px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    color: #94a3b8;
    font-size: 11px;
    background: #f8fafc;
}

.company-logo-empty i {
    font-size: 31px;
}

.company-logo-content {
    padding: 0 20px 18px;
    flex: 1;
}

.company-logo-title {
    min-height: 48px;
    margin: 0 0 7px;
    color: #0f172a;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.8;
}

.company-logo-en-name {
    min-height: 20px;
    overflow: hidden;
    color: #94a3b8;
    font-size: 11px;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.company-logo-meta {
    display: grid;
    margin-top: 17px;
    gap: 9px;
    grid-template-columns: 1fr 1fr;
}

.company-logo-meta > div {
    padding: 10px;
    border-radius: 10px;
    background: #f8fafc;
}

.company-logo-meta span {
    display: block;
    margin-bottom: 4px;
    color: #94a3b8;
    font-size: 10px;
}

.company-logo-meta strong {
    color: #334155;
    font-size: 11px;
}

.company-logo-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 20px;
    border-top: 1px solid #eef2f6;
    color: #1e40af;
    font-size: 11px;
    font-weight: 800;
    background: #fafcff;
}

/* Modal */

.company-modal .modal-content {
    overflow: hidden;
    border: 0;
    border-radius: 20px;
    box-shadow: 0 30px 70px rgba(15, 23, 42, 0.24);
}

.company-modal-header {
    padding: 22px 25px;
    border-bottom: 1px solid #eef2f6;
    background: #ffffff;
}

.company-modal-heading {
    display: flex;
    align-items: center;
    gap: 15px;
}

.company-modal-logo img,
.company-modal-logo-empty {
    width: 76px;
    height: 76px;
    border: 1px solid #e5eaf0;
    border-radius: 15px;
    object-fit: contain;
    background: #ffffff;
}

.company-modal-logo-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 28px;
    background: #f8fafc;
}

.company-modal-header .modal-title {
    margin-bottom: 5px;
    color: #0f172a;
    font-size: 19px;
    font-weight: 900;
}

.company-modal-en-name {
    color: #94a3b8;
    font-size: 12px;
    text-align: right;
}

.company-modal-body {
    padding: 25px;
}

.company-modal-status-row {
    display: flex;
    gap: 8px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.company-information-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.company-info-item {
    display: flex;
    min-height: 72px;
    padding: 13px 15px;
    justify-content: center;
    flex-direction: column;
    border: 1px solid #edf1f5;
    border-radius: 12px;
    background: #fafbfc;
}

.company-info-label {
    margin-bottom: 6px;
    color: #94a3b8;
    font-size: 11px;
}

.company-info-value {
    color: #334155;
    font-size: 13px;
    font-weight: 800;
}

.company-info-value a {
    color: #1e40af;
    text-decoration: none;
}

.company-modal-section {
    margin-top: 22px;
}

.company-modal-section h5 {
    margin-bottom: 10px;
    color: #0f172a;
    font-size: 14px;
    font-weight: 800;
}

.company-modal-text {
    padding: 15px;
    border-right: 3px solid #1e40af;
    border-radius: 9px;
    color: #475569;
    font-size: 13px;
    line-height: 2;
    background: #f8fafc;
}

.company-modal-footer {
    padding: 15px 25px;
    border-top: 1px solid #eef2f6;
}

.company-website-btn {
    color: #ffffff;
    background: #1e3a8a;
}

.company-website-btn:hover {
    color: #ffffff;
    background: #172e70;
}

.company-modal-close-btn {
    color: #475569;
    background: #e2e8f0;
}

/* Empty and Pagination */

.companies-empty-state {
    padding: 70px 20px !important;
    color: #94a3b8;
    text-align: center;
}

.companies-empty-state i {
    margin-bottom: 15px;
    font-size: 42px;
}

.companies-empty-state h4 {
    color: #334155;
    font-size: 16px;
}

.companies-empty-state p {
    margin: 0;
    font-size: 13px;
}

.companies-pagination {
    display: flex;
    margin-top: 30px;
    justify-content: center;
}

.companies-pagination .pagination {
    gap: 6px;
}

.companies-pagination .page-link {
    min-width: 38px;
    min-height: 38px;
    border: 1px solid #e2e8f0;
    border-radius: 9px !important;
    color: #475569;
    text-align: center;
    box-shadow: none;
}

.companies-pagination .page-item.active .page-link {
    border-color: #1e3a8a;
    color: #ffffff;
    background: #1e3a8a;
}

/* Responsive */

@media (max-width: 991px) {
    .companies-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .companies-total {
        width: 100%;
        min-height: 85px;
    }

    .companies-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .companies-view-switcher {
        width: 100%;
    }

    .companies-view-btn {
        justify-content: center;
        flex: 1;
    }
}

@media (max-width: 767px) {
    .companies-page {
        padding: 35px 0;
    }

    .companies-hero {
        padding: 24px 20px;
        border-radius: 16px;
    }

    .companies-title {
        font-size: 24px;
    }

    .companies-filter-card {
        padding: 18px 18px 3px;
    }

    .companies-filter-actions {
        flex-direction: column;
    }

    .companies-search-btn,
    .companies-reset-btn {
        width: 100%;
    }

    .company-information-grid {
        grid-template-columns: 1fr;
    }

    .company-modal-heading {
        align-items: flex-start;
    }

    .company-modal-logo img,
    .company-modal-logo-empty {
        width: 60px;
        height: 60px;
    }

    .company-modal-header .modal-title {
        font-size: 15px;
    }
}



.companies-advanced-filter-btn {
    width: 100%;
    min-height: 48px;
    border: 1px solid #dfe4ec;
    border-radius: 10px;
    background: #f8fafc;
    color: #243248;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    transition: all 0.2s ease;
}

.companies-advanced-filter-btn:hover {
    border-color: #8fa3c4;
    background: #f2f6fb;
    color: #17243a;
}

.companies-selected-count {
    min-width: 24px;
    height: 24px;
    margin-right: 8px;
    padding: 0 7px;
    border-radius: 20px;
    background: #243248;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.companies-advanced-filters {
    margin-top: 8px;
    padding: 22px;
    border: 1px solid #e3e8ef;
    border-radius: 14px;
    background: #f8fafc;
}

.companies-advanced-header {
    margin-bottom: 20px;
    padding-bottom: 17px;
    border-bottom: 1px solid #e3e8ef;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.companies-advanced-title {
    margin-bottom: 5px;
    color: #1f2d42;
    font-size: 16px;
    font-weight: 800;
}

.companies-advanced-description {
    margin: 0;
    color: #7c8798;
    font-size: 12px;
    line-height: 1.8;
}

.companies-clear-all-activities,
.companies-clear-group {
    border: 0;
    background: transparent;
    color: #c04a4a;
    font-size: 11px;
    cursor: pointer;
}

.companies-activity-group {
    height: 100%;
    border: 1px solid #e0e6ee;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

.companies-activity-group-header {
    min-height: 70px;
    padding: 13px 15px;
    border-bottom: 1px solid #edf0f5;
    background: #fbfcfe;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.companies-activity-heading {
    display: flex;
    align-items: center;
}

.companies-activity-icon {
    width: 38px;
    height: 38px;
    margin-left: 9px;
    border-radius: 9px;
    background: #edf2f8;
    color: #2d405f;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.companies-activity-heading h4 {
    margin: 0 0 3px;
    color: #27364c;
    font-size: 13px;
    font-weight: 800;
}

.companies-group-selected-count {
    color: #8a95a6;
    font-size: 10px;
}

.companies-activity-options {
    max-height: 330px;
    padding: 10px;
    overflow-y: auto;
}

.companies-activity-option {
    position: relative;
    width: 100%;
    min-height: 43px;
    margin-bottom: 7px;
    padding: 8px 10px;
    border: 1px solid #e7ebf1;
    border-radius: 8px;
    background: #fff;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.companies-activity-option:last-child {
    margin-bottom: 0;
}

.companies-activity-option:hover {
    border-color: #aebbd0;
    background: #f8fafc;
}

.companies-activity-checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.companies-custom-checkbox {
    width: 21px;
    height: 21px;
    margin-left: 8px;
    border: 2px solid #c6ceda;
    border-radius: 5px;
    background: #fff;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.companies-custom-checkbox i {
    opacity: 0;
    font-size: 9px;
    transform: scale(0.7);
    transition: all 0.2s ease;
}

.companies-activity-option-title {
    color: #3b4657;
    font-size: 11px;
    line-height: 1.7;
}

.companies-activity-checkbox:checked + .companies-custom-checkbox {
    border-color: #263b59;
    background: #263b59;
}

.companies-activity-checkbox:checked + .companies-custom-checkbox i {
    opacity: 1;
    transform: scale(1);
}

.companies-activity-option:has(.companies-activity-checkbox:checked) {
    border-color: #8799b6;
    background: #f1f5fa;
}

.companies-activity-option:has(.companies-activity-checkbox:checked)
.companies-activity-option-title {
    color: #1d304d;
    font-weight: 700;
}

.companies-filter-footer {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #e4e8ee;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.companies-filter-summary {
    color: #7a8595;
    font-size: 12px;
}

.companies-filter-summary strong {
    color: #263b59;
}

.companies-empty-filter {
    padding: 20px 10px;
    color: #929cab;
    text-align: center;
    font-size: 11px;
}

@media (max-width: 991px) {
    .companies-advanced-header,
    .companies-filter-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .companies-filter-actions {
        width: 100%;
    }

    .companies-filter-actions .btn {
        flex: 1;
    }
}
