.admin-actions form{display:inline-block}.cell-danger{color:var(--error);font-weight:700}

/* ================================
   Audit log table
   ================================ */

.audit-panel {
    overflow: hidden;
}

.audit-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.audit-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
}

.audit-table {
    width: 100%;
    min-width: 980px;
    table-layout: fixed;
    border-collapse: collapse;
    margin-top: 0;
}

.audit-table th,
.audit-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    text-align: left;
    font-size: 0.92rem;
}

.audit-table th {
    color: var(--text);
    font-weight: 700;
    background: #f8fafc;
    white-space: nowrap;
    word-break: keep-all;
}

.audit-table tbody tr:hover {
    background: #f8fafc;
}

.audit-table tbody tr:last-child td {
    border-bottom: 0;
}

/* column widths */
.audit-table .col-id {
    width: 50px;
}

.audit-table .col-date {
    width: 220px;
}

.audit-table .col-user {
    width: 90px;
}

.audit-table .col-event {
    width: 230px;
}

.audit-table .col-ip {
    width: 140px;
}

.audit-table .col-metadata {
    width: auto;
}

/* cells */
.audit-id,
.audit-user,
.audit-ip {
    white-space: nowrap;
}

.audit-date {
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.5;
}

.audit-event {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.audit-metadata {
    max-width: 100%;
}

.metadata-code {
    display: block;
    max-width: 100%;
    max-height: 120px;
    overflow: auto;
    padding: 6px 8px;
    border-radius: 6px;
    background: #edf2f7;
    color: var(--text);
    font-size: 0.82rem;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.metadata-empty {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    background: #edf2f7;
    color: var(--sub);
    font-size: 0.82rem;
}

.empty-row {
    text-align: center;
    color: var(--sub);
    padding: 24px;
}

/* small screens */
@media (max-width: 760px) {
    .audit-table {
        min-width: 920px;
    }

    .audit-table th,
    .audit-table td {
        padding: 10px 8px;
        font-size: 0.86rem;
    }

    .metadata-code {
        max-height: 100px;
        font-size: 0.78rem;
    }
}

.danger-link {
    color: #c53030;
    background: transparent;
    border: 0;
    padding: 0;
    margin-left: 12px;
    cursor: pointer;
    font: inherit;
    text-decoration: underline;
}

.danger-link:hover {
    color: #9b2c2c;
}

.inline-form {
    display: inline;
}

/* user delete action */
.user-actions {
    white-space: nowrap;
}

.inline-form {
    display: inline-block;
    margin-left: 12px;
}

.link-button {
    border: none;
    background: transparent;
    padding: 0;
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
}

.danger-link {
    color: #c53030;
    font-weight: 700;
}

.danger-link:hover {
    color: #9b2c2c;
}

/* user management actions */
.admin-actions {
    display: flex;
    gap: 16px;
    margin: 24px 0;
}

.user-actions {
    white-space: nowrap;
}

.inline-form {
    display: inline-block;
    margin-left: 12px;
}

.link-button {
    border: none;
    background: transparent;
    padding: 0;
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
}

.danger-link {
    color: #c53030;
    font-weight: 700;
}

.danger-link:hover {
    color: #9b2c2c;
}

/* user management display */
.admin-actions {
    display: flex;
    gap: 16px;
    margin: 24px 0;
}

.user-actions {
    white-space: nowrap;
}

.inline-form {
    display: inline-block;
    margin-left: 12px;
}

.link-button {
    border: none;
    background: transparent;
    padding: 0;
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
}

.danger-link {
    color: #c53030;
    font-weight: 700;
}

.danger-link:hover {
    color: #9b2c2c;
}

.muted-text {
    color: #718096;
}

.action-note {
    margin-left: 12px;
    font-size: 0.9rem;
}

.status-deleted {
    color: #718096;
    font-weight: 700;
}

.is-deleted-user {
    background: #f8fafc;
}

/* user management actions */
.admin-actions {
    display: flex;
    gap: 16px;
    margin: 24px 0;
}

.user-actions {
    white-space: nowrap;
}

.inline-form {
    display: inline-block;
    margin-left: 12px;
}

.link-button {
    border: none;
    background: transparent;
    padding: 0;
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
}

.danger-link {
    color: #c53030;
    font-weight: 700;
}

.danger-link:hover {
    color: #9b2c2c;
}

.muted-text {
    color: #718096;
}

.action-note {
    margin-left: 12px;
    font-size: 0.9rem;
}

.status-deleted {
    color: #718096;
    font-weight: 700;
}

/* ================================
   Admin users page polish
   ================================ */

.card {
    max-width: 1080px;
    margin: 48px auto;
    padding: 40px 44px;
    background: #ffffff;
    border: 1px solid #dbe4ef;
    border-radius: 16px;
    box-shadow: 0 14px 32px rgba(26, 54, 93, 0.08);
}

.card h1 {
    margin: 0 0 28px;
    font-size: 2rem;
    letter-spacing: 0.02em;
    color: #263247;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 0 28px;
}

.admin-actions a,
.admin-actions .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 10px;
    background: #3182ce;
    color: #ffffff !important;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 8px 16px rgba(49, 130, 206, 0.18);
}

.admin-actions a:hover,
.admin-actions .button:hover {
    background: #2b6cb0;
}

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

.admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.96rem;
}

