* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@keyframes successBounce {
    0% {
        transform: translate(-50%, -50%) scale(0.3);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes successPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
    }
}

:root {
    --primary: #FFD700;
    --secondary: #003d99;
    --dark-bg: #0a1628;
    --dark-card: #1a2d47;
    --dark-border: #2a4a6f;
    --text-light: #e8f0ff;
    --text-muted: #a8b8d8;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--dark-bg);
    color: var(--text-light);
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ヘッダー */
.header {
    background: linear-gradient(135deg, #001a4d 0%, #003d99 100%);
    border-bottom: 3px solid #FFD700;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.7);
}

.header-left h1 {
    color: #FFD700;
    font-size: 1.5em;
    font-weight: bold;
    letter-spacing: 1px;
}

.header-right {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* ログインボックス（右上） */
.login-box {
    display: flex;
    gap: 5px;
    align-items: center;
}

.login-box form {
    display: flex;
    gap: 5px;
}

.login-box input {
    padding: 8px 12px;
    border: 1px solid var(--dark-border);
    border-radius: 5px;
    font-size: 0.85em;
    background: #1e293b;
    color: var(--text-light);
}

.login-box input::placeholder {
    color: var(--text-muted);
}

.login-box button {
    padding: 8px 15px;
    background: #FFD700;
    color: #001a4d;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-box button:hover {
    background: #FFC700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    transform: translateY(-2px);
}

.error {
    color: var(--primary);
    font-size: 0.75em;
    white-space: nowrap;
    margin: 0;
}

.success {
    color: #22c55e;
    font-size: 0.9em;
    text-align: center;
}

/* ユーザーボックス（ログイン後） */
.user-box {
    display: flex;
    gap: 10px;
    align-items: center;
}

.greeting {
    background: rgba(0, 61, 153, 0.3);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    white-space: nowrap;
    color: #FFD700;
    font-weight: bold;
    border: 1px solid #FFD700;
}

#logoutBtn {
    padding: 8px 15px;
    background: #6b7280;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
    white-space: nowrap;
}

#logoutBtn:hover {
    background: #4b5563;
}

/* メインコンテンツ */
.container {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 30px;
}

/* タブ */
.tab-bar {
    display: flex;
    gap: 5px;
    margin-bottom: 30px;
    border-bottom: 2px solid #FFD700;
    background: transparent;
    border-radius: 0;
    overflow: auto;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: bold;
    color: var(--text-muted);
    transition: all 0.3s;
    pointer-events: auto;
    border-radius: 0;
}

.tab-btn.active {
    color: #FFD700;
    background: transparent;
    border-bottom-color: #FFD700;
}

.tab-btn:hover {
    color: #FFD700;
    background: rgba(255, 215, 0, 0.05);
}

.tab-content {
    display: none;
    padding: 25px 0;
    animation: fadeIn 0.3s ease-in;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* フィルターバー */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
    background: transparent;
    padding: 0;
    border-radius: 0;
}

.filter-btn {
    padding: 12px 28px;
    background: rgba(59, 130, 246, 0.1);
    border: 2px solid #3b82f6;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    pointer-events: auto;
    color: #3b82f6;
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.95em;
}

.filter-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: linear-gradient(135deg, #FFD700 0%, #FFC700 100%);
    color: #1a1a1a;
    border-color: #FFD700;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.3);
}

/* 指名手配リスト */
.criminals-grid {
    display: table;
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 40px;
    background: var(--dark-card);
    border-radius: 5px;
    overflow: hidden;
}

.criminal-row {
    display: table-row;
    border-bottom: 1px solid var(--dark-border);
}

.criminal-row:hover {
    background: rgba(255, 215, 0, 0.05);
}

.criminal-row:last-child {
    border-bottom: none;
}

.criminal-cell {
    display: table-cell;
    padding: 12px;
    vertical-align: middle;
    border-right: 1px solid var(--dark-border);
    font-size: 0.85em;
}

.criminal-cell:last-child {
    border-right: none;
}

.criminal-name-cell {
    min-width: 80px;
    font-weight: bold;
    color: #FFD700;
}

.criminal-type-cell {
    min-width: 70px;
    color: #90EE90;
    font-weight: bold;
    text-align: center;
    background: rgba(144, 238, 144, 0.1);
}

.criminal-deadline-cell {
    min-width: 100px;
    color: #87CEEB;
}

.criminal-charges-cell {
    min-width: 180px;
    color: #e8f0ff;
    font-size: 0.8em;
}

.criminal-amount-cell {
    min-width: 90px;
    font-weight: bold;
    color: #FF6B6B;
    text-align: right;
}

.charge-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2px;
    gap: 5px;
}

