:root {
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-primary-light: #dbeafe;
    --color-bg: #f8fafc;
    --color-bg-secondary: #f1f5f9;
    --color-text: #0f172a;
    --color-text-light: #475569;
    --color-border: #e2e8f0;
    --color-success: #22c55e;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--color-bg); color: var(--color-text); line-height: 1.6; }

/* Auth */
.auth-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%); padding: 20px; }
.auth-box { background: var(--color-white); padding: 40px; border-radius: 16px; width: 100%; max-width: 420px; box-shadow: var(--shadow-lg); }
.auth-logo { text-align: center; margin-bottom: 32px; }
.logo-icon { width: 56px; height: 56px; background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover)); border-radius: 12px; display: flex; align-items: center; justify-content: center; color: white; font-size: 28px; font-weight: bold; margin: 0 auto 12px; }
.auth-title { font-size: 28px; font-weight: 700; color: var(--color-text); }
.auth-subtitle { color: var(--color-text-light); margin-top: 4px; }
.auth-footer { text-align: center; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--color-border); }
.auth-footer a { color: var(--color-primary); text-decoration: none; font-weight: 500; }
.auth-footer a:hover { text-decoration: underline; }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-label { display: block; margin-bottom: 8px; font-weight: 500; font-size: 14px; color: var(--color-text); }
.form-input, .form-select { width: 100%; padding: 12px 16px; border: 1px solid var(--color-border); border-radius: 8px; font-size: 14px; transition: all 0.2s ease; background: var(--color-white); }
.form-input:focus, .form-select:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
textarea.form-input { resize: vertical; min-height: 100px; }

/* Buttons */
.btn { padding: 12px 24px; border: none; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.2s ease; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-primary { background: var(--color-primary); color: white; }
.btn-primary:hover { background: var(--color-primary-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-secondary { background: var(--color-bg-secondary); color: var(--color-text); }
.btn-secondary:hover { background: var(--color-border); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 13px; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; font-size: 14px; }
.alert-error { background: #fee2e2; color: var(--color-danger); }
.alert-success { background: #dcfce7; color: var(--color-success); }

/* Header */
.header { background: var(--color-white); border-bottom: 1px solid var(--color-border); padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100; }
.header-left { display: flex; align-items: center; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; }
.logo .logo-icon { width: 36px; height: 36px; font-size: 18px; }
.header-right { display: flex; align-items: center; gap: 16px; }
.user-name { font-weight: 500; color: var(--color-text-light); }

/* Main Content */
.main-content { max-width: 900px; margin: 0 auto; padding: 32px 24px; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; flex-wrap: wrap; gap: 16px; }
.page-title { font-size: 28px; font-weight: 700; margin-bottom: 4px; }
.page-subtitle { color: var(--color-text-light); }

/* Tabs */
.tabs { display: flex; gap: 8px; margin-bottom: 24px; border-bottom: 1px solid var(--color-border); padding-bottom: 0; }
.tab { padding: 12px 20px; background: none; border: none; font-size: 14px; font-weight: 500; color: var(--color-text-light); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all 0.2s ease; display: flex; align-items: center; gap: 8px; }
.tab:hover { color: var(--color-text); }
.tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.tab-count { background: var(--color-bg-secondary); padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.tab.active .tab-count { background: var(--color-primary-light); color: var(--color-primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Tickets List */
.tickets-list { display: flex; flex-direction: column; gap: 12px; }
.ticket-card { background: var(--color-white); border: 1px solid var(--color-border); border-radius: 12px; padding: 20px; cursor: pointer; transition: all 0.2s ease; }
.ticket-card:hover { border-color: var(--color-primary); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.ticket-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; gap: 12px; }
.ticket-id { font-size: 13px; color: var(--color-text-light); font-weight: 500; }
.ticket-titulo { font-size: 16px; font-weight: 600; margin-bottom: 8px; color: var(--color-text); }
.ticket-descricao { font-size: 14px; color: var(--color-text-light); margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ticket-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.ticket-meta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.ticket-data { font-size: 13px; color: var(--color-text-light); }

/* Badges */
.badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.badge-aberto, .badge-blue { background: var(--color-primary-light); color: var(--color-primary); }
.badge-andamento { background: #fef3c7; color: #d97706; }
.badge-pendente, .badge-orange { background: #fed7aa; color: var(--color-warning); }
.badge-fechado, .badge-green { background: #dcfce7; color: var(--color-success); }
.badge-alta, .badge-red { background: #fee2e2; color: var(--color-danger); }
.badge-media { background: #fef3c7; color: #d97706; }
.badge-baixa, .badge-gray { background: #f3f4f6; color: #6b7280; }

/* Empty State */
.empty-state { text-align: center; padding: 60px 20px; background: var(--color-white); border-radius: 12px; border: 1px solid var(--color-border); }
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; margin-bottom: 8px; }
.empty-state p { color: var(--color-text-light); margin-bottom: 20px; }

/* Modal */
.modal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.5); z-index: 1000; align-items: center; justify-content: center; padding: 20px; }
.modal.active { display: flex; }
.modal-content { background: var(--color-white); border-radius: 16px; width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; animation: modalIn 0.3s ease; }
.modal-lg { max-width: 700px; }
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(-10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--color-border); display: flex; justify-content: space-between; align-items: center; }
.modal-title { font-size: 18px; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 28px; cursor: pointer; color: var(--color-text-light); line-height: 1; padding: 0; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 8px; }
.modal-close:hover { background: var(--color-bg-secondary); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--color-border); display: flex; justify-content: flex-end; gap: 12px; }

/* Detalhes */
.detalhe-info { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 24px; padding: 16px; background: var(--color-bg-secondary); border-radius: 8px; }
.detalhe-row { display: flex; flex-direction: column; gap: 4px; }
.detalhe-label { font-size: 12px; color: var(--color-text-light); text-transform: uppercase; letter-spacing: 0.5px; }
.detalhe-titulo { margin-bottom: 16px; }
.detalhe-titulo h4 { font-size: 18px; }
.detalhe-descricao { padding: 16px; background: var(--color-bg); border-radius: 8px; margin-bottom: 24px; }
.detalhe-descricao p { white-space: pre-wrap; }
.detalhe-historico { margin-bottom: 24px; }
.detalhe-historico h4, .detalhe-resposta h4 { font-size: 14px; margin-bottom: 12px; color: var(--color-text-light); }
.historico-item { padding: 12px 16px; background: var(--color-bg); border-radius: 8px; margin-bottom: 8px; border-left: 3px solid var(--color-primary); }
.historico-item.resposta { border-left-color: var(--color-success); }
.historico-autor { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.historico-data { font-size: 12px; color: var(--color-text-light); }
.historico-texto { margin-top: 8px; font-size: 14px; }

/* Responsive */
@media (max-width: 640px) {
    .auth-box { padding: 24px; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .detalhe-info { grid-template-columns: 1fr; }
    .ticket-header { flex-direction: column; }
}
