/* =====================================================
   共通カード・ユーザー情報・セクション見出し
   ===================================================== */

.card {
    margin-bottom: 22px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.user-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.user-profile,
.user-name-row,
.section-heading,
.section-heading-between {
    display: flex;
    align-items: center;
}

.user-profile,
.section-heading {
    gap: 12px;
}

.user-name-row {
    flex-wrap: wrap;
    gap: 8px;
}

.section-heading-between {
    justify-content: space-between;
    gap: 16px;
}

.avatar {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--primary), #5f8fff);
    color: #fff;
    font-size: 1.15rem;
    font-weight: 800;
}

.role-badge,
.gun-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-weight: 800;
}

.role-badge {
    padding: 4px 9px;
    background: #e9f0ff;
    color: var(--primary);
    font-size: 0.76rem;
}

.role-badge.admin {
    background: #fff0d8;
    color: #9a5b00;
}

.section-heading {
    margin-bottom: 20px;
}

.section-heading h2,
.admin-user-form h3 {
    margin: 2px 0 0;
}

.section-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: #edf3ff;
    font-size: 1.2rem;
}

/* =====================================================
   ダッシュボード・入力フォーム
   ===================================================== */

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(300px, 0.8fr) minmax(420px, 1.2fr);
    gap: 22px;
}

.field {
    min-width: 0;
}

.field label {
    display: block;
    margin-bottom: 7px;
    color: #344054;
    font-size: 0.9rem;
    font-weight: 700;
}

.field input,
.field select {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #fff;
    color: var(--text);
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s;
}

.field textarea {
    width: 100%;
    min-height: 110px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #fff;
    color: var(--text);
    outline: none;
    resize: vertical;
    box-sizing: border-box;
    font: inherit;
    line-height: 1.6;
    transition:
        border-color 0.18s,
        box-shadow 0.18s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--primary);
    box-shadow:
        0 0 0 4px
        rgba(20, 87, 217, 0.11);
}

.field input[readonly] {
    background: var(--surface-muted);
    color: var(--muted);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.absence-form-card {
    margin-top: 20px;
    margin-bottom: 20px;
    border-left:
        5px solid
        var(--danger);
}

.absence-form-card .form-grid {
    align-items: start;
}

.absence-reason-field {
    grid-column: 1 / -1;
}

.absence-form-card[hidden] {
    display: none;
}

.schedule-form-card .field:first-child,
.schedule-form-card .field:nth-child(2),
.schedule-form-card .field:nth-child(3) {
    grid-column: 1 / -1;
}

.password-input-wrap {
    position: relative;
}

.password-input-wrap input {
    padding-right: 62px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 7px;
    transform: translateY(-50%);
    padding: 6px 9px;
    border: 0;
    border-radius: 8px;
    background: #edf2f8;
    color: #344054;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
}

.form-buttons,
.form-action {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* =====================================================
   ボタン・メッセージ・通知
   ===================================================== */

.button {
    min-height: 42px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: 11px;
    cursor: pointer;
    font-weight: 800;
    transition: transform 0.16s, background 0.16s, border-color 0.16s;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    background: var(--primary);
    color: #fff;
}

.button-primary:hover {
    background: var(--primary-hover);
}

.button-secondary {
    background: #fff;
    border-color: var(--border);
    color: #344054;
}

.button-danger {
    background: #fff;
    border-color: #efc5c5;
    color: var(--danger);
}

.button-small {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 0.8rem;
}

.button-block {
    width: 100%;
}

.message {
    min-height: 22px;
    margin: 12px 0 0;
    font-size: 0.9rem;
    font-weight: 700;
}

.message.error {
    color: var(--danger);
}

.message.success {
    color: var(--success);
}

.edit-status {
    margin: -8px 0 16px;
    color: #9a5b00;
    font-weight: 800;
}

.notice {
    padding: 12px 14px;
    border-radius: 12px;
    line-height: 1.65;
}

.notice-warning {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.password-panel summary,
.admin-summary {
    cursor: pointer;
    font-weight: 800;
}

.password-panel summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.summary-help {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 500;
}

.password-form {
    margin-top: 18px;
}

