/* Daily Desk - Header/sidebar metallic gray; rest white */

:root {
    /* Gold (header/sidebar accent) */
    --gold: #c9a227;
    --gold-light: #e5c76b;
    --gold-strip: linear-gradient(90deg, #8b7355 0%, #c9a227 20%, #e5c76b 50%, #c9a227 80%, #8b7355 100%);
    /* Header & sidebar only - metallic gray */
    --header-bg: linear-gradient(180deg, #3d3d3d 0%, #2a2a2a 100%);
    --sidebar-bg: #252525;
    --sidebar-hover: #353535;
    --sidebar-active: #1a1a1a;
    --sidebar-border: #3d3d3d;
    --sidebar-text: #e0e0e0;
    --sidebar-text-muted: #9ca3af;
    /* Rest of project - white theme */
    --body-bg: #ffffff;
    --content-bg: #ffffff;
    --card-bg: #ffffff;
    --card-border: #e5e7eb;
    --text: #111827;
    --text-muted: #6b7280;
    --input-bg: #ffffff;
    --input-border: #d1d5db;
    --btn-secondary-bg: #f3f4f6;
    --btn-secondary-border: #d1d5db;
    --success: #22c55e;
    --warning: #eab308;
    --danger: #ef4444;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-header: 0 2px 6px rgba(0,0,0,0.15);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--body-bg);
    color: var(--text);
    min-height: 100vh;
}

/* Gold strip + header */
.main-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header-bg);
    box-shadow: var(--shadow-header);
}

.gold-strip {
    height: 6px;
    background: var(--gold-strip);
    width: 100%;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    flex-wrap: nowrap;
    gap: 1rem;
    overflow: hidden;
}
.header-inner .brand {
    flex-shrink: 0;
}

.brand {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    background: linear-gradient(90deg, #c9a227, #e5c76b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.02em;
}

.top-nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: nowrap;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.25rem 0;
    scrollbar-width: thin;
    scrollbar-color: var(--gold) rgba(255,255,255,0.1);
    -webkit-overflow-scrolling: touch;
}
.top-nav::-webkit-scrollbar {
    height: 6px;
}
.top-nav::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
    border-radius: 3px;
}
.top-nav::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 3px;
}

.top-nav a {
    color: var(--sidebar-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.top-nav .user-menu {
    flex-shrink: 0;
}

.top-nav a:hover {
    color: var(--gold-light);
}

.notif-link {
    position: relative;
}

.badge {
    background: var(--gold);
    color: #1a1a1a;
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    margin-left: 0.25rem;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.login-from-badge {
    font-size: 0.8rem;
    color: var(--gold-light);
    background: rgba(0,0,0,0.2);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}
.user-menu .btn-logout {
    padding: 0.35rem 0.75rem;
    background: rgba(255,255,255,0.15);
    color: var(--sidebar-text);
    border: 1px solid var(--sidebar-border);
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
}
.user-menu .btn-logout:hover {
    background: rgba(255,255,255,0.25);
    color: var(--gold-light);
}
.btn-login-header {
    padding: 0.4rem 1rem;
    background: var(--gold);
    color: #1a1a1a;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
}
.btn-login-header:hover {
    background: var(--gold-light);
    color: #1a1a1a;
}

.user-name {
    color: var(--sidebar-text-muted);
    font-size: 0.9rem;
}

/* Layout */
.layout {
    display: flex;
    min-height: calc(100vh - 60px);
}

/* Sidebar - gray metallic dark, fixed so it does not scroll */
.sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    width: 220px;
    min-width: 220px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 50;
}

.side-nav {
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--gold) rgba(255,255,255,0.05);
}
.side-nav::-webkit-scrollbar {
    width: 6px;
}
.side-nav::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.03);
    border-radius: 3px;
}
.side-nav::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 3px;
}

.side-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1.25rem;
    color: var(--sidebar-text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    border-left: 3px solid transparent;
    transition: background 0.2s, color 0.2s;
}

.side-nav a:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text);
}

.side-nav a.active {
    background: var(--sidebar-active);
    color: var(--gold-light);
    border-left-color: var(--gold);
}

.side-nav .icon {
    opacity: 0.8;
    font-size: 1rem;
}

.sidebar-stats {
    margin-top: auto;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--sidebar-border);
    font-size: 0.85rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.35rem 0;
}

.stat-row span {
    color: var(--sidebar-text-muted);
}

.stat-row strong {
    color: var(--gold-light);
}

/* Main content - white (margin-left so it doesn't sit under fixed sidebar) */
.content {
    flex: 1;
    margin-left: 220px;
    padding: 1.5rem;
    overflow-x: auto;
}
.content--full-width {
    margin-left: 0;
    background: var(--content-bg);
    min-height: calc(100vh - 60px);
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow);
}

.card h2, .card h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text);
    font-size: 1.15rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.btn-primary {
    background: var(--gold);
    color: #1a1a1a;
}

.btn-primary:hover {
    background: var(--gold-light);
    color: #1a1a1a;
}

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

.btn-secondary:hover {
    background: #e5e7eb;
    color: var(--text);
}

.btn-danger {
    background: var(--danger);
    color: white;
}
.btn-success {
    background: var(--success);
    color: white;
}

.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    max-width: 400px;
    padding: 0.5rem 0.75rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.95rem;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #9ca3af;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--gold);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

