/* ============================================================
   HelpDesk - Base CSS
   Isolamento total do plugin via #hd-app
   ============================================================ */

/* Google Fonts — JetBrains Mono apenas (tabelas) */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap');

/* Reset da página standalone (quando o tema é bypassado) */
body.hd-standalone {
    margin: 0;
    padding: 0;
    background: #f3f4f6;
    min-height: 100vh;
}

body.hd-standalone * {
    box-sizing: border-box;
}

/* CSS Variables - Paleta Applet */
#hd-app {
    --hd-primary:   #fcdd45;
    --hd-dark:      #242424;
    --hd-white:     #fefefe;
    --hd-border:    #d4d8dd;
    --hd-surface:   #f3f4f6;

    /* Derivadas */
    --hd-primary-hover:   #f5d020;
    --hd-text:            #242424;
    --hd-text-muted:      #6b7280;
    --hd-text-light:      #9ca3af;
    --hd-shadow-sm:       0 1px 3px rgba(0,0,0,0.08);
    --hd-shadow:          0 2px 8px rgba(0,0,0,0.1);
    --hd-shadow-lg:       0 8px 24px rgba(0,0,0,0.12);
    --hd-radius:          8px;
    --hd-radius-sm:       5px;
    --hd-radius-lg:       12px;
    --hd-radius-full:     9999px;

    /* Status */
    --hd-success:         #16a34a;
    --hd-success-light:   #dcfce7;
    --hd-danger:          #dc2626;
    --hd-danger-light:    #fee2e2;
    --hd-warning:         #d97706;
    --hd-warning-light:   #fef3c7;
    --hd-info:            #475569;
    --hd-info-light:      #f1f5f9;
    --hd-secondary:       #6b7280;
    --hd-secondary-light: #f3f4f6;

    /* Layout */
    --hd-header-h:        56px;
    --hd-sidebar-w:       220px;
    --hd-container:       1200px;
}

/* Reset isolado — não vaza para fora do wrapper */
#hd-app,
#hd-app * {
    box-sizing: border-box;
}

#hd-app {
    font-size: 13px;
    line-height: 1.5;
    color: var(--hd-text);
    background: var(--hd-surface);
    min-height: 100vh;
    position: relative;
}

/* Neutraliza estilos do tema que podem vazar */
#hd-app h1, #hd-app h2, #hd-app h3,
#hd-app h4, #hd-app h5, #hd-app h6 {
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
    padding: 0;
    border: none;
    color: var(--hd-dark);
}

#hd-app h1 { font-size: 1.4rem; }
#hd-app h2 { font-size: 1.2rem; }
#hd-app h3 { font-size: 1rem; }
#hd-app h4 { font-size: 0.9rem; }

#hd-app a {
    text-decoration: none;
    color: inherit;
}

#hd-app p {
    margin: 0;
}

#hd-app,
#hd-app *:not(td):not(code):not(pre) {
    font-family: "Segoe UI", ui-sans-serif, system-ui, sans-serif !important;
}

#hd-app input,
#hd-app select,
#hd-app textarea,
#hd-app button {
    font-family: "Segoe UI", ui-sans-serif, system-ui, sans-serif !important;
    font-size: 13px;
}

#hd-app ul, #hd-app ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ============================================================
   Layout Principal
   ============================================================ */

#hd-app .hd-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
#hd-app .hd-header {
    height: var(--hd-header-h);
    background: var(--hd-dark);
    color: var(--hd-white);
    display: flex;
    align-items: center;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--hd-shadow);
}

#hd-app .hd-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: var(--hd-container);
    margin: 0 auto;
}

#hd-app .hd-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 15px;
    color: var(--hd-primary);
    letter-spacing: -0.3px;
}

#hd-app .hd-brand svg {
    flex-shrink: 0;
}

#hd-app .hd-header-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

#hd-app .hd-nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--hd-radius-sm);
    color: rgba(255,255,255,0.75);
    font-size: 12.5px;
    font-weight: 500;
    transition: all 0.15s;
    cursor: pointer;
    text-decoration: none;
}

/* Ícones do nav: amarelo quando inativo */
#hd-app .hd-nav-link svg {
    color: var(--hd-primary);
    flex-shrink: 0;
}

#hd-app .hd-nav-link:hover {
    color: var(--hd-white);
    background: rgba(255,255,255,0.08);
}

#hd-app .hd-nav-link:hover svg {
    color: var(--hd-white);
}

#hd-app .hd-nav-link.active {
    color: var(--hd-dark);
    background: var(--hd-primary);
}

/* Ícones escuros quando ativo (fundo amarelo) */
#hd-app .hd-nav-link.active svg {
    color: var(--hd-dark);
}

