/* Claudus app shell (preto e branco) */

:root {
    --background: #ffffff;
    --foreground: #09090b;
    --muted: #f4f4f5;
    --muted-foreground: #71717a;
    --border: #e4e4e7;
    --input: #e4e4e7;
    --accent: #f4f4f5;
    --mono: #09090b;
    --primary: #18181b;
    --primary-foreground: #ffffff;
    --sidebar-width: 300px;
    --sidebar-collapsed-width: 60px;
    --header-height: 60px;
    --toolbar-height: 54px;
}

html, body {
    height: 100%;
}

body {
    font-family: Inter, system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--background);
    color: var(--foreground);
}

/* —— Buttons —— */
.app-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    height: 2.125rem;
    padding: 0 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.25rem;
    border-radius: 0.375rem;
    transition: color 0.15s, background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}

.app-btn-sm {
    height: 1.875rem;
    padding: 0 0.625rem;
    font-size: 0.75rem;
}

.app-btn-ghost {
    color: var(--muted-foreground);
    background: transparent;
}

.app-btn-ghost:hover {
    color: var(--foreground);
    background: var(--accent);
}

.app-btn-outline {
    color: var(--foreground);
    background: var(--background);
    border: 1px solid var(--border);
}

.app-btn-outline:hover {
    background: var(--accent);
}

.app-btn-primary {
    color: var(--primary-foreground);
    background: var(--mono);
}

.app-btn-primary:hover {
    background: #000000;
}

.app-btn-icon {
    width: 2.125rem;
    height: 2.125rem;
    padding: 0;
    flex-shrink: 0;
}

.app-btn-icon.active,
.app-btn-primary.active {
    color: var(--primary-foreground);
    background: var(--mono);
}

/* —— Input —— */
.app-input {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.app-input .ph,
.app-input > i {
    position: absolute;
    left: 0.75rem;
    color: var(--muted-foreground);
    pointer-events: none;
    font-size: 1rem;
}

.app-input input {
    width: 100%;
    height: 2.125rem;
    padding: 0 0.75rem 0 2.25rem;
    font-size: 0.8125rem;
    color: var(--foreground);
    background: var(--background);
    border: 1px solid var(--input);
    border-radius: 0.375rem;
    outline: none;
}

.app-input input:focus {
    border-color: var(--mono);
    box-shadow: 0 0 0 2px rgba(9, 9, 11, 0.08);
}

.app-input input.app-input-plain {
    padding-left: 0.75rem;
}

.app-badge-stroke {
    position: absolute;
    right: 0.5rem;
    padding: 0.125rem 0.375rem;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--muted-foreground);
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    background: var(--background);
    pointer-events: none;
}

/* —— Breadcrumb —— */
.app-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.8125rem;
}

.app-breadcrumb-link {
    color: var(--muted-foreground);
}

.app-breadcrumb-link:hover {
    color: var(--foreground);
}

.app-breadcrumb-separator {
    color: var(--muted-foreground);
}

.app-breadcrumb-page {
    color: var(--foreground);
    font-weight: 500;
}

/* —— Sidebar menu —— */
.app-menu-section-title {
    padding: 0 0.5rem;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--muted-foreground);
}

.app-menu-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    height: 2.125rem;
    padding: 0 0.625rem;
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--foreground);
    border-radius: 0.375rem;
    transition: background-color 0.15s, color 0.15s;
}

.app-menu-link:hover {
    background: var(--accent);
}

.app-menu-link.is-active {
    color: var(--primary-foreground);
    background: var(--mono);
}

.app-menu-link.is-active .ph {
    color: var(--primary-foreground);
    opacity: 1;
}

/* —— Avatar —— */
.app-avatar {
    position: relative;
    width: 1.75rem;
    height: 1.75rem;
    flex-shrink: 0;
}

.app-avatar-image {
    width: 100%;
    height: 100%;
    border-radius: 9999px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--muted);
    border: 1px solid var(--border);
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--foreground);
}

.app-avatar-status {
    position: absolute;
    top: -0.125rem;
    right: -0.125rem;
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 9999px;
    border: 2px solid var(--background);
    background: var(--mono);
}

