/* ── Conto Hub - Troute Hub統一デザイン ── */

:root {
    --primary: #1a1a2e;
    --accent: #06c755;
    --accent-light: #e6f9ee;
    --blue: #1d9bf0;
    --blue-light: #e8f4fd;
    --warning: #f59e0b;
    --warning-light: #fff8e1;
    --danger: #e53e3e;
    --purple: #7c3aed;
    --purple-light: #f3e8ff;
    --bg: #f0f2f5;
    --card: #ffffff;
    --text: #333;
    --text-muted: #666;
    --border: #e0e0e0;
}

/* ── Reset ── */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: var(--blue); text-decoration: none; }
a:hover { opacity: 0.85; }

/* ── Sidebar ── */
.sidebar {
    position: fixed; top: 0; left: 0; width: 220px; height: 100vh;
    background: var(--primary); color: #fff; display: flex; flex-direction: column;
    z-index: 100;
}
.sidebar-brand {
    padding: 20px 16px; font-size: 1.2rem; font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex; align-items: center; gap: 8px;
}
.sidebar-brand .icon { font-size: 1.4rem; }
.sidebar-nav { flex: 1; padding: 12px 0; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; color: rgba(255,255,255,0.6);
    font-size: 0.9rem; border-left: 3px solid transparent;
    transition: all .15s;
}
.sidebar-nav a:hover { color: #fff; background: rgba(255,255,255,0.05); }
.sidebar-nav a.active {
    color: #fff; background: rgba(6,199,85,0.1);
    border-left-color: var(--accent);
}
.sidebar-nav a .nav-icon { font-size: 1.1rem; width: 20px; text-align: center; }
.sidebar-footer {
    padding: 16px; border-top: 1px solid rgba(255,255,255,0.1);
}
.sidebar-footer a {
    color: rgba(255,255,255,0.5); font-size: 0.85rem;
    display: flex; align-items: center; gap: 8px;
}
.sidebar-footer a:hover { color: #fff; }

/* ── Main Content ── */
.main { margin-left: 220px; padding: 24px; min-height: 100vh; }
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 1.6rem; color: var(--primary); margin-bottom: 4px; }
.page-header .subtitle { font-size: 0.9rem; color: var(--text-muted); }

/* ── Login (no sidebar) ── */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); }
.login-container { width: 100%; max-width: 400px; padding: 2rem; text-align: center; }
.login-container h1 { font-size: 2rem; color: var(--primary); margin-bottom: 0.3rem; }
.login-container .subtitle { color: var(--text-muted); margin-bottom: 2rem; }

