:root {
    --ah-primary-color: #4f46e5;
    --ah-primary-hover: #4338ca;
    --ah-surface: #ffffff;
    --ah-surface-muted: #f9fafb;
    --ah-border: #e5e7eb;
    --ah-text: #111827;
    --ah-text-muted: #6b7280;
    --ah-radius: 14px;
    --ah-shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
    --ah-shadow-md: 0 16px 40px rgba(15, 23, 42, 0.12);
}

body.ah-plugin-page {
    background: #ffffff;
    color: var(--ah-text);
}

body.ah-plugin-page .ah-card,
body.ah-plugin-page .card.ah-card,
body.ah-plugin-page .card {
    border-radius: var(--ah-radius) !important;
    box-shadow: none;
    border: 1px solid var(--ah-border);
}

body.ah-plugin-page .card:hover.ah-card {
    box-shadow: var(--ah-shadow-sm);
}

body.ah-plugin-page .btn-primary {
    background-color: var(--ah-primary-color) !important;
    border-color: var(--ah-primary-color) !important;
}

body.ah-plugin-page .btn-primary:hover {
    background-color: var(--ah-primary-hover) !important;
    border-color: var(--ah-primary-hover) !important;
}

body.ah-plugin-page .form-control,
body.ah-plugin-page .form-select {
    border-radius: 10px !important;
    border-color: var(--ah-border) !important;
    min-height: 42px;
    background: #fff !important;
}

body.ah-plugin-page .form-control:focus,
body.ah-plugin-page .form-select:focus {
    border-color: #c7d2fe !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12) !important;
}

body.ah-plugin-page .table > :not(caption) > * > * {
    border-bottom-color: var(--ah-border);
}

