:root {
    --brand-primary: 186 86 89;
    --brand-primary-hover: 166 66 69;
    --brand-dark: 60 20 22;
}

body { font-family: 'Inter', system-ui, sans-serif; }
[x-cloak] { display: none !important; }

/* Global form overrides */
.form-check-input:checked {
    background-color: rgb(var(--brand-primary));
    border-color: rgb(var(--brand-primary));
}
.form-control:focus, .form-check-input:focus {
    border-color: rgb(var(--brand-primary));
    box-shadow: 0 0 0 .25rem rgb(var(--brand-primary) / .25);
}

/* Links */
a.link-brand { color: rgb(var(--brand-primary)); }
a.link-brand:hover { color: rgb(var(--brand-primary-hover)); }

/* Backgrounds */
.bg-brand-gradient {
    background:
        radial-gradient(ellipse at 20% 50%, rgb(var(--brand-primary) / .6) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgb(var(--brand-primary) / .4) 0%, transparent 50%),
        radial-gradient(ellipse at 60% 80%, rgb(var(--brand-primary) / .3) 0%, transparent 50%),
        linear-gradient(135deg, rgb(var(--brand-dark)) 0%, rgb(var(--brand-primary-hover)) 50%, rgb(var(--brand-dark)) 100%);
    background-size: 200% 200%, 200% 200%, 200% 200%, 200% 200%;
    animation: brand-gradient-shift 8s ease infinite;
}

@keyframes brand-gradient-shift {
    0%, 100% { background-position: 0% 50%, 100% 0%, 0% 100%, 0% 50%; }
    50% { background-position: 100% 50%, 0% 100%, 100% 0%, 100% 50%; }
}

/* Utilities */
.ls-wide { letter-spacing: .15em; text-transform: uppercase; }

/* ── Page Hero (reusable) ─────────────────────────────── */

.page-hero {
    position: relative;
    overflow: hidden;
    margin: -1.75rem -1.75rem 0;
    padding: 2.5rem 2.5rem 4.5rem;
    background:
        radial-gradient(ellipse 70% 100% at 20% 90%, rgb(var(--brand-primary) / .12) 0%, transparent 50%),
        radial-gradient(ellipse 50% 80% at 80% 10%, rgb(var(--brand-primary) / .08) 0%, transparent 50%),
        linear-gradient(135deg,
            rgb(var(--brand-dark)) 0%,
            rgb(var(--brand-primary-hover)) 40%,
            rgb(var(--brand-primary)) 60%,
            rgb(var(--brand-dark)) 100%);
    background-size: 100% 100%, 100% 100%, 300% 300%;
    animation: page-hero-shift 10s ease infinite;
}

@keyframes page-hero-shift {
    0%, 100% { background-position: 0% 0%, 100% 100%, 0% 50%; }
    50%      { background-position: 100% 100%, 0% 0%, 100% 50%; }
}

.page-hero-content {
    position: relative;
    z-index: 1;
}

.page-hero-eyebrow {
    font-size: .6rem;
    font-weight: 700;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: rgba(255 255 255 / .4);
    margin-bottom: .5rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}
.page-hero-eyebrow i {
    font-size: .65rem;
}

.page-hero-title {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -.03em;
    color: #fff;
    margin-bottom: .25rem;
    line-height: 1.2;
}

.page-hero-subtitle {
    color: rgba(255 255 255 / .4);
    font-size: .85rem;
    font-weight: 400;
    margin-bottom: 0;
}