/* Lead form – professional layout */
.lead-form-page .page-header {
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.lead-form-page .page-header-left h1 {
    margin: 0 0 0.25rem 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
}

.lead-form-page .page-subtitle {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 400;
}

.lead-form-page .btn-back {
    align-self: center;
}

.lead-form {
    max-width: 820px;
}

.lead-form .form-errors {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.lead-form .form-errors p {
    margin: 0;
}

/* Billing forms - reuse form section styles */
.billing-form .form-section,
.company-settings-form .form-section {
    background: #fafafa;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 1.35rem 1.5rem;
    margin-bottom: 1rem;
}
.billing-form .form-section-title,
.company-settings-form .form-section-title { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 1.25rem 0; padding-bottom: 0.75rem; border-bottom: 1px solid var(--card-border); font-size: 1rem; font-weight: 600; color: var(--text); }
.billing-form .form-section-fields,
.company-settings-form .form-section-fields { display: flex; flex-direction: column; gap: 0; }
.billing-form .form-grid,
.company-settings-form .form-grid { display: grid; gap: 1rem 1.5rem; }
.billing-form .form-grid-2,
.company-settings-form .form-grid-2 { grid-template-columns: 1fr 1fr; }
.billing-form .form-grid-3,
.company-settings-form .form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.billing-form .form-group-full,
.company-settings-form .form-group-full { grid-column: 1 / -1; }
.billing-form .form-group,
.company-settings-form .form-group { margin-bottom: 0; }
.billing-form .form-group label,
.company-settings-form .form-group label { display: block; margin-bottom: 0.4rem; font-size: 0.875rem; font-weight: 500; color: var(--text); }
.billing-form .form-group input,
.billing-form .form-group select,
.billing-form .form-group textarea,
.company-settings-form .form-group input,
.company-settings-form .form-group select,
.company-settings-form .form-group textarea {
    width: 100%; max-width: none; padding: 0.55rem 0.75rem; border: 1px solid var(--input-border); border-radius: 6px;
    font-size: 0.95rem; background: var(--input-bg); color: var(--text);
}
/* Quotation/Invoice items section */
.quotation-items-section .items-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.quotation-items-section .items-section-header .form-section-title {
    margin: 0;
    padding: 0;
    border: none;
}
.billing-items-scroll {
    overflow-x: auto;
    margin-bottom: 1rem;
    border: 1px solid var(--card-border);
    border-radius: 6px;
    background: #fff;
}
.billing-items-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-size: 0.9rem;
}
.billing-items-table th {
    padding: 0.65rem 0.75rem;
    text-align: left;
    background: var(--card-bg, #2d3748);
    color: #e2e8f0;
    font-weight: 600;
    border-bottom: 1px solid var(--card-border);
}
.billing-items-table th.col-num { width: 40px; text-align: center; }
.billing-items-table th.col-desc { min-width: 200px; }
.billing-items-table th.col-qty { width: 90px; text-align: right; }
.billing-items-table th.col-unit { width: 80px; text-align: center; }
.billing-items-table th.col-rate { width: 110px; text-align: right; }
.billing-items-table th.col-amount { width: 100px; text-align: right; }
.billing-items-table th.col-actions { width: 50px; text-align: center; }
.billing-items-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--card-border);
    vertical-align: middle;
}
.billing-items-table .col-num { text-align: center; color: var(--text-muted); font-size: 0.85rem; }
.billing-items-table .col-num input[type="hidden"] { display: none; }
.billing-items-table .col-desc .input-wrap,
.billing-items-table .col-desc input { width: 100%; min-width: 180px; }
.billing-items-table .col-qty .input-wrap,
.billing-items-table .col-qty input { width: 70px; text-align: right; }
.billing-items-table .col-unit .input-wrap,
.billing-items-table .col-unit input { width: 65px; text-align: center; }
.billing-items-table .col-rate .input-wrap,
.billing-items-table .col-rate input { width: 90px; text-align: right; }
.billing-items-table .col-amount { text-align: right; font-weight: 600; color: var(--text); }
.billing-items-table .row-amount { font-family: inherit; }
.billing-items-table .col-actions { text-align: center; }
.billing-items-table .btn-remove-row {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--card-border);
    border-radius: 4px;
    background: #fff;
    color: #6b7280;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.billing-items-table .btn-remove-row:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fecaca;
}
.billing-items-table .item-row.row-hidden { display: none; }
.quotation-total-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 700;
}
.quotation-total-row .total-label { color: #92400e; }
.quotation-total-row .total-value { color: #b45309; font-size: 1.25rem; }
.billing-lead-context { margin-bottom: 1rem; padding: 0.75rem 1rem; }
.table-actions { white-space: nowrap; }
.table-actions .btn { margin-right: 0.25rem; }

/* ─── Billing Home Page ─── */
.billing-home-page {
    max-width: 1100px;
    margin: 0 auto;
}
.billing-hero {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #252525 100%);
    border-radius: 12px;
    padding: 2rem 2.25rem;
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    border: 1px solid rgba(201, 162, 39, 0.2);
}
.billing-hero-content { flex: 1; min-width: 280px; }
.billing-hero-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(90deg, #c9a227, #e5c76b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}
.billing-hero-subtitle {
    margin: 0;
    font-size: 0.95rem;
    color: #d1d5db;
    line-height: 1.5;
}
.billing-hero-stats {
    display: flex;
    gap: 2rem;
}
.billing-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.billing-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gold-light);
    line-height: 1.2;
}
.billing-stat-label {
    font-size: 0.75rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.2rem;
}
.billing-cards {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.billing-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.75rem;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
    min-height: 240px;
}
.billing-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    border-color: rgba(201, 162, 39, 0.4);
}
.billing-card-icon {
    font-size: 2.25rem;
    margin-bottom: 1rem;
    line-height: 1;
}
.billing-card--settings .billing-card-icon { opacity: 0.9; }
.billing-card--quotation .billing-card-icon { opacity: 0.9; }
.billing-card--invoice .billing-card-icon { opacity: 0.9; }
.billing-card-title {
    margin: 0 0 0.6rem 0;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
}
.billing-card-desc {
    margin: 0 0 1.25rem 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    flex: 1;
}
.billing-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.billing-card-actions .btn {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}
@media (max-width: 640px) {
    .billing-hero { padding: 1.5rem; flex-direction: column; align-items: stretch; }
    .billing-hero-stats { justify-content: center; gap: 2.5rem; }
    .billing-hero-title { font-size: 1.35rem; }
    .billing-cards { grid-template-columns: 1fr; }
}

.lead-form .form-section {
    background: #fafafa;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 1.35rem 1.5rem;
    margin-bottom: 1rem;
}

.lead-form .form-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1.25rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--card-border);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.lead-form .form-section-icon {
    font-size: 1.15rem;
    opacity: 0.9;
}

.lead-form .form-section-fields {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.lead-form .form-grid {
    display: grid;
    gap: 1rem 1.5rem;
}

.lead-form .form-grid-2 {
    grid-template-columns: 1fr 1fr;
}

.lead-form .form-group-full {
    grid-column: 1 / -1;
}

.lead-form .form-group {
    margin-bottom: 0;
}

.lead-form .form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
}

.lead-form .form-group .required {
    color: #dc2626;
}

.lead-form .form-group input,
.lead-form .form-group select,
.lead-form .form-group textarea {
    width: 100%;
    max-width: none;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    font-size: 0.95rem;
    background: var(--input-bg);
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.lead-form .form-group input:focus,
.lead-form .form-group select:focus,
.lead-form .form-group textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
}

.lead-form .form-group input::placeholder,
.lead-form .form-group textarea::placeholder {
    color: #9ca3af;
}

.lead-form .form-group select {
    cursor: pointer;
    appearance: auto;
}

.lead-form .form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.lead-form .form-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.lead-form .field-error {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: #dc2626;
}

.lead-form .form-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--card-border);
}

.lead-form .btn-submit {
    padding: 0.6rem 1.5rem;
    font-weight: 600;
}

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

/* Follow-up form page – best design */
.followup-form-page .page-header {
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.followup-form-page .page-header-left h1 {
    margin: 0 0 0.25rem 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
}

.followup-form-page .page-subtitle {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.followup-form-page .btn-back {
    align-self: center;
}

.followup-lead-context {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fcd34d;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    max-width: 560px;
}

.followup-lead-link {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
}

.followup-lead-link:hover {
    color: #b45309;
}

.followup-lead-name {
    font-size: 1.05rem;
}

.followup-lead-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 400;
}

.followup-lead-meta::before {
    content: " · ";
    color: #d1d5db;
}

.followup-form {
    max-width: 560px;
}

.followup-form .form-errors {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

.followup-form .form-errors p {
    margin: 0;
}

.followup-form .form-section {
    background: #fafafa;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.followup-form .form-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1.25rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--card-border);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.followup-form .form-section-icon {
    font-size: 1.2rem;
}

.followup-form .form-section-fields {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.followup-form .form-group {
    margin-bottom: 0;
}

.followup-form .form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
}

.followup-form .form-group .required {
    color: #dc2626;
}

.followup-form .form-group input,
.followup-form .form-group textarea {
    width: 100%;
    max-width: none;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    font-size: 0.95rem;
    background: var(--input-bg);
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.followup-form .form-group input:focus,
.followup-form .form-group textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
}

.followup-form .form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.followup-form .field-error {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: #dc2626;
}

.followup-form .form-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--card-border);
}

.followup-form .btn-submit {
    padding: 0.6rem 1.5rem;
    font-weight: 600;
}