.ah-msg-wrapper { display: flex; margin-bottom: 1rem; width: 100%; }
.ah-msg-mine-wrapper { justify-content: flex-end; }
.ah-msg-other-wrapper { justify-content: flex-start; }
.ah-msg { max-width: 75%; padding: 0.75rem 1rem; border-radius: 1rem; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.ah-msg-mine { background-color: var(--ah-primary-color); color: #fff; border-bottom-right-radius: 0.25rem; }
.ah-msg-other { background-color: #eef2f7; color: var(--ah-text); border-bottom-left-radius: 0.25rem; }
.ah-msg-header { font-size: 0.8rem; opacity: 0.85; margin-bottom: 0.25rem; font-weight: 600; }
.ah-msg-time { font-size: 0.7rem; opacity: 0.75; margin-top: 0.25rem; text-align: right; }

.ah-bottom-nav {
    display: none;
}

@media (max-width: 768px) {
    .ah-bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 90;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        background: rgba(255,255,255,0.98);
        border-top: 1px solid var(--ah-border);
        box-shadow: 0 -8px 22px rgba(17, 38, 71, 0.10);
        padding: 8px;
    }

    .ah-bottom-nav a {
        text-decoration: none;
        color: var(--ah-text-muted);
        text-align: center;
        font-size: 12px;
        padding: 10px 6px;
        border-radius: 12px;
        font-weight: 600;
    }

    .ah-bottom-nav a.is-active {
        background: #eaf3ff;
        color: var(--ah-primary-color);
    }

    .ah-bottom-nav--inpage {
        display: grid;
    }
}

.ah-auth-container .login-username,
.ah-auth-container .login-password,
.ah-auth-container .login-remember,
.ah-auth-container .login-submit {
    margin-bottom: 14px;
}

.ah-auth-container .login-username label,
.ah-auth-container .login-password label {
    display: block;
    margin-bottom: 6px;
    color: var(--ah-text);
    font-weight: 500;
}

.ah-auth-container .login-username input,
.ah-auth-container .login-password input {
    width: 100%;
    height: 44px;
    border: 1px solid var(--ah-border);
    border-radius: 12px;
    padding: 0 12px;
    outline: none;
    box-sizing: border-box;
}

.ah-auth-container .login-username input:focus,
.ah-auth-container .login-password input:focus {
    border-color: var(--ah-primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.ah-auth-container .login-submit .button-primary,
.ah-auth-container .login-submit input[type="submit"] {
    width: 100%;
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: var(--ah-primary-color);
    color: #fff;
    font-weight: 600;
}

.ah-auth-container .login-submit .button-primary:hover,
.ah-auth-container .login-submit input[type="submit"]:hover {
    background: var(--ah-primary-hover);
}

.ah-chat-layout {
    overflow: hidden;
}

.ah-chat-sidebar {
    height: min(78vh, 760px);
    display: flex;
    flex-direction: column;
    background: #fff;
}

.ah-chat-sidebar-head {
    padding: 14px 16px;
    border-bottom: 1px solid var(--ah-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ah-thread-list {
    overflow: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ah-thread-item {
    width: 100%;
    border: 1px solid var(--ah-border);
    background: #fff;
    border-radius: 14px;
    padding: 10px;
    text-align: left;
    display: flex;
    gap: 10px;
    align-items: center;
    cursor: pointer;
}

.ah-thread-item.is-active {
    border-color: #b7d3fb;
    background: #eef5ff;
}

.ah-thread-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #e9eef6;
}

.ah-thread-body {
    min-width: 0;
    width: 100%;
}

.ah-thread-top,
.ah-thread-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ah-thread-name {
    font-weight: 700;
    color: var(--ah-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ah-thread-last {
    color: var(--ah-text-muted);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 210px;
}

.ah-thread-time {
    color: var(--ah-text-muted);
    font-size: 12px;
    flex-shrink: 0;
}

.ah-chat-main {
    display: flex;
    flex-direction: column;
    height: min(78vh, 760px);
    background: #fff;
}

.ah-chat-messages {
    flex: 1;
    overflow: auto;
    background: #f7f9fc;
    padding: 16px;
}

.ah-msg-row {
    display: flex;
    margin-bottom: 10px;
}

.ah-msg-row.is-mine {
    justify-content: flex-end;
}

.ah-msg-bubble {
    max-width: 74%;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--ah-border);
    padding: 10px 12px;
}

.ah-msg-row.is-mine .ah-msg-bubble {
    background: #eaf3ff;
    border-color: #cae0ff;
}

.ah-msg-author {
    font-size: 12px;
    color: var(--ah-text-muted);
    margin-bottom: 4px;
}

.ah-msg-text {
    color: var(--ah-text);
}

.ah-msg-date {
    margin-top: 6px;
    font-size: 11px;
    color: var(--ah-text-muted);
    text-align: right;
}

.ah-dashboard-chat-messages {
    background-color: var(--ah-bg-color, #0f172a);
}

.ah-dashboard-chat-messages .ah-msg-row {
    display: block;
    width: 100%;
    clear: both;
}

.ah-dashboard-chat-messages .ah-msg-bubble {
    display: block;
    width: fit-content;
    max-width: min(78%, 520px);
    border-radius: 18px;
    padding: 10px 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
    word-break: break-word;
}

.ah-dashboard-chat-messages .ah-msg-bubble--audio {
    min-width: 250px;
    max-width: 360px;
}

.ah-dashboard-chat-messages .ah-msg-bubble--theirs {
    margin-right: auto;
    margin-left: 0;
    background: var(--ah-surface-color, #ffffff);
    border: 1px solid var(--ah-border-color, #e2e8f0);
    color: var(--ah-text-color, #0f172a);
    border-bottom-left-radius: 6px;
}

.ah-dashboard-chat-messages .ah-msg-bubble--mine {
    margin-left: auto;
    margin-right: 0;
    background: var(--ah-button-color, #4f46e5);
    border: 1px solid var(--ah-button-color, #4f46e5);
    color: var(--ah-button-text-color, #ffffff);
    border-bottom-right-radius: 6px;
}

.ah-dashboard-chat-messages .ah-msg-bubble--system {
    margin-left: auto;
    margin-right: auto;
    background: var(--ah-surface-muted-color, #f1f5f9);
    border: 1px dashed var(--ah-border-color, #cbd5e1);
    color: var(--ah-text-muted-color, #64748b);
    font-size: 12px;
}

.ah-dashboard-chat-messages .ah-msg-text {
    font-size: 14px;
    line-height: 1.45;
    color: inherit;
}

.ah-dashboard-chat-messages .ah-msg-date {
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    width: 100%;
    font-size: 11px;
    text-align: right;
    color: var(--ah-text-muted-color, #94a3b8);
}

.ah-dashboard-chat-messages .ah-msg-receipt {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.ah-dashboard-chat-messages .ah-msg-receipt-icon {
    width: 16px;
    height: 11px;
}

.ah-dashboard-chat-messages .ah-msg-receipt.is-sent {
    color: var(--ah-text-muted-color, #94a3b8);
}

.ah-dashboard-chat-messages .ah-msg-bubble--mine .ah-msg-receipt.is-sent,
.ah-dashboard-chat-messages .ah-msg-bubble--mine .ah-msg-receipt.is-delivered {
    color: var(--ah-button-text-color, #ffffff);
    opacity: 0.72;
}

.ah-dashboard-chat-messages .ah-msg-receipt.is-delivered {
    color: var(--ah-text-muted-color, #94a3b8);
}

.ah-dashboard-chat-messages .ah-msg-receipt.is-read {
    color: #38bdf8;
}

.ah-dashboard-chat-messages .ah-msg-bubble--mine .ah-msg-receipt.is-read {
    color: #bae6fd;
    opacity: 1;
}

.ah-dashboard-chat-messages .ah-chat-video {
    display: block;
    width: 100%;
}

.ah-dashboard-chat-messages .ah-chat-pdf-open {
    cursor: pointer;
    background: transparent;
    border: 0;
    padding: 0;
    text-align: left;
}

.ah-dashboard-chat-messages .ah-msg-bubble--mine .ah-msg-date {
    color: var(--ah-button-text-color, #ffffff);
    opacity: 0.78;
}

.ah-dashboard-chat-messages .ah-msg-attachments {
    margin-top: 8px;
}

.ah-dashboard-chat-messages .ah-msg-bubble--mine a,
.ah-dashboard-chat-messages .ah-msg-bubble--mine .ah-chat-attachment-link {
    color: var(--ah-button-text-color, #ffffff);
    opacity: 0.92;
}

.ah-dashboard-chat-messages .ah-msg-bubble--theirs a,
.ah-dashboard-chat-messages .ah-msg-bubble--theirs .ah-chat-attachment-link {
    color: var(--ah-link-color, #4f46e5);
}

.ah-dashboard-chat-messages .ah-msg-bubble--mine .ah-chat-image-open {
    border-color: var(--ah-border-color, rgba(255, 255, 255, 0.25));
}

.ah-dashboard-chat-messages .ah-msg-bubble--theirs .ah-chat-image-open {
    border-color: var(--ah-border-color, #e2e8f0);
}

.ah-dashboard-chat-messages .ah-msg-row[data-ah-side="mine"] .ah-msg-bubble {
    margin-left: auto;
    margin-right: 0;
}

.ah-dashboard-chat-messages .ah-msg-row[data-ah-side="theirs"] .ah-msg-bubble {
    margin-right: auto;
    margin-left: 0;
}

.ah-chat-widget {
    position: fixed;
    right: 16px;
    bottom: 18px;
    z-index: 120;
}

.ah-chat-widget-toggle {
    border: 0;
    border-radius: 999px;
    background: var(--ah-primary-color);
    color: #fff;
    padding: 10px 16px;
    font-weight: 700;
    box-shadow: var(--ah-shadow-md);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ah-chat-widget-badge {
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    font-size: 12px;
}

.ah-chat-widget-panel {
    width: 340px;
    height: 460px;
    background: #fff;
    border: 1px solid var(--ah-border);
    border-radius: 16px;
    box-shadow: var(--ah-shadow-md);
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ah-chat-widget-head {
    padding: 10px 12px;
    border-bottom: 1px solid var(--ah-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ah-chat-widget-threads {
    overflow: auto;
    flex: 1;
}

.ah-chat-widget-thread {
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--ah-border);
    background: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    text-align: left;
}

.ah-chat-widget-thread:hover {
    background: #f7faff;
}

.ah-chat-widget-thread-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.ah-chat-widget-thread-avatar--empty {
    background: #e9eef6;
}

.ah-chat-widget-thread-main {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ah-chat-widget-thread-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--ah-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ah-chat-widget-thread-last {
    font-size: 12px;
    color: var(--ah-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ah-chat-widget-thread-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    color: var(--ah-text-muted);
}

.ah-chat-widget-conversation {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ah-chat-widget-conversation-head {
    padding: 8px 10px;
    border-bottom: 1px solid var(--ah-border);
    display: flex;
    justify-content: space-between;
}

.ah-chat-widget-messages {
    flex: 1;
    overflow: auto;
    padding: 10px;
    background: #f7f9fc;
}

.ah-chat-widget-msg {
    display: flex;
    margin-bottom: 8px;
}

.ah-chat-widget-msg.is-mine {
    justify-content: flex-end;
}

.ah-chat-widget-msg-bubble {
    max-width: 80%;
    border: 1px solid var(--ah-border);
    border-radius: 10px;
    background: #fff;
    padding: 7px 9px;
    font-size: 13px;
}

.ah-chat-widget-msg.is-mine .ah-chat-widget-msg-bubble {
    background: #eaf3ff;
    border-color: #cae0ff;
}

.ah-chat-widget-msg-bubble small {
    display: block;
    margin-top: 4px;
    color: var(--ah-text-muted);
    text-align: right;
}

.ah-chat-widget-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    border-top: 1px solid var(--ah-border);
    padding: 10px;
}

@media (max-width: 991px) {
    .ah-chat-sidebar,
    .ah-chat-main {
        height: auto;
        min-height: 380px;
    }
}

@media (max-width: 768px) {
    .ah-chat-widget {
        right: 10px;
        left: 10px;
        bottom: 12px;
    }

    .ah-chat-widget-panel {
        width: 100%;
        height: 62vh;
    }
}

.ah-dashboard-shell .ah-dashboard-nav {
    display: flex;
    gap: 8px;
    overflow: auto;
    white-space: nowrap;
}

.ah-dash-link {
    text-decoration: none;
    color: var(--ah-text-muted);
    border: 1px solid var(--ah-border);
    padding: 8px 12px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
}

.ah-dash-link:hover {
    color: var(--ah-primary-color);
    border-color: #bfd8ff;
    background: #f3f8ff;
}

.ah-dash-link.is-active {
    color: var(--ah-primary-color);
    border-color: #c7d2fe;
    background: #eef2ff;
}

.ah-section {
    max-width: 1200px;
    margin: 0 auto;
}

.ah-page-head {
    margin-bottom: 24px;
}

.ah-page-head h1 {
    font-size: clamp(28px, 4vw, 40px);
    line-height: 1.2;
    margin-bottom: 8px;
}

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

.ah-filter-card {
    border: 1px solid var(--ah-border);
    border-radius: var(--ah-radius);
    background: #fff;
    padding: 14px;
}

.ah-advisor-grid .card-title {
    font-size: 20px;
    line-height: 1.3;
}

.ah-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--ah-border);
    background: #f8fafc;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    color: var(--ah-text-muted);
}

.ah-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 14px;
}

.ah-price-row strong {
    font-size: 16px;
    color: var(--ah-text);
}


.fc-col-header-cell.fc-day{
  background: black !important;
}

#ah-dashboard-calendar,
#ah-client-dashboard-calendar {
  --ah-calendar-toolbar-gap: 0.5rem;
}

@media (max-width: 767px) {
  #ah-dashboard-calendar .fc-header-toolbar,
  #ah-client-dashboard-calendar .fc-header-toolbar {
    flex-direction: column;
    gap: var(--ah-calendar-toolbar-gap);
    align-items: stretch;
  }

  #ah-dashboard-calendar .fc-toolbar-chunk,
  #ah-client-dashboard-calendar .fc-toolbar-chunk {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
  }

  #ah-dashboard-calendar .fc-toolbar-title,
  #ah-client-dashboard-calendar .fc-toolbar-title {
    font-size: 1rem;
    line-height: 1.4;
    text-align: center;
  }

  #ah-dashboard-calendar .fc-button,
  #ah-client-dashboard-calendar .fc-button {
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
  }

  #ah-dashboard-calendar .fc-list-event-title,
  #ah-client-dashboard-calendar .fc-list-event-title,
  #ah-dashboard-calendar .fc-list-event-time,
  #ah-client-dashboard-calendar .fc-list-event-time {
    font-size: 0.8125rem;
  }

  #ah-dashboard-calendar .fc-daygrid-day-number,
  #ah-client-dashboard-calendar .fc-daygrid-day-number {
    font-size: 0.75rem;
    padding: 0.25rem;
  }
}