#hd-app .hd-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Badge de notificações */
#hd-app .hd-notif-btn {
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

#hd-app .hd-notif-btn:hover {
    background: rgba(255,255,255,0.15);
    color: var(--hd-white);
}

#hd-app .hd-notif-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: var(--hd-danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 10px;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    border: 2px solid var(--hd-dark);
}

/* Shake animation when has notifications */
#hd-app .hd-notif-btn.hd-has-notif svg {
    animation: hd-bell-shake 3s ease-in-out infinite;
    transform-origin: top center;
}

@keyframes hd-bell-shake {
    0%, 80%, 100% { transform: rotate(0); }
    83% { transform: rotate(12deg); }
    86% { transform: rotate(-10deg); }
    89% { transform: rotate(8deg); }
    92% { transform: rotate(-6deg); }
    95% { transform: rotate(3deg); }
    97% { transform: rotate(-1deg); }
}

/* Avatar do usuário */
#hd-app .hd-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--hd-primary);
    color: var(--hd-dark);
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    border: 2px solid var(--hd-primary);
}

/* Dropdown do usuário */
#hd-app .hd-user-dropdown {
    position: relative;
}

#hd-app .hd-user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--hd-white);
    border: 1px solid var(--hd-border);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    min-width: 220px;
    z-index: 200;
    display: none;
    overflow: hidden;
}

#hd-app .hd-user-menu.open {
    display: block;
}

#hd-app .hd-user-menu-header {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--hd-border);
}

#hd-app .hd-user-menu-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--hd-surface);
    border: 2px solid var(--hd-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: var(--hd-dark);
    flex-shrink: 0;
    overflow: hidden;
}

#hd-app .hd-user-menu-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--hd-dark);
}

#hd-app .hd-user-menu-email {
    font-size: 11px;
    color: var(--hd-text-muted);
    margin-top: 2px;
}

#hd-app .hd-user-menu a,
#hd-app .hd-user-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    font-size: 13px;
    color: var(--hd-text);
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
    text-decoration: none;
}

#hd-app .hd-user-menu a:hover,
#hd-app .hd-user-menu button:hover {
    background: var(--hd-surface);
}

#hd-app .hd-user-menu .hd-menu-danger {
    color: var(--hd-danger);
    border-top: 1px solid var(--hd-border);
}

/* Main content */
#hd-app .hd-main {
    flex: 1;
    padding: 20px;
}

#hd-app .hd-container {
    max-width: var(--hd-container);
    margin: 0 auto;
}

/* ============================================================
   Cards
   ============================================================ */

#hd-app .hd-card {
    background: var(--hd-white);
    border: 1px solid var(--hd-border);
    border-radius: var(--hd-radius);
    box-shadow: var(--hd-shadow-sm);
    overflow: hidden;
}

#hd-app .hd-card-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--hd-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--hd-white);
}

#hd-app .hd-card-header h3 {
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

#hd-app .hd-card-body {
    padding: 16px;
}

#hd-app .hd-card-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--hd-border);
    background: var(--hd-surface);
}

/* ============================================================
   Botões
   ============================================================ */

#hd-app .hd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--hd-radius-sm);
    font-size: 12.5px;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
    outline: none;
}

#hd-app a:focus,
#hd-app button:focus,
#hd-app select:focus,
#hd-app .hd-btn:focus,
#hd-app .hd-tab-btn:focus,
#hd-app .hd-nav-link:focus {
    outline: none;
}

#hd-app .hd-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

#hd-app .hd-btn-primary {
    background: var(--hd-primary);
    color: var(--hd-dark);
    border-color: var(--hd-primary);
}

#hd-app .hd-btn-primary:hover:not(:disabled) {
    background: var(--hd-primary-hover);
    border-color: var(--hd-primary-hover);
}

#hd-app .hd-btn-secondary {
    background: var(--hd-white);
    color: var(--hd-text);
    border-color: var(--hd-border);
}

#hd-app .hd-btn-secondary:hover:not(:disabled) {
    background: var(--hd-surface);
}

#hd-app .hd-btn-danger {
    background: var(--hd-danger);
    color: #fff;
    border-color: var(--hd-danger);
}

#hd-app .hd-btn-ghost {
    background: transparent;
    color: var(--hd-text-muted);
    border-color: transparent;
}

#hd-app .hd-btn-ghost:hover {
    background: var(--hd-surface);
    color: var(--hd-text);
}

#hd-app .hd-btn-sm {
    padding: 5px 10px;
    font-size: 11.5px;
}

#hd-app .hd-btn-lg {
    padding: 10px 20px;
    font-size: 14px;
}

#hd-app .hd-btn-block {
    width: 100%;
}