/* Communication form page – professional design */
.communication-form-page .page-header {
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.communication-form-page .page-header-left h1 {
    margin: 0 0 0.25rem 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
}

.communication-form-page .page-subtitle {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.communication-form-page .btn-back {
    align-self: center;
}

.communication-lead-context {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #93c5fd;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    max-width: 560px;
}

.communication-lead-link {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
}

.communication-lead-link:hover {
    color: #1d4ed8;
}

.communication-lead-name {
    font-size: 1.05rem;
}

.communication-lead-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 400;
}

.communication-lead-meta::before {
    content: " · ";
    color: #d1d5db;
}

.communication-form-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.communication-form-layout .communication-form {
    flex: 1;
    min-width: 0;
    max-width: 560px;
}

.communication-form {
    max-width: 560px;
}

.communication-last-sidebar {
    width: 300px;
    min-width: 280px;
    flex-shrink: 0;
    background: #f8fafc;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 1rem 1.25rem;
}

.communication-last-sidebar h3 {
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

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

.last-comm-item {
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--card-border);
    font-size: 0.82rem;
}

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

.last-comm-type {
    font-weight: 600;
    color: #b45309;
}

.last-comm-item .date-highlight {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.8em;
}

.last-comm-subject {
    display: block;
    font-size: 0.85em;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.last-comm-notes {
    margin: 0.35rem 0 0 0;
    font-size: 0.85em;
    color: var(--text);
    line-height: 1.35;
}

.last-comm-view-all {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: #b45309;
    font-weight: 600;
    text-decoration: none;
}

.last-comm-view-all:hover {
    text-decoration: underline;
}

@media (max-width: 900px) {
    .communication-form-layout {
        flex-direction: column;
    }

    .communication-last-sidebar {
        width: 100%;
        min-width: 0;
    }
}

.communication-form .form-errors {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

.communication-form .form-errors p {
    margin: 0;
}

.communication-form .form-section {
    background: #fafafa;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.communication-form .form-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1.25rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--card-border);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.communication-form .form-section-icon {
    font-size: 1.2rem;
}

.communication-form .form-section-fields {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.communication-form .form-group {
    margin-bottom: 0;
}

.communication-form .form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
}

.communication-form .form-group .required {
    color: #dc2626;
}

.communication-form .form-group input,
.communication-form .form-group select,
.communication-form .form-group textarea {
    width: 100%;
    max-width: none;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    font-size: 0.95rem;
    background: var(--input-bg);
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.communication-form .form-group input:focus,
.communication-form .form-group select:focus,
.communication-form .form-group textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
}

.communication-form .form-group select {
    cursor: pointer;
    appearance: auto;
}

.communication-form .form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.communication-form .form-hint {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.communication-form .field-error {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: #dc2626;
}

.communication-form .form-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--card-border);
}

.communication-form .btn-submit {
    padding: 0.6rem 1.5rem;
    font-weight: 600;
}

/* Tables */
.table-wrap {
    overflow-x: auto;
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
}

table.data-table th,
table.data-table td {
    padding: 0.65rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--card-border);
}

table.data-table th {
    background: #f9fafb;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
}

table.data-table tr:hover td {
    background: #f9fafb;
}

table.data-table a {
    color: #b45309;
    text-decoration: none;
}

table.data-table a:hover {
    text-decoration: underline;
}

/* Messages */
.messages {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
}

.message {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    transition: opacity 0.3s;
}

.message.success {
    background: #dcfce7;
    border: 1px solid var(--success);
    color: #166534;
}

.message.error {
    background: #fee2e2;
    border: 1px solid var(--danger);
    color: #b91c1c;
}

.message.warning {
    background: #fef9c3;
    border: 1px solid var(--warning);
    color: #a16207;
}

/* Dashboard page – compact layout (optimize space, smaller fonts) */
.dashboard-page .page-header {
    margin-bottom: 0.5rem;
}
.dashboard-page .page-header h1 {
    font-size: 1.2rem;
}
.dashboard-page .card {
    padding: 0.65rem 1rem;
    margin-bottom: 0.85rem;
}
.dashboard-page .dashboard-duty-card {
    margin-bottom: 0.85rem;
}
.dashboard-page .dashboard-duty-title {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
}
.dashboard-page .duty-on .duty-status,
.dashboard-page .duty-off .duty-hint {
    margin: 0 0 0.35rem 0;
    font-size: 0.82rem;
}
.dashboard-page .duty-hint {
    font-size: 0.78rem !important;
}
.dashboard-page .duty-off-form {
    margin-top: 0.5rem;
}
.dashboard-page .duty-start-form .duty-form-row {
    gap: 0.5rem;
}
.dashboard-page .duty-start-form .duty-form-row label {
    font-size: 0.8rem;
}
.dashboard-page .duty-start-form .duty-form-row select {
    min-width: 120px;
    padding: 0.3rem 0.4rem;
    font-size: 0.85rem;
}
.dashboard-page .duty-start-form .btn,
.dashboard-page .duty-off-form .btn {
    font-size: 0.82rem;
    padding: 0.3rem 0.6rem;
}

/* Dashboard stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.dashboard-page .stats-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 1.25rem;
    text-align: center;
}
.dashboard-page .stat-card {
    padding: 0.5rem 0.6rem;
    border-radius: 6px;
}

.stat-card--link {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.stat-card--link:hover {
    border-color: var(--gold, #c9a227);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.stat-card--link .value {
    color: #b45309;
}
.stat-card--link:hover .value {
    color: #92400e;
}

.stat-card .value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #b45309;
}
.dashboard-page .stat-card .value {
    font-size: 1.25rem;
}
.stat-card .label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}
.dashboard-page .stat-card .label {
    font-size: 0.72rem;
    margin-top: 0.15rem;
}

/* Dashboard lead stats graph */
.dashboard-duty-card {
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--gold);
}
.dashboard-duty-title {
    margin: 0 0 0.75rem 0;
    font-size: 1.1rem;
}
.duty-on .duty-status,
.duty-off .duty-hint {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
}
.duty-hint {
    color: var(--text-muted);
    font-size: 0.85rem !important;
}
.duty-off-form {
    margin-top: 0.75rem;
}
.duty-start-form .duty-form-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}
.duty-start-form .duty-form-row label {
    font-weight: 600;
    font-size: 0.9rem;
}
.duty-start-form .duty-form-row select {
    min-width: 140px;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--input-border);
    border-radius: 4px;
}

