:root {
    --sidebar-width: 220px;
    --navbar-height: 64px;
    --color-bg: #ffffff;
    --color-bg-secondary: #f9fafb;
    --color-text: #0f172a;
    --color-text-muted: #6b7280;
    --color-accent: #0f172a;
    --color-border: #e5e7eb;
    --color-hover: #f1f5f9;
    --color-danger: #dc2626;
    --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

html[data-theme="dark"] {
    --color-bg: #0b1220;
    --color-bg-secondary: #111827;
    --color-text: #e5e7eb;
    --color-text-muted: #9ca3af;
    --color-accent: #e5e7eb;
    --color-border: #1f2937;
    --color-hover: #1f2937;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--color-bg-secondary);
    color: var(--color-text);
    font-family: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    overflow-x: hidden;
}

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

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--color-bg);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    z-index: 40;
    transition: transform 0.22s ease;
}

.sidebar-top {
    padding: 1rem;
    border-bottom: 1px solid var(--color-border);
    display: grid;
    gap: 0.75rem;
}

.logo-block strong {
    display: block;
    font-size: 1rem;
}

.logo-block span {
    color: var(--color-text-muted);
    font-size: 0.8rem;
}

.sidebar-team-btn {
    width: 100%;
    justify-content: space-between;
}

.sidebar-nav {
    padding: 1rem;
    overflow: auto;
    flex: 1;
}

.nav-label {
    margin: 1rem 0 0.45rem;
    font-size: 0.72rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.nav-item,
.nav-subitem {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0.7rem;
    border-radius: 6px;
    margin-bottom: 0.25rem;
}

.nav-item:hover,
.nav-subitem:hover,
.settings-link:hover,
.top-tab:hover {
    background: var(--color-hover);
}

.nav-item.is-active,
.settings-link.is-active,
.top-tab.is-active {
    background: #f1f5f9;
    color: #0f172a;
}

html[data-theme="dark"] .nav-item.is-active,
html[data-theme="dark"] .settings-link.is-active,
html[data-theme="dark"] .top-tab.is-active {
    background: #1f2937;
    color: #e5e7eb;
}

.nav-item-badge .badge {
    display: inline-flex;
    min-width: 1.2rem;
    justify-content: center;
    border-radius: 999px;
    padding: 0.1rem 0.4rem;
    font-size: 0.72rem;
    border: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
}

.nav-expandable summary {
    list-style: none;
    cursor: pointer;
    padding: 0.55rem 0.7rem;
    border-radius: 6px;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-expandable summary::-webkit-details-marker {
    display: none;
}

.nav-expandable summary::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    flex-shrink: 0;
    transition: transform 0.18s ease;
}

.nav-expandable[open] summary::after {
    transform: rotate(90deg);
}

.nav-expandable summary:hover {
    background: var(--color-hover);
}

.nav-expandable[open] summary {
    background: var(--color-hover);
}

.nav-subitem {
    margin-left: 0.6rem;
}

.nav-subitem.is-active {
    background: #f1f5f9;
    color: #0f172a;
}

html[data-theme="dark"] .nav-subitem.is-active {
    background: #1f2937;
    color: #e5e7eb;
}

html[data-theme="dark"] .nav-expandable summary::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E");
}

.sidebar-footer {
    border-top: 1px solid var(--color-border);
    padding: 1rem;
}

.user-card {
    width: 100%;
    display: grid;
    grid-template-columns: 36px 1fr auto;
    gap: 0.6rem;
    align-items: center;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg);
    padding: 0.45rem;
    cursor: pointer;
}

.avatar,
.avatar-btn {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #0f172a;
    color: #fff;
    font-weight: 500;
}

.avatar-btn {
    border: 0;
    cursor: pointer;
}

.user-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-meta strong,
.user-meta small {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-meta small {
    color: var(--color-text-muted);
}

.chevron {
    color: var(--color-text-muted);
}

.navbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--navbar-height);
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    z-index: 45;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 1rem;
    gap: 1rem;
}

.navbar-center {
    display: inline-flex;
    gap: 0.3rem;
    justify-self: center;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.25rem;
}

.top-tab {
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
}

.navbar-right {
    justify-self: end;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.search-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.search-wrap input {
    width: 220px;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    border-radius: 8px;
    height: 36px;
    padding: 0 3.25rem 0 0.7rem;
}

.search-hint {
    position: absolute;
    right: 0.55rem;
    color: var(--color-text-muted);
    font-size: 0.78rem;
}

.icon-btn,
.ghost-btn,
.dark-btn {
    border-radius: 8px;
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text);
    padding: 0.45rem 0.7rem;
    cursor: pointer;
}

.icon-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.dark-btn {
    background: #0f172a;
    border-color: #0f172a;
    color: #fff;
}

.dark-btn:hover {
    filter: brightness(1.08);
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    min-width: 180px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 0.35rem;
    display: none;
    z-index: 100;
}

.dropdown-menu.dropdown-menu-wide {
    min-width: 240px;
}

.dropdown.open .dropdown-menu {
    display: block;
}

.dropdown.dropup .dropdown-menu {
    top: auto;
    bottom: calc(100% + 0.45rem);
}

.dropdown.open .chevron {
    transform: rotate(180deg);
}

.dropdown-item {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 0.55rem 0.65rem;
    border-radius: 6px;
    cursor: pointer;
}

.dropdown-item:hover {
    background: var(--color-hover);
}

.dropdown-item.danger {
    color: var(--color-danger);
}