#hd-app .hd-btn-icon {
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: var(--hd-radius-sm);
    border: 1px solid var(--hd-border);
    background: var(--hd-white);
    color: var(--hd-text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    text-decoration: none;
}

#hd-app .hd-btn-icon:hover {
    background: var(--hd-surface);
    color: var(--hd-text);
    border-color: var(--hd-text-muted);
}

/* ============================================================
   Formulários
   ============================================================ */

#hd-app .hd-form-group {
    margin-bottom: 14px;
}

#hd-app .hd-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--hd-text);
    margin-bottom: 5px;
}

#hd-app .hd-label .hd-required {
    color: var(--hd-danger);
    margin-left: 2px;
}

#hd-app .hd-input,
#hd-app .hd-select,
#hd-app .hd-textarea {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--hd-border);
    border-radius: var(--hd-radius-sm);
    background: var(--hd-white);
    color: var(--hd-text);
    font-size: 13px;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}

#hd-app select.hd-input,
#hd-app select.hd-select,
#hd-app .hd-input[type="select"] {
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

#hd-app select.hd-input option,
#hd-app select.hd-select option,
#hd-app .hd-select option {
    min-width: 0;
    width: 100%;
    padding: 4px 10px;
}

#hd-app select.hd-input optgroup,
#hd-app select.hd-select optgroup,
#hd-app .hd-select optgroup {
    width: 100%;
}

#hd-app .hd-input:focus,
#hd-app .hd-select:focus,
#hd-app .hd-textarea:focus {
    border-color: #9ca3af;
    box-shadow: 0 0 0 2px rgba(156, 163, 175, 0.15);
}

#hd-app .hd-input::placeholder,
#hd-app .hd-textarea::placeholder {
    color: var(--hd-text-light);
}

#hd-app .hd-textarea {
    resize: vertical;
    min-height: 80px;
}

#hd-app .hd-input-hint {
    font-size: 11px;
    color: var(--hd-text-muted);
    margin-top: 4px;
}

#hd-app .hd-form-row {
    display: grid;
    gap: 12px;
}

#hd-app .hd-form-row.cols-2 { grid-template-columns: 1fr 1fr; }
#hd-app .hd-form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

#hd-app .hd-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--hd-border);
    margin-top: 16px;
}

/* Checkbox e Radio */
#hd-app .hd-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
}

#hd-app .hd-checkbox-label input[type="checkbox"],
#hd-app .hd-checkbox-label input[type="radio"] {
    width: 15px;
    height: 15px;
    accent-color: var(--hd-dark);
    cursor: pointer;
}

/* ============================================================
   Badges / Status
   ============================================================ */

#hd-app .hd-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--hd-radius-full);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.6;
    white-space: nowrap;
}

/* Status badges — paleta de cores por status */
#hd-app .hd-badge-success   { background: #dcfce7; color: #16a34a; }   /* Concluído — verde */
#hd-app .hd-badge-danger    { background: #fee2e2; color: #dc2626; }   /* Cancelado — vermelho claro */
#hd-app .hd-badge-danger-dk { background: #fecaca; color: #991b1b; }   /* Excluído — vermelho escuro */
#hd-app .hd-badge-warning   { background: #fef9c3; color: #ca8a04; }   /* Agendado — amarelo */
#hd-app .hd-badge-orange    { background: #ffedd5; color: #c2410c; }   /* Reagendado — laranja */
#hd-app .hd-badge-info      { background: #dbeafe; color: #1d4ed8; }   /* Aberto — azul */
#hd-app .hd-badge-secondary { background: #e5e7eb; color: #4b5563; }   /* Contato — cinza */
#hd-app .hd-badge-primary   { background: var(--hd-primary); color: var(--hd-dark); }

/* JetBrains Mono nos badges e coluna apelido */
#hd-app .hd-badge,
#hd-app .hd-apelido-text,
#hd-app .hd-apelido-cell strong,
#hd-app .hd-filho-tag {
    font-family: 'JetBrains Mono', monospace !important;
}

/* Remove itálico do optgroup (padrão do navegador) */
#hd-app optgroup {
    font-style: normal !important;
    font-weight: 700;
}

#hd-app .hd-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

#hd-app .hd-dot-success   { background: var(--hd-success); }
#hd-app .hd-dot-danger    { background: var(--hd-danger); }
#hd-app .hd-dot-warning   { background: var(--hd-warning); }
#hd-app .hd-dot-secondary { background: var(--hd-text-light); }

/* ============================================================
   Alertas
   ============================================================ */

#hd-app .hd-alert {
    padding: 10px 14px;
    border-radius: var(--hd-radius-sm);
    font-size: 13px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 14px;
    border: 1px solid transparent;
    line-height: 1.5;
}

#hd-app .hd-alert > svg {
    flex-shrink: 0;
    margin-top: 2px;
}

