@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0&display=swap');

:root {
  --c-primary: #757fef;
  --c-primary-grad: #9a7ff5;
  --c-indigo-alt: #5b6ee0;
  --c-brand: #00bebe;
  --c-brand-bg: #e0faf9;
  --c-success: #00b69b;
  --c-success-bg: #e6faf6;
  --c-warning: #ffa53b;
  --c-warning-text: #f08c1e;
  --c-warning-bg: #fff4e6;
  --c-danger: #e74a68;
  --c-danger-bg: #fdecef;
  --c-ink: #260944;
  --c-dark-grad-end: #3d1a63;
  --c-text-muted: #5b5b98;
  --c-text-faint: #9b9bb8;
  --c-placeholder: #b3b3c9;
  --c-canvas: #f5f5f7;
  --c-card: #fff;
  --c-track: #f0f0f6;
  --c-hover-row: #faf9ff;
  --c-border: #ececf3;
  --c-border-2: #f2f2f7;
  --radius-card: 15px;
  --radius-pill: 30px;
  --radius-icon: 12.5px;
  --radius-bar: 5.5px;
  --radius-chip: 7px;
  --radius-status: 20px;
  --shadow-card: rgba(0, 0, 0, .05) 0px 6px 24px 0px;
  --shadow-nav-active: 0 6px 16px -6px rgba(117, 127, 239, .7);
  --sp-card: 22px;
  --sp-grid-gap: 22px;
  --font-body: 'Open Sans', sans-serif;
  --font-head: 'Raleway', sans-serif;
}

* , *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: var(--font-body); color: var(--c-ink); font-size: 14px; background: var(--c-canvas); }
a { color: inherit; }
.msi { font-family: 'Material Symbols Outlined'; font-weight: normal; font-style: normal; line-height: 1; letter-spacing: normal; text-transform: none; display: inline-block; white-space: nowrap; word-wrap: normal; direction: ltr; -webkit-font-feature-settings: 'liga'; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--font-head); margin: 0; }