.dashboard-graph-card {
    margin-bottom: 1.5rem;
}
.dashboard-page .dashboard-graph-card {
    margin-bottom: 0.85rem;
}
.dashboard-graph-title {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
}
.dashboard-page .dashboard-graph-title {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
}
.lead-stats-graph {
    min-height: 80px;
}
.dashboard-page .lead-stats-graph {
    min-height: 56px;
}
.graph-bars {
    display: flex;
    gap: 4px;
    margin-bottom: 0.75rem;
    border-radius: 6px;
    overflow: hidden;
    min-height: 36px;
}
.dashboard-page .graph-bars {
    margin-bottom: 0.5rem;
    min-height: 28px;
}
.graph-bar-wrap {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1 1 0;
    position: relative;
}
.graph-bar {
    height: 32px;
    border-radius: 4px;
    min-width: 2px;
    transition: width 0.2s ease;
}
.dashboard-page .graph-bar {
    height: 26px;
}
.graph-bar--active {
    background: linear-gradient(90deg, #fef9c3, #eab308);
}
.graph-bar--converted {
    background: linear-gradient(90deg, #dcfce7, #22c55e);
}
.graph-bar--lost {
    background: linear-gradient(90deg, #fee2e2, #ef4444);
}
.graph-bar-label {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    font-weight: 700;
    color: #1f2937;
    text-shadow: 0 0 2px #fff, 0 0 4px #fff;
    white-space: nowrap;
    pointer-events: none;
}
.dashboard-page .graph-bar-label {
    font-size: 0.68rem;
}
.graph-legend {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.dashboard-page .graph-legend {
    gap: 0.5rem;
    font-size: 0.75rem;
}
.graph-legend-item::before {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    margin-right: 0.35rem;
    vertical-align: middle;
}
.graph-legend--active::before { background: #eab308; }
.graph-legend--converted::before { background: #22c55e; }
.graph-legend--lost::before { background: #ef4444; }
.graph-status-breakdown {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--card-border);
}
.dashboard-page .graph-status-breakdown {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
}
.dashboard-page .graph-status-breakdown h3 {
    font-size: 0.82rem;
}
.graph-status-breakdown h3 {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
}
.graph-status-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.35rem;
}
.graph-status-list li {
    font-size: 0.85rem;
}
.dashboard-page .graph-status-list li {
    font-size: 0.78rem;
}

/* Dashboard – follow-ups with time and days */
.dashboard-section {
    margin-bottom: 1.5rem;
}
.dashboard-page .dashboard-section {
    margin-bottom: 0.85rem;
}

.dashboard-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 0 0 0.35rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}
.dashboard-page .dashboard-section-title {
    font-size: 0.92rem;
    margin-bottom: 0.25rem;
}

.dashboard-section-icon {
    font-size: 1.2rem;
}
.dashboard-page .dashboard-section-icon {
    font-size: 1rem;
}

.dashboard-section-badge {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    background: #f3f4f6;
    color: var(--text-muted);
}
.dashboard-page .dashboard-section-badge {
    font-size: 0.68rem;
    padding: 0.15rem 0.35rem;
}

.dashboard-section-badge.delayed {
    background: #fee2e2;
    color: #b91c1c;
}

.dashboard-section-desc {
    margin: 0 0 0.75rem 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.dashboard-page .dashboard-section-desc {
    margin: 0 0 0.4rem 0;
    font-size: 0.75rem;
}

.dashboard-followup-compact .dashboard-section-desc {
    margin-bottom: 0.5rem;
}
.dashboard-page .dashboard-followup-compact .dashboard-section-desc {
    margin-bottom: 0.35rem;
}

.dashboard-followup-compact.card {
    padding: 1rem 1.25rem;
}

.dashboard-delayed {
    border-left: 4px solid #dc2626;
}

.dashboard-delayed .dashboard-section-title {
    color: #b91c1c;
}

.dashboard-reminders-card {
    border-left: 4px solid var(--gold);
    margin-bottom: 1rem;
}
.dashboard-reminders-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.reminder-item-dash {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: #fefce8;
    border-radius: 8px;
    font-size: 0.9rem;
}
.reminder-item-dash .reminder-time {
    flex-shrink: 0;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.reminder-item-dash a {
    color: var(--gold);
    text-decoration: none;
}
.reminder-item-dash a:hover {
    text-decoration: underline;
}
.reminder-item-dash .reminder-msg {
    flex: 1;
    color: var(--text-muted);
}
.reminder-item--from-user .reminder-from {
    font-weight: 500;
}

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

.followup-timed-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--card-border);
    flex-wrap: wrap;
}
.dashboard-page .followup-timed-item {
    padding: 0.35rem 0;
    gap: 0.5rem;
}

.followup-timed-item:last-child {
    border-bottom: none;
}

.followup-item-main {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem 0.6rem;
    flex: 1;
    min-width: 0;
}
.dashboard-page .followup-item-main {
    gap: 0.3rem 0.5rem;
}

.followup-timed-item .followup-lead-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #b45309;
    text-decoration: none;
}
.dashboard-page .followup-timed-item .followup-lead-name {
    font-size: 0.82rem;
}

.followup-timed-item .followup-lead-name:hover {
    text-decoration: underline;
}

.followup-timed-item .followup-when {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.dashboard-page .followup-timed-item .followup-when {
    font-size: 0.72rem;
}

.followup-days-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    background: #dbeafe;
    color: #1e40af;
}
.dashboard-page .followup-days-badge {
    font-size: 0.65rem;
    padding: 0.1rem 0.3rem;
}

.followup-days-badge.today {
    background: #dcfce7;
    color: #166534;
}

.followup-days-badge.tomorrow {
    background: #e0e7ff;
    color: #3730a3;
}

.followup-days-badge.overdue {
    background: #fee2e2;
    color: #b91c1c;
}

.followup-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.dashboard-page .followup-time {
    font-size: 0.72rem;
}

.followup-notes-inline {
    font-size: 0.75rem;
    color: var(--text-muted);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dashboard-page .followup-notes-inline {
    font-size: 0.68rem;
    max-width: 140px;
}

.followup-notes {
    margin: 0.35rem 0 0 0;
    font-size: 0.8rem;
    line-height: 1.3;
}

.delayed-item .followup-when {
    color: #991b1b;
}

/* View / Schedule buttons on follow-up items */
.followup-item-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.btn-followup {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.dashboard-page .btn-followup {
    padding: 0.18rem 0.4rem;
    font-size: 0.68rem;
}
.dashboard-page .layout-two {
    gap: 0.75rem;
}
.dashboard-page .layout-two .card h2 {
    font-size: 0.95rem;
    margin: 0 0 0.5rem 0;
}
.dashboard-page .source-list li,
.dashboard-page .followup-list li {
    padding: 0.35rem 0;
    font-size: 0.82rem;
}
.dashboard-page .empty-state {
    padding: 1rem;
    font-size: 0.8rem;
}

.btn-followup.btn-view {
    background: #f3f4f6;
    color: var(--text);
    border: 1px solid #e5e7eb;
}

.btn-followup.btn-view:hover {
    background: #e5e7eb;
    color: var(--text);
}

.btn-followup.btn-schedule {
    background: #b45309;
    color: #fff;
    border: 1px solid #b45309;
}

.btn-followup.btn-schedule:hover {
    background: #92400e;
    color: #fff;
}

/* Pipeline */
.pipeline {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
}

.pipeline-column {
    min-width: 260px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 1rem;
}
.pipeline-column--has-leads {
    border-color: var(--gold, #c9a227);
    box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.25);
}

.pipeline-column h4 {
    margin: 0 0 1rem 0;
    font-size: 0.95rem;
    color: var(--text-muted);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--card-border);
}

.pipeline-item {
    background: #f9fafb;
    border: 1px solid var(--card-border);
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.pipeline-item:hover {
    border-color: var(--gold);
    background: #fff;
}

.pipeline-item a {
    color: var(--text);
    text-decoration: none;
}

.pipeline-hint {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Tasks page – compact layout */
.tasks-page .page-header {
    margin-bottom: 0.5rem;
}
.tasks-page .page-header h1 {
    font-size: 1.2rem;
}
.tasks-page .page-header .btn {
    font-size: 0.85rem;
    padding: 0.35rem 0.65rem;
}
.tasks-page .page-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.tasks-view-switch {
    display: flex;
    gap: 0.25rem;
}
.tasks-view-link {
    padding: 0.35rem 0.65rem;
    font-size: 0.85rem;
    text-decoration: none;
    color: var(--text-muted);
    background: #f3f4f6;
    border: 1px solid var(--card-border);
    border-radius: 4px;
}
.tasks-view-link:hover {
    background: #e5e7eb;
    color: var(--text);
}
.tasks-view-link.active {
    background: var(--gold);
    color: #1a1a1a;
    border-color: var(--gold);
    font-weight: 600;
}

.tasks-calendar-hint {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0 0 0.5rem 0;
}
.task-calendar-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.task-calendar-month {
    font-weight: 600;
    font-size: 0.95rem;
}
/* Task calendar: same layout as main calendar, avoid cramped .tasks-page .card */
.tasks-page .calendar-grid-wrap.card,
.tasks-page .task-calendar-grid.card {
    padding: 1rem;
    margin-bottom: 1rem;
    overflow: visible;
}
.tasks-page .task-calendar-grid .calendar-grid {
    min-width: 560px;
    table-layout: fixed;
    width: 100%;
}
.tasks-page .task-calendar-grid .calendar-grid th,
.tasks-page .task-calendar-grid .calendar-grid td {
    width: 14.28%;
    min-height: 80px;
    padding: 0.5rem;
    vertical-align: top;
    border: 1px solid var(--card-border);
    overflow: visible;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.tasks-page .task-calendar-grid .calendar-grid th {
    background: #f3f4f6;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
}
.task-calendar-grid .calendar-cell {
    min-height: 80px;
    overflow: visible;
}
.task-calendar-grid .calendar-cell--blank {
    min-height: 60px;
}
.task-calendar-events {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow: visible;
}
.task-calendar-event {
    font-size: 0.78rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.25rem;
    overflow: visible;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.task-calendar-event:last-child {
    border-bottom: none;
}
.task-calendar-title {
    font-weight: 600;
    flex: 1 1 100%;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}
.task-calendar-time,
.task-calendar-assigned {
    white-space: normal;
    flex-shrink: 0;
}
.task-calendar-time {
    color: var(--text-muted);
}
.task-calendar-complete-form {
    display: inline;
}
.task-calendar-complete-form .complete-btn {
    padding: 0.1rem 0.35rem;
    font-size: 0.75rem;
    border: 1px solid var(--card-border);
    background: #dcfce7;
    color: #166534;
    border-radius: 3px;
    cursor: pointer;
}
.task-calendar-complete-form .complete-btn:hover {
    background: #22c55e;
    color: #fff;
}

.tasks-hint {
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.leads-list-hint {
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.task-form-page .task-lead-context {
    margin-bottom: 1rem;
    padding: 0.5rem 0.75rem;
    background: #f0f9ff;
    border-radius: 6px;
    border-left: 4px solid #0ea5e9;
}

.task-form .form-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pipeline-status-form {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.pipeline-move-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.pipeline-status-select {
    font-size: 0.8rem;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    border: 1px solid var(--card-border);
    min-width: 0;
    flex: 1;
}

/* User management */
.users-hint {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.users-hint a {
    color: var(--gold, #b45309);
    font-weight: 600;
}

.user-status {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}
.activity-report-hint {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0 0 1rem 0;
}
.activity-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}
.activity-badge--login {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #22c55e;
}
.activity-badge--logout {
    background: #e0e7ff;
    color: #3730a3;
    border: 1px solid #6366f1;
}
.activity-badge--duty-start {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #3b82f6;
}
.activity-badge--duty-off {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}
.user-status--active {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #22c55e;
}
.user-status--inactive {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.page-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.roles-hint {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.role-edit-form .form-group {
    margin-bottom: 1rem;
}

.role-perm-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    cursor: pointer;
}

.role-edit-form .form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.user-form-page .page-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.user-form-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 900px) {
    .user-form-layout {
        grid-template-columns: 1fr;
    }
}

.user-form-main .user-form {
    max-width: 100%;
}

.user-form .form-errors,
.user-form .form-errors-summary {
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    color: #991b1b;
}

.user-form .form-errors-summary ul {
    margin: 0.5rem 0 0 1.25rem;
    padding: 0;
}

.user-form .form-errors-summary li {
    margin-bottom: 0.25rem;
}

.user-form .form-group {
    margin-bottom: 1rem;
}

.user-form .field-error {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: #b91c1c;
}

.user-form .form-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.user-form .form-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.user-form-sidebar .role-perms-table {
    width: 100%;
    font-size: 0.8rem;
    border-collapse: collapse;
}

.user-form-sidebar .role-perms-table th,
.user-form-sidebar .role-perms-table td {
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--card-border);
    text-align: center;
}

.user-form-sidebar .role-perms-table th {
    background: #f3f4f6;
    font-weight: 600;
}

.user-form-sidebar h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.user-form-sidebar .muted.small {
    margin-bottom: 0.75rem;
}

/* ——— Login page (professional) ——— */
.login-page {
    min-height: calc(100vh - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: linear-gradient(160deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 2.25rem 2rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.login-card-brand {
    text-align: center;
    margin-bottom: 1.75rem;
}

.login-logo {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #b8860b 0%, #c9a227 40%, #e5c76b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-tagline {
    margin: 0.35rem 0 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.login-messages {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem 0;
}

.login-message {
    padding: 0.6rem 0.85rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.login-message:last-child {
    margin-bottom: 0;
}

.login-message--error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.login-message--success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.login-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.35rem;
}

.login-field input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    font-size: 0.95rem;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-field input::placeholder {
    color: #9ca3af;
}

.login-field input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
}

.login-submit {
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a1a1a;
    background: linear-gradient(180deg, #e5c76b 0%, #c9a227 100%);
    border: 1px solid #b8860b;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
}

.login-submit:hover {
    background: linear-gradient(180deg, #ecd16b 0%, #d4a81a 100%);
    box-shadow: 0 2px 8px rgba(201, 162, 39, 0.35);
}

.login-submit:active {
    transform: translateY(1px);
}

.login-footer-hint {
    margin: 1.25rem 0 0 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--card-border);
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
}

/* Legacy auth-box (e.g. other auth pages) */
.auth-box {
    max-width: 400px;
    margin: 4rem auto;
    padding: 2rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.auth-box h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    background: linear-gradient(90deg, #c9a227, #e5c76b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-hint {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: -0.5rem 0 1rem 0;
    text-align: center;
}
.auth-box .btn-primary,
.auth-box .btn-login {
    width: 100%;
    padding: 0.65rem;
    margin-top: 0.5rem;
    font-weight: 600;
}
.auth-box select#login_from {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--input-border);
    border-radius: 4px;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 0.4rem 0.75rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 4px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
}

.pagination a:hover {
    border-color: var(--gold);
    color: #b45309;
}

.pagination .current {
    background: var(--gold);
    color: #1a1a1a;
    border-color: var(--gold);
}

/* Utility */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text);
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

/* Reports filter form */
.reports-filter-form h3 {
    margin: 0 0 0.5rem 0;
}
.reports-filter-form .muted.small {
    margin-bottom: 1rem;
}
.reports-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}
.reports-filter-row .form-group {
    margin-bottom: 0;
}
.reports-filter-row .form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.reports-filter-row input[type="date"],
.reports-filter-row select {
    padding: 0.35rem 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--card-border);
    min-width: 140px;
}
.reports-filter-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Reports page – compact layout + task report */
.reports-page .page-header {
    margin-bottom: 0.5rem;
}
.reports-page .page-header h1 {
    font-size: 1.2rem;
}
.reports-page .card {
    padding: 0.65rem 1rem;
    margin-bottom: 0.75rem;
}
.reports-page .reports-filter-form h3 {
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
}
.reports-page .reports-filter-form .muted.small {
    font-size: 0.78rem;
    margin-bottom: 0.5rem;
}
.reports-page .reports-filter-row {
    gap: 0.5rem;
}
.reports-page .reports-filter-row .form-group label {
    font-size: 0.78rem;
}
.reports-page .reports-filter-row input,
.reports-page .reports-filter-row select {
    font-size: 0.82rem;
    padding: 0.3rem 0.4rem;
    min-width: 110px;
}
.reports-page .reports-filter-actions .btn {
    font-size: 0.82rem;
    padding: 0.3rem 0.6rem;
}
.reports-section-title {
    font-size: 0.98rem;
    margin: 0.75rem 0 0.5rem 0;
    font-weight: 600;
}
.reports-section-title:first-of-type {
    margin-top: 0;
}
.reports-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.reports-stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    padding: 0.45rem 0.6rem;
    text-align: center;
}
.reports-stat-card--link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.reports-stat-card--link:hover {
    border-color: var(--gold, #c9a227);
    background: #fffbeb;
    box-shadow: 0 2px 8px rgba(201, 162, 39, 0.15);
}
.reports-stat-card .value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #b45309;
}
.reports-stat-card .label {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}
.reports-tables-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.reports-table-card h3 {
    font-size: 0.9rem;
    margin: 0 0 0.4rem 0;
}
.reports-table {
    font-size: 0.82rem;
}
.reports-table th,
.reports-table td {
    padding: 0.35rem 0.5rem;
}
.reports-page .empty-state {
    padding: 0.75rem;
    font-size: 0.8rem;
}

.layout-two {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.form-row .form-group {
    margin-bottom: 0;
}

.filter-form .form-group input,
.filter-form .form-group select {
    min-width: 160px;
}

.followup-list, .source-list, .comm-list, .timeline {
    list-style: none;
    padding: 0;
    margin: 0;
}

.followup-list li, .source-list li, .comm-list li, .timeline li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--card-border);
}

.followup-list li:last-child, .source-list li:last-child, .comm-list li:last-child, .timeline li:last-child {
    border-bottom: none;
}

.muted, .small {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Lead detail page – reduced font sizes + date highlight */
.lead-detail-page .page-header h1 {
    font-size: 1.25rem;
}

.lead-detail-page .actions .btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
}

.lead-detail-page .lead-quick-hint {
    font-size: 0.82rem;
}

.lead-assign-card {
    margin-bottom: 1rem;
}
.lead-assign-card .muted.small {
    margin-bottom: 0.75rem;
}
.lead-assign-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.lead-assign-form label {
    font-weight: 600;
    font-size: 0.9rem;
}
.lead-assign-select {
    min-width: 180px;
    padding: 0.35rem 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--card-border);
}

.lead-detail-page .card h3 {
    font-size: 0.95rem;
}

.lead-detail-page .card p,
.lead-detail-page .detail-grid .card p {
    font-size: 0.875rem;
    margin-bottom: 0.4rem;
}

.lead-detail-page .timeline li,
.lead-detail-page .comm-list li {
    font-size: 0.85rem;
}

.lead-detail-page .card ul li {
    font-size: 0.875rem;
}

.lead-detail-page .empty-state {
    font-size: 0.875rem;
}

.date-highlight {
    background: #fef3c7;
    color: #92400e;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9em;
}

/* Leads grid view */
.leads-grid-wrap {
    margin-top: 1rem;
}

.leads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.lead-card {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 1rem 1.1rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.lead-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.lead-card-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
    text-decoration: none;
    line-height: 1.2;
}

.lead-card-name:hover {
    color: #b45309;
    text-decoration: underline;
}

.status-pill {
    border: 1px solid #d1d5db;
    background: #fff;
    border-left-width: 4px;
    border-radius: 999px;
    padding: 0.18rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

/* Status colors: converted = green, pending = yellow, lost = red */
.status-pill--converted {
    background: #dcfce7;
    border-color: #22c55e;
    color: #166534;
}
.status-pill--pending {
    background: #fef9c3;
    border-color: #eab308;
    color: #854d0e;
}
.status-pill--lost {
    background: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
}
.status-pill--success {
    background: #dcfce7;
    border-color: #22c55e;
    color: #166534;
}
.status-pill--danger {
    background: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
}

.status-pill-muted {
    color: var(--text-muted);
    border-color: #d1d5db;
}

.lead-card-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem 1rem;
}

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

.meta-label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 0.15rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.meta-value {
    display: block;
    font-size: 0.9rem;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lead-card-interest .meta-value {
    white-space: normal;
    overflow: visible;
}

.lead-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--card-border);
}

@media (max-width: 640px) {
    .lead-card-meta {
        grid-template-columns: 1fr;
    }
}

.lead-quick-hint {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    margin-bottom: 1.25rem;
    padding: 0.85rem 1.25rem;
    font-size: 0.9rem;
}

.lead-quick-hint strong {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.lead-quick-hint ol {
    margin: 0;
    padding-left: 1.25rem;
}

.lead-quick-hint li {
    margin-bottom: 0.35rem;
}

.lead-quick-hint li:last-child {
    margin-bottom: 0;
}

.lead-quick-hint a {
    color: #b45309;
    font-weight: 600;
    text-decoration: none;
}

/* Tasks grid view */
.tasks-section-title {
    font-size: 0.95rem;
    margin: 1rem 0 0.5rem 0;
}
/* ——— Tasks grid section (toolbar + lists) ——— */
.tasks-grid-section {
    margin-top: 0.5rem;
}
.tasks-toolbar {
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: #fff;
}
.tasks-toolbar-filters {
    margin-bottom: 0.75rem;
}
.tasks-inline-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.6rem 1rem;
}
.tasks-inline-filters .tasks-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.tasks-inline-filters .tasks-filter-group label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.tasks-inline-filters .tasks-filter-group input,
.tasks-inline-filters .tasks-filter-group select {
    font-size: 0.8rem;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--card-border);
    border-radius: 4px;
    min-width: 100px;
}
.tasks-filter-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.tasks-stats-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.25rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.tasks-stats-item strong {
    color: var(--text);
    margin-right: 0.2rem;
}
.tasks-stats-chart {
    display: flex;
    height: 6px;
    min-width: 120px;
    max-width: 200px;
    border-radius: 3px;
    overflow: hidden;
    background: #e5e7eb;
}
.tasks-chart-bar {
    display: block;
    height: 100%;
}
.tasks-chart-bar--pending { background: #f59e0b; }
.tasks-chart-bar--completed { background: #22c55e; }
.tasks-list-block {
    margin-bottom: 1.5rem;
}
.tasks-list-block--completed {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--card-border);
}
.tasks-block-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 0.65rem 0;
}
.tasks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.85rem;
}
.tasks-empty {
    grid-column: 1 / -1;
    color: var(--text-muted);
    padding: 1rem 0;
    font-size: 0.85rem;
}
.task-card {
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.task-card--overdue {
    border-left: 3px solid #dc2626;
    background: #fef2f2;
}
.task-card--unviewed,
.task-card--unread-notes {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.25);
}
.task-card--unread-notes {
    border-left-color: #f59e0b;
    background: #fffbeb;
}
.task-card--unviewed.task-card--unread-notes {
    background: linear-gradient(135deg, #eff6ff 0%, #fffbeb 100%);
    border-left: 4px solid #3b82f6;
}
.task-card--unviewed.task-card--overdue,
.task-card--unread-notes.task-card--overdue {
    background: linear-gradient(135deg, #eff6ff 0%, #fef2f2 100%);
    border-left: 4px solid #dc2626;
}
.task-card--completed {
    border-color: #e5e7eb;
    background: #f9fafb;
}
.task-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--card-border);
}
.task-card-head .task-card-title {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
    flex: 1;
    min-width: 0;
}
.task-card-head .task-card-title a { color: inherit; text-decoration: none; }
.task-card-head .task-card-title a:hover { text-decoration: underline; }
.task-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
    margin-left: 0.35rem;
    font-weight: 600;
}
.task-badge--unviewed {
    background: #3b82f6;
    color: #fff;
}
.task-badge--notes {
    background: #fef3c7;
    color: #92400e;
}
.task-priority {
    font-size: 0.65rem;
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
    font-weight: 600;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.task-priority--high {
    background: #fee2e2;
    color: #b91c1c;
}
.task-priority--medium {
    background: #fef3c7;
    color: #92400e;
}
.task-priority--low {
    background: #dbeafe;
    color: #1e40af;
}
.task-card-body {
    padding: 0.65rem 0.85rem;
    flex: 1;
    min-height: 0;
}
.task-card-meta {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.25rem 0.75rem;
    margin: 0;
    font-size: 0.78rem;
}
.task-meta-row { display: contents; }
.task-meta-row dt {
    margin: 0;
    color: var(--text-muted);
    font-weight: 500;
}
.task-meta-row dd {
    margin: 0;
    color: var(--text);
}
.task-meta-row dd a {
    color: var(--text);
    text-decoration: underline;
}
.task-card-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 0.5rem 0 0 0;
    padding-top: 0.5rem;
    border-top: 1px solid #eee;
    line-height: 1.4;
}
.task-card-footer {
    padding: 0.5rem 0.85rem;
    border-top: 1px solid var(--card-border);
    background: #fafafa;
}
.task-card-footer .btn { font-size: 0.8rem; padding: 0.3rem 0.6rem; }
.task-card-footer--reopen {
    background: #fff;
    padding: 0.65rem 0.85rem;
}
.task-action-form { display: inline; }
.task-card-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}
.task-card-actions .task-action-form--inline { display: inline; }

/* Task detail page */
.task-detail-page .page-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; }
.task-detail-page .page-header-left { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.task-detail-page .page-header-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.task-badge { font-size: 0.7rem; padding: 0.2rem 0.5rem; border-radius: 4px; font-weight: 600; }
.task-badge--completed { background: #d1fae5; color: #065f46; }
.task-badge--pending { background: #fef3c7; color: #92400e; }
.task-detail-card { padding: 1rem 1.25rem; margin-top: 0.5rem; }
.task-detail-meta { display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 1rem; margin: 0; font-size: 0.9rem; }
.task-detail-row dt { margin: 0; color: var(--text-muted); font-weight: 500; min-width: 7rem; }
.task-detail-row dd { margin: 0; color: var(--text); }
.task-detail-row dd.task-reopen-note { font-style: italic; color: var(--text-muted); }
.task-detail-actions { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--card-border); }

/* Task notes & updates */
.task-notes-section { margin-top: 1.25rem; padding: 1rem 1.25rem; }
.task-notes-title { margin: 0 0 0.35rem 0; font-size: 1rem; }
.task-notes-hint { font-size: 0.8rem; color: var(--text-muted); margin: 0 0 1rem 0; }
.task-note-form { margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--card-border); }
.task-note-form .form-group { margin-bottom: 0.5rem; }
.task-note-form label { display: block; font-size: 0.85rem; margin-bottom: 0.2rem; }
.task-notes-list { display: flex; flex-direction: column; gap: 0.75rem; }
.task-note-item { padding: 0.6rem 0.75rem; background: #f8fafc; border-radius: 6px; border: 1px solid var(--card-border); }
.task-note-meta { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.35rem; }
.task-note-author { font-weight: 600; color: var(--text); }
.task-note-date { margin-left: 0.5rem; }
.task-note-content { font-size: 0.9rem; line-height: 1.4; }
.task-note-link { margin-top: 0.35rem; font-size: 0.8rem; }
.task-note-link a { word-break: break-all; }
.task-notes-empty { font-size: 0.85rem; margin: 0; padding: 0.5rem 0; }

/* Task confirm complete */
.task-confirm-complete-card { padding: 1.25rem; }
.task-confirm-question { font-size: 1.1rem; margin: 0 0 0.5rem 0; }
.task-confirm-title { color: var(--text-muted); margin: 0 0 1rem 0; }
.task-confirm-complete-form .form-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Task filters */
.tasks-filter-form {
    margin-bottom: 0.75rem;
    padding: 0.65rem 1rem;
}
.tasks-filter-form .reports-filter-row {
    gap: 0.5rem;
}
.tasks-filter-form .form-group label {
    font-size: 0.75rem;
}
.tasks-filter-form input,
.tasks-filter-form select {
    font-size: 0.8rem;
    padding: 0.3rem 0.4rem;
    min-width: 100px;
}
.tasks-filter-title {
    margin: 0 0 0.5rem 0;
    font-size: 0.88rem;
}

/* Assigned to – highlighted */
.assigned-to-name {
    font-weight: 700;
    font-size: 0.78rem;
    color: #1e40af;
    background: #dbeafe;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
}

/* Task stats card */
.task-stats-card {
    margin-bottom: 1rem;
    padding: 0.65rem 1rem;
}
.task-stats-title {
    margin: 0 0 0.6rem 0;
    font-size: 0.95rem;
}
.task-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}
.task-stat-item {
    text-align: center;
    padding: 0.4rem 0.5rem;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid var(--card-border);
}
.task-stat-value {
    display: block;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
}
.task-stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}
.task-stats-graph h3 {
    margin: 0 0 0.35rem 0;
    font-size: 0.82rem;
}
.task-stats-graph .graph-bar-label {
    font-size: 0.75rem;
}
.task-graph-bars .graph-bar-wrap {
    margin-bottom: 0.35rem;
}
.task-reopen-bar-wrap {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--card-border);
}
.task-reopen-bar-wrap .graph-bar-label {
    font-size: 0.75rem;
}
.task-reopen-bar-wrap .graph-bar {
    margin-top: 0.2rem;
    height: 6px;
    border-radius: 3px;
}
.graph-bar--reopen {
    background: #f59e0b;
}
.reopen-badge {
    font-size: 0.7rem;
    font-weight: 600;
    color: #92400e;
    background: #fef3c7;
    padding: 0.08rem 0.28rem;
    border-radius: 3px;
}
.badge-done-before-deadline {
    font-size: 0.75rem;
    font-weight: 600;
    color: #065f46;
    background: #d1fae5;
    padding: 0.12rem 0.4rem;
    border-radius: 4px;
}
.task-reopen-note {
    margin-top: 0.5rem;
    padding: 0.4rem 0.5rem;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text);
}
.reopen-note-label {
    font-weight: 600;
    color: #92400e;
}
.task-reopen-form-wrap {
    margin-top: 0.5rem;
}
.task-reopen-form {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-items: flex-start;
}
.reopen-note-form-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text);
}
.reopen-note-textarea {
    width: 100%;
    min-height: 52px;
    padding: 0.4rem 0.5rem;
    font-size: 0.82rem;
    border: 1px solid var(--input-border);
    border-radius: 4px;
    resize: vertical;
}