/* —— Dropdown —— */
.app-dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.625rem);
    width: 15.625rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.08);
    z-index: 50;
    padding: 0.25rem 0;
}

.app-dropdown-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
    color: var(--foreground);
}

.app-dropdown-link:hover {
    background: var(--accent);
}

.app-dropdown-separator {
    height: 1px;
    background: var(--border);
    margin: 0.25rem 0;
}

/* —— App cards / tables —— */
.app-card {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.app-table thead th {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted-foreground);
}

.app-table tbody td {
    font-size: 0.8125rem;
    color: #27272a;
}

/* —— Subscription / pricing —— */
.checkout-shell {
    min-height: 100vh;
}

.pricing-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.75rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(9, 9, 11, 0.04);
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s, background-color 0.15s;
}

.pricing-card:hover {
    border-color: #86efac;
    box-shadow: 0 14px 36px rgba(9, 9, 11, 0.08);
    transform: translateY(-1px);
}

.pricing-card:has(input:checked) {
    border-color: var(--mono);
    box-shadow: 0 0 0 1px var(--mono), 0 18px 42px rgba(9, 9, 11, 0.1);
}

.pricing-card.is-selected {
    border-color: var(--mono);
    box-shadow: 0 0 0 1px var(--mono), 0 18px 42px rgba(9, 9, 11, 0.1);
}

.pricing-card.is-recommended {
    border-width: 2px;
    border-color: #22c55e;
    background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 42%);
    box-shadow: 0 18px 48px rgba(22, 163, 74, 0.14);
}

.pricing-card.is-recommended.is-selected {
    border-color: #16a34a;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.24), 0 22px 56px rgba(22, 163, 74, 0.18);
}

.pricing-card-badge-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.pricing-card-badge {
    display: inline-flex;
    align-items: center;
    height: 1.625rem;
    padding: 0 0.625rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #166534;
    background: #dcfce7;
    border: 1px solid #86efac;
    border-radius: 9999px;
    white-space: nowrap;
}

.pricing-card-badge-value {
    color: #ffffff;
    background: #16a34a;
    border-color: #16a34a;
}

.pricing-period-badge {
    display: inline-flex;
    align-items: center;
    height: 1.5rem;
    padding: 0 0.625rem;
    color: #166534;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1rem;
}

.pricing-card-check {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border: 1px solid var(--border);
    border-radius: 9999px;
    color: transparent;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.pricing-card:has(input:checked) .pricing-card-check {
    background: var(--mono);
    border-color: var(--mono);
    color: var(--primary-foreground);
}

.pricing-card.is-selected .pricing-card-check {
    background: var(--mono);
    border-color: var(--mono);
    color: var(--primary-foreground);
}

.pricing-price-block {
    margin-top: 1.75rem;
}

.pricing-savings-box {
    margin-top: 1.5rem;
    padding: 1.125rem;
    border: 1px solid #86efac;
    border-radius: 1rem;
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 52%, #ffffff 100%);
}

.pricing-savings-box-neutral {
    border-color: var(--border);
    background: linear-gradient(135deg, #fafafa 0%, #ffffff 100%);
}

.pricing-savings-label {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #15803d;
}

.pricing-savings-label .ph {
    font-size: 1rem;
}

.pricing-savings-amount {
    margin-top: 0.35rem;
    font-size: 2.125rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    color: #15803d;
}

.pricing-savings-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.875rem;
}

.pricing-savings-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 1.625rem;
    padding: 0.35rem 0.625rem;
    border-radius: 9999px;
    color: #166534;
    background: #dcfce7;
    font-size: 0.75rem;
    font-weight: 800;
}

.pricing-savings-neutral-title {
    margin-top: 0.35rem;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--foreground);
}

.pricing-savings-copy {
    margin-top: 0.625rem;
    font-size: 0.75rem;
    line-height: 1.45;
    color: #3f3f46;
}

.pricing-comparison {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 0.625rem;
    margin-top: 1rem;
}

.pricing-comparison-single {
    grid-template-columns: minmax(0, 1fr);
}

.pricing-comparison-card {
    min-width: 0;
    padding: 0.75rem;
    border: 1px solid #d4d4d8;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.74);
}

