/**
 * Applet Help Desk - Styles
 * Font: Inter
 * Version: 2.0
 */

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

/* ==================== RESET & BASE ==================== */
.ahd-fullwidth,
.ahd-fullwidth *,
.ahd-fullwidth *::before,
.ahd-fullwidth *::after {
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* Forçar fullwidth - sair do container do tema */
.ahd-fullwidth {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
    position: relative;
    left: 0;
    right: 0;
    overflow-x: hidden;
}

/* Prevenir scroll horizontal no body quando HelpDesk ativo */
body:has(.ahd-fullwidth) {
    overflow-x: hidden;
}

/* Esconder header do tema quando HelpDesk está ativo */
body:has(.ahd-fullwidth) header.mb-12,
body:has(.ahd-fullwidth) .entry-header,
body:has(.ahd-fullwidth) .page-header,
.ahd-fullwidth ~ header,
.entry-content > header.mb-12,
header.mb-12:has(h1) {
    display: none !important;
}

/* Remover padding do main do tema */
body:has(.ahd-fullwidth) main.py-20,
body:has(.ahd-fullwidth) .py-20,
main.py-20:has(.ahd-fullwidth),
body main.py-20 {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Override para h3 do tema (.prose) dentro do plugin */
.ahd-fullwidth h3,
.ahd-fullwidth .prose h3,
body .ahd-fullwidth h3 {
    font-size: 1.2rem !important;
    font-weight: 600 !important;
    color: #000000 !important;
    margin-top: 1rem !important;
    margin-bottom: 0.55rem !important;
}

/* Campos disabled */
.ahd-fullwidth input:disabled,
.ahd-fullwidth select:disabled,
.ahd-fullwidth textarea:disabled,
.ahd-form input:disabled,
.ahd-form select:disabled,
.ahd-form textarea:disabled {
    background-color: #e9ecef !important;
    color: #6c757d !important;
    cursor: not-allowed !important;
    opacity: 0.7;
    border-color: #ced4da !important;
}

/* Remover underline de todos os links do plugin */
.ahd-fullwidth a,
.ahd-fullwidth a:hover,
.ahd-fullwidth a:focus,
.ahd-fullwidth a:active {
    text-decoration: none !important;
}

.ahd-fullwidth a:not(.ahd-btn):not(.ahd-filter-btn):not(.ahd-pagination-btn):not(.ahd-logo):not(.ahd-breadcrumb a):hover {
    color: var(--ahd-gray-700) !important;
}

/* ==================== VARIABLES ==================== */
:root {
    --ahd-primary: #FCDD45;
    --ahd-primary-dark: #e5c93e;
    --ahd-primary-light: rgba(252, 221, 69, 0.15);
    --ahd-dark: #242424;
    --ahd-dark-light: #333333;
    --ahd-white: #ffffff;
    --ahd-gray-50: #fafafa;
    --ahd-gray-100: #f5f5f5;
    --ahd-gray-200: #e5e5e5;
    --ahd-gray-300: #d4d4d4;
    --ahd-gray-400: #a3a3a3;
    --ahd-gray-500: #737373;
    --ahd-gray-600: #525252;
    --ahd-gray-700: #404040;
    --ahd-gray-800: #262626;
    --ahd-success: #10b981;
    --ahd-success-light: rgba(16, 185, 129, 0.15);
    --ahd-warning: #f59e0b;
    --ahd-warning-light: rgba(245, 158, 11, 0.15);
    --ahd-danger: #ef4444;
    --ahd-danger-light: rgba(239, 68, 68, 0.15);
    --ahd-info: #3b82f6;
    --ahd-info-light: rgba(59, 130, 246, 0.15);
    --ahd-radius: 8px;
    --ahd-radius-lg: 12px;
    --ahd-radius-xl: 16px;
    --ahd-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --ahd-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --ahd-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --ahd-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --ahd-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --ahd-transition: all 0.2s ease;
}

/* ==================== LOGIN PAGE ==================== */
.ahd-login-page {
    min-height: 80vh;
    background: linear-gradient(135deg, var(--ahd-gray-100) 0%, var(--ahd-white) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.ahd-login-container {
    width: 100%;
    max-width: 480px;
}

.ahd-login-card {
    background: var(--ahd-white);
    border-radius: var(--ahd-radius-xl);
    box-shadow: var(--ahd-shadow-xl);
    padding: 48px;
    border: 1px solid var(--ahd-gray-200);
}

.ahd-login-header {
    text-align: center;
    margin-bottom: 32px;
}

.ahd-login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

.ahd-login-logo-icon {
    width: 56px;
    height: 56px;
    background: var(--ahd-primary);
    border-radius: var(--ahd-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--ahd-shadow-md);
}

.ahd-login-logo-icon svg {
    width: 32px;
    height: 32px;
    fill: var(--ahd-dark);
}

.ahd-login-logo-text {
    font-size: 32px;
    font-weight: 800;
    color: var(--ahd-dark);
    letter-spacing: -0.5px;
}

.ahd-login-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--ahd-dark);
    margin: 0 0 8px 0;
}

.ahd-login-header p {
    font-size: 15px;
    color: var(--ahd-gray-500);
    margin: 0;
}

.ahd-login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Garantir que ao voltar do JS o form mantenha o layout */
.ahd-login-form[style*="flex"] {
    flex-direction: column;
}

.ahd-login-footer {
    margin-top: 32px;
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--ahd-gray-200);
}

.ahd-login-footer p {
    font-size: 13px;
    color: var(--ahd-gray-400);
    margin: 0;
}

/* ==================== APP LAYOUT ==================== */
.ahd-app {
    min-height: 100vh;
    background: var(--ahd-gray-100);
}

/* Header */
.ahd-header {
    background: var(--ahd-white);
    border-bottom: 1px solid var(--ahd-gray-200);
}

.ahd-header-container {
    max-width: 1472px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    padding: 0 20px;
}

.ahd-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ahd-header-user-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--ahd-dark);
}

