/* Manor Design System - Superdesign Refresh */

:root {
    --background: #FAF8F5;
    --surface: #FFFFFF;
    --forest-green: #2D5A3D;
    --forest-green-hover: #1F4A2F;
    --charcoal: #2C2C2C;
    --secondary-text: #6B6B6B;
    --tertiary-text: #9B9B9B;
    --border: #E8E4DF;
    --amber: #C4956A;
    --amber-hover: #B8845E;
    --cream: #FAF8F5;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--charcoal);
    margin: 0;
    -webkit-font-smoothing: antialiased;
    height: 100vh;
    overflow: hidden;
}

h1, h2, h3, h4, .font-serif, .font-display {
    font-family: 'Fraunces', serif;
    letter-spacing: -0.01em;
}

/* Shadows */
.custom-shadow {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.soft-shadow {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
}

.panel-shadow {
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.06);
}

/* Scrollbar */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #E8E4DF;
    border-radius: 10px;
}

/* Active nav underline */
.active-nav-border {
    position: relative;
}
.active-nav-border::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--forest-green);
}

/* Message bubbles */
.message-bubble {
    max-width: 75%;
}

/* Input placeholder */
input::placeholder, textarea::placeholder {
    color: var(--tertiary-text);
}

/* Buttons */
.btn-amber {
    background-color: var(--amber);
    color: white;
    transition: all 0.2s ease;
}
.btn-amber:hover {
    background-color: var(--amber-hover);
    transform: translateY(-1px);
}

/* Outline amber button (Incoming widget) */
.btn-outline-amber {
    border: 1px solid var(--amber);
    color: var(--amber);
    transition: background 0.2s ease;
}
.btn-outline-amber:hover {
    background: rgba(196, 149, 106, 0.1);
}

/* Ghost gray button (Incoming widget) */
.btn-ghost-gray {
    color: var(--tertiary-text);
    transition: color 0.2s ease;
}
.btn-ghost-gray:hover {
    color: var(--secondary-text);
}

/* Line clamp */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Smooth transitions */
a, button {
    transition: all 0.15s ease;
}

/* Panel animations */
.panel-slide-in {
    animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.panel-slide-out {
    animation: slideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideOut {
    from { transform: translateX(0); }
    to { transform: translateX(100%); }
}

/* Panel backdrop */
.panel-backdrop {
    transition: opacity 0.3s ease;
}

/* Card expand/collapse */
.card-expand-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.2s ease;
    opacity: 0;
}

.card-expanded .card-expand-content {
    max-height: 300px;
    opacity: 1;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid #F3F4F6;
}

/* Action card borders */
.action-card-border-amber { border-left: 3px solid var(--amber); }
.action-card-border-green { border-left: 3px solid var(--forest-green); }

/* Toggle switches */
.switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #E5E7EB;
    transition: .4s;
    border-radius: 20px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 14px; width: 14px;
    left: 3px; bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider { background-color: var(--forest-green); }
input:checked + .slider:before { transform: translateX(16px); }
input:disabled + .slider { opacity: 0.5; cursor: not-allowed; }

/* Typing animation */
@keyframes bounce-dot {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-6px); }
}
.typing-dot {
    animation: bounce-dot 1.4s infinite ease-in-out;
}
.typing-dot:nth-child(1) { animation-delay: 0ms; }
.typing-dot:nth-child(2) { animation-delay: 150ms; }
.typing-dot:nth-child(3) { animation-delay: 300ms; }

/* Toggle switch (connections panel style) */
.toggle-switch {
    width: 36px;
    height: 20px;
    border-radius: 99px;
    position: relative;
    transition: background-color 0.2s;
    cursor: pointer;
}
.toggle-dot {
    width: 14px;
    height: 14px;
    background-color: white;
    border-radius: 99px;
    position: absolute;
    top: 3px;
    transition: transform 0.2s;
}
.toggle-on { background-color: var(--forest-green); }
.toggle-on .toggle-dot { transform: translateX(16px); }
.toggle-off { background-color: var(--border); }
.toggle-off .toggle-dot { transform: translateX(3px); }

/* Full-page scrollable views (admin, inbox, history, settings standalone) */
body.page-scrollable {
    height: auto;
    overflow: auto;
    min-height: 100vh;
}

/* Nav links (full-page navigation) */
.nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    color: #6B6B6B;
    border-radius: 6px;
    text-decoration: none;
    transition: color 0.15s ease, background-color 0.15s ease;
    position: relative;
}
.nav-link:hover {
    color: #2D5A3D;
    background-color: #F3F4F2;
}
.nav-link-active {
    color: #2D5A3D !important;
    background-color: #EBF2EC;
}