@media (max-width: 640px) {
    .tasks-inline-filters {
        flex-direction: column;
        align-items: stretch;
    }
    .tasks-inline-filters .tasks-filter-group input,
    .tasks-inline-filters .tasks-filter-group select {
        min-width: 0;
    }
    .tasks-stats-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    .tasks-grid {
        grid-template-columns: 1fr;
    }
}

.lead-quick-hint a:hover {
    text-decoration: underline;
}

.lead-end-card {
    margin-bottom: 1rem;
}
.lead-end-card .muted {
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}
.lead-end-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
.lead-end-form {
    display: inline-block;
}
.lead-end-form button {
    white-space: nowrap;
}

/* Custom confirmation dialog */
.confirm-dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.confirm-dialog-overlay.confirm-dialog-open {
    opacity: 1;
    visibility: visible;
}
.confirm-dialog-overlay[hidden] {
    display: none !important;
}
.confirm-dialog {
    background: var(--card-bg, #fff);
    border: 1px solid var(--card-border, #e5e7eb);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    min-width: 320px;
    max-width: 420px;
    padding: 1.25rem 1.5rem;
}
.confirm-dialog-title {
    margin: 0 0 0.75rem 0;
    font-size: 1.1rem;
    color: var(--text, #1f2937);
}
.confirm-dialog-message {
    margin: 0 0 1.25rem 0;
    font-size: 0.95rem;
    color: var(--text-muted, #6b7280);
    line-height: 1.45;
}
.confirm-dialog-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}
.confirm-dialog-actions .btn {
    min-width: 5rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.badge.success {
    background: var(--success);
    color: #111;
}

.notif-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--card-border);
}

.notif-list li.unread {
    background: #fef3c7;
}

/* Calendar grid */
.calendar-hint {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.calendar-grid-wrap {
    overflow-x: auto;
    padding: 0;
}

.calendar-grid {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    min-width: 560px;
}

.calendar-grid th,
.calendar-grid td {
    border: 1px solid var(--card-border);
    padding: 0.5rem;
    vertical-align: top;
    min-height: 80px;
}

.calendar-grid th {
    background: #f3f4f6;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
}

.calendar-cell {
    min-height: 90px;
}

.calendar-cell--empty {
    background: #f9fafb;
}

.calendar-cell--has-events {
    background: #fffbeb;
    border-left: 3px solid var(--gold, #c9a227);
}
.calendar-cell--has-leaves {
    background: #ecfdf5;
    border-left: 3px solid var(--success, #22c55e);
}
.calendar-leave-user {
    font-weight: 600;
    display: block;
}
.calendar-leave-status {
    font-size: 0.7rem;
    color: var(--text-muted);
}
.calendar-event--approved { border-left: 2px solid var(--success); }
.calendar-event--pending { border-left: 2px solid var(--warning); }
.legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.35rem;
    vertical-align: middle;
}
.legend-dot--approved { background: var(--success); }
.legend-dot--pending { background: var(--warning); }
.legend-item { margin-right: 1rem; }

/* Leave form */
.leave-form {
    padding: 1.5rem;
}
.leave-form .form-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
}

.calendar-cell-day {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
    color: var(--text);
}

.calendar-cell-events {
    list-style: none;
    padding: 0;
    margin: 0;
}

.calendar-event {
    font-size: 0.8rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.calendar-event:last-child {
    border-bottom: none;
}

.calendar-event a {
    color: var(--text);
    text-decoration: none;
}

.calendar-event a:hover {
    color: var(--gold, #c9a227);
    text-decoration: underline;
}

.calendar-event-time {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.calendar-event-notes {
    display: block;
    font-size: 0.72rem;
    margin-top: 0.15rem;
}

.calendar-events {
    list-style: none;
    padding: 0;
}

.calendar-events li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--card-border);
}

/* Mobile */
@media (max-width: 768px) {
    .sidebar {
        position: static;
        width: 100%;
        min-width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--sidebar-border);
        overflow: visible;
    }

    .content {
        margin-left: 0;
    }

    .layout {
        flex-direction: column;
    }

    .side-nav {
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }

    .side-nav a {
        border-left: none;
        border-bottom: 3px solid transparent;
        flex-shrink: 0;
    }

    .side-nav a.active {
        border-left: none;
        border-bottom-color: var(--gold);
    }

    .sidebar-stats {
        display: flex;
        gap: 1rem;
        justify-content: center;
        margin-top: 0;
    }
}

/* ----- Chat module ----- */
.chat-page-header .page-desc,
.chat-room-header .page-desc {
    margin: 0.25rem 0 0 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}
.chat-layout {
    max-width: 520px;
}
.chat-list-card h3,
.chat-new-title {
    margin-top: 1rem;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}
.chat-list-card h3:first-child,
.chat-new-title:first-of-type {
    margin-top: 0;
}
.chat-room-list,
.chat-user-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.chat-room-item,
.chat-user-list li {
    margin-bottom: 0.5rem;
}
.chat-room-item a,
.chat-user-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    border: 1px solid transparent;
}
.chat-room-item a:hover,
.chat-user-link:hover {
    background: var(--btn-secondary-bg);
    border-color: var(--card-border);
}
.chat-room-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gold);
    color: #1a1a1a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.chat-room-name {
    flex: 1;
    font-weight: 500;
}
.chat-room-badge {
    background: #3b82f6;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.4rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.chat-room-item--unread .chat-room-name {
    font-weight: 600;
}