#hd-app .hd-alert > span {
    flex: 1;
    min-width: 0;
}

#hd-app .hd-alert-success { background: var(--hd-success-light); color: var(--hd-success); border-color: #bbf7d0; }
#hd-app .hd-alert-danger  { background: var(--hd-danger-light); color: var(--hd-danger); border-color: #fecaca; }
#hd-app .hd-alert-warning { background: var(--hd-warning-light); color: var(--hd-warning); border-color: #fde68a; }
#hd-app .hd-alert-info    { background: var(--hd-info-light); color: var(--hd-info); border-color: #cbd5e1; }
#hd-app .hd-alert-applet  { background: #fef9c3; color: #242424; border: 1px solid #fde68a; border-left: 4px solid #242424; }

/* ============================================================
   Tabela
   ============================================================ */

#hd-app .hd-table-wrap {
    overflow-x: auto;
    border-radius: var(--hd-radius);
}

#hd-app .hd-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

#hd-app .hd-table th {
    background: var(--hd-surface);
    color: var(--hd-text-muted);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 9px 12px;
    text-align: left;
    border-bottom: 1px solid var(--hd-border);
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
}

#hd-app .hd-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--hd-surface);
    vertical-align: middle;
    color: var(--hd-text);
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 12px;
}

#hd-app .hd-table td * {
    font-family: 'JetBrains Mono', monospace !important;
}

#hd-app .hd-table tr:last-child td {
    border-bottom: none;
}

#hd-app .hd-table tbody tr:hover td {
    background: #fafafa;
}

#hd-app .hd-table-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

/* ============================================================
   Paginação
   ============================================================ */

#hd-app .hd-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-top: 1px solid var(--hd-border);
    font-size: 12px;
    color: var(--hd-text-muted);
    flex-wrap: wrap;
    gap: 8px;
}

#hd-app .hd-pagination-links {
    display: flex;
    gap: 4px;
    align-items: center;
}

#hd-app .hd-page-btn {
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border-radius: var(--hd-radius-sm);
    border: 1px solid var(--hd-border);
    background: var(--hd-white);
    color: var(--hd-text-muted);
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.1s;
}

#hd-app .hd-page-btn:hover {
    border-color: var(--hd-primary);
    color: var(--hd-dark);
}

#hd-app .hd-page-btn.active {
    background: var(--hd-dark);
    border-color: var(--hd-dark);
    color: var(--hd-white);
}

#hd-app .hd-page-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* ============================================================
   Toast / Notificações
   ============================================================ */

#hd-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.hd-toast {
    pointer-events: all;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08), 0 4px 24px rgba(0,0,0,0.06);
    font-size: 13px;
    max-width: 380px;
    min-width: 300px;
    animation: hd-toast-in 0.3s ease;
    background: #fff;
    border: 1px solid #e5e7eb;
    position: relative;
}

.hd-toast-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hd-toast-body {
    flex: 1;
    min-width: 0;
    padding-top: 2px;
}

.hd-toast-title {
    font-weight: 700;
    font-size: 13.5px;
    margin-bottom: 3px;
    color: #1f2937;
}

.hd-toast-msg {
    font-size: 12.5px;
    color: #6b7280;
    line-height: 1.4;
}

.hd-toast-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    padding: 2px;
    line-height: 1;
    font-size: 14px;
    transition: color 0.15s;
}
.hd-toast-close:hover { color: #374151; }

.hd-toast-success .hd-toast-icon { background: #16a34a; color: #fff; }
.hd-toast-success .hd-toast-title { color: #15803d; }

.hd-toast-error .hd-toast-icon { background: #dc2626; color: #fff; }
.hd-toast-error .hd-toast-title { color: #b91c1c; }

.hd-toast-warning .hd-toast-icon { background: #f59e0b; color: #fff; }
.hd-toast-warning .hd-toast-title { color: #92400e; }

.hd-toast-info .hd-toast-icon { background: #3b82f6; color: #fff; }
.hd-toast-info .hd-toast-title { color: #1d4ed8; }

.hd-toast svg {
    flex-shrink: 0;
}

@keyframes hd-toast-in {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Loading overlay
   ============================================================ */

#hd-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.6);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(1px);
}

#hd-app .hd-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--hd-border);
    border-top-color: var(--hd-dark);
    border-radius: 50%;
    animation: hd-spin 0.7s linear infinite;
}

@keyframes hd-spin {
    to { transform: rotate(360deg); }
}

/* Button loading state — spinner overlay sem deformar */
#hd-app .hd-btn-loading {
    position: relative;
    pointer-events: none;
}

#hd-app .hd-btn-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: inherit;
    border-radius: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
}

#hd-app .hd-btn-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: hd-spin 0.7s linear infinite;
    z-index: 2;
}

/* ============================================================
   Tela de Login
   ============================================================ */

#hd-app .hd-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hd-surface);
    padding: 20px;
}

#hd-app .hd-login-card {
    background: var(--hd-white);
    border: 1px solid var(--hd-border);
    border-radius: var(--hd-radius-lg);
    box-shadow: var(--hd-shadow-lg);
    width: 100%;
    max-width: 380px;
    padding: 32px;
}

#hd-app .hd-login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 8px;
}

#hd-app .hd-login-logo-icon {
    width: 40px;
    height: 40px;
    background: var(--hd-primary);
    border-radius: var(--hd-radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

#hd-app .hd-login-logo-text {
    font-size: 20px;
    font-weight: 800;
    color: var(--hd-dark);
    letter-spacing: -0.5px;
}

#hd-app .hd-login-title {
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    color: var(--hd-dark);
    margin-bottom: 4px;
}

#hd-app .hd-login-subtitle {
    font-size: 12.5px;
    text-align: center;
    color: var(--hd-text-muted);
    margin-bottom: 24px;
}

