:root {
    --navy: #102a43;
    --blue: #155e75;
    --green: #12b981;
    --bg: #f3f7fb;
    --card: #fff;
    --text: #172033;
    --muted: #64748b;
    --border: #dbe5ef;
    --red: #dc2626;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

/* ==========================================================================
   Login Page Layout
   ========================================================================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #102a43, #155e75 55%, #12b981);
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .25);
    overflow: hidden;
}

.login-brand {
    padding: 34px;
    background: #102a43;
    color: #fff;
}

.brand-row {
    font-size: 30px;
    font-weight: 800;
    display: flex;
    gap: 12px;
    align-items: center;
}

.logo-mark,
.sun {
    display: inline-grid;
    place-items: center;
    background: var(--green);
    color: #06251d;
    width: 42px;
    height: 42px;
    border-radius: 14px;
}

.login-brand p {
    color: #cbd5e1;
}

.login-body {
    padding: 28px;
}

/* ==========================================================================
   App Layout Shell & Sidebar Menu
   ========================================================================== */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: #0f172a;
    color: white;
    padding: 20px 14px;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 12px rgba(15, 23, 42, 0.15);
}

.sidebar .brand {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 8px;
    margin-bottom: 4px;
}

.sidebar .brand .sun {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-size: 14px;
}

.company-name {
    color: #94a3b8;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
    padding-left: 8px;
    margin-bottom: 24px;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
}

.sidebar a {
    text-decoration: none;
    padding: 9px 12px;
    border-radius: 8px;
    color: #cbd5e1;
    font-size: 13.5px;
    font-weight: 500;
    transition: all 0.15s ease-in-out;
}

.sidebar a:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
}

.sidebar a[href="logout.php"] {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 14px;
    border-radius: 0;
    color: #f87171;
}

.sidebar a[href="logout.php"]:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #f87171;
}

/* ==========================================================================
   Main Layout Framework
   ========================================================================== */
.main {
    margin-left: 240px;
    padding: 32px;
    width: calc(100% - 240px);
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-bottom: 28px;
}

.topbar h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
}

.topbar p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.user-pill {
    background: #fff;
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
}

/* ==========================================================================
   Dashboard Components
   ========================================================================== */
.grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.card,
.panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 18px rgba(15, 23, 42, .02);
}

.toolbar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    align-items: center;
}

/* ==========================================================================
   Buttons and Form Controls
   ========================================================================== */
.btn,
button {
    background: linear-gradient(135deg, var(--blue), var(--green));
    border: 0;
    color: #fff;
    padding: 11px 18px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: opacity 0.15s ease;
}

.btn:hover,
button:hover {
    opacity: 0.95;
}

.btn.secondary {
    background: #e2e8f0;
    color: #102a43;
}

.btn.danger {
    background: #dc2626;
    color: #fff;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-row {
    margin-bottom: 16px;
}

.form-row label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 7px;
}

.form-row input,
.form-row select,
.form-row textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
    font-size: 14px;
    color: var(--text);
}

.form-hint {
    display: block;
    margin-top: 7px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.password-generate-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.password-generate-row input {
    flex: 1;
}

.password-generate-btn {
    flex: 0 0 auto;
    padding: 10px 13px;
    font-size: 12px;
}

.check-row {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.check-row input {
    width: auto;
    margin-top: 2px;
}

.plain-fieldset {
    border: 0;
    margin: 0;
    padding: 0;
}

.plain-fieldset:disabled {
    opacity: 0.55;
}

.seat-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 4px 18px rgba(15, 23, 42, .02);
}

.seat-summary h3 {
    margin: 3px 0 4px;
    font-size: 19px;
}

.seat-summary p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.seat-summary.is-full {
    border-color: #f59e0b;
    background: #fffbeb;
}

.seat-meter {
    width: min(260px, 35%);
    height: 10px;
    overflow: hidden;
    background: #e2e8f0;
    border-radius: 999px;
}

.seat-meter span {
    display: block;
    height: 100%;
    background: linear-gradient(135deg, var(--blue), var(--green));
    border-radius: inherit;
}

.seat-summary.is-full .seat-meter span {
    background: #f59e0b;
}

.danger-zone {
    border-color: #fecaca;
    background: #fffafa;
}

.danger-zone h2 {
    color: #991b1b;
}

.danger-zone p {
    color: #475569;
}

.manager-billing-banner,
.billing-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 20px;
    padding: 14px 16px;
    border: 1px solid #f59e0b;
    border-radius: 14px;
    background: #fffbeb;
    color: #78350f;
    font-size: 13px;
    line-height: 1.5;
}

.manager-billing-banner a {
    margin-left: auto;
    color: #102a43;
    font-weight: 800;
}

.billing-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 20px;
}

.billing-plan-card {
    min-height: 180px;
}

.billing-stat-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 180px;
    padding: 24px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 4px 18px rgba(15, 23, 42, .02);
}

.billing-stat-card span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.billing-stat-card strong {
    display: block;
    margin-top: 8px;
    font-size: 24px;
    color: var(--navy);
}

.billing-stat-card small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    line-height: 1.45;
}

/* --- Dropdown Styling for Assignment --- */
.form-control {
    display: block;
    width: 100%;
    padding: 6px 10px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background-color: #fff;
    transition: all 0.15s ease-in-out;
}