.dropdown-user-head {
    padding: 0.55rem 0.65rem;
    margin-bottom: 0.35rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.dropdown-user-head small {
    color: var(--color-text-muted);
}

.theme-check {
    float: right;
    opacity: 0;
}

.theme-item.active .theme-check {
    opacity: 1;
}

.app-main {
    margin-left: var(--sidebar-width);
    padding-top: var(--navbar-height);
}

.app-content {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 1.25rem;
}

.page-head h1 {
    margin: 0;
    font-size: 1.75rem;
}

.page-head p {
    margin: 0.35rem 0 0;
    color: var(--color-text-muted);
}

.page-head-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.subtabs-nav {
    display: inline-flex;
    border: 1px solid var(--color-border);
    border-radius: 9px;
    padding: 0.2rem;
    background: var(--color-bg-secondary);
    margin-bottom: 1rem;
    gap: 0.1rem;
}

.subtab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid transparent;
    background: transparent;
    color: var(--color-text-muted);
    border-radius: 7px;
    padding: 0.45rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
}

.subtab svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.75;
}

.subtab:hover:not(.is-active) {
    color: var(--color-text);
    background: var(--color-hover);
}

.subtab.is-active {
    color: var(--color-text);
    background: var(--color-bg);
    border-color: var(--color-border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.subtab.is-active svg {
    opacity: 1;
}

.subtab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 0.25rem;
    background: #ef4444;
    color: #fff;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    margin-left: 0.1rem;
}

html[data-theme="dark"] .subtab.is-active {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: none;
}

.tab-panel {
    display: none;
}

.tab-panel.is-active {
    display: block;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.metric-card,
.panel-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1rem;
}

.metric-card p,
.metric-card small,
.panel-card p,
.muted {
    color: var(--color-text-muted);
}

.metric-card h3 {
    margin: 0.35rem 0;
    font-size: 1.35rem;
}

.split-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
}

.panel-card header h2 {
    margin: 0;
}

.panel-card header p {
    margin: 0.35rem 0 1rem;
    color: var(--color-text-muted);
}

.chart-wrap {
    position: relative;
    width: 100%;
    height: 320px;
}

.chart-wrap canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.sales-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sales-list li {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    align-items: center;
    gap: 0.7rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border);
}

.sales-list li:last-child {
    border-bottom: 0;
}

.sale-meta {
    min-width: 0;
}

.sale-meta strong,
.sale-meta a {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sale-meta a {
    color: #2563eb;
}

.sale-amount {
    font-weight: 600;
}

.settings-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.settings-nav {
    display: grid;
    align-content: start;
    gap: 0.35rem;
}

.settings-link {
    border: 1px solid transparent;
    background: transparent;
    text-align: left;
    border-radius: 6px;
    padding: 0.55rem 0.7rem;
    cursor: pointer;
}

.settings-panel {
    display: none;
}

.settings-panel.is-active {
    display: block;
}

.settings-form {
    display: grid;
    gap: 1rem;
    max-width: 720px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1rem;
}

.settings-form label,
.settings-form>div {
    display: grid;
    gap: 0.45rem;
}

.settings-form input,
.settings-form select,
.settings-form textarea,
.url-input {
    width: 100%;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg);
    padding: 0.55rem 0.65rem;
}

.settings-form small {
    color: var(--color-text-muted);
}

#urlInputs {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.flash-success {
    border: 1px solid #86efac;
    background: #f0fdf4;
    color: #166534;
    border-radius: 8px;
    padding: 0.75rem 0.85rem;
    margin-top: 1rem;
}

html[data-theme="dark"] .flash-success {
    background: #052e16;
    border-color: #166534;
    color: #bbf7d0;
}

.auth-body {
    background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.06), transparent 44%), var(--color-bg-secondary);
}

.auth-main {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
}

.auth-shell {
    width: 100%;
    max-width: 430px;
}

.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.auth-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 0.65rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    background: #0f172a;
    color: #fff;
}

.auth-brand h1 {
    margin: 0;
    font-family: "Manrope", "Inter", sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
}

.auth-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 1.1rem;
}

.auth-card-head h2 {
    margin: 0;
    font-family: "Manrope", "Inter", sans-serif;
}

.auth-card-head p {
    margin: 0.4rem 0 0;
    color: var(--color-text-muted);
}

.auth-form {
    display: grid;
    gap: 0.9rem;
    margin-top: 1rem;
}

.auth-form label {
    display: grid;
    gap: 0.4rem;
    font-weight: 500;
}

.auth-form input {
    width: 100%;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg);
    color: var(--color-text);
    padding: 0.6rem 0.7rem;
}

.auth-form-row {
    display: flex;
    justify-content: flex-end;
}

.auth-form-row a,
.auth-card-foot a {
    color: #2563eb;
}

.auth-submit {
    width: 100%;
}

.auth-divider {
    position: relative;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.auth-divider::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    border-top: 1px solid var(--color-border);
    transform: translateY(-50%);
}

.auth-divider span {
    position: relative;
    padding: 0 0.55rem;
    background: var(--color-bg);
}

.auth-provider-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.auth-provider-grid .ghost-btn {
    width: 100%;
    text-align: center;
}

.auth-card-foot {
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--color-border);
}

.auth-card-foot p {
    margin: 0;
    color: var(--color-text-muted);
    text-align: center;
}

/* ---- Users page ---- */

.users-head-actions {
    display: inline-flex;
    gap: 0.5rem;
}

.users-panel {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    overflow: visible;
}

.users-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--color-border);
    border-radius: 8px 8px 0 0;
}

.users-panel-header>div:first-child {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.users-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 20px;
    min-width: 24px;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--color-text-muted);
}