#hd-app .hd-login-input-wrap {
    position: relative;
}

#hd-app .hd-login-input-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--hd-text-light);
    pointer-events: none;
}

#hd-app .hd-login-input-wrap .hd-input {
    padding-left: 34px;
}

#hd-app .hd-login-footer {
    text-align: center;
    font-size: 11px;
    color: var(--hd-text-light);
    margin-top: 20px;
}

#hd-app .hd-forgot-link {
    display: block;
    text-align: center;
    font-size: 12px;
    color: var(--hd-text-muted);
    margin-top: 10px;
    cursor: pointer;
    transition: color 0.15s;
}

#hd-app .hd-forgot-link:hover {
    color: var(--hd-dark);
}

/* Spinner inline no botão */
#hd-app .hd-btn-spinner {
    flex-shrink: 0;
}

/* ============================================================
   Page header
   ============================================================ */

#hd-app .hd-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

#hd-app .hd-page-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--hd-dark);
}

#hd-app .hd-page-subtitle {
    font-size: 12px;
    color: var(--hd-text-muted);
    margin-top: 2px;
}

/* ============================================================
   Stats cards
   ============================================================ */

#hd-app .hd-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

#hd-app .hd-stat-card {
    background: var(--hd-white);
    border: 1px solid var(--hd-border);
    border-radius: var(--hd-radius);
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--hd-shadow-sm);
}

#hd-app .hd-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--hd-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#hd-app .hd-stat-value {
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    color: var(--hd-dark);
}

#hd-app .hd-stat-label {
    font-size: 11px;
    color: var(--hd-text-muted);
    margin-top: 2px;
    font-weight: 500;
}

#hd-app .hd-stat-warning .hd-stat-icon { background: var(--hd-warning-light); color: var(--hd-warning); }
#hd-app .hd-stat-success .hd-stat-icon { background: var(--hd-success-light); color: var(--hd-success); }
#hd-app .hd-stat-info    .hd-stat-icon { background: var(--hd-info-light); color: var(--hd-info); }
#hd-app .hd-stat-danger  .hd-stat-icon { background: var(--hd-danger-light); color: var(--hd-danger); }
#hd-app .hd-stat-primary .hd-stat-icon { background: var(--hd-primary); color: var(--hd-dark); }

/* ============================================================
   Empty state
   ============================================================ */

#hd-app .hd-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--hd-text-muted);
}

#hd-app .hd-empty svg {
    color: var(--hd-border);
    margin-bottom: 12px;
}

#hd-app .hd-empty h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--hd-text);
    margin-bottom: 6px;
}

#hd-app .hd-empty p {
    font-size: 12.5px;
}

/* ============================================================
   Toolbar / Filtros
   ============================================================ */

#hd-app .hd-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

#hd-app .hd-search-box {
    position: relative;
    display: flex;
    align-items: center;
}

#hd-app .hd-search-icon {
    position: absolute;
    left: 10px;
    color: var(--hd-text-light);
    pointer-events: none;
}

#hd-app .hd-search-box .hd-input {
    padding-left: 32px;
    width: 220px;
}

#hd-app .hd-search-clear {
    position: absolute;
    right: 8px;
    color: var(--hd-text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
}

#hd-app .hd-search-clear:hover {
    color: var(--hd-text);
}

/* Autocomplete dropdown */
#hd-app .hd-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--hd-white);
    border: 1px solid var(--hd-border);
    border-top: none;
    border-radius: 0 0 var(--hd-radius-sm) var(--hd-radius-sm);
    max-height: 200px;
    overflow-y: auto;
    z-index: 999;
    box-shadow: var(--hd-shadow);
    display: none;
}

