/* ============================================================
   GreenFlow IT — Design System
   Nordic Enterprise Theme
   ============================================================ */

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('../fonts/inter-300.ttf') format('truetype');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/inter-400.ttf') format('truetype');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/inter-500.ttf') format('truetype');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/inter-600.ttf') format('truetype');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/inter-700.ttf') format('truetype');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('../fonts/inter-800.ttf') format('truetype');
}

/* ─── CSS Custom Properties ──────────────────────────────────── */

:root {
    /* Layout */
    --sidebar-width: 260px;
    --header-height: 64px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Dark Theme (Gray/Black) */
    --bg-root: #0a0a0a;
    --bg-primary: #0f0f0f;
    --bg-secondary: #161616;
    --bg-tertiary: #1d1d1d;
    --bg-elevated: #242424;
    --bg-hover: #2a2a2a;
    --bg-active: #333333;

    --surface-1: rgba(30, 30, 30, 0.5);
    --surface-2: rgba(40, 40, 40, 0.5);
    --surface-3: rgba(50, 50, 50, 0.5);

    --text-primary: #eaeaf4;
    --text-secondary: #c2c2db;
    --text-tertiary: #a8a8c3;
    --text-muted: #8e8ea6;
    --text-inverse: #07070e;

    --accent: #7c5cfc;
    --accent-hover: #9078ff;
    --accent-muted: #7c5cfc20;
    --accent-glow: 0 0 20px #7c5cfc30, 0 0 60px #7c5cfc10;

    --success: #34d399;
    --success-muted: #34d39920;
    --warning: #fbbf24;
    --warning-muted: #fbbf2420;
    --danger: #f87171;
    --danger-muted: #f8717120;
    --info: #60a5fa;
    --info-muted: #60a5fa20;

    /* Status colors */
    --status-novo: #60a5fa;
    --status-novo-bg: #60a5fa18;
    --status-em-curso: #fbbf24;
    --status-em-curso-bg: #fbbf2418;
    --status-resolvido: #34d399;
    --status-resolvido-bg: #34d39918;
    --status-recusado: #f87171;
    --status-recusado-bg: #f8717118;

    /* Priority colors */
    --priority-baixa: #94a3b8;
    --priority-baixa-bg: #94a3b818;
    --priority-media: #60a5fa;
    --priority-media-bg: #60a5fa18;
    --priority-alta: #fb923c;
    --priority-alta-bg: #fb923c18;
    --priority-critica: #f87171;
    --priority-critica-bg: #f8717118;

    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --border-focus: rgba(124, 92, 252, 0.5);

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
    --shadow-xl: 0 16px 48px rgba(0,0,0,0.6);

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 150ms;
    --duration-normal: 250ms;
    --duration-slow: 400ms;
}

/* ─── Light Theme ────────────────────────────────────────────── */

[data-theme="light"] {
    --bg-root: #f5f5f7;
    --bg-primary: #ffffff;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f0f0f2;
    --bg-elevated: #e8e8ec;
    --bg-hover: #e0e0e6;
    --bg-active: #d8d8de;

    --surface-1: rgba(255, 255, 255, 0.85);
    --surface-2: rgba(245, 245, 247, 0.9);
    --surface-3: rgba(235, 235, 240, 0.9);

    --text-primary: #1a1a2e;
    --text-secondary: #353548;
    --text-tertiary: #4f4f66;
    --text-muted: #6a6a84;
    --text-inverse: #ffffff;

    --accent: #6d4de8;
    --accent-hover: #5a38d4;
    --accent-muted: rgba(109, 77, 232, 0.1);
    --accent-glow: 0 0 20px rgba(109, 77, 232, 0.12), 0 0 60px rgba(109, 77, 232, 0.06);

    --success: #10b981;
    --success-muted: rgba(16, 185, 129, 0.12);
    --warning: #f59e0b;
    --warning-muted: rgba(245, 158, 11, 0.12);
    --danger: #ef4444;
    --danger-muted: rgba(239, 68, 68, 0.1);
    --info: #3b82f6;
    --info-muted: rgba(59, 130, 246, 0.1);

    --status-novo: #3b82f6;
    --status-novo-bg: rgba(59, 130, 246, 0.1);
    --status-em-curso: #f59e0b;
    --status-em-curso-bg: rgba(245, 158, 11, 0.1);
    --status-resolvido: #10b981;
    --status-resolvido-bg: rgba(16, 185, 129, 0.1);
    --status-recusado: #ef4444;
    --status-recusado-bg: rgba(239, 68, 68, 0.1);

    --priority-baixa: #64748b;
    --priority-baixa-bg: rgba(100, 116, 139, 0.1);
    --priority-media: #3b82f6;
    --priority-media-bg: rgba(59, 130, 246, 0.1);
    --priority-alta: #f97316;
    --priority-alta-bg: rgba(249, 115, 22, 0.1);
    --priority-critica: #ef4444;
    --priority-critica-bg: rgba(239, 68, 68, 0.1);

    --border: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.15);
    --border-focus: rgba(109, 77, 232, 0.4);

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.1);
    --shadow-xl: 0 16px 48px rgba(0,0,0,0.12);
}