.form-control:focus {
    border-color: var(--blue);
    outline: none;
    box-shadow: 0 0 0 3px rgba(21, 94, 117, 0.15);
}

td .form-control {
    min-width: 140px;
    margin: -6px 0;
}

/* ==========================================================================
   Data Tables
   ========================================================================== */
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
}

th,
td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
    font-size: 14px;
}

th {
    background: #f8fafc;
    color: #334155;
    font-weight: 600;
}

/* ==========================================================================
   Utilities
   ========================================================================== */
.muted {
    color: var(--muted);
    font-size: 14px;
}

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Connected lead-to-customer journey */
.journey-hero,
.journey-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.journey-hero {
    background: linear-gradient(135deg, #0f172a, #155e75);
    color: #fff;
    border-radius: 18px;
    padding: 24px;
    margin-bottom: 20px;
}

.journey-hero h2 {
    margin: 8px 0;
}

.journey-hero .muted {
    color: #cbd5e1;
}

.journey-stage {
    display: inline-block;
    background: #f59e0b;
    color: #451a03;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.journey-overview {
    margin-bottom: 20px;
}

.journey-overview-main {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, .8fr);
    gap: 18px;
    align-items: stretch;
    margin-bottom: 18px;
}

.journey-overview-main h3 {
    margin: 4px 0 8px;
    font-size: 24px;
}

.journey-overview-main p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.journey-next-action {
    padding: 16px;
    border-radius: 14px;
    background: #f4f7fb;
    border: 1px solid var(--border);
}

.journey-next-action strong {
    display: block;
    color: #102a43;
    line-height: 1.45;
}

.journey-step-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.journey-step {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #f8fafc;
}

.journey-step span {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #64748b;
    font-weight: 800;
    font-size: 13px;
}

.journey-step strong,
.journey-step small {
    display: block;
}

.journey-step strong {
    margin-bottom: 4px;
    color: #102a43;
    font-size: 13.5px;
}

.journey-step small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.journey-step.done span {
    background: #dcfce7;
    color: #15803d;
}

.journey-step.current {
    border-color: #34d399;
    background: #ecfdf5;
    box-shadow: 0 10px 26px rgba(18, 185, 129, .08);
}

.journey-step.current span {
    background: var(--green);
    color: #fff;
}

.journey-step.pending {
    opacity: .72;
}

.journey-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
    gap: 20px;
    align-items: start;
}

.journey-grid aside .panel {
    margin-bottom: 20px;
}

.journey-section-title h3,
.journey-related h3 {
    margin-top: 0;
}