#hd-app .hd-autocomplete.open {
    display: block;
}

#hd-app .hd-autocomplete-item {
    padding: 9px 12px;
    cursor: pointer;
    font-size: 12.5px;
    border-bottom: 1px solid var(--hd-surface);
    transition: background 0.1s;
}

#hd-app .hd-autocomplete-item:hover {
    background: var(--hd-surface);
}

#hd-app .hd-autocomplete-item:last-child {
    border-bottom: none;
}

#hd-app .hd-autocomplete-apelido {
    font-weight: 600;
    color: var(--hd-dark);
}

#hd-app .hd-autocomplete-sub {
    font-size: 11px;
    color: var(--hd-text-muted);
    margin-top: 1px;
}

/* ============================================================
   Modal
   ============================================================ */

#hd-app .hd-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#hd-app .hd-modal {
    background: var(--hd-white);
    border-radius: var(--hd-radius-lg);
    box-shadow: var(--hd-shadow-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#hd-app .hd-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--hd-border);
}

#hd-app .hd-modal-title {
    font-size: 15px;
    font-weight: 700;
}

#hd-app .hd-modal-close {
    width: 28px;
    height: 28px;
    border-radius: var(--hd-radius-sm);
    border: 1px solid var(--hd-border);
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--hd-text-muted);
    transition: all 0.15s;
}

#hd-app .hd-modal-close:hover {
    background: var(--hd-surface);
    color: var(--hd-text);
}

#hd-app .hd-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

#hd-app .hd-modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--hd-border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    background: var(--hd-surface);
}

/* ============================================================
   Dropdown menu
   ============================================================ */

#hd-app .hd-dropdown {
    position: relative;
}

#hd-app .hd-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: var(--hd-white);
    border: 1px solid var(--hd-border);
    border-radius: var(--hd-radius);
    box-shadow: var(--hd-shadow-lg);
    min-width: 180px;
    z-index: 100;
    overflow: hidden;
    display: none;
}

#hd-app .hd-dropdown-menu.open {
    display: block;
}

#hd-app .hd-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    font-size: 12.5px;
    color: var(--hd-text);
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    text-decoration: none;
    transition: background 0.1s;
}

#hd-app .hd-dropdown-item:hover {
    background: var(--hd-surface);
}

#hd-app .hd-dropdown-divider {
    height: 1px;
    background: var(--hd-border);
    margin: 4px 0;
}

/* ============================================================
   File upload
   ============================================================ */

#hd-app .hd-file-upload {
    position: relative;
}

#hd-app .hd-file-upload input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

#hd-app .hd-file-drop {
    border: 2px dashed var(--hd-border);
    border-radius: var(--hd-radius);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    color: var(--hd-text-muted);
    font-size: 13px;
}

#hd-app .hd-file-drop:hover {
    border-color: var(--hd-primary);
    background: rgba(252, 221, 69, 0.05);
}

#hd-app .hd-file-drop.has-file {
    border-color: var(--hd-success);
    color: var(--hd-success);
}

/* ============================================================
   Responsivo
   ============================================================ */

@media (max-width: 768px) {
    #hd-app .hd-main {
        padding: 12px;
    }

    #hd-app .hd-form-row.cols-2,
    #hd-app .hd-form-row.cols-3 {
        grid-template-columns: 1fr;
    }

    #hd-app .hd-table-wrap {
        font-size: 12px;
    }

    #hd-app .hd-stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    #hd-app .hd-header-nav {
        display: none;
    }

    #hd-app .hd-modal {
        max-width: 100%;
        margin: 0;
        border-radius: var(--hd-radius-lg) var(--hd-radius-lg) 0 0;
        align-self: flex-end;
        max-height: 85vh;
    }

    #hd-app .hd-search-box .hd-input {
        width: 160px;
    }
}

/* ============================================================
   Painel de notificações (popup do header)
   ============================================================ */

#hd-notif-panel,
#hdNotifPanel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 340px;
    background: var(--hd-white);
    border: 1px solid var(--hd-border);
    border-radius: var(--hd-radius);
    box-shadow: var(--hd-shadow-lg);
    z-index: 200;
    overflow: hidden;
    font-size: 13px;
}

/* ============================================================
   Campos disabled — cinza padrão
   ============================================================ */

#hd-app .hd-input:disabled,
#hd-app .hd-select:disabled,
#hd-app .hd-textarea:disabled,
#hd-app input:disabled,
#hd-app select:disabled,
#hd-app textarea:disabled {
    background: var(--hd-surface);
    color: var(--hd-text-muted);
    cursor: not-allowed;
    border-color: var(--hd-border);
    opacity: 1;
}

/* ============================================================
   Card footer (botões)
   ============================================================ */

