:root {
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    color: #172033;
    background: #f3f5f9;
    font-synthesis: none;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: #f3f5f9;
}

body {
    min-height: 100dvh;
    margin: 0;
    background: #f3f5f9;
}

button,
input {
    font: inherit;
}

button {
    touch-action: manipulation;
}

.topbar {
    position: sticky;
    z-index: 20;
    top: 0;

    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 68px;
    padding:
        calc(10px + env(safe-area-inset-top))
        18px
        10px;

    border-bottom: 1px solid #e6e9ef;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
}

.brand {
    font-size: 16px;
    font-weight: 800;
}

.user-name {
    margin-top: 2px;
    color: #778096;
    font-size: 13px;
}

.icon-button {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;

    border: 0;
    border-radius: 14px;
    background: #eef1f6;
    color: #172033;
    font-size: 21px;
}

.page {
    width: min(100%, 780px);
    margin: 0 auto;
    padding: 24px 16px calc(106px + env(safe-area-inset-bottom));
}

.welcome {
    padding: 4px 2px 22px;
}

.eyebrow {
    margin: 0 0 6px;
    color: #69748b;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1,
h2,
p {
    overflow-wrap: anywhere;
}

h1 {
    margin: 0;
    font-size: clamp(28px, 8vw, 42px);
    line-height: 1.08;
}

h2 {
    margin: 0;
    font-size: 20px;
}

.welcome-text {
    max-width: 540px;
    margin: 10px 0 0;
    color: #687289;
    font-size: 15px;
    line-height: 1.5;
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.quick-card {
    display: flex;
    min-height: 92px;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;

    text-align: left;

    border: 1px solid #e5e9f0;
    border-radius: 20px;
    background: #ffffff;
    color: #172033;
    box-shadow: 0 6px 22px rgba(34, 45, 74, 0.05);
}

.quick-card:active {
    transform: scale(0.98);
}

.quick-icon {
    display: grid;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    place-items: center;

    border-radius: 13px;
    background: #eef1ff;
    font-size: 20px;
}

.quick-card strong,
.quick-card small {
    display: block;
}

.quick-card strong {
    margin-top: 1px;
    font-size: 15px;
}

.quick-card small {
    margin-top: 5px;
    color: #7c8598;
    font-size: 12px;
    line-height: 1.3;
}

.content-card {
    margin-top: 14px;
    padding: 18px;

    border: 1px solid #e5e9f0;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 6px 22px rgba(34, 45, 74, 0.05);
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.badge {
    display: grid;
    min-width: 32px;
    height: 32px;
    place-items: center;

    border-radius: 999px;
    background: #eef1f6;
    color: #657087;
    font-size: 13px;
    font-weight: 800;
}

.empty-state {
    padding: 28px 8px 14px;
    text-align: center;
}

.empty-icon {
    display: grid;
    width: 52px;
    height: 52px;
    margin: 0 auto 12px;
    place-items: center;

    border-radius: 18px;
    background: #f0f2f7;
    font-size: 24px;
}

.empty-state strong {
    font-size: 15px;
}

.empty-state p {
    margin: 7px auto 0;
    color: #7a8498;
    font-size: 13px;
    line-height: 1.45;
}

.bottom-nav {
    position: fixed;
    z-index: 30;
    right: 0;
    bottom: 0;
    left: 0;

    display: grid;
    grid-template-columns: 1fr 1fr 64px 1fr 1fr;
    align-items: end;

    padding:
        8px
        10px
        calc(8px + env(safe-area-inset-bottom));

    border-top: 1px solid #e5e8ef;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
}

.nav-item {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 3px;

    color: #8891a3;
    font-size: 10px;
    text-decoration: none;
}

.nav-item.active {
    color: #26365f;
    font-weight: 800;
}

.nav-item.muted {
    opacity: 0.72;
}

.nav-icon {
    font-size: 20px;
    line-height: 1;
}

.add-button {
    display: grid;
    width: 58px;
    height: 58px;
    margin: -21px auto 2px;
    place-items: center;

    border: 5px solid #ffffff;
    border-radius: 50%;
    background: #293b72;
    color: #ffffff;
    box-shadow: 0 8px 22px rgba(41, 59, 114, 0.3);
    font-size: 31px;
    line-height: 1;
}

.auth-page {
    display: grid;
    min-height: 100dvh;
    padding:
        calc(24px + env(safe-area-inset-top))
        18px
        calc(24px + env(safe-area-inset-bottom));
    place-items: center;
}

.login-card {
    width: min(100%, 420px);
    padding: 28px 22px;

    border: 1px solid #e4e8ef;
    border-radius: 28px;
    background: #ffffff;
    box-shadow: 0 18px 50px rgba(38, 50, 82, 0.09);
}

.login-logo {
    display: grid;
    width: 54px;
    height: 54px;
    margin-bottom: 24px;
    place-items: center;

    border-radius: 18px;
    background: #293b72;
    color: #ffffff;
    font-size: 25px;
    font-weight: 900;
}

.login-description {
    margin: 12px 0 24px;
    color: #747f93;
    font-size: 14px;
    line-height: 1.5;
}

.login-form {
    display: grid;
    gap: 16px;
}

.login-form label span {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 700;
}

.login-form input {
    width: 100%;
    min-height: 52px;
    padding: 0 15px;

    border: 1px solid #dce1e9;
    border-radius: 15px;
    outline: none;
    background: #fafbfc;
    font-size: 16px;
}

.login-form input:focus {
    border-color: #556ca8;
    box-shadow: 0 0 0 4px rgba(85, 108, 168, 0.12);
}

.primary-button {
    min-height: 54px;
    margin-top: 4px;

    border: 0;
    border-radius: 16px;
    background: #293b72;
    color: #ffffff;
    font-weight: 800;
}

.form-error {
    margin-bottom: 18px;
    padding: 12px 14px;

    border-radius: 14px;
    background: #fff0f0;
    color: #a92e2e;
    font-size: 13px;
}

@media (min-width: 760px) {
    .page {
        padding-top: 34px;
    }

    .quick-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .quick-card {
        min-height: 112px;
        flex-direction: column;
    }
}

.add-button {
    text-decoration: none;
}

.page-heading {
    padding: 4px 2px 8px;
}

.page-heading p:last-child {
    margin: 10px 0 0;
    color: #687289;
    line-height: 1.5;
}

.capture-card {
    margin-top: 16px;
}

.capture-form {
    display: grid;
    gap: 14px;
}

.capture-form textarea,
.capture-form select {
    width: 100%;
    border: 1px solid #dce1e9;
    border-radius: 15px;
    outline: none;
    background: #fafbfc;
    color: #172033;
    font-size: 16px;
}

.capture-form textarea {
    min-height: 116px;
    padding: 14px 15px;
    resize: vertical;
}

.capture-form select {
    min-height: 50px;
    padding: 0 13px;
}

.capture-form textarea:focus,
.capture-form select:focus {
    border-color: #556ca8;
    box-shadow: 0 0 0 4px rgba(85, 108, 168, 0.12);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 13px;
}

.form-grid label span {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 700;
}

.messages {
    margin-bottom: 14px;
}

.message {
    padding: 13px 15px;
    border-radius: 15px;
    background: #eaf8ee;
    color: #246b38;
    font-size: 14px;
    font-weight: 700;
}

.field-error {
    color: #a92e2e;
    font-size: 13px;
}

.field-error ul {
    margin: 0;
    padding-left: 18px;
}

.inbox-list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.inbox-item {
    padding: 15px;
    border: 1px solid #e5e9f0;
    border-radius: 18px;
    background: #fafbfc;
}

.inbox-item.processed {
    opacity: 0.58;
}

.inbox-item-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.inbox-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.type-badge,
.visibility-badge {
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.type-badge {
    background: #e9edff;
    color: #344a88;
}

.visibility-badge {
    background: #eef1f5;
    color: #687289;
}

.item-date {
    flex: 0 0 auto;
    color: #8a93a4;
    font-size: 11px;
}

.inbox-content {
    margin: 14px 0;
    color: #253047;
    font-size: 15px;
    line-height: 1.5;
}

.secondary-button {
    min-height: 42px;
    padding: 0 14px;
    border: 0;
    border-radius: 13px;
    background: #edf0f5;
    color: #344158;
    font-size: 13px;
    font-weight: 800;
}

@media (min-width: 600px) {
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.quick-card {
    text-decoration: none;
}

.create-panel summary {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 800;
    list-style: none;
}

.create-panel summary::-webkit-details-marker {
    display: none;
}

.summary-icon {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 12px;
    background: #293b72;
    color: #ffffff;
    font-size: 22px;
}

.create-panel[open] summary {
    margin-bottom: 20px;
}

.erp-form {
    display: grid;
    gap: 15px;
}

.erp-form label > span {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 700;
}

.erp-form input,
.erp-form textarea,
.erp-form select {
    width: 100%;
    min-height: 50px;
    padding: 0 14px;
    border: 1px solid #dce1e9;
    border-radius: 15px;
    outline: none;
    background: #fafbfc;
    color: #172033;
    font-size: 16px;
}

.erp-form textarea {
    min-height: 105px;
    padding-top: 13px;
    padding-bottom: 13px;
    resize: vertical;
}

.erp-form input:focus,
.erp-form textarea:focus,
.erp-form select:focus {
    border-color: #556ca8;
    box-shadow: 0 0 0 4px rgba(85, 108, 168, 0.12);
}

.projects-list {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

.project-card {
    display: block;
    padding: 18px;
    border: 1px solid #e5e9f0;
    border-radius: 22px;
    background: #ffffff;
    color: #172033;
    text-decoration: none;
    box-shadow: 0 6px 22px rgba(34, 45, 74, 0.05);
}

.project-card:active {
    transform: scale(0.99);
}

.project-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.project-kind {
    padding: 5px 9px;
    border-radius: 999px;
    background: #e9edff;
    color: #344a88;
    font-size: 11px;
    font-weight: 800;
}

.project-card h2 {
    margin-top: 15px;
    font-size: 21px;
}

.project-description {
    margin: 8px 0 0;
    color: #707b90;
    font-size: 14px;
    line-height: 1.45;
}

.project-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 18px;
}

.project-stats span {
    padding: 10px 6px;
    border-radius: 13px;
    background: #f4f6f9;
    color: #7a8497;
    text-align: center;
    font-size: 10px;
}

.project-stats strong {
    display: block;
    margin-bottom: 2px;
    color: #263047;
    font-size: 16px;
}

.project-footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
    color: #7b8598;
    font-size: 12px;
}

.back-link {
    display: inline-block;
    margin-bottom: 18px;
    color: #53648f;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
}

.project-header {
    padding: 20px;
    border-radius: 24px;
    background: #293b72;
    color: #ffffff;
}

.project-header h1 {
    margin-top: 17px;
}

.project-header > p {
    margin: 12px 0 0;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.5;
}

.project-header .project-kind {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.project-header .visibility-badge {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
}

.project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.project-meta span {
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 12px;
}

.related-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid #edf0f4;
}

.related-row:last-child {
    border-bottom: 0;
}

.related-row strong,
.related-row small {
    display: block;
}

.related-row strong {
    font-size: 14px;
}

.related-row small {
    margin-top: 4px;
    color: #80899b;
    font-size: 12px;
}

.related-row > span {
    flex: 0 0 auto;
    color: #788296;
    font-size: 12px;
}

.small-empty {
    padding: 24px 4px 10px;
    color: #838c9d;
    font-size: 14px;
    text-align: center;
}

@media (min-width: 760px) {
    .projects-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* Улучшенная интерактивность */

a,
button,
summary {
    -webkit-tap-highlight-color: transparent;
}

.brand-link {
    color: inherit;
    text-decoration: none;
}

.logout-button {
    min-height: 42px;
    padding: 0 14px;

    border: 1px solid #dde2ec;
    border-radius: 13px;
    background: #f3f5f9;
    color: #4a556d;

    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
}

.quick-card,
.project-card,
.nav-item,
.add-button,
.primary-button,
.secondary-button,
.logout-button,
.icon-button,
.create-panel summary {
    transition:
        transform 160ms ease,
        box-shadow 160ms ease,
        border-color 160ms ease,
        background-color 160ms ease,
        color 160ms ease,
        opacity 160ms ease;
}

.quick-card {
    position: relative;
    align-items: center;
    cursor: pointer;
    overflow: hidden;
}

.quick-card > span:nth-child(2) {
    min-width: 0;
    flex: 1;
}

.quick-arrow {
    margin-left: auto;
    color: #a1a9b8;
    font-size: 26px;
    line-height: 1;
}

.quick-card-task .quick-icon {
    background: #e8f7ee;
    color: #247747;
}

.quick-card-event .quick-icon {
    background: #e9efff;
    color: #37589a;
}

.quick-card-inbox .quick-icon {
    background: #fff3de;
    color: #94611b;
}

.quick-card-project .quick-icon {
    background: #f0eaff;
    color: #6842a2;
}

.primary-button,
.secondary-button,
.logout-button,
.add-button {
    cursor: pointer;
}

.nav-item {
    border-radius: 13px;
}

.nav-item.active {
    background: #eef1fa;
    color: #293b72;
}

@media (hover: hover) and (pointer: fine) {
    .quick-card:hover {
        transform: translateY(-3px);
        border-color: #ccd4e3;
        box-shadow: 0 14px 34px rgba(34, 45, 74, 0.12);
    }

    .quick-card:hover .quick-arrow {
        color: #293b72;
        transform: translateX(3px);
    }

    .project-card:hover {
        transform: translateY(-3px);
        border-color: #ccd4e3;
        box-shadow: 0 14px 34px rgba(34, 45, 74, 0.12);
    }

    .nav-item:hover {
        background: #f0f2f7;
        color: #293b72;
    }

    .add-button:hover {
        transform: translateY(-3px) scale(1.05);
        box-shadow: 0 12px 28px rgba(41, 59, 114, 0.42);
    }

    .primary-button:hover {
        background: #344a86;
        box-shadow: 0 9px 24px rgba(41, 59, 114, 0.25);
    }

    .secondary-button:hover,
    .logout-button:hover {
        background: #e4e8f0;
        color: #293b72;
    }

    .create-panel summary:hover {
        color: #344a86;
    }
}

.quick-card:active,
.project-card:active,
.primary-button:active,
.secondary-button:active,
.logout-button:active,
.nav-item:active {
    transform: scale(0.97);
}

.add-button:active {
    transform: scale(0.92);
}

.quick-card:focus-visible,
.project-card:focus-visible,
.nav-item:focus-visible,
.add-button:focus-visible,
.primary-button:focus-visible,
.secondary-button:focus-visible,
.logout-button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
    outline: 3px solid rgba(74, 101, 173, 0.35);
    outline-offset: 3px;
}


/* PERSONAL ERP UPDATE 002: TASKS */

.task-filters form {
    display: grid;
    gap: 12px;
}

.task-filters label > span {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 700;
}

.task-filters select {
    width: 100%;
    min-height: 48px;
    padding: 0 13px;
    border: 1px solid #dce1e9;
    border-radius: 14px;
    background: #fafbfc;
    color: #172033;
    font-size: 15px;
}

.task-section {
    margin-top: 22px;
}

.task-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
    padding: 0 3px;
}

.task-section-heading h2 {
    margin-top: 4px;
}

.danger-heading h2 {
    color: #a63a3a;
}

.task-list {
    display: grid;
    gap: 11px;
}

.task-card {
    display: flex;
    align-items: stretch;
    gap: 12px;
    padding: 14px;
    border: 1px solid #e3e8f0;
    border-radius: 19px;
    background: #ffffff;
    box-shadow: 0 5px 20px rgba(34, 45, 74, 0.04);
    transition:
        transform 160ms ease,
        border-color 160ms ease,
        box-shadow 160ms ease,
        opacity 160ms ease;
}

.task-card.completed {
    opacity: 0.62;
}

.task-check-form {
    display: flex;
    align-items: flex-start;
}

.task-check {
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    place-items: center;
    padding: 0;
    border: 2px solid #aeb8ca;
    border-radius: 10px;
    background: #ffffff;
    color: #ffffff;
    cursor: pointer;
    font-size: 17px;
    font-weight: 900;
    transition:
        transform 150ms ease,
        border-color 150ms ease,
        background-color 150ms ease,
        box-shadow 150ms ease;
}

.task-card.completed .task-check {
    border-color: #34825a;
    background: #34825a;
}

.task-card-body {
    min-width: 0;
    flex: 1;
    color: inherit;
    text-decoration: none;
}

.task-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.task-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.priority-label,
.project-label {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 850;
    text-decoration: none;
}

.priority-low {
    background: #eef1f5;
    color: #6f798b;
}

.priority-normal {
    background: #e9efff;
    color: #405e9e;
}

.priority-high {
    background: #fff1dd;
    color: #99621c;
}

.priority-urgent {
    background: #ffe7e7;
    color: #a13b3b;
}

.project-label {
    background: #f0eaff;
    color: #69479d;
}

.task-arrow {
    color: #a1a9b8;
    font-size: 25px;
    line-height: 1;
}

.task-card h3 {
    margin: 11px 0 0;
    font-size: 16px;
    line-height: 1.35;
}

.task-card.completed h3 {
    text-decoration: line-through;
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 12px;
    margin-top: 9px;
    color: #7b8597;
    font-size: 11px;
}

.task-detail-header {
    padding: 20px;
    border: 1px solid #e0e5ee;
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 8px 28px rgba(34, 45, 74, 0.06);
}

.task-detail-header h1 {
    margin-top: 17px;
    font-size: 27px;
    line-height: 1.22;
}

.task-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 15px 0 19px;
}

.task-detail-meta span {
    padding: 7px 10px;
    border-radius: 999px;
    background: #f1f3f7;
    color: #626d82;
    font-size: 11px;
}

.home-task-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid #edf0f4;
}

.home-task-row:last-of-type {
    border-bottom: 0;
}

.home-task-row form {
    flex: 0 0 auto;
}

.home-task-row > a {
    min-width: 0;
    flex: 1;
    color: inherit;
    text-decoration: none;
}

.home-task-row strong,
.home-task-row small {
    display: block;
}

.home-task-row strong {
    font-size: 14px;
    line-height: 1.35;
}

.home-task-row small {
    margin-top: 5px;
    color: #7c8698;
    font-size: 11px;
}

.section-link,
.small-action-link {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    margin-top: 13px;
    color: #40568f;
    font-size: 13px;
    font-weight: 850;
    text-decoration: none;
}

.small-action-link {
    margin-top: 0;
}

.related-row-link {
    color: inherit;
    text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
    .task-card:hover {
        transform: translateY(-2px);
        border-color: #cbd4e3;
        box-shadow: 0 12px 30px rgba(34, 45, 74, 0.10);
    }

    .task-check:hover {
        transform: scale(1.07);
        border-color: #4b64a0;
        box-shadow: 0 0 0 4px rgba(75, 100, 160, 0.10);
    }

    .section-link:hover,
    .small-action-link:hover,
    .related-row-link:hover {
        color: #293b72;
    }
}

.task-check:active {
    transform: scale(0.9);
}

@media (min-width: 700px) {
    .task-filters form {
        grid-template-columns: 1fr 1fr auto;
        align-items: end;
    }
}


/* PERSONAL ERP UPDATE 003: CALENDAR */

.checkbox-field {
    display: flex !important;
    align-items: center;
    gap: 11px;
    min-height: 48px;
    padding: 0 2px;
}

.checkbox-field input {
    width: 22px !important;
    height: 22px;
    min-height: 22px !important;
    margin: 0;
    accent-color: #40568f;
}

.checkbox-field span {
    margin: 0 !important;
}

.calendar-toolbar {
    display: grid;
    grid-template-columns: 46px 1fr 46px;
    align-items: center;
    gap: 12px;
    margin: 18px 0 12px;
    padding: 14px;
    border: 1px solid #e1e6ef;
    border-radius: 19px;
    background: #ffffff;
    text-align: center;
    box-shadow: 0 5px 20px rgba(34, 45, 74, 0.04);
}

.calendar-toolbar strong {
    display: block;
    margin-top: 4px;
    font-size: 15px;
}

.calendar-nav-button {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 14px;
    background: #f1f3f7;
    color: #344a86;
    font-size: 20px;
    font-weight: 900;
    text-decoration: none;
    transition: 150ms ease;
}

.week-strip {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 16px;
}

.week-day {
    display: grid;
    min-width: 43px;
    min-height: 66px;
    place-items: center;
    align-content: center;
    gap: 3px;
    border: 1px solid #e2e6ee;
    border-radius: 15px;
    background: #ffffff;
    color: #657086;
    text-decoration: none;
    transition: 150ms ease;
}

.week-day span {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.week-day strong {
    font-size: 17px;
}

.week-day small {
    display: grid;
    min-width: 18px;
    height: 18px;
    place-items: center;
    border-radius: 999px;
    background: #e9edff;
    color: #40568f;
    font-size: 9px;
    font-weight: 900;
}

.week-day.today {
    border-color: #91a3d1;
}

.week-day.selected {
    border-color: #293b72;
    background: #293b72;
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(41, 59, 114, 0.23);
}

.week-day.selected small {
    background: rgba(255, 255, 255, 0.17);
    color: #ffffff;
}

.calendar-days {
    display: grid;
    gap: 14px;
}

.calendar-day-card {
    padding: 16px;
    border: 1px solid #e2e7ef;
    border-radius: 21px;
    background: #ffffff;
    box-shadow: 0 5px 20px rgba(34, 45, 74, 0.04);
}

.calendar-day-card.today {
    border-color: #9aaad0;
    box-shadow: 0 8px 26px rgba(52, 75, 135, 0.10);
}

.calendar-day-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.calendar-day-heading h2 {
    margin-top: 4px;
    font-size: 17px;
}

.calendar-event-list {
    display: grid;
    gap: 9px;
}

.calendar-event-card {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 11px;
    padding: 12px;
    border-left: 4px solid #566ea8;
    border-radius: 15px;
    background: #f7f9fc;
    color: inherit;
    text-decoration: none;
    transition: 150ms ease;
}

.calendar-event-card.shared {
    border-left-color: #7d55a6;
}

.calendar-event-time {
    color: #35445f;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.25;
}

.calendar-event-time small {
    display: block;
    margin-top: 3px;
    color: #8a93a3;
    font-size: 10px;
}

.calendar-event-body {
    min-width: 0;
}

.calendar-event-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.calendar-event-body > strong {
    display: block;
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.35;
}

.calendar-event-body > small {
    display: block;
    margin-top: 5px;
    overflow: hidden;
    color: #7b8597;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-empty {
    padding: 18px 4px;
    color: #8a93a3;
    font-size: 13px;
    text-align: center;
}

.event-detail-header {
    padding: 20px;
    border-radius: 24px;
    background: linear-gradient(145deg, #293b72, #405990);
    color: #ffffff;
    box-shadow: 0 12px 32px rgba(41, 59, 114, 0.20);
}

.event-detail-header h1 {
    margin-top: 17px;
    font-size: 27px;
    line-height: 1.22;
}

.event-detail-header .visibility-badge,
.event-detail-header .project-label {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.event-datetime {
    display: grid;
    gap: 4px;
    margin-top: 17px;
}

.event-datetime strong {
    font-size: 15px;
}

.event-datetime span,
.event-location,
.event-detail-header > p {
    color: rgba(255, 255, 255, 0.78);
    font-size: 13px;
}

.event-location {
    margin-top: 13px;
}

.event-detail-header > p {
    margin: 16px 0 0;
    line-height: 1.55;
}

.event-related-link {
    display: inline-flex;
    margin-top: 16px;
    padding: 8px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.13);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
    .calendar-nav-button:hover,
    .week-day:hover {
        transform: translateY(-2px);
        box-shadow: 0 7px 17px rgba(41, 59, 114, 0.10);
    }

    .calendar-event-card:hover {
        transform: translateX(3px);
        background: #f0f3f9;
        box-shadow: 0 7px 18px rgba(41, 59, 114, 0.08);
    }
}

.calendar-nav-button:active,
.week-day:active,
.calendar-event-card:active {
    transform: scale(0.97);
}

@media (min-width: 820px) {
    .calendar-days {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* PERSONAL ERP UPDATE 004: NOTES AND MORE */

.quick-card-note .quick-icon {
    background: #e8f5f1;
    color: #2d765f;
}

.note-filters form {
    display: grid;
    gap: 12px;
}

.note-filters label > span {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 700;
}

.note-filters input[type="search"],
.note-filters select {
    width: 100%;
    min-height: 48px;
    padding: 0 13px;
    border: 1px solid #dce1e9;
    border-radius: 14px;
    background: #fafbfc;
    color: #172033;
    font-size: 15px;
}

.compact-checkbox {
    min-height: 48px;
}

.notes-grid {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

.note-card {
    overflow: hidden;
    border: 1px solid #e2e7ef;
    border-radius: 21px;
    background: #ffffff;
    box-shadow: 0 6px 22px rgba(34, 45, 74, 0.05);
    transition:
        transform 160ms ease,
        border-color 160ms ease,
        box-shadow 160ms ease;
}

.note-card.pinned {
    border-color: #b5a6d5;
    box-shadow: 0 8px 26px rgba(91, 65, 139, 0.10);
}

.note-card-body {
    display: block;
    padding: 17px;
    color: inherit;
    text-decoration: none;
}

.note-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.note-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.note-type-label {
    display: inline-flex;
    min-height: 25px;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    background: #e8f5f1;
    color: #2d765f;
    font-size: 10px;
    font-weight: 850;
}

.pin-mark {
    color: #704aa3;
    font-size: 15px;
}

.note-card h2 {
    margin-top: 15px;
    font-size: 19px;
    line-height: 1.3;
}

.note-card-body > p {
    margin: 10px 0 0;
    color: #667186;
    font-size: 13px;
    line-height: 1.55;
}

.note-card-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    color: #8a93a3;
    font-size: 10px;
}

.note-pin-form {
    padding: 0 17px 15px;
}

.note-pin-button {
    min-height: 38px;
    padding: 0 12px;
    border: 0;
    border-radius: 12px;
    background: #f1f3f7;
    color: #58647a;
    cursor: pointer;
    font-size: 11px;
    font-weight: 850;
    transition: 150ms ease;
}

.notes-empty-card {
    margin-top: 0;
}

.note-detail-card {
    padding: 21px;
    border: 1px solid #e0e5ed;
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 10px 32px rgba(34, 45, 74, 0.07);
}

.note-detail-card h1 {
    margin-top: 18px;
    font-size: 28px;
    line-height: 1.25;
}

.note-content {
    margin-top: 19px;
    color: #303a4e;
    font-size: 15px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.note-content p {
    margin: 0 0 14px;
}

.note-detail-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #edf0f4;
    color: #858fa1;
    font-size: 11px;
}

.more-grid {
    display: grid;
    gap: 13px;
    margin-top: 17px;
}

.more-card {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    padding: 15px;
    border: 1px solid #e2e7ef;
    border-radius: 19px;
    background: #ffffff;
    color: inherit;
    text-decoration: none;
    box-shadow: 0 5px 20px rgba(34, 45, 74, 0.04);
    transition:
        transform 150ms ease,
        border-color 150ms ease,
        box-shadow 150ms ease;
}

.more-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 15px;
    background: #eef1fa;
    color: #40568f;
    font-size: 20px;
    font-weight: 850;
}

.more-card strong,
.more-card small {
    display: block;
}

.more-card strong {
    font-size: 15px;
}

.more-card small {
    margin-top: 5px;
    color: #7c8698;
    font-size: 11px;
    line-height: 1.35;
}

.more-count {
    display: grid;
    min-width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 999px;
    background: #f0f2f6;
    color: #536078;
    font-size: 11px;
    font-weight: 850;
}

@media (hover: hover) and (pointer: fine) {
    .note-card:hover,
    .more-card:hover {
        transform: translateY(-3px);
        border-color: #cbd4e3;
        box-shadow: 0 13px 30px rgba(34, 45, 74, 0.10);
    }

    .note-pin-button:hover {
        background: #e5e9f1;
        color: #344a86;
    }
}

.note-card:active,
.more-card:active {
    transform: scale(0.98);
}

@media (min-width: 720px) {
    .notes-grid,
    .more-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .note-filters form {
        grid-template-columns: 2fr 1fr 1fr;
        align-items: end;
    }

    .note-filters .compact-checkbox,
    .note-filters button {
        align-self: end;
    }
}


/* PERSONAL ERP UPDATE 005: INBOX PROCESSING */

.conversion-label {
    margin: 4px 0 9px;
    color: #7c8698;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.conversion-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.conversion-grid form {
    min-width: 0;
}

.conversion-button {
    display: flex;
    width: 100%;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 9px;
    border: 0;
    border-radius: 13px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 850;
    transition:
        transform 150ms ease,
        box-shadow 150ms ease,
        filter 150ms ease;
}

.conversion-button strong {
    font-size: 16px;
}

.task-conversion {
    background: #e8f7ee;
    color: #287148;
}

.event-conversion {
    background: #e9efff;
    color: #405e9e;
}

.note-conversion {
    background: #e8f5f1;
    color: #2d765f;
}

.project-conversion {
    background: #f0eaff;
    color: #69479d;
}

.manual-process-form {
    margin-top: 10px;
}

.processed-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 13px;
    background: #edf7f0;
    color: #34714b;
    font-size: 11px;
    font-weight: 800;
}

.processed-result a {
    color: #40568f;
    text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
    .conversion-button:hover {
        transform: translateY(-2px);
        filter: brightness(0.98);
        box-shadow: 0 8px 18px rgba(34, 45, 74, 0.10);
    }

    .processed-result a:hover {
        text-decoration: underline;
    }
}

.conversion-button:active {
    transform: scale(0.96);
}

@media (min-width: 650px) {
    .conversion-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}


/* PERSONAL ERP UPDATE 006: FAMILY SHARING */

.erp-form ul[id$="_participants"] {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.erp-form ul[id$="_participants"] li {
    margin: 0;
}

.erp-form ul[id$="_participants"] label {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #e0e5ed;
    border-radius: 13px;
    background: #fafbfc;
    cursor: pointer;
}

.erp-form ul[id$="_participants"] input {
    width: 20px;
    height: 20px;
    min-height: 20px;
    margin: 0;
    accent-color: #40568f;
}

.participant-summary {
    margin-top: 15px;
    padding: 10px 12px;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.78);
    font-size: 11px;
    line-height: 1.5;
}

.participant-summary strong {
    color: #ffffff;
}

.family-user-list {
    display: grid;
    gap: 10px;
    margin-top: 15px;
}

.family-user-card {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid #e3e7ee;
    border-radius: 16px;
    background: #fafbfc;
}

.family-avatar {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 15px;
    background: #e9edff;
    color: #40568f;
    font-size: 18px;
    font-weight: 900;
}

.family-user-card strong,
.family-user-card small,
.family-user-card div > span {
    display: block;
}

.family-user-card strong {
    font-size: 14px;
}

.family-user-card small {
    margin-top: 4px;
    color: #7d8798;
    font-size: 11px;
}

.family-user-card div > span {
    margin-top: 4px;
    color: #9aa2b0;
    font-size: 10px;
}

.admin-label {
    padding: 6px 8px;
    border-radius: 999px;
    background: #f0eaff;
    color: #69479d;
    font-size: 9px;
    font-weight: 850;
}

.field-help {
    display: block;
    margin-top: 6px;
    color: #838d9f;
    font-size: 10px;
    line-height: 1.4;
}

@media (hover: hover) and (pointer: fine) {
    .erp-form ul[id$="_participants"] label:hover {
        border-color: #b5c0d8;
        background: #f2f5fa;
    }
}
