/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f4f5f7; color: #1a1a1a; line-height: 1.5; min-height: 100vh; }

/* === Login === */
.login-page { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.login-box { background: #fff; border-radius: 16px; padding: 48px 40px; text-align: center; max-width: 420px; width: 90%; box-shadow: 0 20px 60px rgba(0,0,0,.15); }
.login-logo { font-size: 28px; font-weight: 700; color: #1a1a1a; margin-bottom: 8px; }
.login-subtitle { color: #666; margin-bottom: 32px; font-size: 15px; }
.login-error { background: #fff0f0; color: #c0392b; padding: 12px; border-radius: 8px; margin-bottom: 20px; font-size: 14px; }
.google-btn { display: inline-flex; align-items: center; gap: 12px; background: #fff; border: 1px solid #dadce0; border-radius: 8px; padding: 12px 28px; font-size: 15px; font-weight: 500; color: #3c4043; text-decoration: none; transition: box-shadow .2s; cursor: pointer; }
.google-btn:hover { box-shadow: 0 2px 8px rgba(0,0,0,.12); }

/* === Topbar === */
.topbar { display: flex; align-items: center; justify-content: space-between; background: #fff; padding: 0 24px; height: 56px; border-bottom: 1px solid #e8e8e8; }
.topbar-brand { font-weight: 700; font-size: 18px; color: #1a1a1a; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-role { font-size: 12px; font-weight: 600; text-transform: uppercase; color: #666; background: #f0f0f0; padding: 3px 10px; border-radius: 12px; }
.topbar-role[data-role="admin"] { background: #e8f0fe; color: #1a73e8; }
.topbar-avatar { width: 32px; height: 32px; border-radius: 50%; }
.topbar-name { font-size: 14px; color: #333; }
.topbar-link { font-size: 14px; color: #1a73e8; text-decoration: none; }
.topbar-link:hover { text-decoration: underline; }

/* === Dashboard Layout === */
.dashboard { display: grid; grid-template-columns: 1fr 380px; gap: 20px; padding: 20px; max-width: 1440px; margin: 0 auto; }
@media (max-width: 900px) { .dashboard { grid-template-columns: 1fr; } }

/* === Panels === */
.panel { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.panel h2 { font-size: 18px; font-weight: 600; margin-bottom: 16px; }

/* === Charts === */
.charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.chart-box { background: #fafafa; border-radius: 8px; padding: 16px; height: 280px; position: relative; }
.chart-box canvas { width: 100% !important; height: 100% !important; }

/* === Table === */
.table-wrap { overflow-x: auto; }
#projects-table { width: 100%; border-collapse: collapse; font-size: 14px; }
#projects-table th, #projects-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #f0f0f0; }
#projects-table th { font-weight: 600; color: #555; background: #fafafa; white-space: nowrap; }
#projects-table tr:hover td { background: #f8f9ff; }

/* === Tabs === */
.tabs { display: flex; border-bottom: 1px solid #e8e8e8; margin-bottom: 16px; }
.tab { padding: 8px 16px; font-size: 14px; font-weight: 500; color: #888; background: none; border: none; cursor: pointer; border-bottom: 2px solid transparent; }
.tab.active { color: #1a73e8; border-bottom-color: #1a73e8; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* === Tasks === */
.task-item { padding: 10px 12px; border-radius: 8px; margin-bottom: 6px; background: #f8f9fa; font-size: 14px; display: flex; align-items: flex-start; gap: 8px; }
.task-item.done { opacity: .5; text-decoration: line-through; }
.task-check { width: 18px; height: 18px; border: 2px solid #ccc; border-radius: 4px; flex-shrink: 0; margin-top: 2px; }
.task-item.done .task-check { background: #1a73e8; border-color: #1a73e8; }
.task-text { flex: 1; }
.task-date { font-size: 11px; color: #999; }

/* === Calendar === */
.cal-event { padding: 10px 12px; border-radius: 8px; margin-bottom: 6px; background: #e8f0fe; font-size: 14px; border-left: 3px solid #1a73e8; }
.cal-event-time { font-size: 12px; color: #1a73e8; font-weight: 600; }
.cal-event-title { margin-top: 2px; }
.cal-event-link { font-size: 12px; color: #1a73e8; }

/* === Admin === */
.admin-container { max-width: 800px; margin: 24px auto; padding: 0 20px; }
.admin-container h1 { font-size: 24px; font-weight: 700; margin-bottom: 24px; }
.admin-section { background: #fff; border-radius: 12px; padding: 24px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.admin-section h2 { font-size: 18px; font-weight: 600; margin-bottom: 16px; }
.inline-form { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.inline-form input[type="email"], .inline-form select { padding: 8px 14px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; }
.inline-form input[type="email"] { flex: 1; min-width: 200px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #f0f0f0; }
.admin-table th { font-weight: 600; color: #555; }

/* === Buttons === */
.btn { padding: 8px 18px; border-radius: 8px; font-size: 14px; font-weight: 500; border: none; cursor: pointer; transition: all .15s; }
.btn-primary { background: #1a73e8; color: #fff; }
.btn-primary:hover { background: #1557b0; }
.btn-danger { background: #fff; color: #c0392b; border: 1px solid #f0d0d0; }
.btn-danger:hover { background: #fff5f5; }

/* === Forms === */
#config-form { display: flex; flex-direction: column; gap: 12px; }
#config-form label { font-size: 13px; font-weight: 600; color: #555; }
#config-form input[type="text"] { padding: 8px 14px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; }

/* === Toast === */
.toast { position: fixed; bottom: 24px; right: 24px; padding: 12px 20px; border-radius: 8px; font-size: 14px; z-index: 1000; transition: opacity .3s; }
.toast.success { background: #e6f4ea; color: #1e7e34; }
.toast.error { background: #fff0f0; color: #c0392b; }
.toast.hidden { opacity: 0; pointer-events: none; }

/* === Loading === */
.loading { text-align: center; padding: 40px; color: #999; font-size: 15px; }