.page-hero-action {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem 1.4rem;
    border-radius: .625rem;
    background: rgba(255 255 255 / .12);
    border: 1px solid rgba(255 255 255 / .18);
    color: #fff;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .03em;
    text-decoration: none;
    transition: all .3s cubic-bezier(.22, .61, .36, 1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    flex-shrink: 0;
}
.page-hero-action:hover {
    background: rgba(255 255 255 / .2);
    border-color: rgba(255 255 255 / .3);
    color: #fff;
    box-shadow: 0 4px 20px rgb(0 0 0 / .2);
    transform: translateY(-1px);
}

@media (max-width: 991.98px) {
    .page-hero {
        margin: -1.75rem -1.75rem 0;
        padding: 2rem 1.5rem 3.5rem;
    }
    .page-hero-title {
        font-size: 1.3rem;
    }
    .page-hero-content {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }
}

/* Toast notifications */
.brand-toast {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 1050;
    min-width: 320px;
    max-width: 420px;
    padding: 1rem 1.25rem;
    border-radius: .75rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    font-size: .875rem;
    box-shadow: 0 8px 32px rgb(0 0 0 / .12);
    background: #fff;
    color: #1a1a1a;
    border-left: 4px solid transparent;
    animation: toast-in .4s cubic-bezier(.22, .61, .36, 1);
    transition: opacity .3s ease, transform .3s ease;
}
.brand-toast.toast-out {
    opacity: 0;
    transform: translateY(-1rem);
}
.brand-toast-error { border-left-color: rgb(var(--brand-primary)); }
.brand-toast-success { border-left-color: #2e7d5b; }
.brand-toast i {
    font-size: 1.25rem;
    flex-shrink: 0;
}
.brand-toast-error i { color: rgb(var(--brand-primary)); }
.brand-toast-success i { color: #2e7d5b; }
.brand-toast-close {
    margin-left: auto;
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    padding: 0;
    font-size: 1.1rem;
    line-height: 1;
}
.brand-toast-close:hover { color: #666; }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(-1rem); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Premium Form Scope ─────────────────────────────────── */

.brand-form .form-label {
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #9a9197;
}
.brand-form .form-control,
.brand-form .form-select {
    border: 1px solid #ede8e9;
    background: #fdfbfb;
    border-radius: .6rem;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.brand-form .form-control:hover,
.brand-form .form-select:hover {
    background: #faf6f7;
}
.brand-form textarea.form-control {
    min-height: 100px;
    resize: vertical;
}
.card-brand .btn-outline-secondary,
.btn-brand-ghost {
    border-color: #ddd6d8;
    color: #6c6068;
    transition: all .2s ease;
}
.card-brand .btn-outline-secondary:hover,
.btn-brand-ghost:hover {
    background: rgb(var(--brand-primary) / .06);
    border-color: rgb(var(--brand-primary) / .3);
    color: rgb(var(--brand-primary));
}
.card-brand .btn-outline-primary {
    border-color: rgb(var(--brand-primary));
    color: rgb(var(--brand-primary));
    transition: all .2s ease;
}
.card-brand .btn-outline-primary:hover {
    background: rgb(var(--brand-primary));
    border-color: rgb(var(--brand-primary));
    color: #fff;
}
.card-brand .btn-outline-danger,
.btn-brand-danger {
    border-color: #e0a0a0;
    color: #c06060;
    transition: all .2s ease;
}
.card-brand .btn-outline-danger:hover,
.btn-brand-danger:hover {
    background: #c06060;
    border-color: #c06060;
    color: #fff;
}
.brand-form input[type="file"]::file-selector-button {
    background: rgb(var(--brand-primary) / .08);
    border: 1px solid rgb(var(--brand-primary) / .2);
    border-radius: .4rem;
    color: rgb(var(--brand-primary));
    padding: .35rem .75rem;
    cursor: pointer;
    transition: background .2s ease;
}
.brand-form input[type="file"]::file-selector-button:hover {
    background: rgb(var(--brand-primary) / .15);
}
.brand-form .form-text {
    font-size: .7rem;
    color: #9a9197;
}

/* ── Premium Card ───────────────────────────────────────── */

.card-brand {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgb(0 0 0 / .04), 0 4px 16px rgb(0 0 0 / .03);
    transition: box-shadow .3s ease;
}
.card-brand:hover {
    box-shadow: 0 2px 6px rgb(0 0 0 / .06), 0 8px 28px rgb(0 0 0 / .06);
}
.card-brand .card-body {
    padding: 1.75rem 2rem;
}
.card-brand .card-header {
    background: transparent;
    border-bottom: 1px solid #f0eaeb;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #9a9197;
}

/* ── Section Title ──────────────────────────────────────── */

.brand-form-title {
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: rgb(var(--brand-primary) / .6);
    padding-bottom: .5rem;
    border-bottom: 1px solid #f0eaeb;
    margin-bottom: 1rem;
}

/* ── Premium Table ──────────────────────────────────────── */

.table-brand {
    margin-bottom: 0;
}
.table-brand thead th {
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #9a9197;
    background: none;
    border-bottom: 1px solid #f0eaeb;
    padding: .75rem 1rem;
}
.table-brand tbody tr {
    transition: background-color .15s ease;
    border-bottom: 1px solid #f5f1f2;
}
.table-brand tbody tr:last-child {
    border-bottom: none;
}
.table-brand tbody tr:hover {
    background-color: rgb(var(--brand-primary) / .03);
}
.table-brand tbody td {
    padding: .75rem 1rem;
    vertical-align: middle;
}

/* ── Badges ─────────────────────────────────────────────── */

.badge-brand-type {
    background: rgb(var(--brand-primary) / .1);
    color: rgb(var(--brand-primary));
    font-weight: 600;
    font-size: .7rem;
    letter-spacing: .05em;
}
.badge-brand-active {
    background: #e6f5ed;
    color: #2e7d5b;
    font-weight: 600;
    font-size: .7rem;
}
.badge-brand-inactive {
    background: #f0eded;
    color: #888;
    font-weight: 600;
    font-size: .7rem;
}

/* ── Item Rows (attachments, comments, kanban tasks) ───── */

.brand-item-row {
    border-radius: .6rem;
    background: #fdfbfb;
    border: 1px solid #f0eaeb;
    padding: .6rem .75rem;
    transition: background .2s ease, box-shadow .2s ease;
}
.brand-item-row:hover {
    background: rgb(var(--brand-primary) / .03);
    box-shadow: 0 2px 8px rgb(0 0 0 / .04);
}

/* ── Assignee Picker Overrides (no Blade changes) ──────── */

.assignee-picker .badge.text-bg-primary {
    background: rgb(var(--brand-primary)) !important;
}
.assignee-picker input.form-control {
    border-radius: .6rem .6rem 0 0;
}
.assignee-picker select.form-select {
    border-radius: 0 0 .6rem .6rem;
}
.assignee-picker:focus-within input.form-control,
.assignee-picker:focus-within select.form-select {
    border-color: rgb(var(--brand-primary));
}

/* ── Action Buttons (show page headers) ─────────────────── */

.btn-brand-ghost,
.btn-brand-danger {
    background: transparent;
    border-radius: .5rem;
    padding: .4rem 1rem;
    font-size: .85rem;
}

/* ── Pagination ────────────────────────────────────────── */

.pagination {
    gap: .25rem;
}
.pagination .page-link {
    border: 1px solid #ede8e9;
    border-radius: .5rem;
    color: #6c6068;
    font-size: .8rem;
    font-weight: 500;
    padding: .4rem .75rem;
    transition: all .2s ease;
}
.pagination .page-link:hover {
    background: rgb(var(--brand-primary) / .06);
    border-color: rgb(var(--brand-primary) / .3);
    color: rgb(var(--brand-primary));
}
.pagination .page-item.active .page-link {
    background: rgb(var(--brand-primary));
    border-color: rgb(var(--brand-primary));
    color: #fff;
    box-shadow: 0 2px 8px rgb(var(--brand-primary) / .25);
}
.pagination .page-item.disabled .page-link {
    background: #fafafa;
    border-color: #ede8e9;
    color: #c5bfc2;
}

/* ── Show Page (company/object detail) ─────────────────── */

.show-detail-row {
    display: flex;
    flex-direction: column;
    gap: .2rem;
}
.show-detail-label {
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #9a9197;
}
.show-detail-label i {
    font-size: .7rem;
    margin-right: .25rem;
}
.show-detail-value {
    font-size: .9rem;
    color: #2a2a2a;
    line-height: 1.5;
}

.show-link-card {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem .75rem;
    border-radius: .6rem;
    background: #fdfbfb;
    border: 1px solid #f0eaeb;
    text-decoration: none;
    color: #2a2a2a;
    transition: all .2s cubic-bezier(.22, .61, .36, 1);
    margin-bottom: .4rem;
}
.show-link-card:last-child {
    margin-bottom: 0;
}
.show-link-card:hover {
    background: rgb(var(--brand-primary) / .04);
    border-color: rgb(var(--brand-primary) / .18);
    box-shadow: 0 2px 8px rgb(var(--brand-primary) / .08);
    transform: translateX(2px);
}
.show-link-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: .5rem;
    background: rgb(var(--brand-primary) / .08);
    color: rgb(var(--brand-primary));
    font-size: .85rem;
    flex-shrink: 0;
}
.show-link-card:hover .show-link-icon {
    background: rgb(var(--brand-primary) / .15);
}
.show-link-name {
    font-weight: 600;
    font-size: .85rem;
}
.show-link-badge {
    font-size: .65rem;
    font-weight: 600;
    letter-spacing: .06em;
    background: rgb(var(--brand-primary) / .08);
    color: rgb(var(--brand-primary));
    padding: .15rem .5rem;
    border-radius: .35rem;
    flex-shrink: 0;
}
.show-link-arrow {
    color: #c5bfc2;
    font-size: .7rem;
    flex-shrink: 0;
    transition: color .2s ease, transform .2s ease;
}
.show-link-card:hover .show-link-arrow {
    color: rgb(var(--brand-primary));
    transform: translateX(2px);
}

.show-empty-hint {
    text-align: center;
    padding: 1.5rem 1rem;
    color: #b5aeb1;
    font-size: .85rem;
}
.show-empty-hint i {
    display: block;
    font-size: 1.5rem;
    margin-bottom: .4rem;
    opacity: .5;
}

.show-attachments-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: 1rem;
}
.show-attachments-count {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgb(var(--brand-primary));
    background: rgb(var(--brand-primary) / .08);
    border: 1px solid rgb(var(--brand-primary) / .18);
    padding: .18rem .55rem;
    border-radius: 999px;
}

.show-attachments-upload {
    display: flex;
    align-items: center;
    gap: .55rem;
    flex-wrap: wrap;
    padding: .65rem .75rem;
    border: 1px dashed rgb(var(--brand-primary) / .24);
    border-radius: .75rem;
    background: linear-gradient(180deg, rgb(var(--brand-primary) / .04), rgb(var(--brand-primary) / .02));
    margin-bottom: 1rem;
}
.show-attachments-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.show-attachments-picker {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    cursor: pointer;
    border-radius: .5rem;
    border: 1px solid rgb(var(--brand-primary) / .2);
    background: #fff;
    color: rgb(var(--brand-primary));
    font-size: .75rem;
    font-weight: 600;
    padding: .38rem .72rem;
    transition: all .2s ease;
}
.show-attachments-picker:hover {
    background: rgb(var(--brand-primary) / .07);
    border-color: rgb(var(--brand-primary) / .35);
}
.show-attachments-filename {
    font-size: .75rem;
    color: #7f767b;
    min-width: 180px;
    max-width: 360px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.show-attachments-submit:disabled {
    opacity: .55;
    cursor: not-allowed;
    pointer-events: none;
}
.show-attachments-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 1px solid #e0a0a0;
    border-radius: .5rem;
    background: rgb(192 96 96 / .08);
    color: #c06060;
    font-size: .7rem;
    cursor: pointer;
    transition: all .2s ease;
}
.show-attachments-clear:hover {
    border-color: #c06060;
    color: #fff;
    background: #c06060;
}

.show-attachments-list {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.show-attachments-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .85rem;
    border: 1px solid #ece4e7;
    border-radius: .75rem;
    padding: .68rem .75rem;
    background: #fff;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.show-attachments-item:hover {
    border-color: rgb(var(--brand-primary) / .25);
    box-shadow: 0 6px 18px rgb(var(--brand-primary) / .08);
    transform: translateY(-1px);
}
.show-attachments-item-main {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: .7rem;
}
.show-attachments-type {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: .58rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    flex-shrink: 0;
}
.show-attachments-type--file {
    background: rgba(91, 138, 181, .12);
    color: #4d7599;
}
.show-attachments-type--pdf {
    background: rgba(205, 72, 72, .12);
    color: #b74848;
}
.show-attachments-type--image {
    background: rgba(46, 125, 91, .12);
    color: #2e7d5b;
}
.show-attachments-text {
    min-width: 0;
}
.show-attachments-name {
    font-size: .86rem;
    font-weight: 600;
    color: #2a2a2a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.show-attachments-meta {
    margin-top: .1rem;
    font-size: .69rem;
    color: #968d92;
    display: flex;
    align-items: center;
    gap: .3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.show-attachments-actions {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-shrink: 0;
}
.show-attachments-actions form {
    margin: 0;
}
.show-attachments-btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    cursor: pointer;
    border: 1px solid #ece4e7;
    background: #faf8f8;
    color: #6f666b;
    border-radius: .5rem;
    padding: .34rem .62rem;
    font-size: .7rem;
    font-weight: 600;
    text-decoration: none;
    transition: all .2s ease;
}
.show-attachments-btn:hover {
    border-color: rgb(var(--brand-primary) / .3);
    color: rgb(var(--brand-primary));
    background: rgb(var(--brand-primary) / .07);
}
.show-attachments-btn--danger {
    border-color: #e0a0a0;
    color: #c06060;
    background: rgb(192 96 96 / .08);
}
.show-attachments-btn--danger:hover {
    border-color: #c06060;
    color: #fff;
    background: #c06060;
}

/* Attachment preview thumbnails */
.show-attachments-item--clickable {
    cursor: pointer;
}
.show-attachments-preview {
    width: 3rem;
    height: 3rem;
    border-radius: .5rem;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgb(var(--brand-primary) / .04);
    border: 1px solid rgb(var(--brand-primary) / .08);
    transition: border-color .2s ease;
}
.show-attachments-preview:hover {
    border-color: rgb(var(--brand-primary) / .2);
}
.show-attachments-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.show-attachments-preview--file {
    color: rgb(var(--brand-primary) / .5);
    font-size: 1.2rem;
}
.show-attachments-preview--file:hover {
    color: rgb(var(--brand-primary));
}

@media (max-width: 900px) {
    .show-attachments-filename {
        max-width: 240px;
    }
}

@media (max-width: 640px) {
    .show-attachments-upload {
        align-items: stretch;
    }
    .show-attachments-filename {
        max-width: 100%;
        min-width: 0;
    }
    .show-attachments-item {
        flex-direction: column;
        align-items: stretch;
        gap: .55rem;
    }
    .show-attachments-actions {
        justify-content: flex-end;
    }
    .show-attachments-btn span {
        display: none;
    }
}