.ahd-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ahd-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ahd-user-avatar {
    width: 36px;
    height: 36px;
    background: var(--ahd-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--ahd-dark);
}

.ahd-user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--ahd-gray-700);
}

/* Main */
.ahd-main {
    padding: 24px 20px;
}

.ahd-container {
    max-width: 1472px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==================== TOOLBAR ==================== */
.ahd-toolbar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.ahd-toolbar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.ahd-page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--ahd-dark);
    margin: 0;
}

.ahd-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.ahd-filters {
    display: flex;
    gap: 8px;
}

.ahd-filter-btn {
    display: inline-flex;
    padding: 8px 12px;
    border-radius: var(--ahd-radius);
    text-decoration: none;
    transition: var(--ahd-transition);
}

.ahd-filter-btn:hover {
    background: var(--ahd-gray-200);
}

.ahd-filter-btn.active {
    background: var(--ahd-dark);
}

.ahd-filter-btn.active .ahd-badge {
    background: var(--ahd-primary) !important;
    color: var(--ahd-dark) !important;
}

/* Ícones dos filtros - escondidos em desktop */
.ahd-filter-icon {
    display: none;
    color: var(--ahd-gray-600);
}

.ahd-filter-btn.active .ahd-filter-icon {
    color: var(--ahd-white);
}

/* Search */
.ahd-search-form {
    display: flex;
    width: 100%;
}

.ahd-search-box {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 400px;
}

.ahd-search-box .ahd-search-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--ahd-gray-400);
    pointer-events: none;
}

.ahd-search-box input {
    width: 100%;
    height: 42px;
    padding: 0 44px;
    border: 1px solid var(--ahd-gray-300);
    border-radius: var(--ahd-radius);
    font-size: 14px;
    transition: var(--ahd-transition);
    background: var(--ahd-white);
}

.ahd-search-box input:focus {
    outline: none;
    border-color: var(--ahd-primary);
    box-shadow: 0 0 0 3px var(--ahd-primary-light);
}

/* Botão limpar busca */
.ahd-search-clear {
    position: absolute;
    right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: var(--ahd-gray-400) !important;
    background: var(--ahd-gray-100);
    transition: var(--ahd-transition);
    text-decoration: none;
}

.ahd-search-clear:hover {
    background: var(--ahd-gray-200);
    color: var(--ahd-dark) !important;
}

.ahd-search-box.has-value input {
    padding-right: 44px;
}