/* ---------- Top date/day/time strip ---------- */
.topbar-datetime { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 7px 20px; background: linear-gradient(150deg, var(--c-ink), var(--c-dark-grad-end)); color: #fff; font-size: 12px; font-weight: 600; letter-spacing: .2px; }
.topbar-datetime .msi { font-size: 15px; opacity: .85; }

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 250px; flex: 0 0 250px; background: #fff; border-right: 1px solid var(--c-border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow: auto; }
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 22px 24px 20px; text-decoration: none; }
.sidebar-logo { width: 38px; height: 38px; border-radius: 10px; flex: 0 0 auto; object-fit: cover; display: block; }
.sidebar-name { font-family: var(--font-head); font-weight: 800; font-size: 19px; letter-spacing: .5px; line-height: 1; color: var(--c-ink); }
.sidebar-tagline { font-size: 9.5px; color: var(--c-text-faint); letter-spacing: .5px; text-transform: uppercase; margin-top: 3px; }
.nav-section-label { padding: 6px 16px 4px; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--c-placeholder); font-weight: 600; margin-top: 8px; }
.nav-list { display: flex; flex-direction: column; gap: 2px; padding: 2px 14px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 9px; cursor: pointer; text-decoration: none; font-weight: 500; color: var(--c-text-muted); transition: .2s; }
.nav-item:hover { background: transparent; color: var(--c-brand); }
.nav-item.active { background: var(--c-primary); color: #fff; font-weight: 600; box-shadow: var(--shadow-nav-active); }
.nav-item.active:hover { background: var(--c-primary); color: #fff; }
.nav-item .msi { font-size: 20px; }
.nav-badge { margin-left: auto; background: #eeeefb; color: var(--c-primary); font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 20px; }
.nav-item.active .nav-badge { background: rgba(255,255,255,.25); color: #fff; }
.sidebar-footer { margin-top: auto; padding: 16px; }
.sidebar-footer-card { background: linear-gradient(150deg, var(--c-primary), var(--c-primary-grad)); border-radius: 14px; padding: 18px; color: #fff; }
.sidebar-footer-card .msi { font-size: 24px; }
.sidebar-footer-title { font-family: var(--font-head); font-weight: 700; font-size: 15px; margin-top: 8px; }
.sidebar-footer-sub { font-size: 12px; opacity: .85; margin-top: 4px; line-height: 1.5; }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-header { display: flex; align-items: center; gap: 18px; padding: 18px 30px; background: #fff; border-bottom: 1px solid var(--c-border); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.header-title { font-family: var(--font-head); font-weight: 800; font-size: 20px; line-height: 1.1; }
.header-crumb { font-size: 12px; color: var(--c-text-faint); margin-top: 3px; }
.header-crumb .sep { color: var(--c-primary); }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: none; background: var(--c-canvas); color: var(--c-text-muted); cursor: pointer; position: relative; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; list-style: none; transition: background .15s, color .15s; }
.icon-btn::-webkit-details-marker { display: none; }
.icon-btn::marker { content: ''; }
.icon-btn:hover { background: var(--c-track); }
.notif-dot { position: absolute; top: 7px; right: 9px; width: 9px; height: 9px; background: var(--c-danger); border-radius: 50%; border: 2px solid #fff; }

.notif-dropdown { position: relative; margin-left: auto; }
.notif-dropdown[open] > summary.icon-btn { background: var(--c-primary); color: #fff; }
.notif-panel {
  position: absolute; top: 54px; right: 0; width: 340px; max-height: 460px; overflow-y: auto;
  background: #fff; border-radius: 16px; box-shadow: rgba(38,9,68,.18) 0 20px 48px 0;
  border: 1px solid var(--c-border); z-index: 30;
}
.notif-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--c-border-2); }
.notif-panel-title { font-family: var(--font-head); font-weight: 800; font-size: 14px; color: var(--c-ink); }
.notif-panel-count { font-size: 11px; font-weight: 700; color: var(--c-primary); background: #eef0ff; padding: 2px 9px; border-radius: 20px; line-height: 1.6; }
.notif-list { padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.notif-item { display: flex; align-items: flex-start; gap: 11px; padding: 10px; border-radius: 11px; text-decoration: none; transition: background .15s; }
.notif-item:hover { background: var(--c-hover-row); }
.notif-icon { width: 32px; height: 32px; border-radius: 50%; background: #eef0ff; color: var(--c-primary); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.notif-body { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; padding-top: 2px; }
.notif-msg { font-size: 12.5px; font-weight: 600; color: var(--c-ink); line-height: 1.4; overflow-wrap: break-word; }
.notif-time { font-size: 10.5px; color: var(--c-text-faint); }
.notif-empty { padding: 36px 16px; text-align: center; color: var(--c-placeholder); font-size: 12.5px; display: flex; flex-direction: column; align-items: center; }
.user-chip { display: flex; align-items: center; gap: 10px; padding-left: 6px; text-decoration: none; }
.user-avatar { width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(135deg, var(--c-success), #4fd1c0); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-family: var(--font-head); flex: 0 0 auto; }
.user-name { font-weight: 700; font-size: 13px; line-height: 1.2; }
.user-role { font-size: 11px; color: var(--c-text-faint); line-height: 1.2; }

.content { padding: 26px 30px 40px; overflow: auto; }

/* ---------- Generic components ---------- */
.card { background: #fff; border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: var(--sp-card); }
.card--dark-gradient { background: linear-gradient(150deg, var(--c-ink), var(--c-dark-grad-end)); color: #fff; }
.grid { display: grid; gap: var(--sp-grid-gap); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-hero { grid-template-columns: 1.25fr 1fr; }
.grid-side { grid-template-columns: 1fr 340px; }
@media (max-width: 1100px) { .grid-2, .grid-3, .grid-hero, .grid-side { grid-template-columns: 1fr; } }

.section-header { display: flex; align-items: center; justify-content: space-between; margin: 0 2px 18px; flex-wrap: wrap; gap: 12px; }
.section-title { font-family: var(--font-head); font-weight: 800; font-size: 17px; }
.section-sub { font-size: 12px; color: var(--c-text-faint); margin-top: 2px; }

.pill-toggle { display: inline-flex; background: #fff; border-radius: var(--radius-pill); padding: 4px; gap: 2px; box-shadow: var(--shadow-card); }
.pill-toggle.flat { background: var(--c-canvas); box-shadow: none; }
.pill-toggle a, .pill-toggle button { border: none; cursor: pointer; font-family: inherit; font-size: 12.5px; font-weight: 700; padding: 7px 18px; border-radius: var(--radius-pill); transition: .2s; background: transparent; color: #8080a0; text-decoration: none; display: inline-block; }
.pill-toggle a.active, .pill-toggle button.active { background: var(--c-primary); color: #fff; box-shadow: var(--shadow-nav-active); }

.progress-track { height: 8px; border-radius: 6px; background: var(--c-track); overflow: hidden; }
.progress-track.sm { height: 6px; border-radius: 5px; }
.progress-track.lg { height: 10px; border-radius: 6px; }
.progress-fill { height: 100%; border-radius: 6px; }

.stat-icon-tile { width: 50px; height: 50px; border-radius: var(--radius-icon); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.stat-icon-tile .msi { font-size: 26px; }

.status-pill { font-size: 11px; font-weight: 700; padding: 4px 11px; border-radius: var(--radius-status); display: inline-block; }
.chip { background: #f3f3fb; color: var(--c-primary); font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: var(--radius-chip); display: inline-block; }

.avatar-circle { border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex: 0 0 auto; font-family: var(--font-head); }
.avatar-circle.sz-28 { width: 28px; height: 28px; font-size: 12px; }
.avatar-circle.sz-44 { width: 44px; height: 44px; font-size: 16px; border-radius: 12px; }

table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data-table thead tr { text-align: left; color: var(--c-text-faint); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; }
table.data-table th { padding: 11px 16px; font-weight: 600; }
table.data-table td { padding: 13px 16px; border-top: 1px solid var(--c-border-2); }
table.data-table tbody tr:hover { background: var(--c-hover-row); }
.table-wrap { overflow-x: auto; }

.pi-edit { outline: none; border-radius: 5px; padding: 1px 4px; margin: -1px -4px; cursor: text; transition: background .15s, box-shadow .15s; }
.pi-edit:hover { background: #f3f3fb; box-shadow: inset 0 0 0 1px #d9d9ef; }
.pi-edit:focus { background: #fff; box-shadow: inset 0 0 0 1.5px var(--c-primary); }

.donut { border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.donut-inner { border-radius: 50%; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; }

.legend-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }

.funnel-card { border-radius: 14px; box-shadow: var(--shadow-card); padding: 22px; border-top: 3px solid transparent; background: #fff; }
.funnel-card--pdm { border-top-color: var(--c-primary); }
.funnel-card--pbm { border-top-color: var(--c-success); }
.funnel-card--pfm { border-top-color: var(--c-warning); }

.project-card { border-radius: 14px; box-shadow: var(--shadow-card); padding: 22px; border-top: 3px solid transparent; background: #fff; }
.project-card--idea { border-top-color: #b3b3c9; }
.project-card--planning { border-top-color: var(--c-warning); }
.project-card--inprogress { border-top-color: var(--c-primary); }
.project-card--done { border-top-color: var(--c-success); }

/* ---------- Forms / buttons (admin CRUD pages) ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; gap: 12px; }
.form-panel { background: #fff; border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 22px; margin-bottom: 22px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 14px; }
.field-label { display: block; font-size: 12px; font-weight: 600; color: var(--c-text-muted); margin: 12px 0 6px; }
.field-input, select.field-input, textarea.field-input {
  width: 100%; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--c-border); background: var(--c-canvas);
  font-family: inherit; font-size: 13.5px; color: var(--c-ink); transition: .15s;
}
.field-input:focus { outline: none; background: #fff; box-shadow: inset 0 0 0 1.5px var(--c-primary); }
.btn-primary, .btn { display: inline-flex; align-items: center; gap: 6px; border: none; cursor: pointer; font-family: inherit; font-weight: 700; font-size: 13px; padding: 11px 20px; border-radius: 11px; background: var(--c-primary); color: #fff; text-decoration: none; transition: .15s; }
.btn-primary:hover, .btn:hover { background: var(--c-indigo-alt); }
.btn-block { width: 100%; justify-content: center; margin-top: 18px; }
.btn-secondary { background: var(--c-canvas); color: var(--c-text-muted); }
.btn-secondary:hover { background: var(--c-track); }
.btn-danger { background: var(--c-danger-bg); color: var(--c-danger); }
.btn-danger:hover { background: var(--c-danger); color: #fff; }
.btn-sm { padding: 7px 13px; font-size: 12px; border-radius: 8px; }

.alert { padding: 12px 16px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; }
.alert-danger { background: var(--c-danger-bg); color: var(--c-danger); }
.alert-success { background: var(--c-success-bg); color: var(--c-success); }

.empty-state { text-align: center; padding: 30px; color: var(--c-placeholder); font-size: 13px; }
.badge-role { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; }
.badge-role.admin { background: var(--c-danger-bg); color: var(--c-danger); }
.badge-role.staff { background: #eef0ff; color: var(--c-primary); }

/* ---------- Auth pages (login / setup / change password) ---------- */
.auth-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, #eceafc, #f5f5f7); }
.auth-wrap { padding: 20px; width: 100%; display: flex; justify-content: center; }
.auth-card { background: #fff; border-radius: 20px; box-shadow: rgba(38,9,68,.12) 0px 20px 50px 0px; padding: 34px; width: 100%; max-width: 380px; }
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 26px; }
.auth-logo { width: 42px; height: 42px; border-radius: 11px; object-fit: cover; display: block; }
.auth-brand-name { font-family: var(--font-head); font-weight: 800; font-size: 20px; }
.auth-brand-sub { font-size: 9.5px; color: var(--c-text-faint); letter-spacing: .5px; text-transform: uppercase; margin-top: 2px; }
.auth-title { font-family: var(--font-head); font-weight: 800; font-size: 21px; }
.auth-subtitle { font-size: 12.5px; color: var(--c-text-faint); margin-top: 4px; margin-bottom: 22px; }
.role-toggle { display: flex; background: var(--c-canvas); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 6px; }
.role-btn { flex: 1; border: none; cursor: pointer; background: transparent; color: var(--c-text-muted); font-family: inherit; font-weight: 700; font-size: 13px; padding: 10px 0; border-radius: 9px; transition: .15s; }
.role-btn.active { background: var(--c-ink); color: #fff; }

/* ---------- Priority / status color helpers ---------- */
.pri-high { background: var(--c-danger-bg); color: var(--c-danger); }
.pri-medium { background: var(--c-warning-bg); color: var(--c-warning-text); }
.pri-low { background: var(--c-success-bg); color: var(--c-success); }
.st-doing { background: #eef0ff; color: var(--c-primary); }
.st-todo { background: var(--c-track); color: #8080a0; }
.st-done { background: var(--c-success-bg); color: var(--c-success); }
