@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

.casos-layout {
    font-family: 'Inter', sans-serif;
    background-color: #f8fafc;
    color: #0f172a;
}

.casos-shell {
    min-height: 100vh;
    display: flex;
}

.casos-sidebar {
    width: 260px;
    background-color: #0f172a;
    color: #fff;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    flex-shrink: 0;
}

.casos-sidebar nav a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.8rem;
    border-radius: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.casos-sidebar nav a:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.casos-layout:not(.mkt-layout):not(.prospectos-layout) .casos-sidebar nav a.is-active {
    background: rgba(6, 182, 212, 0.2);
    color: #fff;
    border-left: 3px solid #06b6d4;
}

.casos-layout.mkt-layout .casos-sidebar nav a.is-active {
    background: rgba(225, 29, 72, 0.2);
    color: #fff;
    border-left: 3px solid #fb7185;
}

.casos-layout.prospectos-layout .casos-sidebar nav a.is-active {
    background: rgba(255, 255, 255, 0.12);
    border-left: 3px solid #38bdf8;
    color: #fff;
}

.casos-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.casos-header {
    background-color: #fff;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.casos-main {
    flex: 1;
    padding: 1.5rem;
}

.card-casos {
    background-color: #fff;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
}

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

.table-casos th,
.table-casos td {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
}

.table-casos th {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: #64748b;
}

.badge-active {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-active.is-on {
    background-color: rgba(34, 197, 94, 0.15);
    color: #15803d;
}

.badge-active.is-off {
    background-color: rgba(248, 113, 113, 0.15);
    color: #b91c1c;
}

.form-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.form-grid label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #0f172a;
}

.form-grid input,
.form-grid select {
    width: 100%;
    border: 1px solid #cbd5f5;
    border-radius: 0.65rem;
    padding: 0.6rem 0.75rem;
    font-size: 0.95rem;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.25rem;
}

.btn-casos {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: 0.75rem;
    border: none;
    background-color: #2563eb;
    color: #fff;
    padding: 0.55rem 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-casos.secondary {
    background-color: #e2e8f0;
    color: #0f172a;
}

.btn-casos.danger {
    background-color: #dc2626;
}

.btn-casos:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.2);
}

.btn-casos.btn-sm {
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
}

.support-new-wrapper {
    margin-top: 1rem;
}

.casos-stepper {
    display: flex;
    gap: 1rem;
    background: #fff;
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
    border: 1px solid #e2e8f0;
}

.casos-stepper__item {
    flex: 1;
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 0.85rem;
    border: 1px solid transparent;
    color: #475569;
}

.casos-stepper__item .index {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 0.85rem;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.casos-stepper__item.is-active {
    border-color: #0d6efd;
    background: rgba(13, 110, 253, 0.08);
    color: #0d6efd;
}

.support-new-layout {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}

@media (max-width: 1024px) {
    .support-new-layout {
        grid-template-columns: 1fr;
    }
}

.support-form-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    position: relative;
}

.field-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #0f172a;
}

.field-group input,
.field-group select,
.field-group textarea {
    border: 1px solid #cbd5f5;
    border-radius: 0.65rem;
    padding: 0.6rem 0.75rem;
    font-size: 0.95rem;
    width: 100%;
}

.field-error {
    font-size: 0.8rem;
    color: #dc2626;
}

.customer-suggestions {
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
    z-index: 20;
    overflow: hidden;
}

.customer-suggestions button {
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    padding: 0.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    cursor: pointer;
}

.customer-suggestions button:hover {
    background: rgba(15, 23, 42, 0.04);
}

.customer-suggestions__empty {
    padding: 0.5rem 0.75rem;
    color: #94a3b8;
    font-size: 0.85rem;
}

.customer-suggestions button.add-new {
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
    color: #0d6efd;
}

.customer-suggestions button.add-new.is-disabled {
    color: #94a3b8;
    pointer-events: none;
}

.caller-suggestion-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.caller-suggestion-row.suggestion-compact {
    padding: 0.35rem 0.5rem;
}

.caller-suggestion-main {
    flex: 1;
}

.customer-suggestions button.caller-suggestion-text {
    width: 100%;
    background: transparent;
    padding: 0;
}

.customer-suggestions button.caller-suggestion-text:hover {
    background: transparent;
}