/* ── Cards ── */
.card {
    background: var(--card); border-radius: 8px; padding: 20px;
    margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.card h3 { font-size: 1.05rem; color: var(--text); margin-bottom: 12px; }

/* ── Stats Grid ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: var(--card); border-radius: 8px; padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    display: flex; align-items: center; gap: 16px;
}
.stat-icon {
    width: 44px; height: 44px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
}
.stat-icon.green { background: var(--accent-light); }
.stat-icon.blue { background: var(--blue-light); }
.stat-icon.yellow { background: var(--warning-light); }
.stat-icon.purple { background: var(--purple-light); }
.stat-info { flex: 1; }
.stat-number { font-size: 1.8rem; font-weight: 700; color: var(--primary); line-height: 1; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 4px; font-weight: 500; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 6px;
    font-size: 0.9rem; transition: border-color 0.2s; background: #fff;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    border-color: var(--accent); outline: none;
}
.form-group input[type="file"] { padding: 8px; }
.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

/* ── Buttons ── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 20px; border: none; border-radius: 6px;
    font-size: 0.9rem; font-weight: 500; cursor: pointer;
    text-decoration: none; transition: all .15s;
}
.btn.primary { background: var(--primary); color: #fff; }
.btn.accent { background: var(--accent); color: #fff; }
.btn.secondary { background: var(--border); color: var(--text); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn:hover { opacity: 0.85; }
.btn.sm { padding: 6px 12px; font-size: 0.8rem; }

/* ── Alerts ── */
.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 0.9rem; }
.alert.error { background: #fde8e8; color: var(--danger); border: 1px solid #fcc; }
.alert.success { background: var(--accent-light); color: #1b7a3d; border: 1px solid #b7e4c7; }
.alert.warning { background: var(--warning-light); color: #92400e; border: 1px solid #fde68a; }

/* ── Tables ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th {
    text-align: left; padding: 10px 12px; border-bottom: 2px solid var(--border);
    color: var(--text-muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase;
}
.data-table td { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; }
.data-table tr:hover { background: #fafafa; }

/* ── Badges ── */
.badge {
    display: inline-block; padding: 3px 8px; border-radius: 4px;
    font-size: 0.75rem; font-weight: 500;
}
.badge.schedule { background: var(--blue-light); color: #1565c0; }
.badge.invoice { background: #fff3e0; color: #e65100; }
.badge.estimate { background: var(--purple-light); color: var(--purple); }
.badge.reminder { background: var(--accent-light); color: #2e7d32; }
.badge.calendar { background: #e0f7fa; color: #00695c; }
.badge.free { background: var(--border); color: var(--text-muted); }
.badge.pro { background: var(--accent-light); color: #06c755; }

/* ── Event List ── */
.event-list { list-style: none; }
.event-list li {
    padding: 10px 0; border-bottom: 1px solid #f0f0f0;
    display: flex; align-items: center; gap: 12px;
}
.event-date { font-size: 0.85rem; color: var(--text-muted); min-width: 110px; font-weight: 500; }
.event-title { font-weight: 500; }
.empty { color: var(--text-muted); font-size: 0.9rem; padding: 16px 0; }

/* ── Upload Area ── */
.upload-area {
    border: 2px dashed var(--border); border-radius: 8px; padding: 24px;
    text-align: center; color: var(--text-muted); transition: border-color .2s;
}
.upload-area:hover { border-color: var(--accent); }
.upload-preview { margin-top: 12px; }
.upload-preview img { max-width: 120px; max-height: 120px; border-radius: 4px; }

/* ── Template Selection Grid ── */
.template-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 8px;
}
.template-option input[type="radio"] { display: none; }
.template-card {
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.template-option input:checked + .template-card {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}
.template-card:hover { border-color: var(--accent); }
.template-card strong { display: block; margin-top: 8px; font-size: 0.9rem; }
.template-card .form-hint { font-size: 0.78rem; margin-top: 4px; }
.template-preview {
    height: 80px;
    border-radius: 4px;
    border: 1px solid var(--border);
}
.simple-preview {
    background: linear-gradient(180deg, #fff 0%, #fff 20%, #f5f5f5 20%, #f5f5f5 25%, #fff 25%, #fff 70%, #e0e0e0 70%, #e0e0e0 71%, #fff 71%);
}
.pro-preview {
    background: linear-gradient(180deg, #263759 0%, #263759 18%, #fff 18%, #fff 22%, #dae3f0 22%, #dae3f0 25%, #fff 25%, #fff 70%, #263759 70%, #263759 72%, #fff 72%);
}
.modern-preview {
    background: linear-gradient(180deg, #268080 0%, #268080 4%, #fff 4%, #fff 22%, #268080 22%, #268080 25%, #e0f4f3 25%, #e0f4f3 30%, #fff 30%, #fff 70%, #268080 70%, #268080 72%, #fff 72%);
}

@media (max-width: 768px) {
    .template-grid { grid-template-columns: 1fr; }
}

/* ── Two Column Layout ── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── Mobile Bottom Tabs ── */
.bottom-tabs {
    display: none; position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--primary); height: 56px; z-index: 100;
    justify-content: space-around; align-items: center;
}
.bottom-tabs a {
    color: rgba(255,255,255,0.5); font-size: 0.7rem; text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.bottom-tabs a .tab-icon { font-size: 1.2rem; }
.bottom-tabs a.active { color: var(--accent); }

/* ── Responsive ── */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main { margin-left: 0; padding: 16px; padding-bottom: 72px; }
    .bottom-tabs { display: flex; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .two-col { grid-template-columns: 1fr; }
    .page-header h1 { font-size: 1.3rem; }
}