/* Chat room - full screen */
.chat-page-full {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 150px);
    min-height: 500px;
    background: var(--content-bg);
}
.chat-room-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-shrink: 0;
    margin-bottom: 0.75rem;
}
.chat-room-header h1 {
    margin: 0;
    font-size: 1.25rem;
}
.chat-room-card {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    max-width: 100%;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    background: var(--card-bg);
    box-shadow: var(--shadow);
}
/* Professional chat scrollview */
.chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.25rem 1rem;
    background: linear-gradient(180deg, #fafbfc 0%, #f5f6f8 100%);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
    scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar {
    width: 8px;
}
.chat-messages::-webkit-scrollbar-track {
    background: #e8eaed;
    border-radius: 4px;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: #b0b4b9;
    border-radius: 4px;
}
.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #8b9199;
}
.chat-msg {
    display: block;
    margin-bottom: 1rem;
    padding: 0.6rem 0.9rem;
    border-radius: 10px;
    max-width: 85%;
    min-height: 2.5rem;
}
.chat-msg--mine {
    margin-left: auto;
    background: linear-gradient(135deg, #e5c76b 0%, #c9a227 100%);
    color: #1a1a1a;
}
.chat-msg--theirs {
    margin-right: auto;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
}
.chat-msg-sender {
    font-weight: 600;
    font-size: 0.85rem;
    display: block;
}
.chat-msg-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.chat-msg-body {
    margin-top: 0.35rem;
    white-space: pre-wrap;
    word-break: break-word;
}
.chat-msg-attachment {
    margin-top: 0.5rem;
}
.chat-msg-attachment a {
    color: var(--gold);
    text-decoration: none;
    font-size: 0.9rem;
}
.chat-msg-attachment a:hover {
    text-decoration: underline;
}
.chat-send-form {
    flex-shrink: 0;
    border-top: 1px solid var(--card-border);
    padding: 1rem 1.25rem;
    background: var(--card-bg);
    border-radius: 0 0 12px 12px;
}
.chat-send-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
}
.chat-send-input-wrap {
    flex: 1;
    min-width: 200px;
}
.chat-send-input-wrap textarea {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1px solid var(--input-border);
    border-radius: 10px;
    font-size: 0.95rem;
    resize: none;
    min-height: 48px;
    max-height: 120px;
}
.chat-send-input-wrap textarea:focus {
    outline: none;
    border-color: var(--gold);
}
.chat-send-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-attach {
    background: #3b82f6 !important;
    color: #fff !important;
    border: none !important;
}
.btn-attach:hover {
    background: #2563eb !important;
    color: #fff !important;
}
.chat-file-input {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}
.chat-attach-label {
    cursor: pointer;
    margin: 0;
}
@media (max-width: 768px) {
    .chat-page-full {
        height: calc(100vh - 120px);
        min-height: 350px;
    }
}