.users-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.users-toolbar input,
.users-toolbar select {
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text);
    border-radius: 7px;
    padding: 0 0.75rem;
    height: 34px;
    outline: none;
    transition: border-color 0.15s;
}

.users-toolbar input:focus,
.users-toolbar select:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.08);
}

.users-toolbar input {
    min-width: 220px;
    flex: 1;
}

.users-table-wrap {
    overflow-x: auto;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 860px;
    background: var(--color-bg);
}

.users-table th,
.users-table td {
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

.users-table thead th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    background: var(--color-bg-secondary);
}

.users-table tbody tr:last-child td {
    border-bottom: none;
}

.users-table tbody tr:hover td {
    background: var(--color-hover);
}

.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-accent);
    color: var(--color-bg);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}

.user-name-cell {
    font-weight: 500;
}

.text-muted-cell {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.text-right {
    text-align: right !important;
}

.status-pill,
.role-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    border: 1px solid var(--color-border);
    font-size: 0.72rem;
    font-weight: 500;
    text-transform: capitalize;
    white-space: nowrap;
}

.status-active {
    background: rgba(13, 148, 136, 0.1);
    border-color: rgba(13, 148, 136, 0.3);
    color: #0f766e;
}

.status-invited {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.35);
    color: #0369a1;
}

.status-suspended {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #b91c1c;
}

/* --- Offer pipeline status pills --- */
.status-offer-new {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.35);
    color: #0369a1;
}

.status-offer-contacted {
    background: rgba(251, 146, 60, 0.12);
    border-color: rgba(251, 146, 60, 0.35);
    color: #c2410c;
}

.status-offer-negotiating {
    background: rgba(167, 139, 250, 0.15);
    border-color: rgba(167, 139, 250, 0.4);
    color: #6d28d9;
}

.status-offer-appt {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.35);
    color: #4338ca;
}

.status-offer-pickedup {
    background: rgba(52, 211, 153, 0.12);
    border-color: rgba(52, 211, 153, 0.35);
    color: #059669;
}

.status-offer-paid {
    background: rgba(13, 148, 136, 0.1);
    border-color: rgba(13, 148, 136, 0.3);
    color: #0f766e;
}

.status-offer-declined {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #b91c1c;
}
.status-offer-archived {
    background: rgba(156, 163, 175, 0.12);
    border-color: rgba(156, 163, 175, 0.3);
    color: #6b7280;
}

/* --- Offer status timeline --- */
.ops-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0 0;
    position: relative;
}

.ops-timeline::before {
    content: '';
    position: absolute;
    left: 0.55rem;
    top: 1rem;
    bottom: 0.5rem;
    width: 2px;
    background: var(--color-border);
}

.ops-timeline-item {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    padding: 0.4rem 0;
    position: relative;
}

.ops-timeline-dot {
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    flex-shrink: 0;
    margin-top: 0.15rem;
    position: relative;
    z-index: 1;
}

.ops-timeline-dot.is-latest {
    background: var(--color-accent);
    border-color: var(--color-accent);
}

.ops-timeline-body {
    flex: 1;
    min-width: 0;
}

.ops-timeline-meta {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 0.15rem;
}

.ops-timeline-note {
    font-size: 0.8rem;
    margin-top: 0.25rem;
    padding: 0.35rem 0.6rem;
    background: var(--color-bg-secondary);
    border-left: 2px solid var(--color-border);
    border-radius: 0 4px 4px 0;
    white-space: pre-wrap;
    word-break: break-word;
}

/* --- Offer notes --- */
.ops-note-item {
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--color-border);
}

.ops-note-item:last-child {
    border-bottom: none;
}

.ops-note-meta {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ops-note-body {
    font-size: 0.875rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.ops-note-delete {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0;
    margin-left: auto;
}

.ops-note-delete:hover {
    color: var(--color-danger);
}

.users-empty {
    margin: 0;
    text-align: center;
    padding: 2rem 1.25rem;
    color: var(--color-text-muted);
    background: var(--color-bg-secondary);
    border-top: 1px solid var(--color-border);
    font-size: 0.875rem;
}

body.sidebar-collapsed .sidebar {
    transform: translateX(calc(var(--sidebar-width) * -1));
}

body.sidebar-collapsed .navbar {
    left: 0;
}

body.sidebar-collapsed .app-main {
    margin-left: 0;
}

@media (max-width: 1100px) {
    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .split-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .sidebar {
        transform: translateX(calc(var(--sidebar-width) * -1));
    }

    .navbar {
        left: 0;
        grid-template-columns: auto 1fr;
    }

    .navbar-center {
        display: none;
    }

    .app-main {
        margin-left: 0;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
        box-shadow: var(--shadow);
    }

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

    .search-wrap input {
        width: 150px;
    }

    .users-toolbar input,
    .users-toolbar select {
        width: 100%;
        min-width: 0;
    }

    .users-panel-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .users-head-actions {
        width: 100%;
    }

    .users-head-actions .ghost-btn,
    .users-head-actions .dark-btn {
        flex: 1;
    }

    .sidebar-footer .dropdown.dropup .dropdown-menu {
        left: 0;
        right: 0;
        width: 100%;
        min-width: 0;
        max-height: 50vh;
        overflow-y: auto;
    }
}

/* ===== MODALS ===== */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

.modal-overlay.is-open {
    opacity: 1;
    pointer-events: all;
}

.modal-box {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    width: 100%;
    max-width: 520px;
    box-shadow: var(--shadow);
    transform: translateY(14px) scale(0.98);
    transition: transform 0.18s ease;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.modal-overlay.is-open .modal-box {
    transform: translateY(0) scale(1);
}

.modal-box-sm {
    max-width: 400px;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.modal-head h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.modal-head-danger {
    border-bottom-color: rgba(220, 38, 38, 0.25);
}

.modal-head-danger h2 {
    color: var(--color-danger);
}

.modal-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    overflow-y: auto;
}

.modal-foot {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 1.25rem;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
    border-radius: 0 0 14px 14px;
    flex-shrink: 0;
}

.modal-desc {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    line-height: 1.5;
}

.modal-desc-danger {
    color: var(--color-danger);
}

/* Form elements inside modals */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text-muted);
}

.form-group input,
.form-group select {
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text);
    border-radius: 8px;
    padding: 0 0.75rem;
    height: 38px;
    outline: none;
    transition: border-color 0.15s;
    width: 100%;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.08);
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

