/* ============================================================
   UOR TICKET — Design System Profissional
   ============================================================ */

/* ---------- 1. RESET & BASE ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Cores principais */
    --primary: #f96b0e;
    --primary-hover: #e67e22;
    --primary-light: rgba(249, 107, 14, 0.08);
    --primary-border: rgba(249, 107, 14, 0.25);

    /* Neutros */
    --dark: #1a1a2e;
    --dark-alt: #16213e;
    --body-bg: #f5f6f8;
    --surface: #ffffff;
    --surface-alt: #f8f9fa;
    --border: #e2e5ea;
    --border-light: #eef0f3;

    /* Texto */
    --text: #212529;
    --text-secondary: #6c757d;
    --text-muted: #9ca3af;
    --text-inverse: #ffffff;

    /* Status */
    --success: #10b981;
    --success-bg: #ecfdf5;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --info: #3b82f6;
    --info-bg: #eff6ff;

    /* Sombras */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);

    /* Border radius */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Transições */
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Espaçamento */
    --nav-height: 64px;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--body-bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); }

img { max-width: 100%; height: auto; }

/* ---------- 2. NAVBAR ---------- */
.uor-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    z-index: 1030;
    background: rgba(249, 107, 14, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 16px rgba(249, 107, 14, 0.25);
    display: flex;
    align-items: center;
    padding: 0 24px;
}

.uor-nav .nav-inner {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.uor-nav .nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-inverse);
    font-weight: 700;
    font-size: 1.15rem;
    text-decoration: none;
    white-space: nowrap;
}

.uor-nav .nav-brand img {
    height: 36px;
    width: auto;
}

.uor-nav .nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
}

.uor-nav .nav-links a {
    color: rgba(255,255,255,0.85);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    white-space: nowrap;
    text-decoration: none;
}

.uor-nav .nav-links a:hover,
.uor-nav .nav-links a.active {
    color: #fff;
    background: rgba(255,255,255,0.15);
}

.uor-nav .nav-links .btn-nav {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    padding: 7px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.uor-nav .nav-links .btn-nav:hover {
    background: rgba(255,255,255,0.3);
}

/* Hamburger */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 1031;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all var(--transition);
}

.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ---------- 3. PAGE LAYOUT ---------- */
.page-wrapper {
    padding-top: calc(var(--nav-height) + 24px);
    padding-bottom: 40px;
    min-height: 100vh;
}

.page-wrapper.no-footer {
    padding-bottom: 0;
}

.container-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- 4. CARDS ---------- */
.card-uor {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), transform var(--transition);
}

.card-uor:hover {
    box-shadow: var(--shadow-md);
}

.card-uor-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
}

.card-uor-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.card-uor-header p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 4px 0 0;
}

.card-uor-body {
    padding: 24px;
}

/* ---------- 5. FORMULÁRIOS ---------- */
.form-group {
    margin-bottom: 20px;
}

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

.form-group label .required {
    color: var(--danger);
    margin-left: 2px;
}

.form-control-uor {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-control-uor::placeholder {
    color: var(--text-muted);
}

.form-control-uor:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-control-uor:disabled {
    background: var(--surface-alt);
    opacity: 0.7;
    cursor: not-allowed;
}

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

select.form-control-uor {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236c757d' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.char-counter {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: right;
    margin-top: 4px;
}

.char-counter.near-limit { color: var(--warning); }
.char-counter.at-limit { color: var(--danger); }

/* ---------- 6. BOTÕES ---------- */
.btn-uor {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    text-decoration: none;
}

.btn-uor:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-uor-primary {
    background: var(--primary);
    color: var(--text-inverse);
}

.btn-uor-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 107, 14, 0.3);
}

.btn-uor-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1.5px solid var(--border);
}

.btn-uor-secondary:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-uor-success {
    background: var(--success);
    color: var(--text-inverse);
}

.btn-uor-success:hover:not(:disabled) {
    background: #059669;
    transform: translateY(-1px);
}

.btn-uor-danger {
    background: var(--danger);
    color: var(--text-inverse);
}

.btn-uor-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-uor-lg {
    padding: 14px 32px;
    font-size: 1rem;
}

.btn-uor-full {
    width: 100%;
}

/* ---------- 7. STATUS BADGES ---------- */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    line-height: 1.4;
}

