/* === Buttons (Outlined Style) === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    border: 1.5px solid;
    background: var(--surface);
    line-height: 1.4;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    color: var(--primary-green);
    border-color: var(--primary-green);
}
.btn-primary:hover {
    background: var(--primary-green);
    color: #fff;
}

.btn-blue {
    color: var(--primary-blue);
    border-color: var(--primary-blue);
}
.btn-blue:hover {
    background: var(--primary-blue);
    color: #fff;
}

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

.btn-warning {
    color: var(--warning);
    border-color: var(--warning);
}
.btn-warning:hover {
    background: var(--warning);
    color: #fff;
}

.btn-secondary {
    color: var(--text-secondary);
    border-color: var(--border);
}
.btn-secondary:hover {
    background: var(--bg);
    color: var(--text);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.78rem;
}

/* === Cards === */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.95rem;
}

.card-body {
    padding: 20px;
}

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

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

th {
    text-align: left;
    padding: 10px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    background: var(--bg);
    border-bottom: 2px solid var(--border);
}

td {
    padding: 10px 14px;
    font-size: 0.87rem;
    border-bottom: 1px solid var(--border);
}

tr:nth-child(even) td {
    background: #FAFBFC;
}

tr:hover td {
    background: #F7FAFC;
}

/* === Forms === */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-family: var(--font);
    transition: border-color 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(25,118,210,0.1);
}

