/* 車両監視管理システム 共通スタイル */

:root {
    --primary-color: #0066cc;
    --primary-dark: #004d99;
    --secondary-color: #4a90e2;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;

    --bg-primary: #f5f7fa;
    --bg-secondary: #ffffff;
    --bg-dark: #2c3e50;

    --text-primary: #333333;
    --text-secondary: #666666;
    --text-light: #999999;
    --text-white: #ffffff;

    --border-color: #dee2e6;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);

    --sidebar-width: 260px;
    --header-height: 64px;
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN',
                 'Noto Sans JP', Meiryo, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 14px;
}

/* レイアウト */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ヘッダー */
.header {
    height: var(--header-height);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--text-white);
    box-shadow: var(--shadow-md);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 24px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.logo-divider {
    width: 1px;
    height: 28px;
    background: rgba(255,255,255,0.3);
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
}

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

.header-time {
    font-size: 14px;
    font-weight: 500;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: white;
}

.user-info:hover {
    background: rgba(255,255,255,0.2);
    color: white;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-secondary);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* サイドバー */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    position: fixed;
    left: 0;
    top: var(--header-height);
    bottom: 0;
    overflow-y: auto;
    box-shadow: var(--shadow-sm);
    z-index: 999;
}

.nav-menu {
    list-style: none;
    padding: 16px 0;
}

.nav-item {
    margin: 4px 12px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-weight: 500;
}

.nav-link:hover {
    background: var(--bg-primary);
    color: var(--primary-color);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--text-white);
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* メインコンテンツ */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 24px;
    flex: 1;
    min-height: calc(100vh - var(--header-height));
}

/* ページタイトル */
.page-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
}

/* カード */
.card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 24px;
    transition: var(--transition);
    border: none;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--bg-primary);
    background: transparent;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.card-body {
    color: var(--text-secondary);
    padding: 0;
}

/* 統計グリッド */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

/* 統計カード */
.stat-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 12px;
    padding: 24px;
    color: white;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card.success {
    background: linear-gradient(135deg, var(--success-color) 0%, #5cb85c 100%);
}

.stat-card.warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #ffda6a 100%);
    color: var(--text-primary);
}

.stat-card.info {
    background: linear-gradient(135deg, var(--info-color) 0%, #5bc0de 100%);
}

.stat-card.danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #e57373 100%);
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-icon {
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    width: 28px;
    height: 28px;
}

.stat-content h3 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-content p {
    font-size: 14px;
    opacity: 0.9;
    margin: 0;
}

/* クイックアクション */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: var(--text-primary);
}

.action-btn:hover {
    border-color: var(--primary-color);
    background: #f8fafc;
    transform: translateY(-2px);
    color: var(--text-primary);
}

.action-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.action-icon svg {
    width: 24px;
    height: 24px;
}

.action-label {
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    line-height: 1.4;
}

/* アクティビティフィード */
.activity-feed {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid var(--bg-primary);
    transition: background 0.2s;
}

.activity-item:hover {
    background: var(--bg-primary);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon.success {
    background: #d4edda;
    color: var(--success-color);
}

.activity-icon.warning {
    background: #fff3cd;
    color: var(--warning-color);
}

.activity-icon.info {
    background: #d1ecf1;
    color: var(--info-color);
}

.activity-icon.danger {
    background: #f8d7da;
    color: var(--danger-color);
}

.activity-icon svg {
    width: 20px;
    height: 20px;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.activity-time {
    font-size: 12px;
    color: var(--text-light);
}

/* ボタン */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--text-white);
    border: none;
}

.btn-primary:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    color: var(--text-white);
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #5cb85c 100%);
    color: var(--text-white);
}

.btn-success:hover {
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #e57373 100%);
    color: var(--text-white);
}

.btn-danger:hover {
    box-shadow: var(--shadow-md);
}

.btn-outline-primary {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-group {
    display: inline-flex;
    gap: 0;
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: var(--border-radius) 0 0 var(--border-radius);
}

.btn-group .btn:last-child {
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.btn-group-sm .btn {
    padding: 4px 10px;
    font-size: 12px;
}

.btn-outline-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-outline-secondary:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.btn-outline-danger {
    background: transparent;
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
}

.btn-outline-danger:hover {
    background: var(--danger-color);
    color: white;
}

/* フォーム */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: var(--transition);
    font-family: inherit;
    background: var(--bg-secondary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.1);
}

.form-select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: var(--transition);
    font-family: inherit;
    background: var(--bg-secondary);
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.1);
}

/* テーブル */
.table-container {
    overflow-x: auto;
    border-radius: var(--border-radius);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
}

.table thead {
    background: var(--bg-primary);
}

.table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--bg-primary);
    color: var(--text-secondary);
    vertical-align: middle;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background: var(--bg-primary);
}

/* バッジ */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.badge-success, .bg-success {
    background: var(--success-color) !important;
    color: var(--text-white);
}

.badge-warning, .bg-warning {
    background: var(--warning-color) !important;
    color: var(--text-primary);
}

.badge-danger, .bg-danger {
    background: var(--danger-color) !important;
    color: var(--text-white);
}

.badge-info, .bg-info {
    background: var(--info-color) !important;
    color: var(--text-white);
}

.badge-secondary, .bg-secondary {
    background: var(--text-light) !important;
    color: var(--text-white);
}