/* Light theme specific overrides */
[data-theme="light"] .sidebar {
    background: #ffffff;
    border-right: 1px solid var(--border);
}

[data-theme="light"] .sidebar-logo img {
    filter: none;
}

[data-theme="light"] .login-card {
    background: rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .form-control {
    background: #f8f8fa;
}

[data-theme="light"] .form-control:focus {
    background: #ffffff;
}

[data-theme="light"] .toast {
    background: #ffffff;
}

[data-theme="light"] .notif-dropdown {
    background: #ffffff;
}

[data-theme="light"] .modal {
    background: #ffffff;
}

/* ─── Reset & Base ───────────────────────────────────────────── */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-root);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out);
}
a:hover { color: var(--accent-hover); }

img { max-width: 100%; display: block; }

/* ─── Scrollbar ──────────────────────────────────────────────── */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* ─── Typography ─────────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 { font-size: 1.8rem; font-weight: 700; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }

.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--text-tertiary); }
.text-secondary { color: var(--text-secondary); }

/* ─── Login Page ─────────────────────────────────────────────── */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(ellipse at 20% 50%, #7c5cfc08 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, #60a5fa06 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, #34d39906 0%, transparent 50%);
    animation: bgShift 20s ease-in-out infinite alternate;
}

@keyframes bgShift {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-5%, 3%) rotate(3deg); }
}

.login-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: var(--surface-1);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-xl), var(--accent-glow);
    animation: loginEntry 0.6s var(--ease-out);
}

@keyframes loginEntry {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo .logo-icon {
    margin: 0 auto 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-logo .logo-icon img {
    height: 48px;
    width: auto;
    filter: brightness(2.2) saturate(0.8);
}

.login-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-logo p {
    color: var(--text-tertiary);
    font-size: 0.85rem;
    margin-top: 0.3rem;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.login-footer a {
    color: var(--accent);
    font-weight: 500;
}

/* Reset password notice */
.reset-link-box {
    background: var(--accent-muted);
    border: 1px solid rgba(124, 92, 252, 0.2);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-top: 1rem;
    word-break: break-all;
}

.reset-link-box .label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.reset-link-box a {
    font-size: 0.85rem;
    color: var(--accent-hover);
}

/* ─── Form Elements ──────────────────────────────────────────── */

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-control {
    width: 100%;
    padding: 0.7rem 0.9rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all var(--duration-fast) var(--ease-out);
    outline: none;
}

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

.form-control:hover {
    border-color: var(--border-hover);
}

.form-control:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-muted);
}

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

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236a6a88' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 6l3.5 4 3.5-4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    padding-right: 2.2rem;
}

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