/* ==================== CARDS ==================== */
.ahd-card {
    background: var(--ahd-white);
    border-radius: var(--ahd-radius-lg);
    box-shadow: var(--ahd-shadow);
    border: 1px solid var(--ahd-gray-200);
    overflow: hidden;
}

.ahd-card-header {
    padding: 6px 20px;
    border-bottom: 1px solid var(--ahd-gray-200);
    background: var(--ahd-gray-50);
}

.ahd-card-header-with-close {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ahd-card-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--ahd-radius);
    color: var(--ahd-gray-500) !important;
    background: transparent;
    transition: var(--ahd-transition);
    text-decoration: none;
}

.ahd-card-close:hover {
    background: var(--ahd-gray-200);
    color: var(--ahd-dark) !important;
}

.ahd-card-header h3 {
    font-size: 10px;
    font-weight: 600;
    color: var(--ahd-gray-500);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ahd-card-body {
    padding: 16px 20px;
}

.ahd-mt {
    margin-top: 16px;
}

/* Container centralizado para detalhes */
.ahd-container-centered {
    max-width: 1260px;
    margin: 0 auto;
    width: 100%;
}

/* ==================== GRID ==================== */
.ahd-grid {
    display: grid;
    gap: 16px;
}

.ahd-grid-2 {
    grid-template-columns: 1fr;
}

/* ==================== INFO GRID ==================== */
.ahd-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

/* Info em linha horizontal */
.ahd-info-row {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.ahd-info-row .ahd-info-item {
    flex: 1;
    min-width: 120px;
}

.ahd-info-row .ahd-info-item:first-child {
    flex: 2;
    min-width: 200px;
}

.ahd-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ahd-info-item label {
    font-size: 12px;
    font-weight: 600;
    color: var(--ahd-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ahd-info-item span {
    font-size: 14px;
    color: var(--ahd-dark);
    font-weight: 500;
}

.ahd-info-full {
    grid-column: span 2;
}

.ahd-info-comment {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--ahd-gray-200);
}

.ahd-info-comment label {
    font-size: 12px;
    font-weight: 600;
    color: var(--ahd-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 8px;
}

.ahd-info-comment p {
    font-size: 14px;
    color: var(--ahd-gray-600);
    line-height: 1.6;
    margin: 0;
}

/* ==================== TABLE ==================== */
.ahd-table-wrapper {
    overflow-x: auto;
}

.ahd-table {
    width: 100%;
    min-width: 1100px;
    border-collapse: collapse;
}

.ahd-table th {
    background: var(--ahd-gray-50);
    padding: 14px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: var(--ahd-gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--ahd-gray-200);
    white-space: nowrap;
}

.ahd-table td {
    padding: 16px;
    border-bottom: 1px solid var(--ahd-gray-200);
    font-size: 14px;
    color: var(--ahd-gray-700);
    white-space: nowrap;
}

.ahd-table tbody tr:last-child td {
    border-bottom: none;
}

.ahd-table tbody tr:hover td {
    background: var(--ahd-primary-light);
}

.ahd-table td strong {
    color: var(--ahd-dark);
    font-weight: 600;
}

.ahd-truncate {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Última coluna (Ocorrência) com largura fixa para evitar deslocamento */
.ahd-table th:last-child,
.ahd-table td:last-child {
    width: 140px;
    min-width: 140px;
    text-align: center;
}

.ahd-empty-cell {
    padding: 60px 20px !important;
}

.ahd-empty-state {
    text-align: center;
}

.ahd-empty-state svg {
    width: 64px;
    height: 64px;
    color: var(--ahd-gray-300);
    margin-bottom: 16px;
}

.ahd-empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--ahd-gray-700);
    margin: 0 0 8px 0;
}

.ahd-empty-state p {
    font-size: 14px;
    color: var(--ahd-gray-500);
    margin: 0;
}

/* ==================== PAGINATION ==================== */
.ahd-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-top: 1px solid var(--ahd-gray-200);
    background: var(--ahd-gray-50);
}

.ahd-pagination-info {
    font-size: 14px;
    color: var(--ahd-gray-600);
}

.ahd-pagination-links {
    display: flex;
    gap: 6px;
}

.ahd-pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    background: var(--ahd-white);
    border: 1px solid var(--ahd-gray-300);
    border-radius: var(--ahd-radius);
    font-size: 14px;
    font-weight: 500;
    color: var(--ahd-gray-700);
    text-decoration: none;
    transition: var(--ahd-transition);
}

.ahd-pagination-btn:hover {
    background: var(--ahd-primary);
    border-color: var(--ahd-primary);
    color: var(--ahd-dark);
}

.ahd-pagination-btn.active {
    background: var(--ahd-dark);
    border-color: var(--ahd-dark);
    color: var(--ahd-white);
}

.ahd-pagination-btn svg {
    width: 16px;
    height: 16px;
}

/* ==================== BUTTONS ==================== */
.ahd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    border-radius: var(--ahd-radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--ahd-transition);
    text-decoration: none;
    white-space: nowrap;
}