.journey-quick-form,
.journey-task-form {
    display: grid;
    gap: 10px;
    padding: 14px;
    margin-bottom: 18px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.journey-quick-form {
    grid-template-columns: 130px 1fr auto;
}

.journey-quick-form textarea {
    grid-column: 1 / -1;
}

.journey-quick-form input,
.journey-quick-form select,
.journey-quick-form textarea,
.journey-task-form input,
.journey-task-form select,
.journey-task-form textarea {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 10px;
    font: inherit;
}

.timeline {
    margin-top: 10px;
}

.timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: 12px;
    padding-bottom: 22px;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 12px;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-dot {
    position: relative;
    z-index: 1;
    width: 14px;
    height: 14px;
    margin-top: 3px;
    border-radius: 50%;
    background: var(--green);
    border: 3px solid #d1fae5;
}

.timeline-item p {
    margin: 8px 0 0;
    line-height: 1.5;
}

.journey-task {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.journey-task form {
    margin-top: 8px;
}

.journey-task .btn {
    padding: 6px 10px;
    font-size: 12px;
}

.journey-task.is-complete {
    opacity: .55;
}

.journey-related a,
.journey-related > div {
    display: flex;
    justify-content: space-between;
    text-decoration: none;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.journey-setup {
    border-left: 5px solid #f59e0b;
    margin-bottom: 20px;
}

/* Solar operations workspace */
.ops-hero {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 20px;
    background: linear-gradient(135deg, #0f172a, #164e63);
    color: #fff;
    border-radius: 18px;
    padding: 24px;
    margin-bottom: 20px;
}

.ops-hero h2 {
    margin: 8px 0;
}

.ops-hero .muted {
    color: #cbd5e1;
}

.ops-progress {
    display: flex;
    flex-direction: column;
    text-align: center;
    padding: 12px 18px;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 14px;
}

.ops-progress strong {
    font-size: 28px;
}

.ops-progress span {
    color: #cbd5e1;
    font-size: 12px;
}

.ops-message {
    border-left: 5px solid var(--green);
    margin-bottom: 20px;
}

.document-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px 16px;
    margin-bottom: 20px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.document-toolbar strong {
    margin-right: auto;
}

.document-toolbar a {
    padding: 7px 10px;
    background: #e2e8f0;
    color: #102a43;
    border-radius: 7px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
}

.document-list-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 0;
    border-top: 1px solid var(--border);
    color: #102a43;
    text-decoration: none;
}

.document-list-item span {
    color: var(--muted);
    font-size: 11px;
}

.ops-stagebar {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    margin-bottom: 20px;
}

.ops-stagebar span {
    padding: 10px;
    text-align: center;
    background: #e2e8f0;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.ops-stagebar span.active {
    background: #155e75;
    color: #fff;
}

.ops-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    align-items: start;
}

.ops-card h3 {
    margin-top: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.ops-card textarea {
    min-height: 90px;
}

.ops-aftercare-form {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.ops-aftercare-form input,
.ops-aftercare-form select,
.ops-aftercare-form textarea,
.ops-case input {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 10px;
    font: inherit;
}

.ops-case {
    padding: 14px 0;
    border-top: 1px solid var(--border);
}

.ops-case.resolved {
    opacity: .65;
}

.ops-case p {
    line-height: 1.5;
}

/* Management dashboard and automatic reminders */
.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.dashboard-metric {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: #fff;
    border: 1px solid var(--border);
    border-top: 4px solid #155e75;
    border-radius: 14px;
    padding: 18px;
    text-decoration: none;
}

.dashboard-metric.danger {
    border-top-color: #dc2626;
}

.dashboard-metric.warning {
    border-top-color: #f59e0b;
}

.dashboard-metric span,
.dashboard-metric small {
    color: var(--muted);
}

.dashboard-metric strong {
    font-size: 27px;
    color: #0f172a;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
    gap: 20px;
    align-items: start;
}

.dashboard-layout aside {
    display: grid;
    gap: 20px;
}

.attention-count {
    min-width: 34px;
    padding: 6px 10px;
    text-align: center;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 999px;
    font-weight: 800;
}

.attention-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    padding: 16px 0;
    border-top: 1px solid var(--border);
}

.attention-item a {
    display: block;
    margin: 5px 0;
    text-decoration: none;
    color: #0f172a;
}

.attention-item p {
    margin: 5px 0;
    color: #475569;
}

.attention-severity {
    display: inline-block;
    padding: 3px 7px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #475569;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.attention-item.urgent .attention-severity {
    background: #fee2e2;
    color: #991b1b;
}

.attention-item.high .attention-severity {
    background: #ffedd5;
    color: #9a3412;
}

.attention-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.attention-actions .btn {
    padding: 7px 9px;
    font-size: 11px;
}

.dashboard-side-panel h3 {
    margin-top: 0;
}

.dashboard-side-panel a {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 0;
    border-top: 1px solid var(--border);
    text-decoration: none;
}

.dashboard-side-panel small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
}

.dashboard-empty {
    padding: 36px 10px;
    text-align: center;
    color: var(--muted);
}

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

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

@media (max-width: 700px) {
    .dashboard-metrics {
        grid-template-columns: 1fr;
    }

    .attention-item {
        grid-template-columns: 1fr;
    }
}

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

    .ops-hero {
        grid-template-columns: 1fr;
    }
}

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

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

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

@media (max-width: 700px) {
    .journey-hero,
    .journey-section-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .journey-quick-form {
        grid-template-columns: 1fr;
    }

    .journey-overview-main,
    .journey-step-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .sidebar {
        position: relative;
        width: 100%;
        bottom: auto;
        height: auto;
    }
    .app-shell {
        display: block;
    }
    .main {
        margin-left: 0;
        width: 100%;
        padding: 20px;
    }
}

/* Sleek graphical company dashboard */
.dashboard-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 26px 28px;
    margin-bottom: 20px;
    color: #fff;
    background:
        radial-gradient(circle at 85% 20%, rgba(52,211,153,.35), transparent 13rem),
        linear-gradient(125deg, #0b2135, #155e75 65%, #0f766e);
    border-radius: 20px;
    box-shadow: 0 18px 42px rgba(15,94,117,.2);
}

.dashboard-hero h2 {
    margin: 5px 0 8px;
    font-size: clamp(24px, 3vw, 34px);
    letter-spacing: -.04em;
}

.dashboard-hero p {
    max-width: 680px;
    margin: 0;
    color: #d5e7ed;
    line-height: 1.55;
}

.dashboard-kicker {
    color: #0f8a73;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.dashboard-hero .dashboard-kicker {
    color: #86efac;
}

.dashboard-hero-actions {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
}

.dashboard-hero-actions .btn {
    white-space: nowrap;
}

.dashboard-hero-actions .btn.secondary {
    color: #fff;
    background: rgba(255,255,255,.13);
    border: 1px solid rgba(255,255,255,.18);
}

.setup-progress {
    padding: 17px 20px;
    margin-bottom: 20px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 15px;
    box-shadow: var(--surface-shadow);
}

.setup-progress > div:first-child {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 13px;
}

.setup-progress-track {
    height: 6px;
    overflow: hidden;
    background: #e2e8f0;
    border-radius: 999px;
}

.setup-progress-track span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #155e75, #34d399);
    border-radius: inherit;
}

.setup-links {
    display: flex;
    gap: 16px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.setup-links a {
    color: #64748b;
    font-size: 11px;
    text-decoration: none;
}

.setup-links a.done {
    color: #059669;
    text-decoration: line-through;
}

.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.dashboard-kpi {
    position: relative;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    min-height: 132px;
    padding: 20px;
    overflow: hidden;
    color: #102a43;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 17px;
    box-shadow: var(--surface-shadow);
    text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease;
}

.dashboard-kpi::after {
    content: "";
    position: absolute;
    right: -30px;
    bottom: -40px;
    width: 110px;
    height: 110px;
    background: currentColor;
    border-radius: 50%;
    opacity: .045;
}

.dashboard-kpi:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 38px rgba(15,23,42,.11);
}