/* Profile modal */

.modal-avatar-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.modal-avatar-row strong {
    display: block;
    font-size: 0.95rem;
}

.modal-avatar-row p {
    margin: 0.1rem 0 0;
    font-size: 0.82rem;
    color: var(--color-text-muted);
}

.user-avatar-lg {
    width: 48px;
    height: 48px;
    font-size: 1rem;
    flex-shrink: 0;
}

.user-avatar-sm {
    width: 28px;
    height: 28px;
    font-size: 0.65rem;
    flex-shrink: 0;
}

.profile-fields {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    overflow: hidden;
}

.profile-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.875rem;
}

.profile-field:last-child {
    border-bottom: none;
}

.profile-field-label {
    color: var(--color-text-muted);
    font-size: 0.8rem;
}

/* Confirm user card inside modals */

.modal-confirm-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 10px;
}

.modal-confirm-user strong {
    display: block;
    font-size: 0.875rem;
}

.modal-confirm-user p {
    margin: 0.1rem 0 0;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* Danger button */

.danger-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: none;
    border-radius: 8px;
    padding: 0 0.9rem;
    height: 36px;
    font-weight: 500;
    cursor: pointer;
    background: var(--color-danger);
    color: #fff;
    transition: opacity 0.15s;
}

.danger-btn:hover {
    opacity: 0.88;
}

@media (max-width: 540px) {
    .form-row-2 {
        grid-template-columns: 1fr;
    }

    .modal-foot {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .modal-foot .ghost-btn,
    .modal-foot .dark-btn,
    .modal-foot .danger-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===== CHAT PAGE ===== */

.page-chat .app-content {
    padding: 0;
    max-width: none;
    height: calc(100vh - var(--navbar-height));
    overflow: hidden;
    display: flex;
}

.chat-layout {
    display: flex;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* ── Contact sidebar ── */

.chat-sidebar {
    width: 300px;
    flex-shrink: 0;
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    background: var(--color-bg);
    overflow: hidden;
}

.chat-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1rem 0.5rem;
    flex-shrink: 0;
}

.chat-sidebar-head h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.chat-search-wrap {
    position: relative;
    padding: 0 0.75rem 0.6rem;
    flex-shrink: 0;
}

.chat-search-icon {
    position: absolute;
    left: 1.3rem;
    top: 50%;
    transform: translateY(-60%);
    color: var(--color-text-muted);
    pointer-events: none;
}

.chat-search-input {
    width: 100%;
    height: 32px;
    padding: 0 0.75rem 0 2rem;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    outline: none;
    font-size: 0.84rem;
    color: var(--color-text);
    transition: border-color 0.15s;
}

.chat-search-input:focus {
    border-color: #0a84ff;
}

.chat-search-input::placeholder {
    color: var(--color-text-muted);
}

.chat-contacts {
    flex: 1;
    overflow-y: auto;
    padding: 0.2rem 0.4rem;
}

.chat-contact {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    padding: 0.6rem 0.65rem;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    border-radius: 12px;
    transition: background 0.12s;
}

.chat-contact:hover {
    background: var(--color-hover);
}

.chat-contact.is-active {
    background: var(--color-hover);
}

.chat-contact-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.chat-contact-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--color-accent);
    color: var(--color-bg);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.chat-avatar-md {
    width: 36px;
    height: 36px;
    font-size: 0.68rem;
}

.chat-online-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 10px;
    height: 10px;
    background: #34c759;
    border-radius: 50%;
    border: 2px solid var(--color-bg);
}

.chat-contact-info {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.chat-contact-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.25rem;
}

.chat-contact-name {
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.chat-contact-time {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.chat-contact-preview {
    font-size: 0.79rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.chat-unread-badge {
    background: #0a84ff;
    color: #fff;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    padding: 0 0.3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ── Message thread ── */

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--color-bg);
    overflow: hidden;
    position: relative;
}

.chat-thread {
    display: none;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.chat-thread.is-active {
    display: flex;
}

.chat-thread-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
    background: var(--color-bg);
}

.chat-thread-avatar-name {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.chat-thread-avatar-name strong {
    display: block;
    font-size: 0.9rem;
}

.chat-header-status {
    font-size: 0.72rem;
    color: var(--color-text-muted);
}

.chat-header-status.is-online {
    color: #34c759;
}

.chat-thread-actions {
    display: flex;
    align-items: center;
    gap: 0.1rem;
}

/* Messages scroll area */

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    scroll-behavior: smooth;
}

/* Group spacing */
.msg-group-end {
    margin-bottom: 0.65rem;
}

/* Message rows */

.msg-row {
    display: flex;
    align-items: flex-end;
    gap: 0.4rem;
}

.msg-sent {
    flex-direction: row-reverse;
}

.msg-received {
    flex-direction: row;
}

.msg-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--color-accent);
    color: var(--color-bg);
    font-size: 0.57rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0.03em;
    align-self: flex-end;
}