.badge-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.badge-aberto { background: var(--warning-bg); color: #b45309; }
.badge-aberto::before { background: var(--warning); }

.badge-respondido { background: var(--primary-light); color: #c2410c; }
.badge-respondido::before { background: var(--primary); }

.badge-em_analise { background: var(--info-bg); color: #1d4ed8; }
.badge-em_analise::before { background: var(--info); }

.badge-fechado { background: var(--success-bg); color: #047857; }
.badge-fechado::before { background: var(--success); }

/* ---------- 8. FORMULÁRIO PRINCIPAL ---------- */
.ticket-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.ticket-form-grid .full-width {
    grid-column: 1 / -1;
}

.form-section {
    padding: 20px;
    background: var(--surface-alt);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

.form-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.form-section-title i {
    color: var(--primary);
    font-size: 1rem;
}

/* File upload */
.file-upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--surface);
}

.file-upload-area:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.file-upload-area i {
    font-size: 2rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: block;
}

.file-upload-area p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

.file-upload-area .small {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.file-list {
    margin-top: 12px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--surface-alt);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.file-item-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.file-item-info i {
    color: var(--primary);
    flex-shrink: 0;
}

.file-item-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-item-size {
    color: var(--text-muted);
    font-size: 0.75rem;
    flex-shrink: 0;
}

.file-item-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    font-size: 1rem;
    transition: color var(--transition);
}

.file-item-remove:hover { color: var(--danger); }

/* ---------- 9. SIDEBAR / INFO PANELS ---------- */
.sidebar-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.sidebar-panel-header {
    padding: 16px 20px;
    background: var(--surface-alt);
    border-bottom: 1px solid var(--border-light);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-panel-header i {
    color: var(--primary);
}

.sidebar-panel-body {
    padding: 20px;
}

.sidebar-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-info-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
}

.sidebar-info-list li:last-child {
    border-bottom: none;
}

.sidebar-info-list li i {
    color: var(--primary);
    margin-top: 2px;
    flex-shrink: 0;
}

/* Status indicator */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
}

.status-indicator .status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    animation: pulse 2s infinite;
}

.status-indicator.online {
    background: var(--success-bg);
    color: #047857;
}

.status-indicator.online .status-dot { background: var(--success); }

.status-indicator.offline {
    background: var(--warning-bg);
    color: #b45309;
}

.status-indicator.offline .status-dot {
    background: var(--warning);
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ---------- 10. CHAT / MESSAGES ---------- */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--surface-alt);
    min-height: 300px;
    max-height: 500px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.msg {
    display: flex;
    flex-direction: column;
    max-width: 75%;
    margin-bottom: 16px;
    animation: msgIn 0.3s ease;
}

@keyframes msgIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.msg-bubble {
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.msg-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.msg.utilizador {
    align-self: flex-end;
}

.msg.utilizador .msg-bubble {
    background: var(--primary);
    color: var(--text-inverse);
    border-bottom-right-radius: 4px;
}

.msg.utilizador .msg-time {
    text-align: right;
}

.msg.admin {
    align-self: flex-start;
}

.msg.admin .msg-bubble {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

/* ---------- 11. TICKET LIST (ADMIN) ---------- */
.ticket-list-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background var(--transition);
}

.ticket-list-item:hover {
    background: var(--primary-light);
}

.ticket-list-item.active {
    background: rgba(249, 107, 14, 0.12);
    border-left: 3px solid var(--primary);
}

.ticket-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.ticket-list-info {
    flex: 1;
    min-width: 0;
}

.ticket-list-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ticket-list-subject {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.ticket-list-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.ticket-list-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ---------- 12. ANEXOS ---------- */
.attachments-section {
    margin-top: 16px;
    padding: 16px;
    background: var(--surface-alt);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

.attachments-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.attachment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    transition: border-color var(--transition);
}

.attachment-item:hover {
    border-color: var(--primary);
}

.attachment-item:last-child {
    margin-bottom: 0;
}

.attachment-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.attachment-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.attachment-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-size {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.attachment-download {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

.attachment-download:hover {
    background: var(--primary-light);
}

/* ---------- 13. MODALS ---------- */
.modal-uor .modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.modal-uor .modal-header {
    background: var(--primary);
    color: var(--text-inverse);
    padding: 18px 24px;
    border: none;
}

.modal-uor .modal-title {
    font-weight: 700;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-uor .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.modal-uor .btn-close:hover {
    opacity: 1;
}

.modal-uor .modal-body {
    padding: 24px;
}

.modal-uor .modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
}

/* ---------- 14. EMPTY STATES ---------- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--surface-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.empty-state-icon i {
    font-size: 1.75rem;
    color: var(--text-muted);
}

.empty-state h5 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.empty-state p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    max-width: 280px;
}

/* ---------- 15. FOOTER ---------- */
.uor-footer {
    background: var(--dark);
    color: rgba(255,255,255,0.8);
    padding: 48px 0 0;
    margin-top: 60px;
}

.footer-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
}

.footer-col h4 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff;
    margin-bottom: 16px;
}

.footer-col p {
    font-size: 0.875rem;
    line-height: 1.7;
    color: rgba(255,255,255,0.6);
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col ul li {
    margin-bottom: 8px;
}

.footer-col ul a {
    color: rgba(255,255,255,0.6);
    font-size: 0.875rem;
    transition: color var(--transition);
}

.footer-col ul a:hover {
    color: var(--primary);
}

.footer-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 0.875rem;
    color: rgba(255,255,255,0.6);
}

.footer-contact-item i {
    color: var(--primary);
    margin-top: 3px;
    flex-shrink: 0;
}

.footer-bottom {
    margin-top: 40px;
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    text-align: center;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
}

/* ---------- 16. LOADING / SPINNER ---------- */
.loading-spinner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 500;
}

.loading-spinner::before {
    content: '';
    width: 18px;
    height: 18px;
    border: 2.5px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* ---------- 17. RESPONSIVIDADE ---------- */
@media (max-width: 991px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    :root {
        --nav-height: 56px;
    }

    .uor-nav {
        padding: 0 16px;
    }

    .uor-nav .nav-links {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: var(--primary);
        flex-direction: column;
        padding: 12px 16px;
        gap: 4px;
        box-shadow: var(--shadow-lg);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-slow);
    }

    .uor-nav .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .uor-nav .nav-links a {
        padding: 12px 16px;
        width: 100%;
        border-radius: var(--radius-sm);
    }

    .nav-toggle {
        display: flex;
    }

    .ticket-form-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .chat-messages {
        max-height: 350px;
    }

    .msg {
        max-width: 90%;
    }
}

@media (max-width: 575px) {
    .card-uor-body {
        padding: 16px;
    }

    .card-uor-header {
        padding: 16px;
    }

    .btn-uor {
        padding: 10px 18px;
        font-size: 0.85rem;
    }

    .btn-uor-lg {
        padding: 12px 24px;
    }
}

/* ---------- 18. UTILITIES ---------- */
.text-primary { color: var(--primary) !important; }
.bg-primary { background-color: var(--primary) !important; }
.border-primary { border-color: var(--primary) !important; }
.rounded-uor { border-radius: var(--radius) !important; }
.shadow-uor { box-shadow: var(--shadow-md) !important; }

/* Smooth scrollbar for webkit */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Focus visible for accessibility */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .uor-nav, .uor-footer, .btn-uor { display: none !important; }
    .page-wrapper { padding: 0; }
    body { background: #fff; }
}

/* ---------- GLOBAL LOADING OVERLAY ---------- */
.uor-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    z-index: 10002;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
}
.uor-overlay.active { display: flex; }

.uor-overlay-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: uor-spin 0.7s linear infinite;
}
@keyframes uor-spin { to { transform: rotate(360deg); } }

.uor-overlay-text {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Top progress bar (thin line at top of viewport) */
.uor-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), #ffb347);
    z-index: 10003;
    transition: width 0.3s ease;
    box-shadow: 0 0 8px var(--primary);
}
.uor-progress-bar.active {
    width: 100%;
    animation: uor-progress-anim 1.5s ease infinite;
}
@keyframes uor-progress-anim {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 95%; }
}
.uor-progress-bar.done {
    width: 100%;
    animation: none;
    transition: opacity 0.3s;
    opacity: 0;
}

/* Inline spinner for buttons */
.uor-btn-loading {
    pointer-events: none;
    opacity: 0.7;
}
.uor-btn-loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: uor-spin 0.6s linear infinite;
    margin-left: 6px;
    vertical-align: middle;
}