.charge-name {
    color: #cbd5e1;
    flex: 1;
}

.charge-amount {
    color: #fbbf24;
    font-weight: bold;
    white-space: nowrap;
}

/* 古いカード形式は完全に削除 - テーブル形式を使用 */

/* チェック操作セクション */
.actions-section {
    background: transparent;
    padding: 0;
    border-radius: 0;
    color: var(--text-light);
}

.actions-section h2 {
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 1.3em;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--dark-border);
}

.actions-list {
    display: grid;
    gap: 10px;
}

.action-item {
    background: var(--light);
    padding: 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.action-item label {
    display: flex;
    gap: 10px;
    cursor: pointer;
    flex: 1;
}

.action-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* ログセクション */
.logs-table-container {
    background: var(--dark-card);
    padding: 0;
    border-radius: 10px;
    max-height: 600px;
    overflow-y: auto;
    color: var(--text-light);
    display: table;
    width: 100%;
    border-collapse: collapse;
}

.log-row {
    display: table-row;
    border-bottom: 1px solid var(--dark-border);
    transition: background 0.2s;
}

.log-row:hover {
    background: rgba(255,255,255,0.03);
}

.log-row:last-child {
    border-bottom: none;
}
.accounts-section {
    background: var(--dark-card);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    color: var(--text-light);
}

.accounts-section h2 {
    color: var(--primary);
    margin-bottom: 15px;
}

.accounts-section form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.accounts-section input,
.accounts-section select {
    padding: 10px;
    border: 1px solid var(--dark-border);
    border-radius: 5px;
    font-size: 0.9em;
    background: var(--dark-bg);
    color: var(--text-light);
}

.accounts-section button {
    padding: 10px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

.accounts-section button:hover {
    background: #b91c1c;
}

.accounts-list {
    background: var(--dark-card);
    padding: 20px;
    border-radius: 10px;
    color: var(--text-light);
}

.accounts-list h2 {
    color: var(--primary);
    margin-bottom: 15px;
}

#accountsTable {
    width: 100%;
    border-collapse: collapse;
}

#accountsTable th {
    background: var(--dark-bg);
    color: var(--text-light);
    padding: 10px;
    text-align: left;
    font-weight: bold;
    border-bottom: 2px solid var(--dark-border);
}

#accountsTable td {
    padding: 10px;
    border-bottom: 1px solid var(--dark-border);
    color: var(--text-light);
}

#accountsTable tr:hover {
    background: rgba(255,255,255,0.05);
}

.delete-btn {
    padding: 5px 10px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8em;
    transition: background 0.3s;
}

.delete-btn:hover {
    background: #dc2626;
}

/* ログセクション */
.logs-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

.logs-section h2 {
    color: var(--primary);
    margin-bottom: 15px;
}

.logs-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 5px;
}

.log-entry {
    padding: 10px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9em;
    color: #666;
}

.log-entry:last-child {
    border-bottom: none;
}

/* モーダル */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}

.modal.show {
    display: block;
}

.modal-content {
    background-color: var(--dark-card);
    margin: 10% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
    border: 1px solid var(--dark-border);
}

