﻿.companies-page {
    width: 100%;
    max-width: 1700px;
    margin: 0 auto;
    padding-bottom: 40px;
}

.companies-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 25px;
}

.companies-eyebrow,
.companies-panel-kicker {
    display: block;
    color: #2563eb;
    font-size: 10px;
    font-weight: 950;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.companies-header h1 {
    margin: 7px 0 0;
    color: #0f172a;
    font-size: clamp(30px, 3vw, 42px);
    line-height: 1.1;
    font-weight: 950;
    letter-spacing: -.045em;
}

.companies-header p {
    max-width: 650px;
    margin: 10px 0 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.7;
}

.companies-summary {
    display: flex;
    align-items: stretch;
    overflow: hidden;
    border: 1px solid #dbe4ef;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .06);
}

    .companies-summary div {
        min-width: 100px;
        padding: 14px 18px;
        border-left: 1px solid #e2e8f0;
    }

        .companies-summary div:first-child {
            border-left: 0;
        }

    .companies-summary strong,
    .companies-summary span {
        display: block;
    }

    .companies-summary strong {
        color: #0f172a;
        font-size: 21px;
        font-weight: 950;
    }

    .companies-summary span {
        margin-top: 3px;
        color: #64748b;
        font-size: 10px;
        font-weight: 750;
    }

.companies-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
    padding: 15px 17px;
    border: 1px solid;
    border-radius: 15px;
}

    .companies-alert > span {
        display: grid;
        width: 29px;
        height: 29px;
        flex: 0 0 29px;
        place-items: center;
        border-radius: 9px;
        color: #fff;
        font-weight: 950;
    }

    .companies-alert strong {
        display: block;
        font-size: 13px;
    }

    .companies-alert p {
        margin: 4px 0 0;
        font-size: 12px;
    }

    .companies-alert.success {
        color: #166534;
        border-color: #bbf7d0;
        background: #f0fdf4;
    }

        .companies-alert.success > span {
            background: #16a34a;
        }

    .companies-alert.danger {
        color: #991b1b;
        border-color: #fecaca;
        background: #fff1f2;
    }

        .companies-alert.danger > span {
            background: #dc2626;
        }

.companies-panel {
    margin-bottom: 22px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 14px 38px rgba(15, 23, 42, .065);
}

.companies-panel-header,
.companies-list-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 24px;
    border-bottom: 1px solid #edf2f7;
}

    .companies-panel-header h2,
    .companies-list-header h2 {
        margin: 6px 0 0;
        color: #0f172a;
        font-size: 20px;
        font-weight: 900;
        letter-spacing: -.025em;
    }

    .companies-panel-header p,
    .companies-list-header p {
        margin: 7px 0 0;
        color: #64748b;
        font-size: 12px;
    }

.companies-form {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    padding: 23px 24px 25px;
}

.companies-form-field {
    min-width: 0;
}

    .companies-form-field label {
        display: block;
        margin-bottom: 7px;
        color: #334155;
        font-size: 11px;
        font-weight: 850;
    }

        .companies-form-field label span {
            color: #dc2626;
        }

.companies-input {
    width: 100%;
    min-height: 44px;
    padding: 0 13px;
    border: 1px solid #dbe4ef;
    border-radius: 12px;
    color: #0f172a;
    background: #fff;
    outline: none;
    font-family: inherit;
    font-size: 13px;
    transition: border-color .18s ease, box-shadow .18s ease;
}

    .companies-input:focus {
        border-color: #60a5fa;
        box-shadow: 0 0 0 4px rgba(37, 99, 235, .10);
    }

.companies-form-field small {
    display: block;
    margin-top: 6px;
    color: #94a3b8;
    font-size: 9px;
    line-height: 1.4;
}

.companies-form-field .validation-message {
    display: block;
    margin-top: 5px;
    color: #dc2626;
    font-size: 10px;
    font-weight: 700;
}

.companies-form-action {
    display: flex;
    align-items: flex-end;
}

.companies-primary-button {
    display: inline-flex;
    width: 100%;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    box-shadow: 0 12px 24px rgba(37, 99, 235, .22);
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 900;
}

    .companies-primary-button:disabled {
        opacity: .65;
        cursor: not-allowed;
    }