.msg-avatar-hidden {
    visibility: hidden;
}

.msg-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 62%;
    gap: 0.18rem;
}

.msg-sent .msg-col {
    align-items: flex-end;
}

.msg-bubble {
    padding: 0.5rem 0.85rem;
    border-radius: 18px;
    font-size: 0.875rem;
    line-height: 1.45;
    word-break: break-word;
    max-width: 100%;
}

/* Sent: blue, tail bottom-right */
.msg-sent .msg-bubble {
    background: #0a84ff;
    color: #fff;
    border-bottom-right-radius: 5px;
}

/* Received: gray, tail bottom-left */
.msg-received .msg-bubble {
    background: #e9e9eb;
    color: #1c1c1e;
    border-bottom-left-radius: 5px;
}

/* Middle bubbles in a group (no tail) */
.msg-sent:not(.msg-group-end) .msg-bubble {
    border-bottom-right-radius: 18px;
}

.msg-received:not(.msg-group-end) .msg-bubble {
    border-bottom-left-radius: 18px;
}

.msg-time {
    font-size: 0.67rem;
    color: var(--color-text-muted);
    padding: 0 0.15rem;
}

/* Typing indicator */

.typing-bubble {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0.6rem 0.85rem;
    min-width: 54px;
}

.typing-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #8e8e93;
    animation: typingPulse 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
    animation-delay: 0s;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingPulse {

    0%,
    60%,
    100% {
        opacity: 0.35;
        transform: scale(0.82);
    }

    30% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ── Composer ── */

.chat-composer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.85rem;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg);
    flex-shrink: 0;
}

.chat-input-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.chat-input {
    width: 100%;
    height: 36px;
    padding: 0 2.3rem 0 0.9rem;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.chat-input:focus {
    border-color: #0a84ff;
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.15);
}

.chat-btn-emoji {
    position: absolute;
    right: 0.4rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0.2rem;
    cursor: pointer;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: color 0.12s;
}

.chat-btn-emoji:hover {
    color: var(--color-text);
}

.chat-btn-round {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.15s, background 0.15s;
}

.chat-btn-attach {
    background: var(--color-bg-secondary);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}

.chat-btn-attach:hover {
    color: var(--color-text);
    background: var(--color-hover);
}

.chat-btn-send {
    background: #0a84ff;
    color: #fff;
}

.chat-btn-send:disabled {
    background: var(--color-bg-secondary);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
    cursor: default;
    opacity: 1;
}

.chat-btn-send:not(:disabled):hover {
    opacity: 0.85;
}

/* Dark mode */

html[data-theme="dark"] .msg-received .msg-bubble {
    background: #3a3a3c;
    color: #f5f5f7;
}

html[data-theme="dark"] .typing-dot {
    background: #636366;
}

/* Responsive: collapse sidebar to icons on small screens */

@media (max-width: 680px) {
    .chat-sidebar {
        width: 68px;
    }

    .chat-sidebar-head h2,
    .chat-sidebar-head .icon-btn,
    .chat-search-wrap {
        display: none;
    }

    .chat-contact-info {
        display: none;
    }

    .chat-contact {
        justify-content: center;
        padding: 0.65rem 0;
        margin: 0;
        width: 100%;
        border-radius: 0;
    }
}

/* ─────────────────────────────────────────────
   CHAT ENHANCEMENTS
   ───────────────────────────────────────────── */

/* ── Pinned contacts row ── */

.chat-pinned-row {
    display: flex;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem 0.4rem;
    overflow-x: auto;
    scrollbar-width: none;
    flex-shrink: 0;
}

.chat-pinned-row::-webkit-scrollbar {
    display: none;
}

.chat-pinned-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.35rem;
    border-radius: 10px;
    flex-shrink: 0;
    transition: background 0.12s;
}

.chat-pinned-btn:hover {
    background: var(--color-hover);
}

.chat-pinned-avatar-wrap {
    position: relative;
    display: inline-flex;
}

.chat-pinned-avatar-wrap .chat-contact-avatar {
    width: 52px;
    height: 52px;
    font-size: 0.75rem;
}

.chat-pinned-unread {
    position: absolute;
    top: -3px;
    right: -3px;
    background: #0a84ff;
    color: #fff;
    border-radius: 999px;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    padding: 0 0.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.chat-pinned-name {
    font-size: 0.7rem;
    color: var(--color-text);
    max-width: 56px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-section-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 0.2rem 0.9rem 0.35rem;
    flex-shrink: 0;
}

/* ── Date separator ── */

.chat-date-sep {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0.75rem 0 0.5rem;
    color: var(--color-text-muted);
    font-size: 0.68rem;
}

.chat-date-sep::before,
.chat-date-sep::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

.chat-date-sep span {
    white-space: nowrap;
    font-weight: 500;
}

/* ── Read receipt ── */

.msg-receipt {
    margin-left: 0.3rem;
    font-size: 0.65rem;
    color: var(--color-text-muted);
    font-style: italic;
}

.msg-receipt.is-read {
    color: #0a84ff;
}

/* ── Reaction bar (hover-reveal) ── */

.msg-col {
    position: relative;
}

.msg-reaction-bar {
    display: none;
    position: absolute;
    bottom: calc(100% + 4px);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 0.2rem 0.4rem;
    gap: 0.1rem;
    box-shadow: var(--shadow);
    z-index: 10;
    white-space: nowrap;
}

.msg-sent .msg-reaction-bar {
    right: 0;
    left: auto;
}

.msg-received .msg-reaction-bar {
    left: 0;
    right: auto;
}

/* Show bar on bubble hover (JS-controlled via .is-visible — see app.js) */
.msg-reaction-bar.is-visible {
    display: flex;
}

.msg-react-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.05rem;
    line-height: 1;
    padding: 0.15rem 0.2rem;
    border-radius: 50%;
    transition: transform 0.1s;
}