select.form-control {
    appearance: auto;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.helptext {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.errorlist {
    list-style: none;
    padding: 0;
    margin: 4px 0 0;
}

.errorlist li {
    font-size: 0.8rem;
    color: var(--danger);
}

/* === Badges === */
.badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 12px;
    white-space: nowrap;
}

.badge-aberto { background: #EBF5FB; color: #1976D2; }
.badge-em_analise { background: #FFF8E1; color: #F57F17; }
.badge-aguardando_cliente { background: #FFF3E0; color: #E65100; }
.badge-em_desenvolvimento { background: #E8F5E9; color: #2E7D32; }
.badge-resolvido { background: #E0F2F1; color: #00695C; }
.badge-encerrado { background: #F3E5F5; color: #6A1B9A; }
.badge-cancelado { background: #FFEBEE; color: #C62828; }

.badge-baixa { background: #E8F5E9; color: #2E7D32; }
.badge-media { background: #FFF8E1; color: #F57F17; }
.badge-alta { background: #FFF3E0; color: #E65100; }
.badge-critica { background: #FFEBEE; color: #C62828; }

/* === Pagination === */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 24px;
    list-style: none;
}

.pagination a, .pagination span {
    padding: 6px 12px;
    font-size: 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
}

.pagination a:hover {
    background: var(--bg);
    text-decoration: none;
}

.pagination .current {
    background: var(--primary-blue);
    color: #fff;
    border-color: var(--primary-blue);
}

/* === Timeline === */
.timeline {
    position: relative;
    padding-left: 24px;
}

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

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

.timeline-item::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-blue);
    border: 2px solid var(--surface);
}

.timeline-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.timeline-content {
    font-size: 0.85rem;
    margin-top: 2px;
}

/* === Alerts / Messages === */
.messages {
    list-style: none;
    padding: 0;
    margin-bottom: 16px;
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.alert-success { background: #F0FFF4; border: 1px solid #C6F6D5; color: #22543D; }
.alert-error { background: #FFF5F5; border: 1px solid #FED7D7; color: #742A2A; }
.alert-warning { background: #FFFAF0; border: 1px solid #FEEBC8; color: #7B341E; }
.alert-info { background: #EBF8FF; border: 1px solid #BEE3F8; color: #2A4365; }

.alert-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: inherit;
    opacity: 0.6;
    padding: 0 4px;
}

/* === Scope Tabs === */
.scope-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}

.scope-tab {
    padding: 8px 16px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s;
}

.scope-tab:hover {
    color: var(--text);
    text-decoration: none;
}

.scope-tab.active {
    color: var(--primary-blue);
    border-bottom-color: var(--primary-blue);
}

/* === Filters Bar === */
.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.filters-bar .form-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 140px;
}

.filters-bar .form-control {
    padding: 6px 10px;
    font-size: 0.82rem;
}

/* === Detail Grid === */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px 24px;
}

.detail-item label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 2px;
}

.detail-item span, .detail-item p {
    font-size: 0.9rem;
    color: var(--text);
}

/* === Empty state === */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 0.95rem;
    margin-bottom: 12px;
}

/* === Preview Modal === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-container {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

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

.modal-title {
    font-weight: 600;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60%;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0 4px;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    padding: 20px;
    overflow: auto;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.modal-body img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.modal-body iframe {
    width: 100%;
    height: 70vh;
    border: none;
}

.modal-body video {
    max-width: 100%;
    max-height: 70vh;
}

/* === Notification Badge === */
.topbar-notif {
    position: relative;
    display: inline-flex;
    align-items: center;
    color: var(--text-secondary);
    text-decoration: none;
    margin-right: 12px;
}

.topbar-notif:hover {
    color: var(--text);
}

.notif-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: #E53E3E;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

.sidebar-notif-badge {
    position: static;
    margin-left: auto;
}

/* === Notification List === */
.notificacao-item {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

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

.notificacao-nao-lida {
    background: #EBF8FF;
}

.notificacao-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notificacao-icon {
    color: var(--text-secondary);
    flex-shrink: 0;
}

.notificacao-nao-lida .notificacao-icon {
    color: var(--primary-blue);
}

.notificacao-mensagem {
    font-size: 0.87rem;
    margin: 0;
}

.notificacao-mensagem a {
    color: var(--text);
    text-decoration: none;
}

.notificacao-mensagem a:hover {
    text-decoration: underline;
}

.notificacao-nao-lida .notificacao-mensagem {
    font-weight: 600;
}

.notificacao-data {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* === SLA Indicators === */
.sla-indicators {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.sla-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    border: 1px solid;
}

.sla-ok {
    background: #F0FFF4;
    border-color: #C6F6D5;
    color: #22543D;
}

.sla-warning {
    background: #FFFAF0;
    border-color: #FEEBC8;
    color: #7B341E;
}

.sla-breached {
    background: #FFF5F5;
    border-color: #FED7D7;
    color: #742A2A;
}

.sla-label {
    font-weight: 600;
}

.sla-status {
    font-weight: 400;
}

/* === SLA Dots (list view) === */
.sla-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.sla-dot-ok { background: #48BB78; }
.sla-dot-warning { background: #ECC94B; }
.sla-dot-breached { background: #F56565; animation: sla-pulse 1.5s infinite; }

@keyframes sla-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* === Bulk Actions Bar === */
.bulk-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: #EBF5FB;
    border: 1px solid #BEE3F8;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1976D2;
}

/* === Quick-Add Button === */
.btn-quick-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 1.5px solid var(--primary-green);
    border-radius: 50%;
    background: var(--surface);
    color: var(--primary-green);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    margin-left: 6px;
    line-height: 1;
    vertical-align: middle;
    transition: all 0.15s;
}

.btn-quick-add:hover {
    background: var(--primary-green);
    color: #fff;
}

/* === Timer Button === */
.timer-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.timer-btn svg {
    flex-shrink: 0;
}

/* === Acessibilidade Badge (sidebar) === */
.acess-badge {
    position: static;
    margin-left: auto;
    background: #E53E3E;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    line-height: 1;
    animation: acess-pulse 2s infinite;
}

@keyframes acess-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(229,62,62,0.4); }
    50% { opacity: 0.85; box-shadow: 0 0 0 6px rgba(229,62,62,0); }
}

/* === Misc === */
.text-muted { color: var(--text-secondary); }
.text-sm { font-size: 0.82rem; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.gap-1 { gap: 8px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