#hd-app .hd-card-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--hd-border);
    background: var(--hd-surface);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

#hd-app .hd-card-footer.hd-card-footer--between {
    justify-content: space-between;
}

/* ============================================================
   Mobile — grids colapsam para 1 coluna
   ============================================================ */

@media (max-width: 768px) {
    /* Grids de 2 colunas dos cards de chamado */
    #hd-app [style*="grid-template-columns: 1fr 1fr"],
    #hd-app [style*="grid-template-columns:1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Info grid dentro dos cards */
    #hd-app .hd-info-grid {
        grid-template-columns: 1fr !important;
    }

    #hd-app .hd-info-item.full {
        grid-column: 1 !important;
    }

    /* Stats */
    #hd-app .hd-stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* Toolbar */
    #hd-app .hd-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Page header */
    #hd-app .hd-page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Form rows */
    #hd-app .hd-form-row.cols-2,
    #hd-app .hd-form-row.cols-3 {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Ícones do header — forçar cor via atributo (SVGs com cores hardcoded)
   ============================================================ */

/* Nav links: ícones amarelos quando inativos */
#hd-app .hd-header-nav .hd-nav-link path[stroke="#000000"],
#hd-app .hd-header-nav .hd-nav-link circle[stroke="#000000"],
#hd-app .hd-header-nav .hd-nav-link rect[stroke="#000000"] {
    stroke: var(--hd-primary) !important;
}

#hd-app .hd-header-nav .hd-nav-link path[fill="#000000"],
#hd-app .hd-header-nav .hd-nav-link circle[fill="#000000"] {
    fill: var(--hd-primary) !important;
}

/* Nav links ativos: ícones escuros (fundo amarelo) */
#hd-app .hd-header-nav .hd-nav-link.active path[stroke="#000000"],
#hd-app .hd-header-nav .hd-nav-link.active circle[stroke="#000000"] {
    stroke: var(--hd-dark) !important;
}

#hd-app .hd-header-nav .hd-nav-link.active path[fill="#000000"],
#hd-app .hd-header-nav .hd-nav-link.active circle[fill="#000000"] {
    fill: var(--hd-dark) !important;
}

/* Ícones do header right (notif, avatar dropdown) */
#hd-app .hd-header-right path[stroke="#000000"],
#hd-app .hd-header-right circle[stroke="#000000"] {
    stroke: rgba(255,255,255,0.75) !important;
}

#hd-app .hd-header-right path[fill="#000000"],
#hd-app .hd-header-right circle[fill="#000000"] {
    fill: rgba(255,255,255,0.75) !important;
}

/* Fallback geral para qualquer ícone com fill currentColor */
#hd-app .hd-header-nav .hd-nav-link svg {
    overflow: visible;
}

/* ============================================================
   Vinculação: seção técnico (ajuste visual)
   ============================================================ */

#hd-app .hd-vinc-section {
    background: var(--hd-surface);
    border: 1px solid var(--hd-border);
    border-radius: var(--hd-radius);
    overflow: hidden;
}

#hd-app .hd-vinc-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--hd-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#hd-app .hd-vinc-header h3 {
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

#hd-app .hd-vinc-body {
    padding: 16px;
}

#hd-app .hd-vinc-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--hd-border);
    background: var(--hd-white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

#hd-app .hd-filho-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--hd-dark);
    color: var(--hd-primary);
    border-radius: var(--hd-radius-sm);
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    margin: 3px;
}

#hd-app .hd-filho-tag button {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(252,221,69,0.6);
    padding: 0;
    line-height: 1;
    font-size: 14px;
    display: flex;
    align-items: center;
    transition: color 0.15s;
}

#hd-app .hd-filho-tag button:hover {
    color: var(--hd-primary);
}

#hd-app .hd-filhos-tags {
    min-height: 36px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 4px 0;
    gap: 2px;
}

/* ============================================================
   CXA dot ao lado do CTRL/REQ (inline)
   ============================================================ */

#hd-app .hd-ctrl-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'JetBrains Mono', monospace !important;
}

/* ============================================================
   Filhos na lista de chamados — collapse inline
   ============================================================ */

#hd-app .hd-tr-filho {
    background: #fffdf0;
}

#hd-app .hd-tr-filho td {
    border-bottom: 1px solid #fef9c3;
    font-size: 12px;
}

#hd-app .hd-filho-row-apelido {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--hd-text-muted);
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 12px;
}

#hd-app .hd-filho-row-apelido::before {
    content: "└";
    color: var(--hd-border);
    font-size: 14px;
    line-height: 1;
}

/* ============================================================
   Expand button (lista de chamados - pai/filho)
   ============================================================ */