/* Reminders */
.reminders-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    max-width: 960px;
}
@media (max-width: 768px) {
    .reminders-layout {
        grid-template-columns: 1fr;
    }
}
.reminder-form .form-group {
    margin-bottom: 1rem;
}
.reminder-form .form-control {
    width: 100%;
    max-width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--input-border);
    border-radius: 6px;
}
.reminder-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.reminder-item {
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--card-border);
    font-size: 0.95rem;
}
.reminder-item:last-child {
    border-bottom: none;
}
.reminder-message {
    color: var(--text-muted);
}
.reminder-past {
    opacity: 0.75;
}
.muted {
    color: var(--text-muted);
}
.empty-state {
    color: var(--text-muted);
    font-style: italic;
}

/* ----- Notifications page ----- */
.notif-page-header .page-desc,
.notif-send-header .page-desc {
    margin: 0.35rem 0 0 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}
.notif-header-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.notif-header-row h1 {
    margin: 0;
}
.notif-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.notif-icon {
    margin-right: 0.35rem;
}
.badge--notif {
    margin-left: 0.5rem;
    vertical-align: middle;
}
.notif-section {
    margin-bottom: 1.5rem;
}
.notif-section-head {
    margin-bottom: 0.5rem;
}
.notif-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
}
.notif-section-icon {
    font-size: 1.2rem;
}
.notif-section-desc {
    margin: 0 0 1rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.notif-section-desc a {
    color: var(--gold);
    text-decoration: none;
}
.notif-section-desc a:hover {
    text-decoration: underline;
}
.notif-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.notif-item {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--card-border);
    transition: background 0.15s;
}
.notif-item:last-child {
    border-bottom: none;
}
.notif-item:hover {
    background: #fafafa;
}
.notif-item--unread {
    background: #f0f7ff;
}
.notif-item--unread:hover {
    background: #e8f0ff;
}
.notif-item-main {
    flex: 1;
    min-width: 0;
}
.notif-item-title {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 1rem;
}
.notif-item-message {
    margin: 0.25rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.4;
}
.notif-item-time {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}
.notif-item-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.notif-mark-read {
    font-size: 0.85rem;
    color: var(--gold);
    text-decoration: none;
}
.notif-mark-read:hover {
    text-decoration: underline;
}
.notif-list--reminders .notif-item {
    padding: 0.75rem 1rem;
}
.notif-item--reminder .notif-item-link {
    text-decoration: none;
    color: var(--text);
    display: block;
}
.notif-item--reminder .notif-item-link:hover {
    color: var(--gold);
}
.notif-item--reminder .notif-item-message {
    margin-top: 0.2rem;
}