.pricing-comparison-card span {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--muted-foreground);
}

.pricing-comparison-card strong {
    display: block;
    margin-top: 0.25rem;
    font-size: 1rem;
    line-height: 1.15;
    color: var(--foreground);
}

.pricing-comparison-card.is-current {
    border-color: #86efac;
    background: rgba(240, 253, 244, 0.85);
}

.pricing-comparison-card.is-current strong {
    color: #15803d;
}

.pricing-comparison-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.625rem;
    height: 1.625rem;
    border-radius: 9999px;
    color: #15803d;
    background: #dcfce7;
    font-size: 0.9375rem;
    font-weight: 800;
}

.pricing-savings-percent {
    margin-top: 0.75rem;
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.625rem;
    border-radius: 9999px;
    color: #166534;
    background: #dcfce7;
    font-size: 0.75rem;
    font-weight: 800;
}

.checkout-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted-foreground);
}

.checkout-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.375rem;
    height: 1.375rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--foreground);
    background: var(--muted);
}

.checkout-trust-item {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    line-height: 1.35;
}

.checkout-trust-item .ph {
    color: var(--foreground);
    margin-top: 0.125rem;
    flex-shrink: 0;
}

.support-widget {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 60;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
}

.support-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0 1rem;
    color: var(--primary-foreground);
    background: var(--mono);
    border-radius: 9999px;
    box-shadow: 0 12px 30px rgba(9, 9, 11, 0.18);
    font-size: 0.8125rem;
    font-weight: 600;
}

.support-trigger:hover {
    background: #000000;
}

.support-panel {
    width: min(22rem, calc(100vw - 2.5rem));
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 1rem;
    box-shadow: 0 20px 45px rgba(9, 9, 11, 0.16);
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(0.75rem) scale(0.98);
    transform-origin: bottom right;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.support-panel.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.support-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--muted);
}

.support-form {
    display: grid;
    gap: 0.875rem;
    padding: 1rem;
}

.help-hand-icon .ph {
    transform-origin: 70% 80%;
    animation: help-hand-wave 1.8s ease-in-out infinite;
}

.js-support-open:hover .help-hand-icon .ph,
.js-support-open:focus-visible .help-hand-icon .ph {
    animation-duration: 0.9s;
}

@keyframes help-hand-wave {
    0%, 58%, 100% {
        transform: rotate(0deg);
    }
    10% {
        transform: rotate(16deg);
    }
    20% {
        transform: rotate(-10deg);
    }
    30% {
        transform: rotate(14deg);
    }
    40% {
        transform: rotate(-6deg);
    }
    50% {
        transform: rotate(8deg);
    }
}

@media (max-width: 640px) {
    .support-widget {
        right: 1rem;
        bottom: 1rem;
        left: 1rem;
        align-items: stretch;
    }

    .support-trigger {
        width: 100%;
    }

    .support-panel {
        width: 100%;
    }
}

/* —— Auth —— */
.auth-panel-left {
    background: var(--mono);
}

.auth-grid-pattern {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 28px 28px;
}

.ph-icon-sm { font-size: 1rem; }
.ph-icon-md { font-size: 1.125rem; }
.ph-icon-lg { font-size: 1.25rem; }

/* —— Layout shell —— */
#app-shell {
    --sidebar-width: 300px;
    --sidebar-collapsed-width: 60px;
    --header-height: 60px;
    --toolbar-height: 54px;
}

.app-main-scroll {
    padding-top: var(--header-height);
}

@media (min-width: 1024px) {
    .app-main-scroll {
        padding-top: calc(var(--header-height) + var(--toolbar-height));
        padding-left: var(--sidebar-width);
    }
}

.app-header {
    height: var(--header-height);
}

.app-sidebar {
    top: var(--header-height);
    width: var(--sidebar-width);
}

.app-toolbar {
    min-height: var(--toolbar-height);
}

@media (min-width: 1024px) {
    .app-toolbar-fixed {
        position: fixed;
        top: var(--header-height);
        left: var(--sidebar-width);
        right: 0;
        z-index: 10;
    }
}