.companies-button-spinner,
.companies-loader {
    width: 17px;
    height: 17px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: companies-spin .8s linear infinite;
}

@keyframes companies-spin {
    to {
        transform: rotate(360deg);
    }
}

.companies-search {
    display: flex;
    width: min(440px, 100%);
    min-height: 43px;
    align-items: center;
    gap: 9px;
    padding: 0 13px;
    border: 1px solid #dbe4ef;
    border-radius: 12px;
    background: #f8fafc;
}

    .companies-search span {
        color: #64748b;
        font-size: 19px;
    }

    .companies-search input {
        width: 100%;
        border: 0;
        color: #0f172a;
        background: transparent;
        outline: none;
        font-family: inherit;
        font-size: 12px;
    }

.companies-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.companies-table {
    width: 100%;
    border-collapse: collapse;
}

    .companies-table th {
        padding: 13px 18px;
        color: #64748b;
        background: #f8fafc;
        text-align: left;
        font-size: 10px;
        font-weight: 900;
        letter-spacing: .07em;
        text-transform: uppercase;
    }

    .companies-table td {
        padding: 15px 18px;
        border-top: 1px solid #f1f5f9;
        color: #334155;
        font-size: 12px;
    }

    .companies-table tbody tr:hover {
        background: #fafcff;
    }

.companies-name-cell {
    display: flex;
    min-width: 230px;
    align-items: center;
    gap: 11px;
}

.companies-avatar {
    display: grid;
    width: 39px;
    height: 39px;
    flex: 0 0 39px;
    place-items: center;
    border-radius: 12px;
    color: #1d4ed8;
    background: #dbeafe;
    font-size: 11px;
    font-weight: 950;
}

.companies-name-cell strong,
.companies-name-cell span {
    display: block;
}

.companies-name-cell strong {
    color: #0f172a;
    font-size: 12px;
}

.companies-name-cell span {
    max-width: 280px;
    margin-top: 4px;
    overflow: hidden;
    color: #94a3b8;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.companies-code {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 8px;
    color: #4338ca;
    background: #eef2ff;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.companies-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
}

    .companies-status span {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: currentColor;
    }

    .companies-status.active {
        color: #047857;
        background: #d1fae5;
    }

    .companies-status.inactive {
        color: #b91c1c;
        background: #fee2e2;
    }

.companies-open-button {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    gap: 7px;
    padding: 0 11px;
    border: 1px solid #dbe4ef;
    border-radius: 10px;
    color: #334155;
    background: #fff;
    text-decoration: none;
    font-size: 10px;
    font-weight: 850;
}

    .companies-open-button:hover {
        color: #1d4ed8;
        border-color: #bfdbfe;
        background: #eff6ff;
    }

.companies-loading,
.companies-empty {
    display: flex;
    min-height: 240px;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 30px;
    text-align: center;
}

    .companies-loading .companies-loader {
        width: 32px;
        height: 32px;
        border-width: 3px;
        border-color: #dbeafe;
        border-top-color: #2563eb;
    }

    .companies-loading strong,
    .companies-empty strong {
        display: block;
        color: #0f172a;
        font-size: 14px;
    }

    .companies-loading p,
    .companies-empty p {
        margin: 5px 0 0;
        color: #94a3b8;
        font-size: 11px;
    }

.companies-empty {
    flex-direction: column;
}

.companies-empty-icon {
    display: grid;
    width: 50px;
    height: 50px;
    place-items: center;
    border-radius: 15px;
    background: #eef2ff;
    font-size: 21px;
}

@media (max-width: 1250px) {
    .companies-form {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .companies-header,
    .companies-list-header {
        flex-direction: column;
    }

    .companies-summary {
        width: 100%;
    }

        .companies-summary div {
            min-width: 0;
            flex: 1;
        }

    .companies-search {
        width: 100%;
    }

    .companies-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .companies-form {
        grid-template-columns: 1fr;
    }

    .companies-summary {
        align-items: stretch;
        flex-direction: column;
    }

        .companies-summary div {
            border-top: 1px solid #e2e8f0;
            border-left: 0;
        }

            .companies-summary div:first-child {
                border-top: 0;
            }
}
