:root {
    color-scheme: light;
    --ink: #121820;
    --muted: #72808f;
    --line: #d6dde6;
    --surface: #ffffff;
    --page: #eef3f6;
    --primary: #09b96d;
    --primary-dark: #07995b;
    --accent: #e5484d;
    --focus: #8de6b8;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--page);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

.auth-page {
    background:
            linear-gradient(90deg, rgba(2, 7, 12, 0.18), rgba(246, 241, 228, 0.20)),
            linear-gradient(180deg, rgba(248, 252, 250, 0.15), rgba(9, 13, 18, 0.18)),
            url("https://images.unsplash.com/photo-1464822759023-fed622ff2c3b?auto=format&fit=crop&w=2400&q=85");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-panel,
.panel {
    width: min(100%, 460px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 50px rgba(23, 32, 42, 0.08);
    padding: 24px;
}

.auth-panel {
    width: min(100%, 440px);
    min-height: 420px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 56px;
    color: #fff;
    background: rgba(20, 23, 24, 0.80);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    box-shadow: 0 24px 54px rgba(4, 8, 12, 0.38);
    backdrop-filter: blur(10px);
}

.welcome-panel {
    width: min(100%, 520px);
    min-height: 430px;
    text-align: center;
    align-items: center;
}

.brand-row,
.section-head,
.topbar,
.nav-actions {
    display: flex;
    align-items: center;
}

.brand-row {
    gap: 14px;
    margin-bottom: 22px;
}

.brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: rgba(9, 185, 109, 0.16);
    border: 1px solid rgba(9, 185, 109, 0.55);
    color: #fff;
    font-weight: 800;
    margin: 0 auto 20px;
}

.brand-mark.small {
    width: 32px;
    height: 32px;
    font-size: 13px;
    margin: 0;
    background: var(--primary);
    border-color: var(--primary);
}

h1,
h2,
p {
    margin: 0;
}

h1 {
    font-size: 34px;
    line-height: 1.15;
    text-align: center;
}

h2 {
    font-size: 20px;
}

p {
    color: var(--muted);
    margin-top: 4px;
}

.auth-panel p {
    color: rgba(255, 255, 255, 0.78);
    text-align: center;
    font-size: 18px;
    line-height: 1.55;
    margin-top: 18px;
}

.form-stack,
.welcome-actions,
.note-form {
    display: grid;
    gap: 18px;
}

.auth-panel .form-stack {
    margin-top: 42px;
}

label {
    display: grid;
    gap: 4px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.48);
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 13px;
    font: inherit;
    color: var(--ink);
    background: #fff;
}

.auth-panel input {
    border: 0;
    border-bottom: 2px solid rgba(255, 255, 255, 0.34);
    border-radius: 0;
    padding: 9px 0 12px;
    color: #fff;
    background: transparent;
}

.auth-panel input::placeholder {
    color: rgba(255, 255, 255, 0.42);
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus {
    outline: 3px solid rgba(141, 230, 184, 0.36);
    border-color: var(--focus);
}

.auth-panel input:focus {
    outline: 0;
    border-color: var(--primary);
}

button,
.primary-btn,
.secondary-btn,
.ghost-btn {
    border: 0;
    border-radius: 999px;
    min-height: 42px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
}

.primary-btn {
    background: var(--primary);
    color: #fff;
}

.primary-btn:hover {
    background: var(--primary-dark);
}

.secondary-btn {
    border: 2px solid var(--primary);
    background: transparent;
    color: var(--primary);
}

.secondary-btn.danger-outline {
    border-color: var(--accent);
    color: var(--accent);
}

.ghost-btn {
    background: transparent;
    color: var(--primary);
}

.compact {
    min-height: 34px;
    padding: 0 12px;
}

.split-actions {
    display: grid;
    margin-top: 18px;
    text-align: center;
}

.welcome-actions {
    width: 100%;
    margin-top: 54px;
}

.welcome-actions .primary-btn,
.welcome-actions .secondary-btn,
.auth-panel .primary-btn {
    min-height: 54px;
    font-size: 18px;
}

.ghost-link {
    color: var(--primary);
    font-weight: 800;
}

.message {
    min-height: 22px;
    margin-top: 16px;
    color: #73e4ad;
    font-weight: 700;
    text-align: center;
}

.message.error {
    color: #ff8a8f;
}

.topbar {
    min-height: 64px;
    justify-content: space-between;
    padding: 0 24px;
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
}

.nav-actions {
    gap: 10px;
}

.avatar-btn,
.profile-avatar-preview {
    width: 46px;
    height: 46px;
    border: 2px solid rgba(9, 185, 109, 0.38);
    border-radius: 50%;
    padding: 0;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: #eafaf2;
    color: var(--primary-dark);
    font-weight: 900;
}

.avatar-btn {
    min-height: 46px;
}

.avatar-btn:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(9, 185, 109, 0.12);
}

.avatar-btn img,
.profile-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-layout {
    width: min(1180px, calc(100% - 32px));
    margin: 24px auto;
    display: grid;
    grid-template-columns: 390px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.app-layout.single {
    grid-template-columns: 1fr;
}

.admin-layout {
    width: min(1600px, calc(100% - 48px));
    margin: 30px auto;
    display: grid;
    grid-template-columns: minmax(420px, 0.75fr) minmax(620px, 1.5fr);
    gap: 24px;
    align-items: start;
}

.admin-layout .panel {
    width: 100%;
    padding: 26px 30px;
    border-radius: 10px;
}

.admin-layout .section-head {
    align-items: flex-start;
    margin-bottom: 22px;
}

.admin-layout .section-head h1 {
    text-align: left;
    font-size: 34px;
    line-height: 1.1;
}

.admin-layout .section-head p {
    max-width: 780px;
    line-height: 1.35;
}

.admin-layout .item-list {
    gap: 14px;
}

.admin-layout .item {
    position: relative;
    padding: 16px 18px;
    border-radius: 8px;
}

.admin-layout .monitoring-item {
    padding: 18px 190px 18px 20px;
}

.app-layout .panel {
    width: 100%;
}

.section-head {
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.item-list {
    display: grid;
    gap: 12px;
}

.item {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: #fff;
}

.item h3 {
    margin: 0 0 8px;
    font-size: 17px;
}

.item p {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.pill {
    border-radius: 999px;
    background: #eef3f1;
    color: #315f59;
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 800;
}

.pill.danger {
    background: #fdebea;
    color: var(--accent);
}

.monitoring-item {
    overflow: hidden;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.monitoring-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.10);
}

.monitoring-item::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
}

.monitoring-item.open {
    border-color: #f5b8b4;
    background: linear-gradient(90deg, #fff7f7 0%, #ffffff 44%);
}

.monitoring-item.reviewed {
    border-color: #bdebd5;
    background: linear-gradient(90deg, #f5fff9 0%, #ffffff 44%);
}

.monitoring-item.open::before {
    background: #f04438;
}

.monitoring-item.reviewed::before {
    background: #00bf63;
}

.monitoring-item h3 {
    font-size: 18px;
    line-height: 1.3;
}

.monitoring-item.open h3 {
    color: #1f2937;
}

.monitoring-item.reviewed h3 {
    color: #244033;
}

.monitoring-item.open .pill {
    background: #fff1f1;
    color: #9f2d26;
}

.monitoring-item.reviewed .pill {
    background: #ecf8f1;
    color: #176445;
}

.monitor-status {
    position: absolute;
    top: 18px;
    right: 18px;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 0 12px;
    font-size: 13px;
    font-weight: 900;
}

.monitor-status::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.monitor-status.open {
    border: 1px solid #fac5c1;
    background: #fff1f1;
    color: #b42318;
}

.monitor-status.open::before {
    background: #f04438;
    box-shadow: 0 0 0 4px rgba(240, 68, 56, 0.14);
}

.monitor-status.reviewed {
    border: 1px solid #a9e8cc;
    background: #ecfdf3;
    color: #067647;
}

.monitor-status.reviewed::before {
    background: #00bf63;
    box-shadow: 0 0 0 4px rgba(0, 191, 99, 0.14);
}

.monitoring-item.open .secondary-btn {
    border-color: #f04438;
    background: #f04438;
    color: #fff;
}

.monitoring-item.reviewed .secondary-btn {
    border-color: #a9e8cc;
    background: #f6fef9;
    color: #067647;
    cursor: default;
}

@media (max-width: 720px) {
    .admin-layout .monitoring-item {
        padding: 64px 16px 16px 18px;
    }

    .monitor-status {
        top: 16px;
        right: auto;
        left: 18px;
        max-width: calc(100% - 34px);
    }
}

.user-item h3 {
    overflow-wrap: anywhere;
}

.user-item p {
    line-height: 1.3;
}

.users-panel .item {
    width: 100%;
}

.list-panel .item h3 {
    line-height: 1.25;
}

.list-panel .item > p {
    margin-top: 8px;
    line-height: 1.45;
}

.list-panel .meta-row {
    align-items: center;
}

.hidden {
    display: none;
}

.profile-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(11, 18, 24, 0.46);
}

.profile-modal.hidden {
    display: none;
}

.profile-dialog {
    width: min(100%, 620px);
    max-height: min(92vh, 760px);
    overflow: auto;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
}

.profile-dialog-head,
.profile-avatar-row,
.profile-dialog-actions,
.profile-dialog-actions > div {
    display: flex;
    align-items: center;
}

.profile-dialog-head {
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.profile-dialog-head h2 {
    font-size: 24px;
}

.icon-btn {
    width: 38px;
    min-height: 38px;
    padding: 0;
    border-radius: 50%;
    background: #f2f6f8;
    color: #344256;
    font-size: 18px;
}

.profile-form {
    display: grid;
    gap: 18px;
}

.profile-avatar-row {
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    border: 1px solid #e2eaf1;
    border-radius: 12px;
    background: #f8fbfa;
}

.profile-avatar-preview {
    width: 84px;
    height: 84px;
    font-size: 26px;
}

.profile-avatar-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.file-btn {
    position: relative;
    overflow: hidden;
}

.file-btn input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

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

.profile-field-wide {
    grid-column: 1 / -1;
}

.profile-fields input[readonly] {
    color: #64748b;
    background: #f4f7f9;
}

.profile-dialog .message {
    min-height: 20px;
    margin-top: 0;
    color: var(--primary);
}

.profile-dialog .message.error {
    color: var(--accent);
}

.profile-dialog-actions {
    justify-content: space-between;
    gap: 12px;
}

.profile-dialog-actions > div {
    gap: 8px;
}

.workspace-page {
    background:
            radial-gradient(circle at top left, rgba(9, 185, 109, 0.14), transparent 34%),
            linear-gradient(180deg, #f8fbfa 0%, #eef4f7 100%);
}

.workspace-page .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 74px;
    padding: 0 30px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(14px);
}

.workspace-page .brand-link {
    font-size: 22px;
}

.workspace-layout {
    width: min(1480px, calc(100% - 48px));
    margin: 30px auto 56px;
}

.workspace-hero {
    min-height: 190px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 520px;
    gap: 24px;
    align-items: end;
    padding: 34px;
    border: 1px solid rgba(9, 185, 109, 0.18);
    border-radius: 18px;
    color: #fff;
    background:
            linear-gradient(135deg, rgba(10, 33, 38, 0.94), rgba(7, 78, 69, 0.88)),
            url("https://images.unsplash.com/photo-1493246507139-91e8fad9978e?auto=format&fit=crop&w=1800&q=80");
    background-size: cover;
    background-position: center;
    box-shadow: 0 26px 70px rgba(17, 35, 43, 0.16);
    overflow: hidden;
}

.workspace-hero h1 {
    text-align: left;
    font-size: 48px;
}

.workspace-hero p {
    color: rgba(255, 255, 255, 0.74);
    font-size: 18px;
}

.eyebrow {
    margin-bottom: 10px;
    color: #7df0b7 !important;
    font-size: 12px !important;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.stat-card {
    min-height: 112px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(12px);
}

.stat-card span {
    display: block;
    color: #fff;
    font-size: 34px;
    font-weight: 900;
}

.stat-card p {
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.68);
    font-weight: 800;
}

.workspace-grid {
    display: grid;
    grid-template-columns: 430px minmax(0, 1fr);
    gap: 24px;
    margin-top: 24px;
    align-items: start;
}

.compose-panel,
.notes-panel {
    border: 1px solid rgba(201, 213, 225, 0.9);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 20px 55px rgba(20, 32, 44, 0.08);
}

.compose-panel {
    position: sticky;
    top: 98px;
    padding: 26px;
}

.notes-panel {
    min-height: 520px;
    padding: 26px;
}

.compose-panel h2,
.notes-panel h2 {
    font-size: 26px;
}

.compose-panel p,
.notes-panel p {
    color: #617085;
}

.workspace-page .section-head {
    margin-bottom: 22px;
}

.field-label {
    gap: 9px;
    color: #334155;
    font-size: 14px;
    font-weight: 900;
}

.field-label input,
.field-label textarea,
.search-row input,
.search-row select {
    border: 1px solid #d5dee9;
    border-radius: 12px;
    background: #fbfdff;
    color: var(--ink);
}

.field-label input,
.field-label textarea {
    padding: 14px 15px;
}

.note-form {
    gap: 16px;
}

.form-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
}

.form-actions .secondary-btn {
    min-height: 54px;
    border-color: #d7e1ea;
    color: #475569;
}

.compose-panel .message {
    min-height: 24px;
    color: var(--primary);
}

.compose-panel .message.error {
    color: var(--accent);
}

.notes-toolbar {
    align-items: center;
}

.search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 170px;
    gap: 12px;
    margin-bottom: 20px;
}

.search-row input,
.search-row select {
    min-height: 46px;
    padding: 0 14px;
    font: inherit;
}

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

.note-card {
    min-height: 210px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    border: 1px solid #dce5ee;
    border-radius: 16px;
    background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 251, 250, 0.98));
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.note-card.done {
    background:
            linear-gradient(180deg, rgba(245, 252, 248, 0.98), rgba(237, 249, 243, 0.98));
}

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

.status-badge,
.note-date {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 900;
}

.status-badge.todo {
    background: #fff4d6;
    color: #8a5c00;
}

.status-badge.done {
    background: #dbf8e8;
    color: #087845;
}

.note-date {
    background: #eef4f7;
    color: #607184;
}

.note-card h3 {
    margin: 4px 0 0;
    font-size: 22px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.note-card p {
    flex: 1;
    color: #59677a;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.note-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    padding-top: 8px;
    border-top: 1px solid #e8eef4;
}

.note-action {
    min-height: 34px;
    border: 1px solid #dce5ee;
    border-radius: 999px;
    background: #fff;
    color: #334155;
    font-size: 13px;
}

.note-action:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.note-action.danger:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.empty-notes {
    grid-column: 1 / -1;
    min-height: 220px;
    display: grid;
    place-items: center;
    gap: 8px;
    align-content: center;
    border: 1px dashed #bdd0df;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.62);
    color: #607184;
    text-align: center;
}

.empty-notes strong {
    color: var(--ink);
    font-size: 22px;
}

.empty-notes span {
    font-size: 15px;
}

@media (max-width: 820px) {
    .app-layout,
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-layout {
        width: min(100% - 28px, 1600px);
        margin-top: 18px;
    }

    .topbar {
        padding: 10px 16px;
        gap: 12px;
        flex-wrap: wrap;
    }
}

@media (max-width: 1050px) {
    .workspace-hero,
    .workspace-grid {
        grid-template-columns: 1fr;
    }

    .compose-panel {
        position: static;
    }
}

@media (max-width: 720px) {
    .workspace-layout {
        width: min(100% - 28px, 1480px);
        margin-top: 18px;
    }

    .workspace-hero {
        padding: 24px;
    }

    .workspace-hero h1 {
        font-size: 38px;
    }

    .stats-grid,
    .notes-grid,
    .search-row,
    .form-actions,
    .profile-fields {
        grid-template-columns: 1fr;
    }

    .profile-avatar-row,
    .profile-dialog-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .profile-avatar-actions,
    .profile-dialog-actions > div {
        justify-content: stretch;
    }

    .profile-avatar-actions > *,
    .profile-dialog-actions button {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .auth-shell {
        padding: 18px;
    }

    .auth-panel {
        min-height: auto;
        padding: 36px 28px;
        border-radius: 16px;
    }

    h1 {
        font-size: 30px;
    }

    .auth-panel p {
        font-size: 16px;
    }
}
