:root {
    --bg: #f5f5f7;
    --panel: #ffffff;
    --sidebar: #fbfbfc;
    --text: #171717;
    --muted: #72727a;
    --subtle: #9a9aa1;
    --border: #e3e3e7;
    --border-strong: #d0d0d5;

    --green: #65b07d;
    --yellow: #d3b958;
    --amber: #db934d;
    --red: #d36262;

    --shadow: 0 9px 30px rgba(0, 0, 0, .045);

    --radius: 17px;
}

/* =====================================================
   BASE
   ===================================================== */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "SF Pro Display",
        "SF Pro Text",
        "Segoe UI",
        sans-serif;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid rgba(100, 130, 200, .45);
    outline-offset: 2px;
}

.hidden {
    display: none !important;
}

/* =====================================================
   AUTH
   ===================================================== */

.screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 25px;
    background:
        radial-gradient(
            circle at top,
            #ffffff 0,
            #f5f5f7 55%,
            #eeeeF1 100%
        );
}

.auth-card {
    width: min(430px, 100%);
    padding: 36px;
    border: 1px solid var(--border);
    border-radius: 23px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 25px 80px rgba(0,0,0,.08);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 38px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #171717;
    color: white;
    font-size: 18px;
    font-weight: 700;
}

.brand-name {
    font-weight: 700;
    font-size: 17px;
}

.brand-version {
    margin-top: 2px;
    color: var(--subtle);
    font-size: 10px;
}

.auth-heading h1 {
    margin: 0;
    font-size: 28px;
    letter-spacing: -.8px;
}