.ahd-btn-primary {
    background: var(--ahd-dark);
    color: var(--ahd-white) !important;
}

.ahd-btn-primary:hover {
    background: var(--ahd-gray-700);
    color: var(--ahd-white) !important;
    transform: translateY(-1px);
    box-shadow: var(--ahd-shadow-md);
}

.ahd-btn-outline {
    background: var(--ahd-white);
    color: var(--ahd-gray-700) !important;
    border: 1px solid var(--ahd-gray-300);
}

.ahd-btn-outline:hover {
    background: var(--ahd-gray-100);
    border-color: var(--ahd-gray-400);
    color: var(--ahd-dark) !important;
}

.ahd-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.ahd-btn-lg {
    padding: 12px 20px;
    font-size: 14px;
}

.ahd-btn-block {
    width: 100%;
}

.ahd-btn-disabled {
    background: var(--ahd-gray-200) !important;
    color: var(--ahd-gray-400) !important;
    border: 1px solid var(--ahd-gray-200) !important;
    cursor: not-allowed !important;
    pointer-events: none;
}

.ahd-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: var(--ahd-white) !important;
    border: 1px solid var(--ahd-gray-300) !important;
    border-radius: var(--ahd-radius);
    color: var(--ahd-gray-600) !important;
    transition: var(--ahd-transition);
    text-decoration: none;
}

.ahd-btn-icon:hover {
    background: var(--ahd-gray-100) !important;
    border-color: var(--ahd-gray-400) !important;
    color: var(--ahd-dark) !important;
}

.ahd-btn-icon svg {
    width: 16px;
    height: 16px;
}

/* ==================== FORMS ==================== */
.ahd-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ahd-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ahd-form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--ahd-gray-700);
}

.ahd-form-group input,
.ahd-form-group select,
.ahd-form-group textarea {
    height: 42px;
    padding: 0 14px;
    border: 1px solid var(--ahd-gray-300);
    border-radius: var(--ahd-radius);
    font-size: 14px;
    transition: var(--ahd-transition);
    background: var(--ahd-white);
    width: 100%;
}

.ahd-form-group textarea {
    height: auto;
    padding: 12px 14px;
}

.ahd-form-group input:focus,
.ahd-form-group select:focus,
.ahd-form-group textarea:focus {
    outline: none;
    border-color: var(--ahd-primary);
    box-shadow: 0 0 0 3px var(--ahd-primary-light);
}

.ahd-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.ahd-form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.ahd-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--ahd-gray-200);
    margin-top: 12px;
}

/* Input with icon */
.ahd-input-wrapper {
    position: relative;
}

.ahd-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--ahd-gray-400);
}

.ahd-input-wrapper input {
    padding-left: 48px;
}

/* ==================== BADGES ==================== */
.ahd-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ahd-badge-sm {
    padding: 3px 10px;
    font-size: 11px;
}

.ahd-badge-lg {
    padding: 6px 14px;
    font-size: 13px;
}

.ahd-badge-warning {
    background: var(--ahd-warning-light);
    color: #b45309;
}

.ahd-badge-success {
    background: var(--ahd-success-light);
    color: #047857;
}

.ahd-badge-danger {
    background: var(--ahd-danger-light);
    color: #b91c1c;
}

.ahd-badge-primary {
    background: var(--ahd-info-light);
    color: #1d4ed8;
}

.ahd-badge-info {
    background: var(--ahd-info-light);
    color: #1d4ed8;
}