.dashboard-kpi.teal { color: #0f766e; }
.dashboard-kpi.blue { color: #0369a1; }
.dashboard-kpi.green { color: #059669; }
.dashboard-kpi.red { color: #dc2626; }

.kpi-icon {
    display: grid;
    place-items: center;
    min-width: 42px;
    height: 42px;
    background: currentColor;
    border-radius: 13px;
    box-shadow: inset 0 0 0 20px rgba(255,255,255,.88);
}

.kpi-icon .nav-icon {
    width: 20px;
    height: 20px;
}

.dashboard-kpi div {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.dashboard-kpi small {
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.dashboard-kpi strong {
    margin: 7px 0 4px;
    color: #0f172a;
    font-size: clamp(24px, 2.5vw, 32px);
    line-height: 1;
    letter-spacing: -.04em;
}

.dashboard-kpi div > span {
    color: #94a3b8;
    font-size: 11px;
}

.dashboard-visual-grid,
.dashboard-work-grid {
    display: grid;
    gap: 20px;
    align-items: start;
}

.dashboard-visual-grid {
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr);
    margin-bottom: 20px;
}

.dashboard-work-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(340px, .85fr);
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 19px;
}

.panel-heading h2 {
    margin: 3px 0 0;
    font-size: 19px;
    letter-spacing: -.02em;
}

.panel-heading > a {
    color: #0f766e;
    font-size: 11px;
    font-weight: 750;
    text-decoration: none;
}

.pipeline-bars {
    display: grid;
    gap: 13px;
}

.pipeline-bar-row {
    display: grid;
    grid-template-columns: 105px 1fr 30px;
    align-items: center;
    gap: 12px;
    color: #475569;
    font-size: 11px;
    font-weight: 650;
    text-decoration: none;
}

.pipeline-bar-row strong {
    color: #102a43;
    text-align: right;
}

.pipeline-bar-track {
    height: 8px;
    overflow: hidden;
    background: #edf2f7;
    border-radius: 999px;
}

.pipeline-bar-track i {
    display: block;
    min-width: 4px;
    height: 100%;
    background: linear-gradient(90deg, #155e75, #34d399);
    border-radius: inherit;
}

.pipeline-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding-top: 18px;
    margin-top: 20px;
    border-top: 1px solid var(--border);
}

.pipeline-summary div {
    display: flex;
    flex-direction: column;
}

.pipeline-summary small {
    color: #94a3b8;
    font-size: 10px;
    text-transform: uppercase;
}

.pipeline-summary strong {
    margin-top: 4px;
    color: #102a43;
    font-size: 20px;
}

.health-panel {
    text-align: center;
}

.health-panel .panel-heading {
    text-align: left;
}

.health-ring {
    display: grid;
    width: 150px;
    height: 150px;
    margin: 6px auto 22px;
    place-items: center;
    background: conic-gradient(#34d399 calc(var(--value) * 1%), #e8eef3 0);
    border-radius: 50%;
}

.health-ring::before {
    content: "";
    position: absolute;
}

.health-ring > div {
    display: grid;
    width: 116px;
    height: 116px;
    place-content: center;
    background: #fff;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px #edf2f7;
}

.health-ring strong {
    color: #102a43;
    font-size: 27px;
}

.health-ring span {
    color: #94a3b8;
    font-size: 10px;
}

.health-stats {
    display: grid;
    gap: 4px;
    text-align: left;
}

.health-stats a,
.health-stats div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    color: #475569;
    border-top: 1px solid var(--border);
    font-size: 11px;
    text-decoration: none;
}

.health-stats span {
    display: flex;
    align-items: center;
    gap: 7px;
}

.health-stats .nav-icon {
    width: 15px;
    height: 15px;
    color: #0f8a73;
}

.attention-panel .attention-item {
    grid-template-columns: 8px 1fr auto;
    align-items: center;
    padding: 13px 0;
}

.attention-dot {
    width: 7px;
    height: 7px;
    background: #94a3b8;
    border-radius: 50%;
    box-shadow: 0 0 0 4px #f1f5f9;
}

.attention-item.urgent .attention-dot {
    background: #ef4444;
    box-shadow: 0 0 0 4px #fee2e2;
}

.attention-item.high .attention-dot {
    background: #f59e0b;
    box-shadow: 0 0 0 4px #fef3c7;
}

.attention-panel .attention-item a {
    margin: 0;
}

.attention-panel .attention-item p {
    margin: 3px 0;
    font-size: 11px;
}

.attention-panel .attention-item small {
    color: #94a3b8;
    font-size: 10px;
}

.icon-action {
    padding: 6px 8px;
    color: #64748b;
    background: #f1f5f9;
    border-radius: 7px;
    box-shadow: none;
    font-size: 9px;
}

.install-timeline {
    display: grid;
}

.install-timeline a {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 13px 0;
    color: #102a43;
    border-top: 1px solid var(--border);
    text-decoration: none;
}

.install-timeline time {
    display: grid;
    width: 44px;
    height: 48px;
    place-content: center;
    text-align: center;
    background: #ecfdf5;
    border-radius: 10px;
}

.install-timeline time strong {
    color: #0f766e;
    font-size: 18px;
    line-height: 1;
}

.install-timeline time span,
.install-timeline div span {
    display: block;
    margin-top: 3px;
    color: #94a3b8;
    font-size: 9px;
    text-transform: uppercase;
}

.install-timeline b {
    padding: 5px 7px;
    color: #0f766e;
    background: #ecfdf5;
    border-radius: 999px;
    font-size: 9px;
}

@media (max-width: 1250px) {
    .dashboard-kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .dashboard-visual-grid,
    .dashboard-work-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    .dashboard-hero { align-items: flex-start; flex-direction: column; padding: 22px; }
    .dashboard-kpi-grid { grid-template-columns: 1fr; }
    .dashboard-kpi { min-height: 112px; }
    .pipeline-bar-row { grid-template-columns: 85px 1fr 25px; gap: 8px; }
    .attention-panel .attention-item { grid-template-columns: 8px 1fr; }
    .attention-panel .attention-actions { grid-column: 2; }
}

/* Product UI refresh: collapsible icon navigation and richer surfaces */
:root {
    --sidebar-width: 272px;
    --sidebar-collapsed: 82px;
    --surface-shadow: 0 12px 30px rgba(15, 23, 42, .07);
}

body {
    background:
        radial-gradient(circle at 90% 0%, rgba(18,185,129,.09), transparent 25rem),
        radial-gradient(circle at 20% 100%, rgba(21,94,117,.08), transparent 30rem),
        var(--bg);
}

/* Solar CRM themed scrollbars */
html {
    scrollbar-width: thin;
    scrollbar-color: #64748b #edf4f7;
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: #edf4f7;
    border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #94a3b8, #64748b);
    border: 2px solid #edf4f7;
    border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--blue), var(--green));
}

*::-webkit-scrollbar-corner {
    background: transparent;
}

.sidebar {
    scrollbar-width: thin;
    scrollbar-color: rgba(52,211,153,.72) rgba(255,255,255,.08);
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255,255,255,.05);
    border-radius: 999px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(52,211,153,.95), rgba(14,165,233,.68));
    border: 2px solid rgba(7,21,37,.9);
    border-radius: 999px;
}

