html, body {
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.tinycrm-loading {
    padding: 2rem;
    font-size: 1.1rem;
    color: #555;
}

.tinycrm-secret {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: 0.08em;
    word-break: break-all;
}

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

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

.tinycrm-qr svg {
    display: block;
    width: 220px;
    height: 220px;
    background: #fff;
    padding: 8px;
    border-radius: 4px;
}

.tinycrm-clickable {
    cursor: pointer;
}

.tinycrm-note-body {
    white-space: pre-wrap;
}

.tinycrm-contact-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.25rem;
}

.tinycrm-row-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.125rem;
}

.tinycrm-board {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    align-items: flex-start;
}

.tinycrm-board-column {
    flex: 0 0 292px;
    display: flex;
    flex-direction: column;
    background: var(--mud-palette-background-gray);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 10px;
    padding: 0.5rem;
    min-height: 160px;
}

.tinycrm-board-column-head {
    padding: 0.35rem 0.4rem 0.6rem;
    border-bottom: 3px solid var(--mud-palette-primary);
    margin-bottom: 0.5rem;
}

.tinycrm-board-zone {
    flex: 1 1 auto;
    min-height: 80px;
    border-radius: 8px;
    padding: 2px;
}

.tinycrm-board-zone.tinycrm-can-drop {
    outline: 2px dashed var(--mud-palette-primary);
    outline-offset: -2px;
    background: rgba(36, 82, 122, 0.06);
}

.tinycrm-board-card {
    word-break: break-word;
    border: 1px solid var(--mud-palette-lines-default);
    border-left: 3px solid var(--mud-palette-secondary);
    transition: box-shadow 120ms ease, transform 120ms ease;
}

.tinycrm-board-card:hover {
    box-shadow: 0 4px 14px rgba(16, 24, 40, 0.12);
}

.tinycrm-board-card.tinycrm-draggable {
    cursor: grab;
}

.tinycrm-dragging {
    opacity: 0.55;
    transform: rotate(1.5deg);
}

.tinycrm-board-amount {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.tinycrm-stage-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
}

/* Stage 5H Block 19G: temporary password shown once on the users page */
.tinycrm-temp-password {
    font-size: 1.25rem;
    letter-spacing: 0.08em;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.06);
    user-select: all;
}

/* ------------------------------------------------------------------
 * Stage 5H Block 19I: layout and look
 * ------------------------------------------------------------------ */

.tinycrm-appbar {
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.tinycrm-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: inherit;
    text-decoration: none;
    margin-left: 0.25rem;
}

.tinycrm-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--mud-palette-primary), var(--mud-palette-secondary));
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
}

.tinycrm-brand-name {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
}

.tinycrm-user-button {
    text-transform: none;
    padding-left: 4px;
    padding-right: 8px;
}

.tinycrm-drawer .mud-nav-link {
    border-radius: 8px;
    margin: 2px 10px;
    padding-top: 9px;
    padding-bottom: 9px;
    width: auto;
}

.tinycrm-drawer .mud-nav-link.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-weight: 600;
}

.tinycrm-drawer .mud-nav-link.active .mud-nav-link-icon {
    color: var(--mud-palette-secondary);
}

.tinycrm-nav-section {
    margin: 18px 22px 6px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mud-palette-drawer-icon);
}

.tinycrm-main {
    background: var(--mud-palette-background);
    min-height: 100vh;
}

.tinycrm-auth {
    min-height: calc(100vh - var(--mud-appbar-height));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem 4rem;
    background:
        radial-gradient(1200px 500px at 10% -10%, rgba(36, 82, 122, 0.16), transparent 60%),
        radial-gradient(900px 400px at 110% 110%, rgba(224, 123, 57, 0.14), transparent 60%),
        var(--mud-palette-background);
}

.tinycrm-auth-panel {
    width: 100%;
    max-width: 460px;
}

.tinycrm-auth-panel > .mud-paper {
    border: 1px solid var(--mud-palette-lines-default);
    box-shadow: 0 12px 40px rgba(16, 24, 40, 0.10);
}

/* Cards: hairline border and a soft shadow instead of the default elevation */
.tinycrm-main .mud-paper.mud-elevation-1 {
    border: 1px solid var(--mud-palette-lines-default);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.tinycrm-main .mud-simple-table table thead th {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

/* Page header */
.tinycrm-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.tinycrm-page-header-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tinycrm-page-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(36, 82, 122, 0.10);
    color: var(--mud-palette-primary);
}

.tinycrm-page-subtitle {
    color: var(--mud-palette-text-secondary);
}

/* Timeline */
.tinycrm-timeline-day {
    margin: 0.75rem 0 0.25rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

.tinycrm-timeline .mud-timeline-item-content {
    padding-top: 2px;
}

.tinycrm-note {
    border-radius: 8px;
    border: 1px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-surface);
    padding: 0.6rem 0.75rem;
    margin-top: 0.35rem;
}

.tinycrm-note.tinycrm-note-pinned {
    border-color: var(--mud-palette-secondary);
    background: rgba(224, 123, 57, 0.06);
}

/* My tasks buckets */
.tinycrm-bucket {
    border-left: 4px solid var(--mud-palette-primary);
}

.tinycrm-bucket-overdue {
    border-left-color: var(--mud-palette-error);
}

.tinycrm-bucket-today {
    border-left-color: var(--mud-palette-secondary);
}

.tinycrm-bucket-later,
.tinycrm-bucket-nodue {
    border-left-color: var(--mud-palette-lines-inputs);
}

.tinycrm-name-cell {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* Stage 5H Block 19J: attachments (links) */
.tinycrm-link-row {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.tinycrm-link-row:last-of-type {
    border-bottom: 0;
}

.tinycrm-link-title {
    font-weight: 600;
    word-break: break-word;
}

.tinycrm-task-attachments {
    background: var(--mud-palette-background-gray);
    padding: 0.5rem 1rem !important;
}

/* Stage 5H Block 20E: file picker of the partner import. */
.tinycrm-file-pick {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: var(--mud-default-borderradius);
    background: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
    font-weight: 500;
    cursor: pointer;
}

.tinycrm-file-pick:hover {
    background: var(--mud-palette-primary-darken);
}

.tinycrm-file-pick input {
    display: none;
}

/* Stage 5H Block 20F: honeypot field of the registration form. */
.tinycrm-hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ------------------------------------------------------------------
 * Stage 5H Block 21D: global search in the app bar
 * ------------------------------------------------------------------ */

.tinycrm-search-slot {
    width: min(460px, 40vw);
}

.tinycrm-search-slot .tinycrm-search {
    width: 100%;
}

.tinycrm-search-slot .mud-input-control {
    margin-top: 0;
    margin-bottom: 0;
}

.tinycrm-search-popover .mud-list-item {
    padding-top: 6px;
    padding-bottom: 6px;
}

/* Stage 5H Block 21E: contact persons of a company */
.tinycrm-person-row {
    padding: 8px 0;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.tinycrm-person-row:last-of-type {
    border-bottom: none;
}

/* Stage 5H Block 22E: idle sign-out warning */
.tinycrm-idle-warning {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 2000;
    max-width: 360px;
}

/* Stage 5H Block 24A: notification bell */
.tinycrm-notification-popover {
    max-height: 520px;
    overflow-y: auto;
}

.tinycrm-notification-popover .mud-menu-item {
    align-items: flex-start;
}
