/* MasterBinder 0.0.4 — account controls immediately left of Online + Admin ZIP updater */
.main-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 22px;
}

.main-header > .brand-block {
    flex: 0 1 auto;
    min-width: 0;
}

.header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    flex: 1 1 auto;
    min-width: 0;
    padding-top: 7px;
}

.header-right .account-area {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 7px;
}

.header-right .account-area form { margin: 0; }

.header-right > .header-status {
    display: flex !important;
    margin: 0;
    flex: 0 0 auto;
    order: 99;
}

.admin-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.admin-version {
    flex: 0 0 auto;
    padding: 7px 10px;
    color: #dce7fa;
    border: 1px solid #40506e;
    border-radius: 6px;
    background: #1b263c;
    font-size: 12px;
    font-weight: 750;
}

.admin-grid-top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 12px;
}

.admin-update-panel,
.admin-update-history {
    padding: 20px;
    margin-top: 12px;
}

.admin-update-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #303b56;
}

.admin-update-heading.compact { padding-bottom: 12px; }
.admin-update-heading h2 { margin: 2px 0 5px; color: #fff; font-size: 19px; }
.admin-update-heading p { margin: 0; color: #9ba9c1; line-height: 1.5; }

.update-upload-form { margin-top: 18px; }

.update-file-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.update-file-row input[type="file"] {
    width: 100%;
    min-height: 40px;
    padding: 7px 9px;
    color: #dce6f8;
    border: 1px solid #46536f;
    border-radius: 4px;
    background: #121829;
}

.update-file-row input[type="file"]::file-selector-button {
    margin-right: 10px;
    padding: 6px 10px;
    color: #fff;
    cursor: pointer;
    border: 1px solid #51617e;
    border-radius: 4px;
    background: #2a3854;
}

.update-install-button { min-width: 205px; }

.update-rules {
    margin-top: 10px;
    color: #7f8da8;
    font-size: 12px;
    line-height: 1.5;
}

.update-error {
    margin-top: 14px;
    padding: 10px 12px;
    color: #ffc2c2;
    border: 1px solid #7b3a3a;
    border-radius: 5px;
    background: #3a1f24;
    font-size: 13px;
    font-weight: 650;
}

.update-history-table-wrap {
    overflow-x: auto;
    margin-top: 14px;
}

.update-history-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
    font-size: 12px;
}

.update-history-table th,
.update-history-table td {
    padding: 9px 10px;
    text-align: left;
    border-bottom: 1px solid #2d3852;
}

.update-history-table th { color: #9dacC7; font-weight: 750; }
.update-history-table td { color: #d9e1ef; }

.update-status {
    display: inline-flex;
    padding: 3px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 850;
}

.update-status.installed { color: #bff2d4; background: #1c4930; }
.update-status.failed { color: #ffc4c4; background: #55262b; }
.update-status.processing { color: #d7e4fa; background: #2c3e5d; }
.update-empty { text-align: center !important; color: #7887a2 !important; }

.update-detail-row pre {
    max-height: 230px;
    overflow: auto;
    margin: 0;
    white-space: pre-wrap;
    color: #d8dfec;
    background: #101726;
    border: 1px solid #2b354d;
    padding: 10px;
    border-radius: 5px;
    font-family: Consolas, monospace;
    font-size: 11px;
}

@media (max-width: 980px) {
    .main-header {
        flex-direction: column;
        gap: 8px;
    }

    .header-right {
        width: 100%;
        padding-top: 0;
        align-items: flex-start;
    }

    .header-right .account-area {
        flex: 1 1 auto;
        justify-content: flex-end;
    }

    .header-right > .header-status {
        align-self: flex-start;
    }
}

@media (max-width: 760px) {
    .admin-grid-top { grid-template-columns: 1fr; }
    .admin-hero { align-items: flex-start; flex-direction: column; }
    .update-file-row { grid-template-columns: 1fr; }
    .update-install-button { width: 100%; }
}

@media (max-width: 620px) {
    .header-right { gap: 6px; }

    .header-right .account-area {
        gap: 4px;
        flex-wrap: wrap;
    }

    .header-link,
    .account-name {
        padding-left: 6px;
        padding-right: 6px;
        font-size: 11px;
    }

    .role-badge { padding-left: 6px; padding-right: 6px; }

    .header-right > .header-status {
        display: flex !important;
        padding: 6px 8px;
        font-size: 11px;
    }
}