.auth-heading p {
    margin: 9px 0 27px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field label {
    color: #707078;
    font-size: 10px;
    font-weight: 600;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 11px 12px;
    background: #fafafa;
    color: #202020;
    font-size: 12px;
}

.field textarea {
    min-height: 85px;
    resize: vertical;
}

.auth-primary,
.auth-secondary {
    min-height: 43px;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 600;
}

.auth-primary {
    margin-top: 3px;
    background: #171717;
    color: white;
}

.auth-primary:hover {
    background: #000;
}

.auth-secondary {
    background: #f0f0f2;
    color: #4e4f55;
}

.auth-secondary:hover {
    background: #e8e8ea;
}

.auth-error {
    display: none;
    padding: 9px 10px;
    border-radius: 9px;
    background: #faeaea;
    color: var(--red);
    font-size: 10px;
    line-height: 1.45;
}

.auth-error.visible {
    display: block;
}

/* =====================================================
   APP
   ===================================================== */

.app-hidden {
    display: none;
}

.app-shell {
    min-height: 100vh;
    display: flex;
}

/* =====================================================
   SIDEBAR
   ===================================================== */

.sidebar {
    width: 258px;
    min-width: 258px;
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    background: var(--sidebar);
    border-right: 1px solid var(--border);
}

.brand-row {
    min-height: 77px;
    padding: 17px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-cog {
    width: 35px;
    height: 35px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #77777f;
    font-size: 17px;
}

.settings-cog:hover {
    background: #eeeeF0;
    color: #222;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 6px 10px 15px;
}

.nav-section {
    margin-bottom: 14px;
}

.nav-section-label {
    padding: 0 10px 6px;
    color: #9d9da5;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .12em;
}

.nav-item {
    width: 100%;
    min-height: 43px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 7px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #62636a;
    text-align: left;
    font-size: 13px;
    transition:
        background .15s ease,
        color .15s ease;
}

.nav-item:hover {
    background: #f0f0f2;
    color: #171717;
}

.nav-item.active {
    background: #e8e8eb;
    color: #111;
    font-weight: 600;
}

.nav-count {
    margin-left: auto;
    min-width: 22px;
    padding: 3px 6px;
    border-radius: 999px;
    background: #ededee;
    color: #73747b;
    text-align: center;
    font-size: 9px;
}

.nav-arrow {
    margin-left: auto;
    color: #9999a0;
    font-size: 17px;
}

.sidebar-footer {
    padding: 12px 15px;
    border-top: 1px solid var(--border);
}

.account-mini {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 11px;
}

.account-avatar,
.settings-account-avatar {
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #e7e7e9;
    color: #45464d;
    font-weight: 700;
}

.account-avatar {
    width: 30px;
    height: 30px;
    font-size: 11px;
}

.account-mini-text {
    min-width: 0;
}

.account-mini-text strong,
.account-mini-text span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-mini-text strong {
    font-size: 10px;
}

.account-mini-text span {
    margin-top: 2px;
    color: #9b9ba2;
    font-size: 8px;
}

.save-status {
    color: #9999a1;
    font-size: 9px;
}

.save-dot {
    width: 6px;
    height: 6px;
    display: inline-block;
    margin-right: 6px;
    border-radius: 50%;
    background: var(--green);
}

/* =====================================================
   TOPBAR
   ===================================================== */

.main-content {
    flex: 1;
    min-width: 0;
}

.topbar {
    height: 78px;
    padding: 0 31px;
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: rgba(245,245,247,.9);
    backdrop-filter: blur(18px);
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
}

.topbar-left {
    gap: 10px;
}

.topbar-right {
    gap: 14px;
}

.topbar h1 {
    margin: 0;
    font-size: 21px;
    letter-spacing: -.45px;
}

.page-eyebrow {
    margin-bottom: 3px;
    color: #a0a0a7;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .14em;
}

.live-clock {
    color: #75767d;
    font-size: 12px;
    white-space: nowrap;
}

.mobile-menu {
    display: none;
    width: 35px;
    height: 35px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #55565c;
    font-size: 18px;
}

/* =====================================================
   CONTENT
   ===================================================== */

.content-area {
    max-width: 1240px;
    margin: 0 auto;
    padding: 36px 31px 70px;
}

.view {
    display: none;
}

.view.active-view {
    display: block;
}

.view-intro {
    margin-bottom: 25px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
}

.view-intro h2,
.welcome-row h2 {
    margin: 0;
    font-size: 30px;
    letter-spacing: -1px;
}

.view-intro p,
.welcome-row p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.welcome-row {
    margin-bottom: 27px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

.today-date {
    color: var(--muted);
    font-size: 12px;
    padding-bottom: 4px;
}

/* =====================================================
   PANELS
   ===================================================== */

.panel {
    margin-bottom: 15px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.today-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.overdue-panel {
    border-color: rgba(211,98,98,.23);
}

.section-heading {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-heading h3 {
    margin: 3px 0 0;
    font-size: 16px;
    letter-spacing: -.2px;
}

.section-kicker {
    color: #a0a0a8;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .12em;
}

.section-kicker.urgent {
    color: var(--red);
}

.section-count {
    min-width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #f0f0f2;
    color: #6d6d74;
    font-size: 10px;
}

.section-count.danger {
    background: #faeaea;
    color: var(--red);
}

/* =====================================================
   BUTTONS
   ===================================================== */

.add-button {
    min-height: 40px;
    padding: 0 15px;
    border: 1px solid #171717;
    border-radius: 10px;
    background: #171717;
    color: white;
    font-size: 11px;
    font-weight: 600;
    transition: .15s ease;
}

.add-button:hover {
    background: #000;
    transform: translateY(-1px);
}

.secondary-button,
.danger-button {
    min-height: 38px;
    padding: 0 12px;
    border-radius: 9px;
    font-size: 10px;
}

.secondary-button {
    border: 1px solid var(--border);
    background: white;
    color: #66676e;
}

.secondary-button:hover {
    border-color: var(--border-strong);
    background: #fafafa;
}

.danger-button {
    background: #faeaea;
    color: var(--red);
}

.text-button {
    border: 0;
    background: transparent;
    color: #77777f;
    font-size: 10px;
}

.text-button:hover {
    color: #111;
}

/* =====================================================
   TASKS
   ===================================================== */

.task-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.task-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: #fff;
}

.task-card.completed {
    opacity: .74;
}

.task-urgency {
    height: 3px;
}

.urgency-green {
    background: var(--green);
}

.urgency-yellow {
    background: var(--yellow);
}

.urgency-amber {
    background: var(--amber);
}

.urgency-red,
.urgency-overdue {
    background: var(--red);
}

.task-inner {
    padding: 13px 14px;
}

.task-row {
    display: flex;
    align-items: flex-start;
    gap: 11px;
}

.task-check {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    padding: 0;
    margin-top: 1px;
    border: 1.5px solid #c7c7cd;
    border-radius: 50%;
    background: white;
    position: relative;
}

.task-check.checked {
    background: #222;
    border-color: #222;
}

.task-check.checked::after {
    content: "✓";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: white;
    font-size: 11px;
}

.task-main {
    flex: 1;
    min-width: 0;
}

.task-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.task-title.completed-title {
    color: #999aa0;
    text-decoration: line-through;
}

.task-meta {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.meta-pill {
    padding: 4px 7px;
    border-radius: 999px;
    background: #f3f3f4;
    color: #8e8e96;
    font-size: 9px;
}

.meta-pill.overdue {
    background: #faeaea;
    color: var(--red);
    font-weight: 700;
}

.meta-file {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.meta-file-dot {
    width: 6px;
    height: 6px;
    border-radius: 2px;
}

.edit-button {
    flex: 0 0 auto;
    min-width: 44px;
    min-height: 30px;
    padding: 0 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #85868d;
    font-size: 10px;
}

.edit-button:hover {
    background: #f2f2f4;
    color: #222;
}

/* =====================================================
   FILTERS / SORT
   ===================================================== */

.toolbar,
.archive-toolbar {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.filter-row,
.archive-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.filter-chip {
    padding: 8px 11px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: white;
    color: #85858c;
    font-size: 9px;
}

.filter-chip.active {
    border-color: #e7e7e9;
    background: #e8e8eb;
    color: #171717;
    font-weight: 600;
}

.sort-select {
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: white;
    color: #6b6c73;
    font-size: 10px;
}

/* =====================================================
   TODO
   ===================================================== */

.todo-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.todo-item {
    min-height: 51px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: white;
}

.todo-main {
    flex: 1;
    min-width: 0;
}

.todo-title {
    font-size: 12px;
    font-weight: 600;
}

.todo-title.completed-title {
    color: #999;
    text-decoration: line-through;
}

.todo-file {
    margin-top: 4px;
    color: #999aa1;
    font-size: 9px;
}

/* =====================================================
   INBOX
   ===================================================== */

.inbox-help {
    margin-bottom: 16px;
    padding: 13px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fafafa;
}

.inbox-help strong,
.inbox-help span {
    display: block;
}

.inbox-help strong {
    margin-bottom: 4px;
    font-size: 11px;
}

.inbox-help span {
    color: #898a91;
    font-size: 10px;
}

.info-circle {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    display: grid;
    place-items: center;
    border: 1px solid #d0d0d5;
    border-radius: 50%;
    color: #777880;
    font-size: 10px;
}

.inbox-item {
    margin-bottom: 9px;
    padding: 16px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: white;
}

.inbox-item:hover {
    border-color: var(--border-strong);
}

.inbox-main {
    min-width: 0;
}

.inbox-title {
    font-size: 12px;
    font-weight: 600;
}

.inbox-meta {
    margin-top: 4px;
    color: #999aa1;
    font-size: 9px;
}

.inbox-delete {
    margin-top: 5px;
    border: 0;
    background: transparent;
    color: #aaaab1;
    font-size: 10px;
}

.inbox-delete:hover {
    color: var(--red);
}

/* =====================================================
   PROJECTS / FILES
   ===================================================== */

.projects-grid,
.files-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.project-card,
.file-card {
    padding: 17px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: white;
    box-shadow: var(--shadow);
}

.project-header,
.file-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.project-dot,
.file-dot {
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    margin-top: 3px;
    border-radius: 4px;
}

.project-name,
.file-name {
    flex: 1;
    font-size: 14px;
    font-weight: 700;
}

.project-description,
.file-description {
    min-height: 31px;
    margin-top: 8px;
    color: #8e8e95;
    font-size: 10px;
    line-height: 1.5;
}

.progress-info {
    margin: 15px 0 7px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #8d8d94;
    font-size: 9px;
}

.progress-track {
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: #eeeeef;
}

.progress-bar {
    height: 100%;
    border-radius: inherit;
}

.card-footer {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-stat {
    color: #92929a;
    font-size: 9px;
}

/* =====================================================
   FILE DETAIL
   ===================================================== */

.file-detail-header {
    margin-bottom: 24px;
}

.file-back {
    margin-bottom: 16px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #5d5e65;
    font-size: 13px;
    font-weight: 600;
}

.file-back:hover {
    color: #111;
}

.file-heading-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 15px;
}

.file-heading {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-heading-dot {
    width: 14px;
    height: 14px;
    border-radius: 5px;
}

.file-heading h2 {
    margin: 0;
    font-size: 31px;
    letter-spacing: -1px;
}

.file-heading p {
    margin: 6px 0 0;
    color: #8a8a92;
    font-size: 11px;
}

.file-heading-actions {
    display: flex;
    gap: 7px;
}

.file-detail-stats {
    margin-bottom: 15px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.stat-card {
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: white;
}

.stat-label {
    color: #9e9ea5;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .1em;
}

.stat-number {
    margin-top: 7px;
    font-size: 22px;
    font-weight: 700;
}

.stat-number.danger {
    color: var(--red);
}

.file-detail-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.file-section-card {
    margin-bottom: 15px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: white;
}

.file-section-heading {
    margin-bottom: 13px;
    display: flex;
    justify-content: space-between;
}

.file-section-heading h3 {
    margin: 0;
    font-size: 14px;
}

.file-section-heading span {
    color: #9a9aa1;
    font-size: 9px;
}

/* =====================================================
   CALENDAR
   ===================================================== */

.calendar-header-actions,
.calendar-navigation {
    display: flex;
    align-items: center;
    gap: 6px;
}

.calendar-toolbar {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.calendar-period {
    font-size: 14px;
    font-weight: 700;
}

.segmented-control {
    padding: 3px;
    display: flex;
    gap: 3px;
    border-radius: 10px;
    background: #eeeeef;
}

.segment {
    padding: 8px 12px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #85858d;
    font-size: 10px;
}

.segment.active {
    background: white;
    color: #171717;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.calendar-day {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 17px;
    background: white;
}

.calendar-day-header {
    padding: 17px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.calendar-day-title {
    font-size: 14px;
    font-weight: 700;
}

.calendar-day-date {
    color: #87878f;
    font-size: 11px;
}

.calendar-items {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.calendar-event {
    padding: 12px;
    border: 1px solid var(--border);
    border-left: 4px solid #cfcfd3;
    border-radius: 10px;
    background: #fcfcfc;
}

.calendar-event-time {
    margin-bottom: 4px;
    color: #8d8e95;
    font-size: 9px;
}

.calendar-event-title {
    font-size: 12px;
    font-weight: 600;
}

.calendar-event-type {
    margin-top: 4px;
    color: #a0a0a7;
    font-size: 8px;
}

.calendar-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.week-column {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: white;
}

.week-header {
    padding: 12px 8px;
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.week-header.today {
    background: #f1f1f3;
}

.week-day {
    display: block;
    color: #91929a;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.week-date {
    display: block;
    margin-top: 4px;
    font-size: 15px;
    font-weight: 700;
}

.week-items {
    min-height: 190px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.week-event {
    padding: 8px;
    border-radius: 8px;
    background: #f2f2f3;
    color: #4a4b52;
    font-size: 9px;
    line-height: 1.35;
}

.month-calendar {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 17px;
    background: white;
}

.month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.month-name {
    padding: 10px;
    border-bottom: 1px solid var(--border);
    color: #909198;
    font-size: 9px;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
}

.month-cell {
    min-height: 110px;
    padding: 9px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.month-cell:nth-child(7n) {
    border-right: 0;
}

.month-cell.muted {
    background: #fafafa;
}

.month-number {
    margin-bottom: 7px;
    color: #76777f;
    font-size: 11px;
}

.month-cell.today .month-number {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #171717;
    color: white;
}

.month-event {
    overflow: hidden;
    margin-bottom: 4px;
    padding: 4px 5px;
    border-radius: 6px;
    background: #f0f0f2;
    font-size: 9px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* =====================================================
   SETTINGS
   ===================================================== */

.settings-account-card,
.settings-card {
    max-width: 780px;
    margin-bottom: 10px;
    padding: 17px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: white;
}

.settings-account-card {
    justify-content: flex-start;
}

.settings-account-card > div:nth-child(2) {
    flex: 1;
}

.settings-account-card strong,
.settings-account-card span {
    display: block;
}

.settings-account-card strong {
    font-size: 12px;
}

.settings-account-card span {
    margin-top: 3px;
    color: #92929a;
    font-size: 9px;
}

.settings-account-avatar {
    width: 42px;
    height: 42px;
    font-size: 13px;
}

.settings-card h3 {
    margin: 0 0 5px;
    font-size: 12px;
}

.settings-card p {
    max-width: 620px;
    margin: 0;
    color: #8e8e95;
    font-size: 10px;
    line-height: 1.5;
}

.settings-card-title {
    max-width: 780px;
    margin: 24px 0 8px;
    color: #83848b;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.theme-grid {
    max-width: 780px;
    margin-bottom: 10px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.theme-option {
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: white;
    text-align: left;
}

.theme-option:hover {
    border-color: #c9c9cf;
}

.theme-option.active {
    border: 2px solid #222;
    padding: 12px;
}

.theme-option strong,
.theme-option small {
    display: block;
}

.theme-option strong {
    margin-top: 9px;
    font-size: 11px;
}

.theme-option small {
    margin-top: 4px;
    color: #8c8c93;
    font-size: 9px;
}

.theme-preview {
    width: 100%;
    height: 48px;
    position: relative;
    overflow: hidden;
    border: 1px solid #dddde1;
    border-radius: 8px;
}

.theme-preview::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 30%;
}

.theme-preview::after {
    content: "";
    position: absolute;
    inset: 0 0 0 auto;
    width: 70%;
}

.preview-light {
    background: #f5f5f7;
}

.preview-light::before {
    background: #fbfbfc;
}

.preview-light::after {
    background: #fff;
}

.preview-dark {
    background: #171717;
}

.preview-dark::before {
    background: #101010;
}

.preview-dark::after {
    background: #242424;
}

.preview-dark-sidebar {
    background: #f5f5f7;
}

.preview-dark-sidebar::before {
    background: #111;
}

.preview-dark-sidebar::after {
    background: #fff;
}

.preview-dark-main {
    background: #242424;
}

.preview-dark-main::before {
    background: #fbfbfc;
}

.preview-dark-main::after {
    background: #242424;
}

.danger-card {
    border-color: #efdada;
}

/* =====================================================
   TOGGLE
   ===================================================== */

.toggle input {
    display: none;
}

.toggle-track {
    width: 44px;
    height: 26px;
    padding: 3px;
    display: block;
    border-radius: 999px;
    background: #d4d4d8;
}

.toggle-track::after {
    content: "";
    width: 20px;
    height: 20px;
    display: block;
    border-radius: 50%;
    background: white;
    box-shadow: 0 1px 4px rgba(0,0,0,.14);
    transition: transform .18s ease;
}

.toggle input:checked + .toggle-track {
    background: #55a96f;
}

.toggle input:checked + .toggle-track::after {
    transform: translateX(18px);
}

/* =====================================================
   MODAL
   ===================================================== */

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(12,12,13,.43);
    backdrop-filter: blur(5px);
}

.modal-backdrop.visible {
    display: flex;
}

.modal {
    width: min(620px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    padding: 21px;
    border-radius: 20px;
    background: white;
    box-shadow: 0 30px 90px rgba(0,0,0,.19);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.modal-header h2 {
    margin: 0;
    font-size: 21px;
    letter-spacing: -.45px;
}

.modal-close {
    width: 33px;
    height: 33px;
    border: 0;
    border-radius: 9px;
    background: #f0f0f2;
    color: #66676f;
    font-size: 20px;
}

.modal-close:hover {
    background: #e5e5e8;
}

.form-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 11px;
}

.form-actions {
    margin-top: 5px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.push-left {
    margin-right: auto;
}

.colour-row {
    display: flex;
    gap: 7px;
}

.colour-option {
    width: 29px;
    height: 29px;
    border: 2px solid transparent;
    border-radius: 8px;
}

.colour-option.selected {
    border-color: #222;
}

/* =====================================================
   TUTORIAL
   ===================================================== */

.tutorial-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(8,8,9,.76);
}

.tutorial-overlay.hidden {
    display: none;
}

.tutorial-spotlight {
    position: fixed;
    border-radius: 13px;
    pointer-events: none;
    box-shadow:
        0 0 0 9999px rgba(8,8,9,.76),
        0 0 0 2px rgba(255,255,255,.9),
        0 0 28px rgba(255,255,255,.14);
    transition:
        left .35s ease,
        top .35s ease,
        width .35s ease,
        height .35s ease;
}

.tutorial-card {
    position: fixed;
    width: min(360px, calc(100% - 30px));
    padding: 22px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 18px;
    background: #fff;
    color: #171717;
    box-shadow: 0 25px 90px rgba(0,0,0,.3);
    transition:
        left .35s ease,
        top .35s ease;
}

.tutorial-progress {
    color: #9a9aa1;
    font-size: 9px;
}

.tutorial-category {
    margin-top: 15px;
    color: #9a9aa1;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .13em;
}

.tutorial-card h2 {
    margin: 6px 0 8px;
    font-size: 20px;
    letter-spacing: -.4px;
}

.tutorial-card p {
    margin: 0;
    color: #74747b;
    font-size: 11px;
    line-height: 1.6;
}

.tutorial-actions {
    margin-top: 21px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tutorial-skip,
.tutorial-next {
    min-height: 35px;
    padding: 0 12px;
    border-radius: 9px;
    font-size: 10px;
}

.tutorial-skip {
    border: 0;
    background: transparent;
    color: #85858c;
}

.tutorial-next {
    background: #171717;
    color: white;
    font-weight: 600;
}

/* =====================================================
   DARK THEMES
   ===================================================== */

body.theme-dark,
body.theme-dark-main {
    --bg: #171717;
    --panel: #222222;
    --sidebar: #111111;
    --text: #f3f3f3;
    --muted: #a7a7ae;
    --subtle: #8d8d94;
    --border: #35353a;
    --border-strong: #48484d;
}

body.theme-dark .sidebar,
body.theme-dark-main .sidebar {
    border-color: #35353a;
}

body.theme-dark .sidebar {
    background: #111;
}

body.theme-dark-main .sidebar {
    background: #fbfbfc;
    color: #171717;
}

body.theme-dark-main .nav-item {
    color: #62636a;
}

body.theme-dark-main .nav-item:hover,
body.theme-dark-main .nav-item.active {
    color: #171717;
}

body.theme-dark-main .brand-name,
body.theme-dark-main .settings-cog {
    color: #171717;
}

body.theme-dark .topbar,
body.theme-dark-main .topbar {
    background: rgba(23,23,23,.9);
    border-color: #35353a;
}

body.theme-dark-main .topbar {
    color: #f3f3f3;
}

body.theme-dark .panel,
body.theme-dark .task-card,
body.theme-dark .todo-item,
body.theme-dark .inbox-item,
body.theme-dark .project-card,
body.theme-dark .file-card,
body.theme-dark .stat-card,
body.theme-dark .file-section-card,
body.theme-dark .calendar-day,
body.theme-dark .week-column,
body.theme-dark .month-calendar,
body.theme-dark .settings-account-card,
body.theme-dark .settings-card,
body.theme-dark .theme-option,
body.theme-dark-main .panel,
body.theme-dark-main .task-card,
body.theme-dark-main .todo-item,
body.theme-dark-main .inbox-item,
body.theme-dark-main .project-card,
body.theme-dark-main .file-card,
body.theme-dark-main .stat-card,
body.theme-dark-main .file-section-card,
body.theme-dark-main .calendar-day,
body.theme-dark-main .week-column,
body.theme-dark-main .month-calendar,
body.theme-dark-main .settings-account-card,
body.theme-dark-main .settings-card,
body.theme-dark-main .theme-option {
    background: #222;
    border-color: #35353a;
    color: #f3f3f3;
}

body.theme-dark-main .sidebar,
body.theme-dark-main .settings-cog,
body.theme-dark-main .brand-name,
body.theme-dark-main .account-mini-text strong {
    color: #171717;
}

body.theme-dark .secondary-button,
body.theme-dark .sort-select,
body.theme-dark .filter-chip,
body.theme-dark-main .secondary-button,
body.theme-dark-main .sort-select,
body.theme-dark-main .filter-chip {
    background: #27272a;
    border-color: #3c3c40;
    color: #d0d0d5;
}

body.theme-dark .segment.active,
body.theme-dark-main .segment.active {
    background: #27272a;
    color: white;
}

body.theme-dark .segmented-control,
body.theme-dark-main .segmented-control {
    background: #303034;
}

body.theme-dark .inbox-help,
body.theme-dark .calendar-event,
body.theme-dark .week-event,
body.theme-dark .month-event {
    background: #2a2a2d;
    border-color: #3a3a3e;
}

body.theme-dark .field input,
body.theme-dark .field select,
body.theme-dark .field textarea {
    background: #29292c;
    border-color: #404047;
    color: white;
}

body.theme-dark .modal {
    background: #222;
    color: white;
}

body.theme-dark .modal-close {
    background: #333337;
    color: white;
}

body.theme-dark .task-check {
    background: #222;
    border-color: #57575e;
}

body.theme-dark-main .main-content {
    background: #171717;
}

body.theme-dark-sidebar .sidebar {
    background: #111;
    color: white;
}

body.theme-dark-sidebar .main-content {
    background: #f5f5f7;
    color: #171717;
}

body.theme-dark-sidebar .topbar {
    background: rgba(245,245,247,.9);
    color: #171717;
}

body.theme-dark-sidebar .panel,
body.theme-dark-sidebar .task-card,
body.theme-dark-sidebar .todo-item,
body.theme-dark-sidebar .inbox-item,
body.theme-dark-sidebar .project-card,
body.theme-dark-sidebar .file-card,
body.theme-dark-sidebar .stat-card,
body.theme-dark-sidebar .file-section-card,
body.theme-dark-sidebar .calendar-day,
body.theme-dark-sidebar .week-column,
body.theme-dark-sidebar .month-calendar,
body.theme-dark-sidebar .settings-card,
body.theme-dark-sidebar .settings-account-card,
body.theme-dark-sidebar .theme-option {
    background: white;
    color: #171717;
}

body.theme-dark-sidebar .nav-item {
    color: #babac0;
}

body.theme-dark-sidebar .nav-item:hover {
    background: #29292c;
    color: white;
}

body.theme-dark-sidebar .nav-item.active {
    background: #303033;
    color: white;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 1050px) {
    .projects-grid,
    .files-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 850px) {

    .sidebar {
        position: fixed;
        left: -270px;
        z-index: 80;
        transition: left .2s ease;
        box-shadow: 14px 0 35px rgba(0,0,0,.1);
    }

    .sidebar.mobile-open {
        left: 0;
    }

    .mobile-menu {
        display: grid;
        place-items: center;
    }

    .topbar {
        padding: 0 18px;
    }

    .content-area {
        padding: 28px 18px 50px;
    }

    .today-grid,
    .file-detail-columns {
        grid-template-columns: 1fr;
    }

    .calendar-week {
        overflow-x: auto;
        grid-template-columns: repeat(7, minmax(120px, 1fr));
        padding-bottom: 5px;
    }
}

@media (max-width: 650px) {

    .topbar-right {
        gap: 7px;
    }

    .live-clock {
        display: none;
    }

    .view-intro,
    .welcome-row,
    .file-heading-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .calendar-header-actions {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .projects-grid,
    .files-grid,
    .theme-grid {
        grid-template-columns: 1fr;
    }

    .file-detail-stats {
        grid-template-columns: 1fr 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .calendar-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* BETA 2.0 LAYOUT FIX */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100vh;
    z-index: 1000;
}

.main-content {
    margin-left: 250px;
    width: calc(100% - 250px);
    min-width: 0;
    box-sizing: border-box;
}

body {
    overflow-x: hidden;
}