/* Send notification form */
.notif-send-header {
    margin-bottom: 1.25rem;
}
.notif-send-header .btn {
    margin-bottom: 0.5rem;
}
.notif-send-card {
    max-width: 520px;
}
.notif-send-form .form-group label .required {
    color: var(--danger);
}
.notif-send-form .form-group input,
.notif-send-form .form-group select,
.notif-send-form .form-group textarea {
    max-width: 100%;
}
.form-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.form-error {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: var(--danger);
}
.notif-send-form .form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}
.side-nav .notif-sidebar-link {
    position: relative;
}
.side-nav .sidebar-badge {
    margin-left: 0.35rem;
    font-size: 0.65rem;
    padding: 0.1rem 0.35rem;
}
.badge--chat {
    background: #3b82f6;
    color: #fff;
}
.badge--task {
    background: #3b82f6;
    color: #fff;
}

/* Dashboard: Learn IQ legal link */
.dashboard-legal-strip {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.dashboard-legal-strip__link {
    font-size: 0.85rem;
    color: #0f766e;
    text-decoration: none;
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: #ecfdf5;
    border: 1px solid #99f6e4;
    transition: background 0.15s, border-color 0.15s;
}
.dashboard-legal-strip__link:hover {
    background: #d1fae5;
    border-color: #5eead4;
    text-decoration: none;
}