.msg-react-btn:hover {
    transform: scale(1.3);
}

/* ── Reaction pills (below bubble) ── */

.msg-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.15rem;
}

.msg-reactions:empty {
    display: none;
}

.msg-reaction-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 0.1rem 0.45rem;
    font-size: 0.78rem;
    cursor: pointer;
    transition: background 0.12s;
    line-height: 1.4;
}

.msg-reaction-pill.is-mine {
    background: rgba(10, 132, 255, 0.1);
    border-color: rgba(10, 132, 255, 0.3);
}

.msg-reaction-pill:hover {
    background: var(--color-hover);
}

.msg-reaction-count {
    font-size: 0.68rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

/* ── Emoji picker ── */

.chat-emoji-picker {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    width: 300px;
    max-height: 260px;
    overflow-y: auto;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 0.5rem 0.6rem;
    z-index: 50;
    scrollbar-width: thin;
}

.emoji-group-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 0.45rem 0 0.2rem;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 1px;
}

.emoji-item {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0.3rem;
    border-radius: 6px;
    text-align: center;
    transition: background 0.1s, transform 0.1s;
}

.emoji-item:hover {
    background: var(--color-hover);
    transform: scale(1.2);
}

/* ── Toast notifications ── */

.chat-toast-stack {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 9000;
    pointer-events: none;
}

.chat-toast {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    padding: 0.55rem 0.85rem 0.55rem 0.6rem;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.13);
    pointer-events: all;
    cursor: pointer;
    min-width: 220px;
    max-width: 300px;
    animation: toastIn 0.22s ease forwards;
}

.chat-toast.is-leaving {
    animation: toastOut 0.2s ease forwards;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateY(8px) scale(0.93);
    }
}

.chat-toast-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--color-accent);
    color: var(--color-bg);
    font-size: 0.62rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0.03em;
}

.chat-toast-body {
    flex: 1;
    min-width: 0;
}

.chat-toast-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-toast-preview {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Mobile back button ── */

.chat-back-btn {
    display: none;
    margin-right: 0.25rem;
}

@media (max-width: 680px) {
    .chat-back-btn {
        display: inline-flex;
    }

    /* Sidebar slide: show sidebar, hide main by default on mobile */
    .chat-layout {
        position: relative;
    }

    .chat-sidebar {
        position: absolute;
        inset: 0;
        width: 100% !important;
        z-index: 5;
        transition: transform 0.22s ease;
    }

    .chat-main {
        position: absolute;
        inset: 0;
        transform: translateX(100%);
        transition: transform 0.22s ease;
        z-index: 6;
    }

    /* When a thread is open: slide main in, sidebar out */
    .chat-layout.thread-open .chat-sidebar {
        transform: translateX(-100%);
    }

    .chat-layout.thread-open .chat-main {
        transform: translateX(0);
    }
}

/* ── Dark mode additions ── */
html[data-theme="dark"] .chat-emoji-picker {
    background: #1c1c1e;
    border-color: #3a3a3c;
}

html[data-theme="dark"] .msg-reaction-bar {
    background: #1c1c1e;
    border-color: #3a3a3c;
}

html[data-theme="dark"] .msg-reaction-pill {
    background: #2c2c2e;
    border-color: #3a3a3c;
}

html[data-theme="dark"] .chat-toast {
    background: #1c1c1e;
    border-color: #3a3a3c;
}

/* ═══════════════════════════════════════════════════════
   CHAT — Phase 2: attach previews, info panel,
                   call card, new-message modal
   ═══════════════════════════════════════════════════════ */

/* ── File / image attachment bubbles ── */
.msg-bubble-img {
    padding: 4px !important;
    background: transparent !important;
    border: none !important;
}

.chat-img-preview {
    max-width: 200px;
    max-height: 180px;
    border-radius: 14px;
    display: block;
    object-fit: cover;
}

.msg-bubble-file {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 180px;
}

.chat-file-icon {
    width: 32px;
    height: 40px;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.chat-file-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.chat-file-name {
    font-size: 0.78rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
}

.chat-file-size {
    font-size: 0.66rem;
    opacity: 0.72;
}

/* ── Contact info panel (slides in from right inside .chat-main) ── */
.chat-info-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 270px;
    background: var(--color-bg);
    border-left: 1px solid var(--color-border);
    transform: translateX(100%);
    transition: transform 0.22s ease;
    z-index: 20;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.chat-info-panel.is-open {
    transform: translateX(0);
}

.chat-info-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.chat-info-head h3 {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
}

.chat-info-body {
    padding: 1.5rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.chat-info-avatar {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: var(--color-accent);
    color: var(--color-bg);
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.4rem;
    letter-spacing: 0.03em;
}

.chat-info-name {
    font-size: 1rem;
    font-weight: 600;
}

.chat-info-status {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.chat-info-status.is-online {
    color: #34c759;
}

.chat-info-action-row {
    display: flex;
    gap: 0.75rem;
    margin: 0.75rem 0 1rem;
}

.chat-info-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 0.65rem 0.9rem;
    cursor: pointer;
    font-size: 0.68rem;
    color: var(--color-text);
    transition: background 0.12s;
    min-width: 60px;
}

.chat-info-action-btn:hover {
    background: var(--color-hover);
}

.chat-info-action-btn svg {
    color: #0a84ff;
}

.chat-info-fields {
    width: 100%;
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--color-border);
    padding-top: 0.75rem;
    margin-top: 0.25rem;
}

.chat-info-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.825rem;
}

.chat-info-field:last-child {
    border-bottom: none;
}

.chat-info-field-label {
    color: var(--color-text-muted);
    font-size: 0.78rem;
}

/* ── Calling card (fixed floating, bottom-center) ── */
.chat-call-card {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: #1c1c1e;
    color: #fff;
    border-radius: 18px;
    padding: 0.9rem 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    box-shadow: 0 8px 36px rgba(0, 0, 0, 0.35);
    z-index: 9000;
    min-width: 260px;
    animation: callSlideUp 0.22s ease;
}

.chat-call-card[hidden] {
    display: none;
}

@keyframes callSlideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.chat-call-card-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #48484a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
    letter-spacing: 0.03em;
}

