:root {
  --bg: #ffffff; --surface: #ffffff; --surface-2: #f7f7f5; --text: #191919; --muted: #787774;
  --border: #e9e9e7; --brand-navy: #030b64; --brand-blue: #2563eb; --brand-cyan: #2ee6e8; --brand-violet: #5b4df5; --brand-purple: #7c3aed; --primary: #2563eb; --primary-dark: #1d4ed8; --shadow: none;
  --radius: 10px; --employment: #2563eb; --independent: #2563eb; --personal: #525252; --habit-acquire: #16a34a;
  --habit-stop: #dc2626; --break: #d97706; --unproductive: #ef4444; --neutral: #6b7280; --extra: #f59e0b;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.45; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.muted { color: var(--muted); }
.eyebrow { color: var(--primary); font-weight: 800; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 6px; }
.brand-row { display: flex; align-items: center; gap: 10px; font-size: 1rem; }
.brand-mark { width: 54px; height: 54px; border-radius: 17px; display: grid; place-items: center; font-weight: 900; color: white; background: var(--primary); box-shadow: none; }
.brand-mark.small { width: 36px; height: 36px; border-radius: 11px; font-size: .8rem; }
.button { border: 1px solid transparent; border-radius: 6px; padding: 8px 12px; font-weight: 600; transition: .15s ease; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; box-shadow: none; }
.button:hover { background: #efefed; }
.button.primary { background: var(--primary); color: #fff; }
.button.primary:hover { background: var(--primary-dark); }
.button.secondary { background: #f1f1ef; color: var(--text); border-color: #e2e2df; }
.button.danger { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.button.small { padding: 7px 10px; font-size: .8rem; }
label { display: grid; gap: 7px; font-weight: 600; color: var(--text); font-size: .82rem; }
input, select, textarea { width: 100%; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 6px; padding: 8px 10px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(91,77,245,.12); }
textarea { min-height: 90px; resize: vertical; }
.check-row { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--muted); }
.check-row input { width: auto; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 8px; margin-top: 18px; }
.form-error { color: #dc2626; min-height: 1.2em; }
.login-page { height: 100vh; height: 100dvh; overflow: hidden; background: #e9edf5; color: var(--text); }
.auth-stage { height: 100vh; height: 100dvh; display: grid; place-items: center; padding: clamp(12px, 2.8vh, 28px); background: radial-gradient(circle at 50% 8%, rgba(91,77,245,.12), transparent 38%), #f4f1ff; }
.auth-shell { width: min(1040px, 100%); height: min(620px, calc(100dvh - clamp(24px, 5.6vh, 56px))); max-height: calc(100dvh - clamp(24px, 5.6vh, 56px)); display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 2.6vw, 30px); background: white; border-radius: 24px; overflow: hidden; padding: clamp(10px, 1.6vh, 16px); box-shadow: 0 22px 58px rgba(91, 77, 245, .25); }
.auth-visual { position: relative; overflow: hidden; border-radius: 18px; padding: 34px; color: white; background: radial-gradient(circle at 68% 26%, rgba(255,255,255,.78), transparent 22%), radial-gradient(circle at 32% 42%, rgba(0,24,180,.95), transparent 34%), radial-gradient(circle at 88% 8%, #c084fc, transparent 38%), linear-gradient(155deg, #030b64 0%, #0649ea 48%, #2ee6e8 100%); }
.auth-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.04), rgba(1,8,48,.44)); }
.auth-message, .auth-clock-art, .auth-logo-icon { position: relative; z-index: 2; }
.auth-logo-icon { width: 68px; height: 68px; display: grid; place-items: center; color: white; font-weight: 900; font-size: 1rem; }
.auth-logo-icon img { max-width: 100%; max-height: 100%; object-fit: contain; }
.auth-logo-icon span { width: 46px; height: 46px; border: 2px solid rgba(255,255,255,.86); border-radius: 14px; display: grid; place-items: center; }
.auth-message { position: absolute; left: clamp(22px, 3vw, 34px); right: clamp(22px, 3vw, 34px); bottom: clamp(22px, 3vh, 34px); }
.auth-kicker { font-size: .86rem; font-weight: 800; color: rgba(255,255,255,.88); margin-bottom: 14px; }
.auth-message h1 { margin: 0 0 12px; font-size: clamp(1.85rem, 3.4vw, 2.8rem); line-height: 1.03; letter-spacing: -.055em; max-width: 430px; }
.auth-message p:last-child { max-width: 380px; margin: 0; color: rgba(255,255,255,.86); font-size: .95rem; line-height: 1.55; }
.auth-visual-glow { position: absolute; border-radius: 50%; filter: blur(6px); opacity: .8; }.glow-one { width: 360px; height: 360px; right: -80px; top: -80px; background: rgba(35,255,239,.34); }.glow-two { width: 330px; height: 330px; left: -120px; bottom: 80px; background: rgba(54,45,255,.55); }
.auth-grid-lines { position: absolute; inset: 0; opacity: .1; background-image: linear-gradient(rgba(255,255,255,.2) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.2) 1px, transparent 1px); background-size: 42px 42px; mask-image: linear-gradient(to bottom, black, transparent 72%); }
.auth-clock-art { --minute-angle: -90deg; --hour-angle: -45deg; width: clamp(150px, 26vh, 210px); height: clamp(150px, 26vh, 210px); margin: clamp(36px, 7vh, 78px) auto 0; border-radius: 50%; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); box-shadow: inset 0 0 50px rgba(255,255,255,.08), 0 20px 60px rgba(0,0,0,.15); opacity: .72; }
.clock-ring { position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.22); }.ring-one { inset: 28px; }.ring-two { inset: 55px; }
.clock-hand { position: absolute; left: 50%; top: 50%; height: 4px; border-radius: 99px; background: white; transform-origin: left center; transition: transform .35s ease; }.hand-one { width: 36%; transform: rotate(var(--minute-angle)); }.hand-two { width: 27%; transform: rotate(var(--hour-angle)); background: #fbbf24; }
.clock-center { position: absolute; width: 16px; height: 16px; left: calc(50% - 8px); top: calc(50% - 8px); border-radius: 50%; background: white; box-shadow: 0 0 0 8px rgba(255,255,255,.15); }
.clock-orbit { position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #fbbf24; }.orbit-a { right: 16px; top: 72px; }.orbit-b { left: 30px; bottom: 42px; background: #67e8f9; }
.auth-panel { display: grid; align-content: center; min-height: 0; overflow: hidden; padding: clamp(18px, 3.8vw, 48px); background: white; }
.auth-panel-brand { display: flex; align-items: center; gap: 10px; margin-bottom: clamp(14px, 2.8vh, 28px); min-height: 40px; }
.auth-logo-full { max-width: 190px; max-height: 54px; object-fit: contain; }
.auth-logo-fallback { display: flex; align-items: center; gap: 10px; }
.auth-form-view { display: none; }.auth-form-view.active { display: block; }
.auth-form-view h2 { margin: 6px 0 7px; font-size: clamp(1.55rem, 3.4vh, 2rem); letter-spacing: -.045em; }.auth-form-view > .muted { margin: 0; line-height: 1.42; max-width: 360px; font-size: .8rem; }
.form-star { color: var(--primary); font-size: 2.1rem; line-height: .7; font-weight: 900; margin-bottom: 8px; }
.auth-form { display: grid; gap: clamp(8px, 1.45vh, 13px); margin-top: clamp(12px, 2.35vh, 22px); }
.auth-form label { font-size: .78rem; }
.auth-form input { border-radius: 7px; padding: clamp(7px, 1.25vh, 9px) 11px; }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.link-button { border: 0; background: transparent; color: var(--primary); font-weight: 800; padding: 0; font-size: .76rem; }
.link-button:hover { text-decoration: underline; }
.auth-submit { width: 100%; padding: clamp(9px, 1.55vh, 12px); border-radius: 8px; margin-top: 4px; box-shadow: 0 10px 18px rgba(91,77,245,.28); }
.login-page .brand-mark { background: linear-gradient(135deg, var(--brand-purple), var(--brand-blue)); box-shadow: 0 10px 24px rgba(91, 77, 245, .3); }
.login-page .button.primary { background: linear-gradient(135deg, var(--brand-purple), var(--brand-blue)); }
.login-page .button.primary:hover { background: linear-gradient(135deg, var(--brand-purple), var(--brand-blue)); }
.password-field { position: relative; }.password-field input { padding-right: 46px; }
.password-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border: 0; background: transparent; border-radius: 8px; }
.password-toggle::before { content: ""; position: absolute; inset: 8px 5px; border: 2px solid #64748b; border-radius: 50% 50% 45% 45%; transform: rotate(0deg); }
.password-toggle::after { content: ""; position: absolute; width: 5px; height: 5px; left: 14px; top: 14px; border-radius: 50%; background: #64748b; }
.password-toggle.visible { background: #f1f5f9; }
.auth-switch { text-align: center; color: var(--muted); font-size: .78rem; margin-top: clamp(8px, 1.8vh, 16px); }.auth-switch button { border: 0; background: transparent; color: var(--primary); font-weight: 800; padding: 0; }
.form-message, .form-error { min-height: 1em; font-size: .78rem; line-height: 1.25; margin: 0; }.form-message.success { color: #15803d; }.form-message.error { color: #dc2626; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 245px minmax(0, 1fr); }
.sidebar-backdrop { display: none; }
.sidebar { background: #f7f7f5; color: var(--text); padding: 14px 10px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--border); }
.sidebar::before { content: ""; display: none; }
.sidebar > * { position: relative; z-index: 1; }
.sidebar-brand { padding: 8px 10px 22px; color: var(--text); }
.sidebar nav { display: grid; gap: 4px; }
.sidebar button { border: 1px solid transparent; background: transparent; color: #5f5e5b; padding: 7px 9px; border-radius: 6px; display: flex; gap: 10px; align-items: center; text-align: left; font-weight: 600; box-shadow: none; }
.sidebar button span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; background: #ececea; color: #5f5e5b; font-size: .7rem; }
.sidebar button .sidebar-icon { width: 20px; height: 20px; border-radius: 0; background: currentColor; color: #6f6e69; -webkit-mask: var(--icon) center / 18px 18px no-repeat; mask: var(--icon) center / 18px 18px no-repeat; }
.sidebar button:hover, .sidebar button.active { color: var(--text); background: #ededeb; border-color: transparent; }
.admin-only { display: none !important; }
.admin-only.is-visible { display: flex !important; }
.sidebar-bottom { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); }
.main-content { padding: 32px clamp(28px, 5vw, 72px) 60px; min-width: 0; max-width: 1320px; width: 100%; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 34px; }
.mobile-menu-button { display: none; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; min-width: 54px; height: 38px; padding: 0 10px; font-size: .78rem; font-weight: 800; }
.topbar-title { min-width: 0; }
.topbar h1 { margin: 0; font-size: 1.7rem; letter-spacing: -.035em; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.icon-button { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 6px; padding: 8px 11px; }
.theme-switch { display: inline-flex; grid-auto-flow: column; align-items: center; gap: 8px; cursor: pointer; color: var(--muted); font-size: .78rem; font-weight: 700; }
.theme-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.theme-switch span { width: 36px; height: 20px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); position: relative; transition: .16s ease; }
.theme-switch span::after { content: ""; position: absolute; width: 14px; height: 14px; left: 2px; top: 2px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); transition: .16s ease; }
.theme-switch input:checked + span { background: var(--primary); border-color: var(--primary); }
.theme-switch input:checked + span::after { transform: translateX(16px); border-color: rgba(255,255,255,.75); }
.theme-switch input:focus-visible + span { box-shadow: 0 0 0 3px rgba(37,99,235,.18); }
.theme-switch b { font-weight: 700; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: white; background: linear-gradient(135deg, #7c3aed, #2563eb); font-weight: 900; font-size: .72rem; overflow: hidden; }
.avatar img, .profile-photo img { width: 100%; height: 100%; object-fit: cover; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: none; padding: 16px; }
.card h3 { margin: 0 0 12px; font-size: .95rem; }
.view-toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.view-toolbar .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.empty-state { text-align: center; padding: 34px; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 999px; font-size: .7rem; font-weight: 800; background: var(--surface-2); color: var(--muted); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
dialog { border: 0; padding: 0; border-radius: 18px; background: transparent; max-width: 600px; width: calc(100% - 30px); }
dialog::backdrop { background: rgba(15, 23, 42, .55); backdrop-filter: blur(3px); }
.modal-card { position: relative; background: var(--surface); color: var(--text); border-radius: 18px; padding: 24px; max-height: 85vh; overflow: auto; }
.modal-close { position: absolute; top: 12px; right: 12px; border: 0; border-radius: 8px; background: var(--surface-2); color: var(--muted); width: 30px; height: 30px; }
.button.ghost { background: #ffffff; color: var(--primary); border: 1px solid #d8d8d4; }
.button.icon-danger { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }
.profile-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.profile-photo { width: 78px; height: 78px; border-radius: 24px; display: grid; place-items: center; overflow: hidden; background: linear-gradient(135deg, #7c3aed, #2563eb); color: white; font-weight: 900; font-size: 1.2rem; }
.profile-header-copy { flex: 1; }.profile-header-copy h3 { margin-bottom: 4px; }.profile-header-copy p { margin: 0; }
.form-grid input:disabled, .form-grid select:disabled, .form-grid textarea:disabled { opacity: .72; background: var(--surface-2); cursor: not-allowed; }
.job-actions, .row-actions { display: flex; gap: 6px; align-items: center; }
.field-label { display: block; margin-bottom: 7px; font-weight: 700; font-size: .86rem; }
.day-selector { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day-selector label { cursor: pointer; }.day-selector input { display: none; }
.day-selector span { display: block; border: 1px solid var(--border); border-radius: 9px; padding: 8px 3px; text-align: center; color: var(--muted); font-size: .75rem; }
.day-selector input:checked + span { background: var(--primary); border-color: var(--primary); color: white; }
#toast-container { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 10; }
.toast { background: #111827; color: white; padding: 11px 14px; border-radius: 10px; box-shadow: var(--shadow); font-size: .85rem; }
@media (max-width: 760px) {
  .auth-stage { padding: 0; }.auth-shell { height: 100dvh; max-height: 100dvh; border-radius: 0; grid-template-columns: 1fr; padding: 0; }.auth-visual { display: none; }.auth-panel { padding: clamp(16px, 4vh, 26px) 22px; align-content: center; overflow: hidden; }.auth-panel-brand { display: flex; margin-bottom: clamp(12px, 2.5vh, 22px); }
  body { font-size: 13px; }
  .app-shell { display: block; min-height: 100dvh; }
  body.sidebar-open { overflow: hidden; }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 19;
    display: block;
    background: rgba(15, 23, 42, .38);
    backdrop-filter: blur(2px);
  }
  .sidebar-backdrop[hidden] { display: none; }
  .sidebar {
    position: fixed;
    z-index: 20;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(82vw, 292px);
    height: 100dvh;
    padding: calc(14px + env(safe-area-inset-top)) 10px calc(14px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow-y: auto;
    overflow-x: hidden;
    border-right: 1px solid var(--border);
    border-top: 0;
    transform: translateX(-102%);
    transition: transform .2s ease;
    box-shadow: 18px 0 42px rgba(15, 23, 42, .18);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar::-webkit-scrollbar { display: none; }
  .sidebar-brand { display: flex; padding-bottom: 18px; }
  .sidebar nav, .sidebar-bottom {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 0;
    border: 0;
  }
  .sidebar-bottom { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); }
  .sidebar button {
    min-width: 0;
    display: flex;
    gap: 10px;
    justify-items: initial;
    justify-content: flex-start;
    font-size: .9rem;
    line-height: 1.2;
    padding: 9px 10px;
    white-space: normal;
  }
  .sidebar .admin-only.is-visible { display: flex !important; }
  .sidebar button .sidebar-icon { width: 20px; height: 20px; -webkit-mask-size: 18px 18px; mask-size: 18px 18px; }
  .main-content { max-width: none; padding: 16px 14px calc(28px + env(safe-area-inset-bottom)); }
  .topbar { justify-content: flex-start; align-items: flex-start; gap: 10px; margin-bottom: 22px; }
  .mobile-menu-button { display: inline-grid; place-items: center; flex: 0 0 auto; }
  .topbar-title { flex: 1; }
  .topbar h1 { font-size: 1.45rem; }
  .topbar .eyebrow { font-size: .64rem; }
  .topbar-actions { margin-left: auto; }
  .topbar-actions { gap: 8px; }
  .theme-switch b { display: none; }
  .avatar { width: 34px; height: 34px; }
  .card { padding: 14px; border-radius: 12px; }
  .view-toolbar { display: grid; grid-template-columns: 1fr; align-items: stretch; gap: 10px; }
  .view-toolbar .actions { display: grid; grid-template-columns: 1fr; width: 100%; }
  .button { width: 100%; }
  .button.small { width: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .form-actions { display: grid; grid-template-columns: 1fr; }
  .profile-header { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px; }
  .profile-header .button { grid-column: 1 / -1; }
  .profile-photo { width: 62px; height: 62px; border-radius: 18px; }
  .mini-item { align-items: flex-start; }
  .job-actions, .row-actions { flex-wrap: wrap; justify-content: flex-end; }
  .task-table { display: block; overflow-x: auto; white-space: nowrap; }
  dialog { width: calc(100% - 18px); }
  .modal-card { padding: 20px 16px; max-height: 88dvh; }
  #toast-container { left: 12px; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); }
  .toast { width: 100%; }
}
@media (max-height: 680px) {
  .auth-shell { height: calc(100dvh - 16px); max-height: calc(100dvh - 16px); }
  .auth-logo-full { max-height: 42px; }
  .auth-panel-brand { margin-bottom: 10px; }
  .auth-form-view h2 { font-size: 1.45rem; }
  .auth-form-view > .muted { font-size: .74rem; }
  .auth-form { gap: 7px; margin-top: 10px; }
  .auth-form label { gap: 4px; font-size: .72rem; }
  .auth-form input { padding: 6px 9px; }
  .auth-row { display: grid; gap: 6px; }
  .link-button { justify-self: start; }
  .auth-switch { margin-top: 8px; }
}
