html, body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ---------- Сторінка входу ---------- */

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3f51b5 0%, #7986cb 55%, #ff9800 160%);
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .25);
    padding: 32px 28px;
}

.login-header {
    text-align: center;
    margin-bottom: 24px;
}

.login-logo {
    font-size: 44px;
    line-height: 1;
}

.login-header h1 {
    font-size: 24px;
    margin: 10px 0 4px;
    color: #21255c;
}

.login-header p {
    margin: 0;
    font-size: 13px;
    color: #6b6f8a;
}

.login-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #3b3f5c;
    margin: 14px 0 6px;
}

.login-input {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 12px;
    font-size: 15px;
    border: 1px solid #d3d6e3;
    border-radius: 8px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.login-input:focus {
    border-color: #3f51b5;
    box-shadow: 0 0 0 3px rgba(63, 81, 181, .15);
}

.login-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0 20px;
    font-size: 14px;
    color: #3b3f5c;
    cursor: pointer;
}

.login-button {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: #3f51b5;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s;
}

.login-button:hover {
    background: #32409c;
}

.login-error {
    background: #fdecea;
    color: #b3261e;
    border: 1px solid #f5c6c2;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    margin-bottom: 8px;
}

.login-validation {
    display: block;
    color: #b3261e;
    font-size: 12px;
    margin-top: 4px;
}

/* ---------- Записи ---------- */

.note-content-preview {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: pre-wrap;
    color: var(--mud-palette-text-secondary);
    font-size: .875rem;
}

.note-text-view {
    white-space: pre-wrap;
    word-break: break-word;
}

.checklist-done {
    text-decoration: line-through;
    opacity: .6;
}

.search-highlight {
    background: #ffe082;
    border-radius: 3px;
    padding: 0 2px;
}

.note-card {
    transition: box-shadow .15s, transform .15s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.note-card:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, .14);
    transform: translateY(-2px);
}

/* ---------- Оболонка ---------- */

.quick-search {
    max-width: 420px;
}

.folder-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fab-new-note {
    position: fixed !important;
    right: 16px;
    bottom: 16px;
    z-index: 1200;
}

/* ---------- Смартфони ---------- */

@media (max-width: 599.98px) {
    .mud-main-content .mud-container {
        padding-left: 10px;
        padding-right: 10px;
    }

    .page-actions {
        width: 100%;
    }

    .page-actions .mud-button-root {
        flex: 1 1 auto;
    }

    .note-card {
        margin-bottom: 4px;
    }

    /* заголовки сторінок компактніші */
    .page-title {
        font-size: 1.25rem !important;
    }

    /* таблиці не ламають ширину екрана */
    .mud-table-container {
        overflow-x: auto;
    }

    /* довгі назви файлів переносяться */
    .mud-list-item .mud-link {
        word-break: break-word;
    }
}

#blazor-error-ui {
    background: #ffe082;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1500;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}