.chat-call-card-meta {
    flex: 1;
    min-width: 0;
}

.chat-call-card-type {
    font-size: 0.68rem;
    color: #aeaeb2;
    margin-bottom: 0.1rem;
}

.chat-call-card-name {
    font-size: 0.92rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-call-card-status {
    font-size: 0.72rem;
    color: #aeaeb2;
    margin-top: 0.1rem;
}

.chat-call-card-actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}

.chat-call-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s;
    flex-shrink: 0;
}

.chat-call-end {
    background: #ff3b30;
    color: #fff;
}

.chat-call-end:hover {
    opacity: 0.85;
}

/* ── New message modal — contact selector ── */
.chat-new-contacts {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
    max-height: 200px;
    overflow-y: auto;
}

.chat-new-contact-opt {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.12s;
    font-size: 0.875rem;
    border: 1px solid transparent;
}

.chat-new-contact-opt:hover {
    background: var(--color-hover);
}

.chat-new-contact-opt input[type="radio"] {
    display: none;
}

.chat-new-contact-opt.is-selected {
    background: rgba(10, 132, 255, 0.08);
    border-color: rgba(10, 132, 255, 0.3);
}

.chat-new-contact-opt .chat-contact-avatar {
    width: 30px;
    height: 30px;
    font-size: 0.58rem;
    flex-shrink: 0;
}

html[data-theme="dark"] .chat-info-panel {
    background: #1c1c1e;
    border-color: #3a3a3c;
}

html[data-theme="dark"] .chat-info-head {
    border-color: #3a3a3c;
}

html[data-theme="dark"] .chat-info-fields {
    border-color: #3a3a3c;
}

html[data-theme="dark"] .chat-info-field {
    border-color: #3a3a3c;
}

html[data-theme="dark"] .chat-info-action-btn {
    background: #2c2c2e;
    border-color: #3a3a3c;
}

html[data-theme="dark"] .chat-new-contact-opt.is-selected {
    background: rgba(10, 132, 255, 0.12);
}

/* ═══════════════════════════════════════════════════════
   APPS — Integration page
   ═══════════════════════════════════════════════════════ */

.apps-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.apps-toolbar-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.apps-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.apps-search-icon {
    position: absolute;
    left: 0.65rem;
    color: var(--color-text-muted);
    pointer-events: none;
}

.apps-search-input {
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text);
    border-radius: 8px;
    padding: 0.42rem 0.75rem 0.42rem 2rem;
    font-size: 0.875rem;
    outline: none;
    width: 210px;
    transition: border-color 0.15s;
}

.apps-search-input:focus {
    border-color: #0a84ff;
}

.apps-search-input::placeholder {
    color: var(--color-text-muted);
}

.apps-select {
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text);
    border-radius: 8px;
    padding: 0.42rem 2rem 0.42rem 0.75rem;
    font-size: 0.875rem;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    transition: border-color 0.15s;
}

.apps-select:focus {
    border-color: #0a84ff;
}

/* Grid */
.apps-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding-bottom: 2rem;
}

@media (max-width: 900px) {
    .apps-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .apps-grid {
        grid-template-columns: 1fr;
    }
}

/* Card */
.apps-card {
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1rem;
    background: var(--color-bg);
    transition: box-shadow 0.18s, border-color 0.18s;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.apps-card:hover {
    box-shadow: var(--shadow);
    border-color: rgba(0, 0, 0, 0.12);
}

.apps-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.apps-icon-box {
    width: 40px;
    height: 40px;
    border-radius: 9px;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--color-text);
}

.apps-card-body h2 {
    margin: 0 0 0.25rem;
    font-size: 0.925rem;
    font-weight: 600;
}

.apps-card-body p {
    margin: 0;
    font-size: 0.825rem;
    color: var(--color-text-muted);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Connect / Connected button */
.apps-connect-btn {
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text);
    border-radius: 7px;
    padding: 0.32rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.apps-connect-btn:hover:not(.is-connected) {
    background: var(--color-hover);
}

.apps-connect-btn.is-connected {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
}

.apps-connect-btn.is-connected:hover {
    background: #dbeafe;
}

/* Empty state */
.apps-empty {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    text-align: center;
    padding: 2rem 0;
    margin: 0;
}

/* Dark mode */
html[data-theme="dark"] .apps-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .apps-connect-btn.is-connected {
    border-color: #1e40af;
    background: #1e3a8a;
    color: #93c5fd;
}

html[data-theme="dark"] .apps-connect-btn.is-connected:hover {
    background: #1e40af;
}

html[data-theme="dark"] .apps-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23aaa' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* ===== ERROR PAGES ===== */
.error-shell {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
    width: 100%;
    max-width: 480px;
    padding: 2rem 1rem;
}

.error-code {
    font-family: "Manrope", "Inter", sans-serif;
    font-size: 5rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--color-accent, #2563eb);
    margin-bottom: 0.25rem;
}

.error-code-danger {
    color: #dc2626;
}

.error-code-muted {
    color: var(--color-text-muted);
    font-size: 4rem;
}

.error-title {
    margin: 0;
    font-family: "Manrope", "Inter", sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
}

.error-desc {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 380px;
}

.error-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 0.5rem;
}

