/* Reset & Base */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: Arial, sans-serif; background: #f0f4f8; color: #1e293b; }
a { text-decoration: none; color: inherit; }
select, input, textarea, button { font-family: inherit; }
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

/* Utilities */
.hidden { display: none !important; }
.ml-auto { margin-left: auto; }
.mt-sm { margin-top: 10px; padding-top: 10px; border-top: 1px solid #f1f5f9; }

/* Login */
.login-page { min-height: 100vh; background: linear-gradient(135deg, rgba(26,26,46,0.25), rgba(22,33,62,0.25)); backdrop-filter: blur(2px); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; }
.login-brand { margin-bottom: 32px; text-align: center; }
.login-brand .brand-title { font-size: 36px; font-weight: 900; color: #fff; letter-spacing: 3px; }
.login-brand .brand-sub { color: #000; font-size: 11px; letter-spacing: 5px; margin-top: 6px; }
.login-card { background: #fff; border-radius: 20px; padding: 36px; width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.login-heading { font-size: 18px; font-weight: 800; color: #1e293b; margin-bottom: 6px; }
.login-sub { font-size: 13px; color: #94a3b8; margin-bottom: 28px; }
.login-footer { color: rgba(0,0,0,0.3); font-size: 11px; margin-top: 32px; }

/* Header */
.site-header { background: rgba(253,186,116,0.45); padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 2px 12px rgba(0,0,0,.15); }
.header-brand { cursor: pointer; }
.brand-title { font-size: 22px; font-weight: 900; color: #1e293b; letter-spacing: 2px; }
.brand-accent { color: #e91e8c; }
.header-back { font-size: 11px; color: #c2185b; margin-top: 2px; }
.header-right { display: flex; align-items: center; gap: 12px; }
.year-badge { background: linear-gradient(135deg,#1e293b,#334155); color: #fff; font-weight: 800; font-size: 14px; padding: 6px 16px; border-radius: 20px; letter-spacing: 1px; }
.client-badge { color: #1e293b; font-weight: 700; font-size: 14px; background: rgba(255,255,255,0.5); padding: 6px 16px; border-radius: 20px; }
.user-label { font-size: 12px; color: #1e293b; font-weight: 600; }
.btn-signout { background: rgba(0,0,0,0.1); border: none; border-radius: 8px; padding: 5px 12px; font-size: 12px; font-weight: 600; cursor: pointer; color: #1e293b; }
.btn-signout:hover { background: rgba(0,0,0,0.2); }

/* Year bar */
.year-bar { background: #fff; border-bottom: 1px solid #e2e8f0; padding: 10px 24px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.year-bar-label { font-size: 12px; font-weight: 700; color: #64748b; margin-right: 4px; }
.btn-year { padding: 6px 18px; border-radius: 20px; border: 2px solid #e2e8f0; cursor: pointer; font-weight: 800; font-size: 13px; background: #fff; color: #64748b; transition: all 0.15s; display: inline-block; }
.btn-year.active { border-color: #e91e8c; background: linear-gradient(135deg,#e91e8c,#c2185b); color: #fff; }
.btn-year-add { padding: 6px 14px; border-radius: 20px; border: 2px dashed #cbd5e1; cursor: pointer; font-weight: 700; font-size: 13px; background: #fff; color: #94a3b8; }
.add-year-form { display: flex; gap: 6px; align-items: center; }

/* Buttons */
.btn-primary { background: linear-gradient(135deg,#e91e8c,#c2185b); color: #fff; border: none; border-radius: 10px; padding: 10px 20px; font-weight: 700; font-size: 14px; cursor: pointer; }
.btn-primary:hover { opacity: 0.9; }
.btn-primary-sm { background: linear-gradient(135deg,#e91e8c,#c2185b); color: #fff; border: none; border-radius: 8px; padding: 5px 14px; font-weight: 700; font-size: 12px; cursor: pointer; }
.btn-secondary { background: #fff; color: #64748b; border: 2px solid #e2e8f0; border-radius: 10px; padding: 10px 16px; font-weight: 700; font-size: 13px; cursor: pointer; display: inline-block; }
.btn-secondary-sm { background: #f1f5f9; color: #64748b; border: none; border-radius: 8px; padding: 5px 12px; font-weight: 600; font-size: 12px; cursor: pointer; }
.btn-outline { background: transparent; color: #e91e8c; border: 2px solid #e91e8c; border-radius: 20px; padding: 7px 18px; font-weight: 700; font-size: 12px; cursor: pointer; display: inline-block; }
.btn-outline:hover { background: #e91e8c; color: #fff; }
.btn-full { width: 100%; }
.btn-filter { padding: 6px 18px; border-radius: 20px; border: 2px solid #e2e8f0; cursor: pointer; font-weight: 700; font-size: 12px; background: #fff; color: #64748b; display: inline-block; }
.btn-filter.active { background: #1e293b; border-color: #1e293b; color: #fff; }

/* Forms */
.form-group { margin-bottom: 16px; }
.field-label { font-size: 12px; font-weight: 700; color: #64748b; display: block; margin-bottom: 6px; }
.field-input { width: 100%; border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 14px; font-size: 14px; background: #f8fafc; box-sizing: border-box; }
.field-input:focus { outline: 2px solid #e91e8c; border-color: #e91e8c; }
.field-input-sm { width: 90px; border: 1px solid #e2e8f0; border-radius: 8px; padding: 5px 10px; font-size: 13px; font-weight: 600; }
.field-textarea { width: 100%; border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px 12px; font-size: 13px; resize: vertical; background: #f8fafc; min-height: 100px; }
.alert-error { color: #ef4444; font-size: 12px; font-weight: 600; margin-bottom: 12px; padding: 8px 12px; background: #fee2e2; border-radius: 8px; }
.alert-success { color: #16a34a; font-size: 12px; font-weight: 600; margin-bottom: 12px; padding: 8px 12px; background: #dcfce7; border-radius: 8px; }

/* Main layout */
.main-content { padding: 24px; max-width: 1200px; margin: 0 auto; }

/* Profile page */
.profile-page { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.profile-card { background: #fff; border-radius: 16px; padding: 32px; flex: 1; min-width: 300px; max-width: 480px; box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.profile-heading { font-size: 20px; font-weight: 900; color: #1e293b; margin-bottom: 4px; }
.profile-sub { font-size: 13px; color: #64748b; margin-bottom: 24px; }
.profile-section-title { font-size: 11px; font-weight: 700; color: #94a3b8; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 16px; }
.btn-profile-link { background: none; border: none; padding: 5px 10px; font-size: 12px; font-weight: 600; color: #64748b; cursor: pointer; border-radius: 8px; }
.btn-profile-link:hover { background: rgba(0,0,0,0.07); }

/* Stats */
.stats-bar { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.stat-card { background: #fff; border-radius: 12px; padding: 10px 16px; flex: 1; min-width: 80px; box-shadow: 0 2px 6px rgba(0,0,0,.06); text-align: center; }
.stat-num { font-size: 22px; font-weight: 900; }
.stat-label { font-size: 10px; color: #64748b; margin-top: 2px; }

/* Filters */
.filter-bar { display: flex; gap: 12px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.search-input { flex: 1; min-width: 200px; border-radius: 10px; }
.type-filters { display: flex; gap: 8px; }
.filter-right { display: flex; gap: 10px; margin-left: auto; }

/* Date filter panel */
.date-filter-panel { background: #fff; border-radius: 12px; padding: 14px 20px; margin-bottom: 16px; box-shadow: 0 2px 8px rgba(0,0,0,.06); display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.date-filter-mode { display: flex; gap: 6px; }
.date-filter-range { display: flex; gap: 10px; align-items: center; }
.date-filter-range label { font-size: 12px; font-weight: 600; color: #64748b; }
.date-filter-range .field-input { width: auto; }

/* Add panel */
.add-panel { background: #fff; border-radius: 14px; padding: 20px; margin-bottom: 16px; box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.add-panel-row { display: flex; gap: 10px; align-items: center; }

/* Client grid */
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.client-card { background: #fff; border-radius: 14px; padding: 18px; box-shadow: 0 2px 8px rgba(0,0,0,.06); border: 2px solid #93c5fd; position: relative; }
.client-card--jr { border-color: #fcd34d; }
.client-name { font-weight: 700; font-size: 13px; color: #1e293b; display: block; margin-bottom: 6px; padding-right: 70px; line-height: 1.4; }
.client-name:hover { color: #e91e8c; }
.client-meta { font-size: 11px; color: #64748b; margin-top: 4px; }
.due-soon { font-weight: 700; color: #b45309; }
.client-type-badge { display: inline-block; font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 99px; margin-bottom: 6px; }
.badge--fsp { background: #dbeafe; color: #1e40af; }
.badge--jr { background: #fef3c7; color: #92400e; }
.jr-label { font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: 99px; margin-right: 4px; }
.btn-archive { position: absolute; top: 10px; right: 10px; background: #fee2e2; border: none; border-radius: 6px; padding: 3px 8px; cursor: pointer; font-size: 11px; font-weight: 700; color: #991b1b; }
.btn-archive:hover { background: #fecaca; }

/* Score bar */
.score-bar-wrap { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.score-bar { flex: 1; background: #f1f5f9; border-radius: 99px; height: 8px; overflow: hidden; }
.score-bar-fill { height: 100%; background: linear-gradient(90deg, #ef4444, #f97316, #eab308, #22c55e); }
.score-pct { font-weight: 800; font-size: 14px; min-width: 38px; text-align: right; }

/* Score widget */
#score-widget { text-align: center; }
.score-large { font-size: 56px; font-weight: 900; line-height: 1; }
.score-sub { font-size: 12px; color: #94a3b8; margin-top: 4px; margin-bottom: 16px; }
.score-box { border-radius: 12px; border: 2px solid; padding: 12px; text-align: center; margin-bottom: 12px; }
.score-box-pct { font-size: 28px; font-weight: 800; }
.score-box-label { font-size: 10px; color: #64748b; }
.answered-count { background: #f8fafc; border-radius: 10px; padding: 10px 14px; font-size: 12px; color: #64748b; text-align: center; }

/* Tab bar */
.tab-bar { background: #fff; border-bottom: 1px solid #f1f5f9; padding: 0 24px; display: flex; align-items: center; gap: 8px; }
.tab { padding: 12px 20px; border: none; border-bottom: 3px solid transparent; background: none; font-weight: 700; font-size: 13px; cursor: pointer; color: #94a3b8; display: inline-block; }
.tab.active { border-bottom-color: #e91e8c; color: #e91e8c; }
.tab-action { margin-left: auto; margin: 8px 0 8px auto; }

/* Dashboard grid */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.card { background: #fff; border-radius: 16px; padding: 24px; box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.card-heading { background: linear-gradient(135deg,#e91e8c,#c2185b); color: #fff; border-radius: 8px; padding: 4px 12px; font-size: 11px; font-weight: 700; display: inline-block; margin-bottom: 20px; }
.detail-row { display: flex; align-items: center; margin-bottom: 12px; gap: 8px; }
.detail-label { background: linear-gradient(135deg,#e91e8c,#c2185b); color: #fff; padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 700; min-width: 100px; text-align: center; flex-shrink: 0; }
.detail-row .field-input { border-radius: 6px; font-size: 13px; padding: 6px 10px; }
.due-soon-field { border: 2px solid #eab308 !important; background: #fefce8 !important; color: #b45309 !important; font-weight: 700; }
.due-ok-field { background: #f0fdf4 !important; color: #166534 !important; font-weight: 700; }

/* Checklist filter */
.filter-card { background: #fff; padding: 14px 20px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.06); margin-bottom: 20px; }
.filter-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-label { font-size: 12px; color: #64748b; font-weight: 700; min-width: 90px; }
.score-summary { font-size: 12px; }
.btn-chip { padding: 5px 13px; border-radius: 20px; border: none; cursor: pointer; font-size: 12px; font-weight: 600; background: #f1f5f9; color: #64748b; }
.btn-chip.active { background: linear-gradient(135deg,#e91e8c,#c2185b); color: #fff; }

/* Section cards */
.section-card { background: #fff; border-radius: 14px; margin-bottom: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.06); overflow: hidden; }
.section-header { display: flex; align-items: center; gap: 12px; padding: 14px 20px; cursor: pointer; background: #f8fafc; }
.section-header--open { background: linear-gradient(135deg,#1a1a2e,#16213e); }
.section-header--open .section-subject { color: #fff; }
.section-header--open .section-progress { color: #94a3b8; }
.section-header--open .section-toggle { color: #e91e8c; }
.section-num { background: linear-gradient(135deg,#e91e8c,#c2185b); color: #fff; border-radius: 8px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; flex-shrink: 0; }
.section-subject { flex: 1; font-weight: 700; font-size: 14px; }
.section-progress { font-size: 12px; color: #64748b; }
.section-toggle { color: #94a3b8; }
.section-body { }
.section-body.hidden { display: none; }

/* Checklist rows */
.checklist-header { display: grid; grid-template-columns: 1fr 140px 180px 200px; background: #f1f5f9; padding: 8px 16px; gap: 8px; font-size: 12px; font-weight: 600; color: #64748b; }
.checklist-row { display: grid; grid-template-columns: 1fr 140px 180px 200px; padding: 10px 16px; gap: 8px; align-items: start; border-top: 1px solid #f1f5f9; }
.checklist-row:nth-child(odd) { background: #fff; }
.checklist-row:nth-child(even) { background: #fafafa; }
.req-text { font-size: 13px; color: #374151; line-height: 1.5; padding-top: 4px; }
.req-autofill { font-size: 12px; color: #94a3b8; font-style: italic; padding-top: 6px; }
.sel-answer, .sel-action { width: 100%; border: 1px solid #e2e8f0; border-radius: 6px; padding: 5px 8px; font-size: 12px; cursor: pointer; font-weight: 600; }
.notes-input { width: 100%; border: 1px solid #e2e8f0; border-radius: 6px; padding: 6px 10px; font-size: 12px; background: #fffbf0; resize: none; min-height: 34px; line-height: 1.6; color: #374151; overflow: hidden; }
.notes-input:focus { outline: 1px solid #e91e8c; }

/* Empty state */
.empty-state { grid-column: 1 / -1; text-align: center; color: #94a3b8; padding: 40px; font-size: 14px; }