.sidebar {
    width: var(--sidebar-width);
    padding: 18px 14px;
    background: linear-gradient(180deg, #071525 0%, #0f2940 62%, #0d3b3b 130%);
    box-shadow: 8px 0 28px rgba(15, 23, 42, .18);
    z-index: 50;
    overflow-x: hidden;
    overflow-y: auto;
    transition: width .22s ease, transform .22s ease;
}

.sidebar-brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 54px;
}

.sidebar .brand {
    min-width: 0;
    margin: 0;
    padding: 7px 8px;
    text-decoration: none;
}

.sidebar .brand > .nav-icon {
    min-width: 38px;
    width: 38px;
    height: 38px;
    padding: 8px;
    color: #082f2c;
    background: linear-gradient(135deg, #fbbf24, #34d399);
    border-radius: 12px;
    box-shadow: 0 7px 18px rgba(52,211,153,.22);
}

.sidebar .brand span {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
    white-space: nowrap;
}

.sidebar .brand small {
    margin-top: 5px;
    color: #8da7ba;
    font-size: 10px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.sidebar-toggle,
.mobile-menu-toggle {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    color: #cbd5e1;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;
    box-shadow: none;
}

.sidebar-toggle .nav-icon,
.mobile-menu-toggle .nav-icon {
    width: 18px;
    height: 18px;
}

.company-name {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px 14px;
    margin-bottom: 8px;
    white-space: nowrap;
}

.company-dot {
    width: 7px;
    height: 7px;
    background: #34d399;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(52,211,153,.12);
}

.sidebar nav {
    gap: 12px;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 43px;
    padding: 10px 11px;
    border-radius: 11px;
    white-space: nowrap;
}

.sidebar nav a:hover {
    background: rgba(255,255,255,.08);
    transform: translateX(2px);
}

.sidebar nav a.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(52,211,153,.19), rgba(56,189,248,.08));
    box-shadow: inset 3px 0 #34d399;
}

.nav-icon {
    width: 19px;
    height: 19px;
    min-width: 19px;
}

.nav-section {
    display: grid;
    gap: 3px;
}

.nav-section-label {
    padding: 6px 12px 4px;
    color: #6f8ba0;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.sidebar .logout-link {
    margin-top: auto;
    color: #fca5a5;
    border-top: 1px solid rgba(255,255,255,.08);
}

.nav-count {
    min-width: 19px;
    margin-left: auto;
    padding: 3px 5px;
    color: #fff;
    background: #ef4444;
    border-radius: 999px;
    font-size: 9px;
    line-height: 1;
    text-align: center;
}

.main {
    width: calc(100% - var(--sidebar-width));
    margin-left: var(--sidebar-width);
    padding: 34px 38px 50px;
    transition: margin-left .22s ease, width .22s ease;
}

.topbar {
    margin-bottom: 30px;
    padding: 0 2px;
}

.topbar h1 {
    font-size: 28px;
}

.eyebrow {
    display: block;
    margin-bottom: 5px;
    color: #0f8a73;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 13px 6px 7px;
    font-weight: 650;
    box-shadow: 0 6px 20px rgba(15,23,42,.05);
}

.user-pill small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
}