/* Dark mode */
html[data-theme="dark"] .error-code-danger {
    color: #f87171;
}

/* ===== ANALYTICS TAB ===== */
.analytics-stat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.35rem;
}

.analytics-stat-head p {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
}

.analytics-stat-icon {
    width: 1rem;
    height: 1rem;
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.analytics-split {
    display: grid;
    grid-template-columns: 4fr 3fr;
    gap: 1rem;
}

.ref-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ref-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ref-list-meta {
    flex: 1;
    min-width: 0;
}

.ref-list-label {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ref-bar-wrap {
    width: 100%;
    height: 0.5rem;
    background: var(--color-bg-secondary);
    border-radius: 9999px;
    overflow: hidden;
}

.ref-bar {
    height: 100%;
    border-radius: 9999px;
}

.ref-bar-accent {
    background: var(--color-accent, #2563eb);
}

.ref-bar-muted {
    background: var(--color-text-muted);
}

.ref-list-count {
    font-size: 0.75rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    padding-left: 0.25rem;
    color: var(--color-text);
}

@media (max-width: 768px) {
    .analytics-split {
        grid-template-columns: 1fr;
    }
}

/* --- CARME Ops: auth alert messages --- */
.auth-alert {
    border-radius: 8px;
    padding: 0.7rem 0.85rem;
    margin-top: 0.9rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.auth-alert.is-hiding {
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
}

.auth-alert-close {
    margin-left: auto;
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    opacity: 0.55;
    padding: 0;
    color: inherit;
}

.auth-alert-close:hover {
    opacity: 1;
}

.auth-alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #b91c1c;
}

.auth-alert-ok {
    background: rgba(22, 101, 52, 0.1);
    border: 1px solid rgba(22, 101, 52, 0.3);
    color: #166534;
}

html[data-theme="dark"] .auth-alert-error {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

html[data-theme="dark"] .auth-alert-ok {
    background: rgba(22, 101, 52, 0.2);
    color: #bbf7d0;
}

/* --- CARME Hub: pagination --- */
.ops-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.85rem 1.1rem;
    border-top: 1px solid var(--color-border);
}

.ops-pagination-info {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.ops-pagination-nav {
    display: inline-flex;
    gap: 0.25rem;
}

.ops-pagination-nav a,
.ops-pagination-nav span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text);
    text-decoration: none;
    background: var(--color-bg);
    transition: background 0.12s, border-color 0.12s;
}

.ops-pagination-nav a:hover {
    background: var(--color-hover);
}

.ops-pagination-nav span.is-current {
    background: #0f172a;
    border-color: #0f172a;
    color: #fff;
}

.ops-pagination-nav a.is-disabled {
    opacity: 0.4;
    pointer-events: none;
}

html[data-theme="dark"] .ops-pagination-nav span.is-current {
    background: #e5e7eb;
    border-color: #e5e7eb;
    color: #0f172a;
}

/* --- CARME Hub: audit log cards --- */
.audit-list {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
}

.audit-card {
    border-bottom: 1px solid var(--color-border);
}

.audit-card:last-child {
    border-bottom: none;
}

.audit-card-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.7rem 1rem;
}

.audit-toggle {
    cursor: pointer;
}

.audit-toggle:hover {
    background: var(--color-hover);
}

.audit-card-time {
    flex-shrink: 0;
    min-width: 5.5rem;
}

.audit-date {
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}

.audit-clock {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 0.1rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.audit-card-badge {
    flex-shrink: 0;
    min-width: 7.5rem;
}

.audit-card-main {
    flex: 1;
    min-width: 0;
}

.audit-event {
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.audit-staff {
    font-size: 0.775rem;
    color: var(--color-text-muted);
    margin-top: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.audit-chevron {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: var(--color-text-muted);
    cursor: pointer;
    border-radius: 4px;
    transition: transform 0.18s;
    pointer-events: none;
}

.audit-card.is-open .audit-chevron {
    transform: rotate(180deg);
}

.audit-card-meta {
    border-top: 1px solid var(--color-border);
    padding: 0.85rem 1rem;
    background: var(--color-bg-secondary);
}

.audit-card-meta pre {
    font-size: 0.78rem;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--color-text);
}

/* --- Multi-select checkbox column --- */
.cb-col {
    width: 2.25rem;
    text-align: center;
    padding-left: 0.75rem !important;
    padding-right: 0 !important;
}

.cb-col input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
    accent-color: var(--color-accent);
    vertical-align: middle;
}

/* --- Bulk action bar --- */
.bulk-bar {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.14);
    padding: 0.7rem 1.1rem;
    z-index: 400;
    white-space: nowrap;
    font-size: 0.9rem;
    font-weight: 500;
}

.bulk-bar[hidden] {
    display: none;
}

/* --- CARME Hub: search toolbar --- */
.ops-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--color-border);
}

.ops-toolbar input[type="search"],
.ops-toolbar select {
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text);
    border-radius: 7px;
    padding: 0 0.75rem;
    height: 34px;
    outline: none;
    transition: border-color 0.15s;
    font-size: 0.875rem;
}

.ops-toolbar input[type="search"] {
    min-width: 240px;
    flex: 1;
}

.ops-toolbar input[type="search"]:focus,
.ops-toolbar select:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.08);
}