.form-error {
    font-size: 0.8rem;
    color: var(--danger);
    margin-top: 0.3rem;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

/* ─── Buttons ────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.3rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    outline: none;
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.2;
}

.btn:active {
    transform: scale(0.97);
}

.btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #6040e0);
    color: white;
    box-shadow: 0 2px 12px #7c5cfc30;
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-hover), #7050f0);
    box-shadow: 0 4px 20px #7c5cfc40;
    transform: translateY(-1px);
}

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

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 0.5rem 0.8rem;
}
.btn-ghost:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--danger-muted);
    color: var(--danger);
    border-color: rgba(248, 113, 113, 0.2);
}
.btn-danger:hover {
    background: var(--danger);
    color: white;
}

.btn-success {
    background: var(--success-muted);
    color: var(--success);
    border-color: rgba(52, 211, 153, 0.2);
}
.btn-success:hover {
    background: var(--success);
    color: var(--text-inverse);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}
.btn-sm svg { width: 14px; height: 14px; }

.btn-lg {
    padding: 0.85rem 1.8rem;
    font-size: 1rem;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-icon {
    padding: 0.5rem;
    border-radius: var(--radius-sm);
}

.btn:disabled, .btn.loading {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

.btn-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ─── App Layout ─────────────────────────────────────────────── */

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    background: var(--bg-primary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: transform var(--duration-slow) var(--ease-out);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-header {
    padding: 1.3rem 1.2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo img {
    height: 32px;
    width: auto;
    filter: brightness(2.2) saturate(0.8);
}

.sidebar-app-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sidebar-subtitle {
    font-size: 0.60rem;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    letter-spacing: 0.04em;
    margin-top: 0.4rem;
    display: inline-block;
    text-align: center;
    line-height: 1.3;
    max-width: 200px;
}

[data-theme="light"] .sidebar-subtitle {
    color: #000000;
    background: rgba(0, 0, 0, 0.06);
}

.sidebar-nav {
    flex: 1;
    padding: 0.8rem 0.6rem;
}

.sidebar-section {
    margin-bottom: 1.2rem;
}

.sidebar-section-title {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0 0.6rem;
    margin-bottom: 0.4rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.7rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 450;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    position: relative;
    user-select: none;
    margin-bottom: 2px;
}

.nav-item svg {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity var(--duration-fast);
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}
.nav-item:hover svg { opacity: 1; }

.nav-item.active {
    background: var(--accent-muted);
    color: var(--accent-hover);
    font-weight: 500;
}

.nav-item.active svg {
    opacity: 1;
    color: var(--accent);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--accent);
    border-radius: 0 var(--radius-full) var(--radius-full) 0;
}

.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-full);
    min-width: 18px;
    text-align: center;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.sidebar-footer {
    padding: 0.8rem;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem;
    margin-bottom: 0.4rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--duration-fast);
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.theme-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.theme-toggle .theme-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.theme-toggle .theme-icon svg {
    width: 16px;
    height: 16px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--duration-fast);
}

.sidebar-user:hover {
    background: var(--bg-tertiary);
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-info .name {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-info .role {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sidebar-user .logout-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: all var(--duration-fast);
    cursor: pointer;
    background: none;
    border: none;
}

.sidebar-user .logout-btn:hover {
    background: var(--danger-muted);
    color: var(--danger);
}

.sidebar-user .logout-btn svg {
    width: 16px;
    height: 16px;
}

/* Mobile sidebar toggle */
.sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 200;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--accent), #6040e0);
    border: none;
    color: white;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px #7c5cfc50;
    transition: transform var(--duration-fast);
}
.sidebar-toggle:active { transform: scale(0.9); }
.sidebar-toggle svg { width: 22px; height: 22px; }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 99;
    backdrop-filter: blur(4px);
}

/* Main content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Page header */
.page-header {
    padding: 1.5rem 2rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header-left h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.page-header-left p {
    color: var(--text-tertiary);
    font-size: 0.85rem;
    margin-top: 0.2rem;
}

.page-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Page body */
.page-body {
    padding: 0 2rem 2rem;
    flex: 1;
    animation: pageIn 0.35s var(--ease-out);
}

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

/* ─── Cards ──────────────────────────────────────────────────── */

.card {
    background: var(--surface-1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color var(--duration-fast) var(--ease-out);
}

.card:hover {
    border-color: var(--border-hover);
}

.card-header {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.card-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
}

.card-body {
    padding: 1.2rem;
}

.card-footer {
    padding: 0.8rem 1.2rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ─── Dashboard ──────────────────────────────────────────────── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--surface-1);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.2rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: all var(--duration-fast) var(--ease-out);
    cursor: default;
}

.stat-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.stat-icon svg { width: 22px; height: 22px; }

.stat-icon.blue { background: var(--info-muted); color: var(--info); }
.stat-icon.green { background: var(--success-muted); color: var(--success); }
.stat-icon.amber { background: var(--warning-muted); color: var(--warning); }
.stat-icon.red { background: var(--danger-muted); color: var(--danger); }
.stat-icon.purple { background: var(--accent-muted); color: var(--accent); }

.stat-info { flex: 1; }
.stat-info .stat-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.3rem;
}
.stat-info .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
}

.stat-info .stat-detail {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

/* Dashboard grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
}

/* Chart */
.chart-bar-container {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    height: 120px;
    padding-top: 0.5rem;
}

.chart-bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}

.chart-bar {
    width: 100%;
    max-width: 36px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    min-height: 4px;
    transition: height var(--duration-slow) var(--ease-out);
    position: relative;
}

.chart-bar::after {
    content: attr(data-value);
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.chart-bar-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
    text-align: center;
}