.close {
    color: var(--text-muted);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: var(--text-light);
}

#modalTitle {
    color: var(--primary);
    margin-bottom: 20px;
}

#modalBody {
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-danger {
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

.btn-danger:hover {
    background: #b91c1c;
}

/* 指名手配テーブル */
.criminals-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: 5px;
    overflow: hidden;
}

.criminals-table thead {
    background: #1a2d47;
    border-bottom: 2px solid var(--dark-border);
}

.criminals-table th {
    padding: 15px;
    text-align: left;
    color: var(--primary);
    font-weight: bold;
    font-size: 0.95em;
}

.criminals-table tbody tr {
    border-bottom: 1px solid var(--dark-border);
    transition: background 0.2s;
}

.criminals-table tbody tr:hover {
    background: rgba(255, 215, 0, 0.05);
}

.criminals-table tbody tr:last-child {
    border-bottom: none;
}

.criminals-table .status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: bold;
}

.criminals-table .status.wanted {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid #f87171;
}

.criminals-table .status.caught {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border: 1px solid #34d399;
}

.btn-arrest {
    padding: 8px 16px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.85em;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-arrest:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.5);
    transform: translateY(-1px);
}

.btn-warning {
    padding: 8px 16px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.85em;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.5);
    transform: translateY(-1px);
}

/* テーブル列幅統一 */
.criminals-table .col-name {
    width: 12%;
}

.criminals-table .col-charges {
    width: 40%;
}

.criminals-table .col-penalty {
    width: 15%;
    text-align: center;
    font-weight: bold;
}

.criminals-table .col-deadline {
    width: 18%;
}

.criminals-table .col-status {
    width: 10%;
}

.criminals-table .col-action {
    width: 5%;
    text-align: center;
}

/* テーブルセルの垂直配置 */
.criminals-table td {
    vertical-align: middle;
    padding: 15px;
    color: var(--text-light);
    font-size: 0.9em;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 15px;
    }

    .criminals-grid {
        grid-template-columns: 1fr;
    }

    .filter-bar {
        flex-wrap: wrap;
    }
}

/* タブのアクティブ状態 */
.tab-btn.active {
    border-bottom: 3px solid var(--primary);
    color: var(--primary);
    font-weight: bold;
}

/* ロール表示 */
.role-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 0.85em;
    font-weight: bold;
    color: white;
}

.role-admin {
    background: var(--primary);
}

.role-superior {
    background: #f97316;
}

.role-police {
    background: #3b82f6;
}

/* 自動更新通知のアニメーション */
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* 特殊指名手配のスタイル */
.criminal-card.special-wanted {
    border: 3px solid #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.criminal-card.special-wanted .criminal-status {
    background-color: #f59e0b;
    color: white;
}

.criminal-special-notes {
    margin-top: 12px;
    padding: 10px;
    background-color: #fef08a;
    border-left: 3px solid #f59e0b;
    border-radius: 4px;
    font-size: 0.95em;
}

.criminal-special-notes strong {
    display: block;
    margin-bottom: 8px;
    color: #92400e;
}

.criminal-special-notes ul {
    margin: 0;
    padding-left: 20px;
}


/* テンプレート入力セクション */
.template-input-section {
    background: var(--dark-card);
    padding: 25px;
    border-radius: 10px;
    border-left: 4px solid var(--primary);
    margin-bottom: 30px;
    color: var(--text-light);
}

.template-input-section h2 {
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 1.2em;
}

.template-textarea {
    font-family: 'Courier New', monospace !important;
    line-height: 1.6;
    background: var(--dark-bg);
    color: var(--text-light);
    border: 1px solid var(--dark-border);
    padding: 15px;
    border-radius: 5px;
}

.template-textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.error {
    color: #dc2626;
    padding: 10px;
    background: #fee2e2;
    border-radius: 5px;
    border-left: 3px solid #dc2626;
}