.user-avatar {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    color: #fff;
    font-weight: 800;
    background: linear-gradient(135deg, #155e75, #12b981);
    border-radius: 50%;
}

.card,
.panel,
.dashboard-metric {
    box-shadow: var(--surface-shadow);
    transition: box-shadow .2s ease, transform .2s ease;
}

.card:hover,
.dashboard-metric:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 38px rgba(15,23,42,.11);
}

.panel h2,
.panel h3 {
    color: #102a43;
}

.btn,
button {
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.btn:hover,
button:hover {
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(21,94,117,.18);
}

.form-row input,
.form-row select,
.form-row textarea {
    transition: border-color .15s ease, box-shadow .15s ease;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    border-color: #12b981;
    outline: none;
    box-shadow: 0 0 0 4px rgba(18,185,129,.12);
}

th {
    background: linear-gradient(180deg, #f8fafc, #f1f5f9);
}

tbody tr:hover td {
    background: #f8fcfb;
}

.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed); }
.sidebar-collapsed .main { width: calc(100% - var(--sidebar-collapsed)); margin-left: var(--sidebar-collapsed); }
.sidebar-collapsed .sidebar .nav-label,
.sidebar-collapsed .sidebar .nav-section-label,
.sidebar-collapsed .sidebar .company-dot { display: none; }
.sidebar-collapsed .sidebar .sidebar-brand-row { justify-content: center; }
.sidebar-collapsed .sidebar .brand { display: none; }
.sidebar-collapsed .sidebar .nav-count { position: absolute; margin: -25px 0 0 24px; }
.sidebar-collapsed .sidebar nav a { justify-content: center; padding-left: 10px; padding-right: 10px; }
.sidebar-collapsed .sidebar nav a:hover { transform: none; }
.sidebar-collapsed .company-name { justify-content: center; height: 15px; padding: 0; }
.mobile-menu-toggle { display: none; color: #fff; background: #102a43; }
.sidebar-overlay { display: none; }

@media (max-width: 900px) {
    .sidebar {
        position: fixed;
        width: min(290px, 86vw);
        height: 100vh;
        transform: translateX(-105%);
    }
    .sidebar-mobile-open .sidebar { transform: translateX(0); }
    .sidebar-mobile-open .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 40;
        background: rgba(2,8,23,.55);
        backdrop-filter: blur(3px);
    }
    .main,
    .sidebar-collapsed .main {
        width: 100%;
        margin-left: 0;
        padding: 22px 18px 40px;
    }
    .sidebar-collapsed .sidebar { width: min(290px, 86vw); }
    .sidebar-collapsed .sidebar .nav-label,
    .sidebar-collapsed .sidebar .nav-section-label,
    .sidebar-collapsed .sidebar .company-dot { display: initial; }
    .sidebar-collapsed .sidebar .brand { display: flex; }
    .sidebar-collapsed .sidebar nav a { justify-content: flex-start; }
    .mobile-menu-toggle { display: inline-grid; }
    .topbar { align-items: flex-start; }
    .user-pill { display: none; }
}

/* Company-to-owner support centre */
.support-layout,
.ticket-thread-layout {
    display: grid;
    grid-template-columns: minmax(340px, .85fr) minmax(0, 1.15fr);
    gap: 20px;
    align-items: start;
}

.ticket-thread-layout {
    grid-template-columns: minmax(0, 1fr) 290px;
}

.ticket-list {
    display: grid;
}

.ticket-list > a {
    display: grid;
    grid-template-columns: 8px 1fr auto;
    align-items: center;
    gap: 13px;
    padding: 14px 0;
    color: #102a43;
    border-top: 1px solid var(--border);
    text-decoration: none;
}

.ticket-list > a:first-child {
    border-top: 0;
}

.ticket-list > a:hover strong {
    color: #0f766e;
}

.ticket-list div {
    min-width: 0;
}

.ticket-list div strong,
.ticket-list div span {
    display: block;
}

.ticket-list div span {
    margin-top: 4px;
    color: #94a3b8;
    font-size: 10px;
}

.ticket-priority {
    width: 7px;
    height: 34px;
    background: #94a3b8;
    border-radius: 999px;
}