/* Status distribution */
.status-distribution {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.status-bar-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.status-bar-item .status-name {
    font-size: 0.8rem;
    color: var(--text-secondary);
    width: 80px;
    flex-shrink: 0;
}

.status-bar-track {
    flex: 1;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.status-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width var(--duration-slow) var(--ease-out);
    min-width: 0;
}

.status-bar-item .status-count {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    width: 30px;
    text-align: right;
}

/* ─── Tickets List ───────────────────────────────────────────── */

.filters-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-input-wrapper svg {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.search-input-wrapper .form-control {
    padding-left: 2.4rem;
}

.filter-select {
    min-width: 140px;
}

.filter-chips {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    user-select: none;
}

.filter-chip:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.filter-chip.active {
    background: var(--accent-muted);
    border-color: rgba(124, 92, 252, 0.3);
    color: var(--accent);
}

/* Ticket list items */
.ticket-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.ticket-item {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.ticket-item:hover {
    background: var(--surface-2);
    border-color: var(--border-hover);
    transform: translateX(4px);
}

.ticket-priority-indicator {
    width: 4px;
    height: 36px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.ticket-priority-indicator.baixa { background: var(--priority-baixa); }
.ticket-priority-indicator.media { background: var(--priority-media); }
.ticket-priority-indicator.alta { background: var(--priority-alta); }
.ticket-priority-indicator.critica { 
    background: var(--priority-critica);
    box-shadow: 0 0 8px var(--priority-critica);
}

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

.ticket-info-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.ticket-ref {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    font-family: 'SFMono-Regular', 'Consolas', monospace;
}

.ticket-title {
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ticket-meta {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-top: 0.3rem;
    flex-wrap: wrap;
}

.ticket-meta-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.ticket-meta-item svg {
    width: 13px;
    height: 13px;
}

.ticket-actions-col {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-shrink: 0;
}

/* ─── Badges ─────────────────────────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.badge-novo {
    background: var(--status-novo-bg);
    color: var(--status-novo);
}
.badge-em_curso {
    background: var(--status-em-curso-bg);
    color: var(--status-em-curso);
}
.badge-resolvido {
    background: var(--status-resolvido-bg);
    color: var(--status-resolvido);
}
.badge-recusado {
    background: var(--status-recusado-bg);
    color: var(--status-recusado);
}

/* Pulsing dot for 'novo' */
.badge-novo::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--status-novo);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.badge-priority {
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-sm);
    font-size: 0.68rem;
}

.badge-priority.baixa { background: var(--priority-baixa-bg); color: var(--priority-baixa); }
.badge-priority.media { background: var(--priority-media-bg); color: var(--priority-media); }
.badge-priority.alta { background: var(--priority-alta-bg); color: var(--priority-alta); }
.badge-priority.critica { 
    background: var(--priority-critica-bg); 
    color: var(--priority-critica);
    animation: criticalPulse 1.5s ease-in-out infinite;
}

@keyframes criticalPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.3); }
    50% { box-shadow: 0 0 0 4px rgba(248, 113, 113, 0); }
}

/* ─── Avatar ─────────────────────────────────────────────────── */

.avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    color: white;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

.avatar-sm { width: 28px; height: 28px; font-size: 0.7rem; }
.avatar-lg { width: 48px; height: 48px; font-size: 1.1rem; }
.avatar-xl { width: 64px; height: 64px; font-size: 1.4rem; }

/* ─── Ticket Detail ──────────────────────────────────────────── */

.ticket-detail-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
}

.ticket-detail-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.ticket-detail-header .back-btn {
    margin-top: 0.3rem;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: color var(--duration-fast);
    background: none;
    border: none;
}
.ticket-detail-header .back-btn:hover { color: var(--text-primary); }
.ticket-detail-header .back-btn svg { width: 22px; height: 22px; }

.ticket-detail-title {
    flex: 1;
}

.ticket-detail-title h1 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.ticket-detail-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

/* Description card */
.description-card .card-body {
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.92rem;
}

/* Comments section */
.comments-section {
    margin-top: 1.5rem;
}

.comments-section h3 {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comments-section h3 .count {
    background: var(--bg-tertiary);
    padding: 0.1rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 1.2rem;
}

.comment-item {
    display: flex;
    gap: 0.8rem;
    padding: 1rem;
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    animation: commentIn 0.3s var(--ease-out);
}

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

.comment-item.internal {
    border-left: 3px solid var(--warning);
    background: var(--warning-muted);
}

.comment-content {
    flex: 1;
    min-width: 0;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
    flex-wrap: wrap;
}

.comment-author {
    font-weight: 600;
    font-size: 0.88rem;
}

.comment-role-badge {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-sm);
    background: var(--accent-muted);
    color: var(--accent);
}