#hd-app .hd-apelido-cell {
    display: flex;
    align-items: center;
    gap: 6px;
}

#hd-app .hd-expand-btn {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid var(--hd-border);
    background: var(--hd-white);
    color: var(--hd-text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
    padding: 0;
}

#hd-app .hd-expand-btn:hover:not(.disabled) {
    background: var(--hd-primary);
    color: var(--hd-dark);
    border-color: var(--hd-primary);
}

#hd-app .hd-expand-btn.disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

#hd-app .hd-expand-btn.expanded {
    background: var(--hd-dark);
    color: var(--hd-primary);
    border-color: var(--hd-dark);
}

#hd-app .hd-children-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    background: var(--hd-primary);
    color: var(--hd-dark);
    font-size: 10px;
    font-weight: 700;
    border-radius: var(--hd-radius-full);
    padding: 0 3px;
}

#hd-app .hd-children-cell {
    padding: 0 !important;
    background: #fffdf0;
}

/* Child icon in listing */
#hd-app .hd-child-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Details row under main row */
#hd-app .hd-tr-details td {
    font-family: inherit !important;
}

/* Filhos na lista de chamados — collapse inline */
#hd-app .hd-tr-filho {
    background: #fffdf0;
}
#hd-app .hd-tr-filho td {
    border-bottom: 1px solid #fef9c3;
    font-size: 12px;
}
#hd-app .hd-filho-row-apelido {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--hd-text-muted);
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 12px;
}
#hd-app .hd-filho-row-apelido::before {
    content: "└";
    color: var(--hd-border);
    font-size: 14px;
    line-height: 1;
}

/* Timeline */
#hd-app .hd-timeline { padding: 0; }
#hd-app .hd-timeline-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--hd-border);
}
#hd-app .hd-timeline-item:last-child { border-bottom: none; }
#hd-app .hd-timeline-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--hd-primary);
    flex-shrink: 0;
    margin-top: 6px;
}
#hd-app .hd-timeline-content { flex: 1; min-width: 0; }
#hd-app .hd-timeline-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
#hd-app .hd-timeline-date {
    font-size: 12px;
    color: var(--hd-text-muted);
}
#hd-app .hd-timeline-comment {
    font-size: 13px;
    color: var(--hd-text);
    margin-top: 6px;
    line-height: 1.5;
    background: #fafafa;
    padding: 8px 10px;
    border-radius: var(--hd-radius-sm);
    border: 1px solid var(--hd-border);
}

/* Stacked data in table cells */
#hd-app .hd-td-sub {
    font-size: 11px;
    color: var(--hd-text-light);
    margin-top: 1px;
    line-height: 1.3;
}

/* ============================================================
   Footer
   ============================================================ */
#hd-app .hd-footer {
    border-top: 1px solid var(--hd-border);
    background: var(--hd-white);
    width: 100%;
    position: sticky;
    bottom: 0;
    z-index: 50;
}

#hd-app .hd-footer-inner {
    max-width: var(--hd-container);
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: 11px;
    color: var(--hd-text-light);
}

#hd-app .hd-footer-links {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

#hd-app .hd-footer-links a {
    color: var(--hd-text-muted);
    text-decoration: none;
    transition: color 0.15s;
}

#hd-app .hd-footer-links a:hover {
    color: var(--hd-dark);
}

#hd-app .hd-footer-version {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--hd-text-light);
    opacity: 0.6;
}

/* Profile avatar */
#hd-app .hd-profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--hd-surface);
    border: 3px solid var(--hd-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 24px;
    color: var(--hd-dark);
    overflow: hidden;
    flex-shrink: 0;
}

#hd-app .hd-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== Drawer ===== */
#hd-app .hd-drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
#hd-app .hd-drawer-backdrop.active {
    opacity: 1;
    visibility: visible;
}
#hd-app .hd-drawer {
    position: fixed;
    top: 0;
    right: -480px;
    width: 480px;
    max-width: 100%;
    height: 100%;
    background: var(--hd-surface);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    transition: right 0.3s ease;
}
#hd-app .hd-drawer.active {
    right: 0;
}
#hd-app .hd-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--hd-border);
    background: var(--hd-white);
}
#hd-app .hd-drawer-header h3 {
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}
#hd-app .hd-drawer-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--hd-text-muted);
    padding: 4px;
    border-radius: var(--hd-radius-sm);
    transition: color 0.15s, background 0.15s;
}
#hd-app .hd-drawer-close:hover {
    color: var(--hd-danger);
    background: var(--hd-danger-light);
}
#hd-app .hd-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}
#hd-app .hd-drawer-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--hd-border);
    background: var(--hd-white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
@media (max-width: 520px) {
    #hd-app .hd-drawer {
        width: 100%;
        right: -100%;
    }
}