.ahd-badge-secondary {
    background: var(--ahd-gray-200);
    color: var(--ahd-gray-600);
}

/* Badge inline - força width auto */
.ahd-badge-inline {
    width: auto !important;
    display: inline-flex !important;
}

/* ==================== ALERTS ==================== */
.ahd-alert {
    padding: 14px 18px;
    border-radius: var(--ahd-radius);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
}

.ahd-alert-error {
    background: var(--ahd-danger-light);
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.ahd-alert-success {
    background: var(--ahd-success-light);
    color: #065f46;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.ahd-alert-warning {
    background: var(--ahd-warning-light);
    color: #92400e;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* ==================== LINKS ==================== */
/* Links genéricos dentro do app */
.ahd-fullwidth a {
    color: var(--ahd-dark);
    text-decoration: none;
    transition: var(--ahd-transition);
}

.ahd-fullwidth a:hover {
    color: var(--ahd-gray-600);
}

/* Links específicos */
.ahd-link-apelido {
    color: var(--ahd-dark) !important;
    font-weight: 600;
    text-decoration: none !important;
}

.ahd-link-apelido:hover {
    color: var(--ahd-gray-600) !important;
    text-decoration: none !important;
}

/* ==================== VAN INFO ==================== */
.ahd-van-info {
    display: block;
    font-size: 13px;
    color: var(--ahd-gray-500);
    margin-top: 4px;
}

.ahd-page-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ==================== BREADCRUMB ==================== */
.ahd-breadcrumb {
    margin-bottom: 20px;
}

.ahd-breadcrumb a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--ahd-gray-600);
    text-decoration: none;
    transition: var(--ahd-transition);
}

.ahd-breadcrumb a:hover {
    color: var(--ahd-dark);
}

/* ==================== PAGE HEADER ==================== */
.ahd-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.ahd-page-header-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.ahd-page-header-left h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--ahd-dark);
    margin: 0;
}

.ahd-page-header-right {
    display: flex;
    gap: 12px;
}

/* ==================== TIMELINE ==================== */
.ahd-timeline {
    position: relative;
    padding-left: 28px;
}

.ahd-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--ahd-gray-200);
}

.ahd-timeline-item {
    position: relative;
    padding-bottom: 24px;
}

.ahd-timeline-item:last-child {
    padding-bottom: 0;
}

.ahd-timeline-marker {
    position: absolute;
    left: -28px;
    top: 6px;
    width: 18px;
    height: 18px;
    background: var(--ahd-white);
    border: 3px solid var(--ahd-primary);
    border-radius: 50%;
}

.ahd-timeline-content {
    background: var(--ahd-gray-50);
    padding: 16px;
    border-radius: var(--ahd-radius);
    border: 1px solid var(--ahd-gray-200);
}

.ahd-timeline-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.ahd-timeline-date {
    font-size: 13px;
    color: var(--ahd-gray-500);
}

.ahd-timeline-contact {
    font-size: 13px;
    color: var(--ahd-gray-700);
    margin-bottom: 8px;
}

.ahd-timeline-comment {
    font-size: 14px;
    color: var(--ahd-gray-600);
    line-height: 1.6;
}