.comment-time {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-left: auto;
}

.comment-body {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.comment-internal-label {
    font-size: 0.65rem;
    color: var(--warning);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Comment form */
.comment-form {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.comment-form textarea {
    min-height: 80px;
    margin-bottom: 0.75rem;
}

.comment-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

/* Ticket sidebar */
.ticket-sidebar .card {
    margin-bottom: 1rem;
}

.ticket-sidebar .detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
}

.ticket-sidebar .detail-row:last-child {
    border-bottom: none;
}

.ticket-sidebar .detail-label {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ticket-sidebar .detail-value {
    font-size: 0.88rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Status selector */
.status-selector {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.status-option {
    padding: 0.45rem 0.7rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.status-option:hover { background: var(--bg-tertiary); }

.status-option.selected {
    border-color: currentColor;
    font-weight: 600;
}

.status-option .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-option.novo { color: var(--status-novo); }
.status-option.novo .status-dot { background: var(--status-novo); }
.status-option.em_curso { color: var(--status-em-curso); }
.status-option.em_curso .status-dot { background: var(--status-em-curso); }
.status-option.resolvido { color: var(--status-resolvido); }
.status-option.resolvido .status-dot { background: var(--status-resolvido); }
.status-option.recusado { color: var(--status-recusado); }
.status-option.recusado .status-dot { background: var(--status-recusado); }

/* ─── Users Management ───────────────────────────────────────── */

.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.user-card {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.2rem;
    display: flex;
    gap: 1rem;
    transition: all var(--duration-fast) var(--ease-out);
}

.user-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.user-card.inactive {
    opacity: 0.5;
}

.user-card-info {
    flex: 1;
    min-width: 0;
}

.user-card-info .user-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.user-card-info .user-email {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-bottom: 0.4rem;
}

.user-card-info .user-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.user-card-info .user-dept {
    font-size: 0.72rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-sm);
}

.user-card-info .user-role-badge {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
}

.user-card-info .user-role-badge.admin {
    background: var(--accent-muted);
    color: var(--accent);
}

.user-card-info .user-role-badge.user {
    background: var(--info-muted);
    color: var(--info);
}

.user-card-actions {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex-shrink: 0;
}

/* ─── Modal ──────────────────────────────────────────────────── */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: modalOverlayIn 0.2s var(--ease-out);
}

@keyframes modalOverlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalIn 0.3s var(--ease-spring);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

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

.modal-header h2 {
    font-size: 1.1rem;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--duration-fast);
}
.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}
.modal-close svg { width: 18px; height: 18px; }

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* ─── Toast Notifications ────────────────────────────────────── */

.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.8rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 280px;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.4s var(--ease-spring);
    pointer-events: all;
    backdrop-filter: blur(20px);
}

.toast.removing {
    animation: toastOut 0.3s var(--ease-out) forwards;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateX(100%) scale(0.95);
    }
}

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.success .toast-icon { color: var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.error .toast-icon { color: var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info { border-left: 3px solid var(--info); }
.toast.info .toast-icon { color: var(--info); }

.toast-message {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.toast-close {
    width: 20px;
    height: 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color var(--duration-fast);
}
.toast-close:hover { color: var(--text-primary); }
.toast-close svg { width: 14px; height: 14px; }

/* ─── New Ticket Alert (Dashboard) ───────────────────────────── */

.alert-banner {
    background: linear-gradient(135deg, rgba(239,68,68,0.12), rgba(239,68,68,0.06));
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: var(--radius-md);
    padding: 0.8rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
    animation: alertSlide 0.5s var(--ease-spring);
    cursor: pointer;
}

@keyframes alertSlide {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-banner .alert-icon {
    width: 24px;
    height: 24px;
    color: #ef4444;
    flex-shrink: 0;
    animation: bellRing 1s ease-in-out;
}

@keyframes bellRing {
    0% { transform: rotate(0); }
    10% { transform: rotate(15deg); }
    20% { transform: rotate(-15deg); }
    30% { transform: rotate(10deg); }
    40% { transform: rotate(-10deg); }
    50% { transform: rotate(5deg); }
    60% { transform: rotate(-5deg); }
    70% { transform: rotate(0); }
}

.alert-banner .alert-text {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

.alert-banner .alert-dismiss {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.2rem;
}

/* ─── Notifications Dropdown ─────────────────────────────────── */

.notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    max-height: 420px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    z-index: 500;
    overflow: hidden;
    animation: dropIn 0.2s var(--ease-out);
}

@keyframes dropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.notif-dropdown-header {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notif-dropdown-header h4 {
    font-size: 0.9rem;
}

.notif-list {
    max-height: 340px;
    overflow-y: auto;
}

.notif-item {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background var(--duration-fast);
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
}

.notif-item:hover { background: var(--bg-tertiary); }

.notif-item.unread {
    background: var(--accent-muted);
}

.notif-item .notif-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    margin-top: 0.45rem;
    flex-shrink: 0;
}

.notif-item.unread .notif-dot { display: block; }
.notif-item:not(.unread) .notif-dot { display: none; }

/* New ticket notifications — red highlight */
.notif-item.type-new-ticket.unread {
    background: rgba(239, 68, 68, 0.1);
}
.notif-item.type-new-ticket .notif-dot {
    background: #ef4444;
}

.notif-item .notif-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.notif-item .notif-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.notif-empty {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ─── Pagination ─────────────────────────────────────────────── */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    margin-top: 1.5rem;
}

.pagination .page-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--duration-fast);
    font-family: inherit;
}

.pagination .page-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.pagination .page-btn.active {
    background: var(--accent-muted);
    border-color: rgba(124, 92, 252, 0.3);
    color: var(--accent);
}

.pagination .page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

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

/* ─── Empty State ────────────────────────────────────────────── */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
}

.empty-state svg {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

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

.empty-state .btn {
    margin-top: 1rem;
}

/* ─── Loading ────────────────────────────────────────────────── */

.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.loading-spinner::after {
    content: '';
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-elevated) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ─── Activity Timeline ─────────────────────────────────────── */

.activity-list {
    display: flex;
    flex-direction: column;
}

.activity-item {
    display: flex;
    gap: 0.7rem;
    padding: 0.6rem 0;
    position: relative;
}

.activity-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 13px;
    top: 34px;
    bottom: -6px;
    width: 1px;
    background: var(--border);
}

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    margin-top: 0.5rem;
    flex-shrink: 0;
    border: 2px solid var(--bg-secondary);
    box-sizing: content-box;
}

