/* =====================================================
   まちボード 管理画面 CSS
   ===================================================== */

:root {
    --primary: #2196F3;
    --primary-dark: #1976D2;
    --primary-light: #BBDEFB;
    --danger: #f44336;
    --success: #4CAF50;
    --warning: #FF9800;
    --info: #03A9F4;
    --text-dark: #212121;
    --text-body: #333333;
    --text-light: #757575;
    --bg-main: #f5f5f5;
    --bg-card: #ffffff;
    --border: #e0e0e0;
    --sidebar-width: 240px;
}

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

body {
    font-family: 'Hiragino Kaku Gothic ProN', 'ヒラギノ角ゴ ProN', Meiryo, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-body);
    background: var(--bg-main);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: #263238;
    color: #eceff1;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s;
}

.sidebar-header {
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.sidebar-header h2 {
    font-size: 18px;
    margin-bottom: 4px;
}

.sidebar-header small {
    color: #90a4ae;
    font-size: 12px;
}

.sidebar-nav { padding: 8px 0; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: #cfd8dc;
    font-size: 14px;
    gap: 10px;
    transition: background 0.2s;
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
    text-decoration: none;
}

.sidebar-nav a.active {
    background: var(--primary);
    color: #fff;
}

.sidebar-nav .nav-icon { font-size: 18px; width: 24px; text-align: center; }
.sidebar-nav .nav-divider { border-top: 1px solid rgba(255,255,255,0.1); margin: 8px 0; }

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* Topbar */
.topbar {
    background: var(--bg-card);
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
}

.topbar-actions { display: flex; gap: 8px; }

/* Content Area */
.content { padding: 24px; }

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border);
    padding: 20px;
    margin-bottom: 20px;
}

.card-header {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

/* Stat Cards */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border);
    padding: 20px;
    text-align: center;
}

.stat-card .stat-icon { font-size: 32px; margin-bottom: 8px; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; color: var(--text-dark); }
.stat-card .stat-label { font-size: 13px; color: var(--text-light); margin-top: 4px; }

/* Tables */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.admin-table th {
    background: #f5f5f5;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.btn:hover { opacity: 0.85; text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-body); }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

textarea.form-control { min-height: 120px; resize: vertical; }

select.form-control {
    appearance: auto;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
}

.badge-primary { background: var(--primary-light); color: var(--primary-dark); }
.badge-success { background: #e8f5e9; color: #2e7d32; }
.badge-danger { background: #ffebee; color: #c62828; }
.badge-warning { background: #fff3e0; color: #e65100; }
.badge-info { background: #e1f5fe; color: #0277bd; }

/* Category badges */
.cat-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}

/* Flash Messages */
.flash {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.flash-error { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }
.flash-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.flash-info { background: #e1f5fe; color: #0277bd; border: 1px solid #81d4fa; }

/* Login Page */
.login-container {
    max-width: 400px;
    margin: 80px auto;
    padding: 0 20px;
}

.login-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 40px 32px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    text-align: center;
}

.login-card h1 {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.login-card .subtitle {
    color: var(--text-light);
    margin-bottom: 24px;
}

.login-card .form-group { text-align: left; }
.login-card .btn { width: 100%; justify-content: center; padding: 12px; font-size: 16px; }

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

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

/* Hamburger (mobile) */
.hamburger {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1100;
    background: #263238;
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 20px;
    cursor: pointer;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 15px; }

/* Responsive */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .hamburger { display: block; }
    .topbar { padding-left: 56px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .content { padding: 16px; }
}