.admin-table thead th {
    padding: 14px 12px;
    color: #263247;
    font-weight: 900;
    text-align: left;
    border-bottom: 1px solid #d8e1ed;
    background: #f8fafc;
}

.admin-table thead th:first-child {
    border-top-left-radius: 10px;
}

.admin-table thead th:last-child {
    border-top-right-radius: 10px;
}

.admin-table tbody td {
    padding: 15px 12px;
    border-bottom: 1px solid #dbe4ef;
    color: #263247;
    vertical-align: middle;
}

.admin-table tbody tr:hover {
    background: #f8fbff;
}

.admin-table tbody tr.is-deleted-user,
.admin-table tbody tr:has(.status-deleted) {
    background: #f8fafc;
}

.admin-table tbody tr.is-deleted-user td,
.admin-table tbody tr:has(.status-deleted) td {
    color: #718096;
}

.admin-table a {
    color: #2b6cb0;
    font-weight: 800;
    text-decoration: none;
}

.admin-table a:hover {
    text-decoration: underline;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}

.inline-form {
    display: inline-flex;
    margin: 0;
}

.link-button {
    border: none;
    background: transparent;
    padding: 0;
    font: inherit;
    cursor: pointer;
    text-decoration: none;
}

.danger-link {
    color: #c53030;
    font-weight: 900;
}

.danger-link:hover {
    color: #9b2c2c;
    text-decoration: underline;
}

.muted-text {
    color: #718096;
    font-weight: 700;
}

.action-note {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    background: #edf2f7;
    color: #718096;
    font-size: 0.82rem;
    font-weight: 800;
}

.status-deleted {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: #edf2f7;
    color: #718096;
    font-size: 0.84rem;
    font-weight: 900;
}

@media (max-width: 900px) {
    .card {
        margin: 24px 16px;
        padding: 28px 22px;
    }

    .card h1 {
        font-size: 1.6rem;
    }

    .admin-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .admin-actions a,
    .admin-actions .button {
        width: 100%;
    }

    .admin-table {
        min-width: 880px;
    }
}

/* ================================
   Admin users font weight reset
   ================================ */

/* 管理画面全体の文字を少し軽くする */
.admin-table,
.admin-table td,
.admin-table td *,
.user-actions,
.user-actions *,
.muted-text,
.action-note,
.status-deleted {
    font-weight: 400 !important;
    letter-spacing: 0 !important;
}

/* 見出しだけは少し太めに残す */
.admin-table thead th {
    font-weight: 600 !important;
    letter-spacing: 0 !important;
}

/* ページタイトルも潰れない程度に調整 */
.card h1 {
    font-weight: 700 !important;
    letter-spacing: 0 !important;
}

/* 上部ボタンは太すぎないようにする */
.admin-actions a,
.admin-actions .button {
    font-weight: 600 !important;
    letter-spacing: 0 !important;
}

/* 詳細リンク・削除リンクも通常寄りにする */
.admin-table a,
.link-button,
.danger-link {
    font-weight: 500 !important;
    letter-spacing: 0 !important;
}

/* 本人・削除済みバッジも軽めにする */
.action-note,
.status-deleted {
    font-weight: 500 !important;
}

/* メール・日時などの可読性調整 */
.admin-table tbody td {
    font-size: 0.95rem !important;
    line-height: 1.65 !important;
}