.activity-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.activity-text strong {
    color: var(--text-primary);
    font-weight: 500;
}

.activity-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* ─── Profile ────────────────────────────────────────────────── */

.profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.profile-header .avatar {
    width: 72px;
    height: 72px;
    font-size: 1.5rem;
}

.profile-info h2 {
    font-size: 1.3rem;
    margin-bottom: 0.15rem;
}

.profile-info p {
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

.profile-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 1.5rem;
}

/* ─── Responsive ─────────────────────────────────────────────── */

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .ticket-detail-layout {
        grid-template-columns: 1fr;
    }
    
    .ticket-sidebar {
        order: -1;
    }
}

@media (max-width: 768px) {
    html { font-size: 14px; }
    
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-toggle {
        display: flex;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .page-header {
        padding: 1.2rem 1rem 0.8rem;
    }
    
    .page-body {
        padding: 0 1rem 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .users-grid {
        grid-template-columns: 1fr;
    }
    
    .profile-cards {
        grid-template-columns: 1fr;
    }
    
    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-input-wrapper {
        min-width: 100%;
    }
    
    .ticket-item {
        flex-wrap: wrap;
    }
    
    .ticket-actions-col {
        width: 100%;
        justify-content: flex-end;
        padding-top: 0.5rem;
        border-top: 1px solid var(--border);
        margin-top: 0.3rem;
    }
    
    .modal {
        max-width: 100%;
        max-height: 95vh;
        margin: 0.5rem;
    }
    
    .notif-dropdown {
        width: calc(100vw - 2rem);
        right: -0.5rem;
    }

    .page-header-left h1 {
        font-size: 1.2rem;
    }
    
    .toast-container {
        left: 1rem;
        right: 1rem;
    }

    .toast {
        min-width: unset;
        max-width: unset;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .login-card {
        padding: 1.5rem;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-header-actions {
        width: 100%;
    }

    .page-header-actions .btn {
        flex: 1;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
}

/* ─── Print styles ───────────────────────────────────────────── */

@media print {
    .sidebar, .sidebar-toggle, .toast-container, .alert-banner { display: none !important; }
    .main-content { margin-left: 0 !important; }
    body { background: white; color: black; }
}