.caller-suggestion-icon {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.caller-suggestion-delete {
    border: none;
    background: transparent;
    padding: 0.15rem;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
}

.caller-suggestion-delete:hover {
    color: #dc2626;
}

.field-label-with-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.edit-field-btn {
    border: none;
    background: none;
    color: #0d6efd;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    cursor: pointer;
}

.edit-field-btn:hover {
    text-decoration: underline;
}

.summary-panel {
    position: sticky;
    top: 1rem;
}

.summary-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.summary-grid.summary-grid--wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.summary-grid .summary-full {
    grid-column: span 2;
}

.summary-grid dt {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #94a3b8;
}

.summary-grid dd {
    font-weight: 600;
}

.history-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.history-list li {
    border-left: 4px solid transparent;
    padding-left: 0.75rem;
    transition: border-color 0.2s ease;
}

.lookup-container {
    position: relative;
}

.lookup-list {
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 0;
    right: 0;
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    background: #fff;
    max-height: 220px;
    overflow-y: auto;
    z-index: 10;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
    display: none;
}

.lookup-list.is-open {
    display: block;
}

.lookup-list button {
    width: 100%;
    text-align: left;
    padding: 0.55rem 0.85rem;
    border: none;
    background: transparent;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.9rem;
    color: #0f172a;
    transition: background 0.15s ease;
}

.lookup-list button:last-child {
    border-bottom: none;
}

.lookup-list button:hover {
    background: rgba(37, 99, 235, 0.08);
}

.lookup-list button.is-active {
    background: rgba(37, 99, 235, 0.15);
    font-weight: 600;
}

.lookup-list__empty {
    padding: 0.75rem;
    font-size: 0.85rem;
    color: #94a3b8;
}

.related-case-item {
    display: flex;
    gap: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    padding: 0.75rem;
    align-items: flex-start;
}

.related-case-item input[type="checkbox"] {
    margin-top: 0.3rem;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 40;
}

.modal-card {
    background: #fff;
    border-radius: 1rem;
    padding: 1.5rem;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 25px 40px rgba(15, 23, 42, 0.25);
}

.section-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.cases-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cases-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.filters-card .filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.filters-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

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

.cases-table table th,
.cases-table table td {
    padding: 0.85rem 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}

.cases-table table th {
    text-transform: uppercase;
    font-size: 0.75rem;
    color: #94a3b8;
}

.cases-table .sort-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: transparent;
    border: none;
    padding: 0;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    color: #475569;
    cursor: pointer;
}

.cases-table .sort-link:focus {
    outline: none;
    color: #0f172a;
}

.cases-table .sort-link .bi {
    font-size: 1rem;
}

.cases-table-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1rem;
}

.case-status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.case-status-pill.pill-blue {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
}

.case-status-pill.pill-purple {
    background: rgba(147, 51, 234, 0.15);
    color: #6d28d9;
}

.case-status-pill.pill-amber {
    background: rgba(251, 191, 36, 0.2);
    color: #b45309;
}

.case-status-pill.pill-green {
    background: rgba(34, 197, 94, 0.15);
    color: #15803d;
}

.case-status-pill.pill-red {
    background: rgba(248, 113, 113, 0.3);
    color: #b91c1c;
}

.caller-suggestions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.caller-suggestion-row {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
}

.caller-suggestion-text {
    flex: 1;
    text-align: left;
}

.caller-suggestion-delete {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    padding: 0.1rem;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
}

.caller-suggestion-delete:hover {
    color: #dc2626;
}

.status-action {
    border-radius: 0.65rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #cbd5f5;
    background: #f8fafc;
    color: #0f172a;
    text-align: left;
}

.status-action.is-active {
    border-color: #0d6efd;
    background: rgba(13, 110, 253, 0.08);
    color: #0d6efd;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 60;
}

.modal-card {
    width: 100%;
    max-width: 32rem;
    background: #fff;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 20px 70px rgba(15, 23, 42, 0.25);
}

.alert-warning {
    border: 1px solid rgba(251, 191, 36, 0.6);
    background: rgba(254, 243, 199, 0.7);
    color: #92400e;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.table-casos td.actions-cell {
    white-space: nowrap;
    vertical-align: middle;
}

.table-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    justify-content: flex-start;
}

.report-card {
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    padding: 1rem;
    background: #fff;
    box-shadow: 0 5px 20px rgba(15, 23, 42, 0.05);
}

.casos-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1300;
    min-width: 240px;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-weight: 600;
    color: #fff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25);
}

.casos-toast.success {
    background: #16a34a;
}

.casos-toast.warning {
    background: #fbbf24;
    color: #1f2937;
}

.casos-toast.error,
.casos-toast.danger {
    background: #dc2626;
}

.modal-card select.w-full {
    width: 100%;
    border: 1px solid #cbd5f5;
    border-radius: 0.65rem;
    padding: 0.6rem 0.75rem;
    font-size: 0.95rem;
}

nav a {
    margin-bottom: 0.5rem;
}