/* ==================== UTILITIES ==================== */
.ahd-text-muted {
    color: var(--ahd-gray-500);
    font-size: 14px;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .ahd-header-container {
        max-width: 100%;
        padding: 0 16px;
    }
    
    .ahd-container {
        max-width: 100%;
        padding: 0 16px;
    }
    
    .ahd-toolbar {
        gap: 12px;
    }
    
    .ahd-toolbar-top {
        width: 100%;
    }
    
    .ahd-search-box {
        max-width: 100%;
    }
    
    .ahd-search-box input {
        width: 100%;
    }
    
    .ahd-filters {
        gap: 6px;
    }
    
    /* Filtros Mobile: ícones em botões consistentes */
    .ahd-filter-icon {
        display: block !important;
    }
    
    .ahd-filter-text {
        display: none !important;
    }
    
    .ahd-filter-btn {
        width: 38px;
        height: 38px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--ahd-white);
        border: 1px solid var(--ahd-gray-300);
        border-radius: var(--ahd-radius);
    }
    
    .ahd-filter-btn:hover {
        background: var(--ahd-gray-100);
        border-color: var(--ahd-gray-400);
    }
    
    .ahd-filter-btn .ahd-filter-icon {
        color: var(--ahd-gray-500);
    }
    
    .ahd-filter-btn.active {
        background: var(--ahd-dark);
        border-color: var(--ahd-dark);
    }
    
    .ahd-filter-btn.active .ahd-filter-icon {
        color: var(--ahd-primary) !important;
    }
    
    .ahd-page-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .ahd-page-header-right {
        flex-direction: column;
    }
    
    .ahd-page-header-right .ahd-btn {
        justify-content: center;
    }
    
    .ahd-info-grid {
        grid-template-columns: 1fr;
    }
    
    .ahd-info-full {
        grid-column: span 1;
    }
    
    .ahd-form-row {
        grid-template-columns: 1fr;
    }
    
    .ahd-login-card {
        padding: 32px 24px;
    }
    
    .ahd-pagination {
        flex-direction: column;
        gap: 12px;
    }
    
    .ahd-user-name {
        display: none;
    }
    
    /* === MOBILE: Esconder tabela, mostrar cards === */
    .ahd-table-wrapper {
        display: none !important;
    }
    
    .ahd-mobile-list {
        display: block !important;
    }
    
    /* Mobile: Espaçamentos */
    .ahd-container {
        padding: 0 16px !important;
    }
    
    .ahd-main {
        padding: 16px 0 !important;
    }
    
    .ahd-card-body {
        padding: 12px 14px;
    }
    
    .ahd-card-header {
        padding: 6px 14px;
    }
    
    /* Mobile: Fontes menores */
    .ahd-page-title {
        font-size: 18px !important;
    }
    
    .ahd-page-header h1 {
        font-size: 16px !important;
    }
    
    .ahd-info-item label {
        font-size: 10px;
    }
    
    .ahd-info-item span {
        font-size: 13px;
    }
    
    /* Mobile: Info row em coluna */
    .ahd-info-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .ahd-info-row .ahd-info-item,
    .ahd-info-row .ahd-info-item:first-child {
        flex: none;
        min-width: auto;
    }
    
    /* Mobile: Timeline/Histórico - data abaixo do badge */
    .ahd-timeline-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px !important;
    }
    
    .ahd-timeline-date {
        font-size: 11px !important;
    }
    
    .ahd-timeline-content {
        padding: 10px 12px !important;
    }
    
    .ahd-timeline-comment {
        font-size: 12px !important;
    }
    
    .ahd-badge-sm {
        padding: 2px 8px;
        font-size: 10px;
    }
}

/* ==================== MOBILE LIST (Cards) ==================== */
/* Escondido em desktop */
.ahd-mobile-list {
    display: none;
    background: var(--ahd-white);
    border-radius: var(--ahd-radius-lg);
    box-shadow: var(--ahd-shadow);
    border: 1px solid var(--ahd-gray-200);
    padding: 0 16px;
    overflow: hidden;
}

.ahd-mobile-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--ahd-gray-200);
    text-decoration: none !important;
    color: inherit;
    transition: var(--ahd-transition);
}

.ahd-mobile-item:last-child {
    border-bottom: none;
}

.ahd-mobile-item:hover {
    background: var(--ahd-gray-50);
    margin: 0 -16px;
    padding: 14px 16px;
}

.ahd-mobile-item:hover .ahd-mobile-item-arrow {
    color: var(--ahd-dark);
    transform: translateX(3px);
}

.ahd-mobile-item:active {
    background: var(--ahd-gray-100);
    margin: 0 -16px;
    padding: 14px 16px;
}

.ahd-mobile-item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ahd-mobile-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ahd-mobile-item-apelido {
    font-size: 15px;
    font-weight: 600;
    color: var(--ahd-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.ahd-mobile-item-name {
    font-size: 13px;
    color: var(--ahd-gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ahd-mobile-item-dates {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
}

.ahd-mobile-date {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--ahd-gray-500);
}

.ahd-mobile-date-success {
    color: #047857;
}

.ahd-mobile-item-arrow {
    flex-shrink: 0;
    color: var(--ahd-gray-300);
    transition: var(--ahd-transition);
}