/* アラート */
.alert {
    padding: 16px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* グリッド */
.grid {
    display: grid;
    gap: 24px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* チャートプレースホルダー */
.chart-placeholder {
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}

/* ステータスオーバービュー */
.status-overview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.status-item {
    padding: 16px;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    text-align: center;
}

.status-value {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.status-label {
    font-size: 13px;
    color: var(--text-secondary);
}

/* チャートグリッド */
.chart-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

/* モーダル */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: transparent;
}

/* ページネーション */
.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 24px;
}

.pagination .page-link {
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
    background: var(--bg-secondary);
}

.pagination .page-link:hover {
    background: var(--bg-primary);
    border-color: var(--primary-color);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-color: var(--primary-color);
}

.pagination .page-item.disabled .page-link {
    color: var(--text-light);
    pointer-events: none;
}

/* ユーティリティ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-light); }
.text-primary { color: var(--primary-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-danger { color: var(--danger-color) !important; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.me-2 { margin-right: 8px; }
.ms-2 { margin-left: 8px; }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }

/* レスポンシブ */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }

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

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: var(--transition);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .stats-grid,
    .quick-actions,
    .grid-4,
    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .status-overview {
        grid-template-columns: 1fr;
    }

    .header {
        padding: 0 16px;
    }

    .logo-text {
        display: none;
    }
}

/* ログインページ専用スタイル */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0066cc 0%, #004d99 100%);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.login-box {
    background: var(--bg-secondary);
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 440px;
    padding: 48px;
    position: relative;
    z-index: 1;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: var(--shadow-md);
}

.login-logo svg {
    width: 48px;
    height: 48px;
    color: white;
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.login-form .input-group {
    position: relative;
    margin-bottom: 20px;
}

.login-form .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    width: 20px;
    height: 20px;
}

.login-form .form-control {
    padding-left: 44px;
}

.remember-forgot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    font-size: 14px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.forgot-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.forgot-link:hover {
    text-decoration: underline;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.4);
}

.system-info {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.system-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 16px;
}

.system-stats .stat-item {
    text-align: center;
    background: transparent;
    padding: 0;
}

.system-stats .stat-number {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.system-stats .stat-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.login-footer {
    margin-top: 32px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

/* カメラグリッド */
.camera-grid {
    display: grid;
    gap: 16px;
}

.camera-grid.grid-2x2 {
    grid-template-columns: repeat(2, 1fr);
}

.camera-grid.grid-3x3 {
    grid-template-columns: repeat(3, 1fr);
}

.camera-grid.grid-4x4 {
    grid-template-columns: repeat(4, 1fr);
}

.camera-cell {
    background: #1a1a2e;
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
    aspect-ratio: 16/9;
}

.camera-cell video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
}

.camera-name {
    font-weight: 600;
    font-size: 14px;
}

.camera-status {
    font-size: 12px;
    opacity: 0.8;
}

/* レイアウトセレクター */
.layout-selector {
    display: flex;
    gap: 8px;
}

.layout-btn {
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 13px;
    font-weight: 500;
}

.layout-btn:hover {
    border-color: var(--primary-color);
}

.layout-btn.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-color: var(--primary-color);
}

/* 検索バー */
.search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.search-input {
    flex: 1;
    position: relative;
}

.search-input input {
    width: 100%;
    padding: 12px 14px 12px 44px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: var(--transition);
}

.search-input input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.1);
    outline: none;
}

.search-input svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-light);
}

/* フィルター */
.filter-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-select {
    min-width: 150px;
}

/* 組織ツリー */
.org-tree {
    padding: 1rem;
}

.org-node {
    margin-left: 0;
}

.org-node .org-node {
    margin-left: 2rem;
    border-left: 2px solid var(--border-color);
    padding-left: 0.5rem;
}

.org-node-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    transition: background 0.2s;
}

.org-node-header:hover {
    background: var(--bg-primary);
}

.org-node-toggle {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.org-node-toggle:hover {
    background: var(--border-color);
}

.org-node-toggle i {
    transition: transform 0.2s;
}

.org-node.collapsed > .org-node-header .org-node-toggle i {
    transform: rotate(-90deg);
}

.org-node.collapsed > .org-node-children {
    display: none;
}

.org-node-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.org-node-name {
    font-weight: 600;
    font-size: 1rem;
}

.org-node-meta {
    margin-top: 0.25rem;
}

.org-node-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.org-node-header:hover .org-node-actions {
    opacity: 1;
}

/* 権限マトリックス */
.permission-matrix th,
.permission-matrix td {
    padding: 0.5rem;
    vertical-align: middle;
}

.permission-matrix thead th {
    font-size: 0.75rem;
    white-space: nowrap;
}

.perm-header {
    font-weight: 500;
    font-size: 0.7rem !important;
    padding: 0.25rem 0.5rem !important;
}

.perm-cell {
    padding: 0.25rem !important;
}

.perm-icon {
    font-size: 1rem;
}

.perm-yes {
    color: var(--success-color);
}

.perm-no {
    color: var(--text-light);
}

/* アウトラインバッジ */
.badge.bg-outline-secondary {
    background: transparent !important;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

/* 階層表示用インデント */
.hierarchy-indent-1 { padding-left: 0; }
.hierarchy-indent-2 { padding-left: 1.5rem; }
.hierarchy-indent-3 { padding-left: 3rem; }

/* optgroup スタイル改善 */
select optgroup {
    font-weight: 600;
    color: var(--text-primary);
}

select option {
    font-weight: normal;
    padding-left: 1rem;
}