.ticket-priority.high { background: #f59e0b; }
.ticket-priority.urgent { background: #ef4444; }
.ticket-priority.low { background: #38bdf8; }

.ticket-thread {
    display: grid;
    gap: 12px;
    padding: 4px 0 20px;
}

.ticket-message {
    max-width: 82%;
    padding: 14px 16px;
    background: #f1f5f9;
    border-radius: 4px 16px 16px;
}

.ticket-message.owner {
    margin-left: auto;
    background: #ecfdf5;
    border-radius: 16px 4px 16px 16px;
}

.ticket-message > div {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.ticket-message time {
    color: #94a3b8;
    font-size: 9px;
}

.ticket-message p {
    margin: 8px 0 0;
    color: #475569;
    font-size: 13px;
    line-height: 1.55;
}

.ticket-reply {
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.ticket-details p {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 0;
    margin: 0;
    border-top: 1px solid var(--border);
    font-size: 11px;
}

.ticket-details p span {
    color: #94a3b8;
}

.ticket-details hr {
    margin: 20px 0 8px;
    border: 0;
}

@media (max-width: 1000px) {
    .support-layout,
    .ticket-thread-layout { grid-template-columns: 1fr; }
    .ticket-details { order: -1; }
}

@media (max-width: 600px) {
    .ticket-message { max-width: 94%; }
    .ticket-list > a { grid-template-columns: 7px 1fr; }
    .ticket-list > a .badge { grid-column: 2; justify-self: start; }
}

/* Dedicated mobile-first sales representative day view */
.sales-day-body {
    min-height: 100vh;
    background: #eef4f6;
}

.sales-mobile-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
    color: #fff;
    background: linear-gradient(120deg, #071525, #155e75);
    box-shadow: 0 5px 20px rgba(15,23,42,.18);
}

.sales-mobile-header > div {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sales-mobile-header > div:first-child span:nth-child(2) {
    display: flex;
    flex-direction: column;
}

.sales-mobile-header small {
    margin-top: 2px;
    color: #a7c4d0;
    font-size: 10px;
}

.sales-mobile-header a {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    color: #d9e8ee;
    background: rgba(255,255,255,.08);
    border-radius: 10px;
}

.sales-logo {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    color: #083344;
    background: linear-gradient(135deg,#fbbf24,#34d399);
    border-radius: 12px;
}

.sales-logo .nav-icon {
    width: 21px;
    height: 21px;
}

.sales-day-shell {
    width: min(100%, 760px);
    margin: 0 auto;
    padding: 15px 14px calc(32px + env(safe-area-inset-bottom));
}

.sales-week-nav {
    display: grid;
    grid-template-columns: 34px 1fr 34px;
    gap: 7px;
    align-items: center;
    margin-bottom: 16px;
}

.sales-week-nav > a {
    display: grid;
    width: 34px;
    height: 42px;
    place-items: center;
    color: #155e75;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 24px;
    text-decoration: none;
}

.sales-date-strip {
    display: grid;
    grid-template-columns: repeat(7,1fr);
    gap: 4px;
}

.sales-date-strip a {
    display: flex;
    min-width: 0;
    padding: 8px 2px;
    flex-direction: column;
    align-items: center;
    color: #64748b;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
}

.sales-date-strip a span,
.sales-date-strip a small {
    font-size: 8px;
    text-transform: uppercase;
}

.sales-date-strip a strong {
    margin: 3px 0;
    color: #102a43;
    font-size: 16px;
}

.sales-date-strip a.active {
    color: #fff;
    background: linear-gradient(160deg,#155e75,#0f766e);
    border-color: transparent;
    box-shadow: 0 8px 18px rgba(15,118,110,.2);
}

.sales-date-strip a.active strong {
    color: #fff;
}

.sales-day-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    margin: 18px 2px 12px;
}

.sales-day-heading span {
    color: #0f8a73;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.sales-day-heading h1 {
    margin: 2px 0 0;
    color: #102a43;
    font-size: 22px;
    letter-spacing: -.03em;
}

.sales-day-heading b {
    padding: 6px 9px;
    color: #0f766e;
    background: #d1fae5;
    border-radius: 999px;
    font-size: 9px;
}

.sales-contact-card,
.sales-note-card,
.sales-notes-card,
.sales-appointments,
.sales-empty {
    padding: 17px;
    margin-bottom: 14px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(15,23,42,.06);
}

.sales-contact-top,
.sales-contact-top > div {
    display: flex;
    align-items: center;
    gap: 11px;
}

.sales-contact-top {
    justify-content: space-between;
}

.sales-avatar {
    display: grid;
    min-width: 45px;
    height: 45px;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg,#155e75,#34d399);
    border-radius: 14px;
    font-weight: 800;
}

.sales-contact-top small {
    color: #0f8a73;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
}

.sales-contact-top h2 {
    margin: 2px 0;
    color: #102a43;
    font-size: 19px;
}

.sales-contact-top div span {
    color: #64748b;
    font-size: 10px;
}

.sales-contact-actions {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 8px;
    margin: 15px 0;
}

.sales-contact-actions a {
    display: flex;
    padding: 11px 5px;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: #0f766e;
    background: #ecfdf5;
    border-radius: 11px;
    font-size: 9px;
    font-weight: 700;
    text-decoration: none;
}

.sales-contact-actions .nav-icon {
    width: 18px;
    height: 18px;
}

.sales-readonly-details p {
    display: grid;
    grid-template-columns: 74px 1fr;
    gap: 10px;
    padding: 9px 0;
    margin: 0;
    border-top: 1px solid #edf2f7;
    font-size: 11px;
}

.sales-readonly-details p span {
    color: #94a3b8;
}

.sales-readonly-details p strong {
    color: #334155;
    font-weight: 600;
}

.sales-note-card h3,
.sales-notes-card h3,
.sales-appointments h3 {
    margin: 0 0 5px;
    color: #102a43;
    font-size: 15px;
}

.sales-note-card > p {
    margin: 0 0 12px;
    color: #94a3b8;
    font-size: 10px;
}

.sales-note-card textarea {
    width: 100%;
    margin-bottom: 8px;
    padding: 11px;
    border: 1px solid var(--border);
    border-radius: 11px;
    font: inherit;
}

.sales-success {
    padding: 11px 13px;
    margin-bottom: 14px;
    color: #065f46;
    background: #d1fae5;
    border-radius: 11px;
    font-size: 11px;
}

.sales-notes-card article {
    padding: 11px 0;
    border-top: 1px solid var(--border);
}

.sales-notes-card article strong,
.sales-notes-card article span {
    display: block;
}

.sales-notes-card article span {
    margin-top: 3px;
    color: #94a3b8;
    font-size: 9px;
}

.sales-notes-card article p {
    margin: 7px 0 0;
    color: #475569;
    font-size: 11px;
    line-height: 1.5;
}

.sales-appointments a {
    display: grid;
    grid-template-columns: 46px 1fr 12px;
    gap: 10px;
    align-items: center;
    padding: 12px 0;
    color: #102a43;
    border-top: 1px solid var(--border);
    text-decoration: none;
}

.sales-appointments a.active {
    margin: 0 -8px;
    padding: 12px 8px;
    background: #f0fdfa;
    border-radius: 10px;
}

.sales-appointments time {
    color: #0f766e;
    font-size: 12px;
    font-weight: 800;
}

.sales-appointments span strong,
.sales-appointments span small {
    display: block;
}

.sales-appointments span small {
    margin-top: 3px;
    color: #94a3b8;
    font-size: 9px;
}

.sales-appointments b {
    color: #94a3b8;
}

.sales-day-list {
    padding: 17px;
}

.sales-appointment-item {
    border-top: 1px solid var(--border);
}

.sales-appointment-item summary {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 38px 16px;
    gap: 10px;
    align-items: center;
    padding: 14px 0;
    color: #102a43;
    cursor: pointer;
    list-style: none;
}

.sales-appointment-item summary::-webkit-details-marker {
    display: none;
}

.sales-appointment-item summary span strong,
.sales-appointment-item summary span small {
    display: block;
}

.sales-appointment-item summary span small {
    margin-top: 3px;
    color: #94a3b8;
    font-size: 9px;
}

.sales-schedule-call {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    color: #0f766e;
    background: #dcfce7;
    border-radius: 10px;
}

.sales-schedule-call .nav-icon {
    width: 17px;
    height: 17px;
}

.sales-expand-icon {
    color: #64748b;
    font-size: 18px;
    text-align: center;
}

.sales-appointment-item[open] {
    margin: 0 -8px 10px;
    padding: 0 8px 8px;
    background: #f8fffd;
    border-radius: 12px;
}

.sales-appointment-item[open] .sales-expand-icon {
    transform: rotate(45deg);
}

.sales-appointment-detail {
    padding: 0 0 10px 56px;
}

.sales-inline-actions {
    display: flex;
    gap: 8px;
    margin: 12px 0;
}

.sales-inline-actions a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 11px;
    color: #0f766e;
    background: #ecfdf5;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 700;
    text-decoration: none;
}

.sales-inline-actions .nav-icon {
    width: 16px;
    height: 16px;
}

.sales-inline-note {
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.sales-inline-note textarea {
    width: 100%;
    margin-bottom: 8px;
    padding: 11px;
    border: 1px solid var(--border);
    border-radius: 11px;
    font: inherit;
}

.sales-inline-notes {
    margin-top: 16px;
}

.sales-inline-notes h4 {
    margin: 0 0 6px;
    color: #102a43;
    font-size: 13px;
}

.sales-inline-notes article {
    padding: 9px 0;
    border-top: 1px solid var(--border);
}

.sales-inline-notes article strong,
.sales-inline-notes article span {
    display: block;
}

.sales-inline-notes article span {
    margin-top: 3px;
    color: #94a3b8;
    font-size: 9px;
}

.sales-inline-notes article p {
    margin: 6px 0 0;
    color: #475569;
    font-size: 11px;
    line-height: 1.45;
}

.sales-document-link {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 0;
    border-top: 1px solid var(--border);
    color: #102a43;
    text-decoration: none;
}

.sales-document-link span {
    color: #64748b;
    font-size: 9px;
}

@media (max-width: 560px) {
    .sales-appointment-detail {
        padding-left: 0;
    }
}

.sales-empty {
    display: grid;
    min-height: 190px;
    place-content: center;
    text-align: center;
    color: #64748b;
}

.sales-empty .nav-icon {
    width: 30px;
    height: 30px;
    margin: 0 auto 10px;
    color: #0f8a73;
}

.sales-empty p {
    max-width: 250px;
    margin: 6px auto 0;
    color: #94a3b8;
    font-size: 11px;
}

@media (min-width: 700px) {
    .sales-day-shell { padding-top: 24px; }
    .sales-contact-card,
    .sales-note-card,
    .sales-notes-card,
    .sales-appointments { padding: 22px; }
}

.role-guide {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 10px;
}

.role-guide div {
    padding: 13px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 11px;
}

.role-guide strong,
.role-guide span {
    display: block;
}

.user-access-form {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.user-access-form select {
    padding: 7px 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    font-size: 11px;
}

.user-access-form .btn {
    padding: 7px 9px;
    font-size: 10px;
}

.role-guide span {
    margin-top: 4px;
    color: #64748b;
    font-size: 11px;
    line-height: 1.45;
}

@media (max-width: 700px) {
    .role-guide { grid-template-columns: 1fr; }
    .billing-grid { grid-template-columns: 1fr; }
    .manager-billing-banner { align-items: flex-start; flex-direction: column; }
    .manager-billing-banner a { margin-left: 0; }
}
