/* ==========================================================================
   Star Hire - admin area
   Tables, forms and the category field editor. Consistent with the theme and
   responsive; loaded after style.css so it can build on the shared tokens.
   ========================================================================== */

/* Admin sub-navigation ---------------------------------------------------- */

.admin-nav {
    margin-top: 4px;
}

.admin-nav .tab {
    text-decoration: none;
}

/* Admin nav warning (2FA not enabled) ------------------------------------- */

.nav-link-warning {
    color: var(--amber);
}

.nav-link-warning:hover {
    color: #ffd98a;
}

/* Page head helper -------------------------------------------------------- */

.page-head .btn {
    align-self: flex-start;
}

/* Tables ------------------------------------------------------------------ */

.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-name {
    display: block;
    font-weight: 650;
    color: #eaf3fb;
}

.table td .muted.small,
.table td .admin-name + .muted.small {
    display: block;
}

/* Forms ------------------------------------------------------------------- */

.admin-form-panel {
    max-width: 860px;
}

.admin-field-narrow {
    max-width: 200px;
}

.admin-divider {
    margin: 24px 0;
    border: 0;
    border-top: 1px solid var(--line);
}

.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text);
}

.checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--cyan);
}

.input-sm,
.select-sm {
    padding: 6px 10px;
    font-size: 0.82rem;
}

.select-sm {
    padding-right: 30px;
    background-position:
        calc(100% - 14px) calc(50% - 2px),
        calc(100% - 9px) calc(50% - 2px);
}

/* Users table ------------------------------------------------------------- */

.admin-users-table td {
    vertical-align: top;
}

.admin-user-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.admin-user-actions form {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Two-factor setup -------------------------------------------------------- */

.mfa-secret,
.mfa-uri {
    display: block;
    padding: 10px 12px;
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--cyan);
    font-family: var(--mono);
    font-size: 0.9rem;
    word-break: break-all;
    user-select: all;
}

/* Category field editor --------------------------------------------------- */

.field-editor {
    padding: 16px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.field-editor > [data-add-field] {
    margin-top: 4px;
}

.field-editor-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.field-editor-item {
    padding: 14px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-left: 3px solid var(--cyan-dim);
    border-radius: var(--radius-sm);
}

.field-editor-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.field-editor-item .field {
    margin-bottom: 10px;
}

.field-editor-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px dashed var(--line);
}

.field-editor-option-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-editor-option {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.field-editor-options [data-add-option] {
    align-self: flex-start;
}

/* Responsive -------------------------------------------------------------- */

@media (max-width: 720px) {
    .field-editor-option {
        grid-template-columns: minmax(0, 1fr);
    }

    .field-editor-item-head {
        align-items: flex-start;
    }
}

/* ==========================================================================
   Trainer sub-navigation and license badges (trainer area + profiles)
   ========================================================================== */

.trainer-nav {
    margin-top: 4px;
}

.trainer-nav .tab {
    text-decoration: none;
}

/* License badges ---------------------------------------------------------- */

.license-badges {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.license-kind-title {
    margin: 0 0 8px;
    font-size: 0.95rem;
    color: #eaf3fb;
}

.license-group-title {
    margin: 4px 0 6px;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.license-badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.license-item {
    display: flex;
    align-items: stretch;
    gap: 6px;
}

.license-badge {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 12px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.license-badge-name {
    font-weight: 650;
    color: #eaf3fb;
}

.license-badge-meta {
    font-size: 0.74rem;
    color: var(--muted);
}

.license-badge.kind-license {
    border-color: rgba(53, 214, 255, 0.45);
    box-shadow: inset 0 0 0 1px rgba(53, 214, 255, 0.12);
}

.license-badge.kind-license .license-badge-name {
    color: var(--cyan);
}

.license-badge.kind-certificate {
    border-color: rgba(255, 194, 61, 0.45);
    box-shadow: inset 0 0 0 1px rgba(255, 194, 61, 0.12);
}

.license-badge.kind-certificate .license-badge-name {
    color: var(--amber);
}

.license-revoke {
    display: flex;
    align-items: center;
}

/* ==========================================================================
   Certified badge (compact "Certified · N" pill, shown next to a username
   everywhere the user appears: cards, contract rows, headings, profiles)
   ========================================================================== */

.certified-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-family: var(--mono);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.5;
    color: #9df0c2;
    background: rgba(61, 220, 132, 0.12);
    border: 1px solid rgba(61, 220, 132, 0.45);
    border-radius: 999px;
    white-space: nowrap;
    cursor: help;
    vertical-align: middle;
}

h1 .certified-badge,
h2 .certified-badge {
    font-size: 0.6em;
    letter-spacing: 0.03em;
    padding: 2px 7px;
    transform: translateY(-1px);
}

@media (max-width: 720px) {
    .certified-badge {
        font-size: 0.64rem;
        padding: 1px 6px;
    }
}
