/* ===================================================
   Açovisa Help Center — Design System
   Primary: #0069B3
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ===== CSS Variables ===== */
:root {
    /* Brand Colors */
    --primary: #0069B3;
    --primary-light: #1a8ad4;
    --primary-lighter: #e8f4fc;
    --primary-dark: #004d85;
    --primary-gradient: linear-gradient(135deg, #0069B3, #004d85);

    /* Neutral */
    --white: #ffffff;
    --gray-50: #f8f9fb;
    --gray-100: #f1f3f5;
    --gray-200: #e3e6ea;
    --gray-300: #cdd2d9;
    --gray-400: #a0a8b4;
    --gray-500: #6b7685;
    --gray-600: #4a5568;
    --gray-700: #2d3748;
    --gray-800: #1a202c;
    --gray-900: #0f1419;

    /* Status */
    --success: #0d9f6e;
    --success-bg: #ecfdf5;
    --warning: #e67e22;
    --warning-bg: #fffbeb;
    --danger: #e74c3c;
    --danger-bg: #fef2f2;
    --info: #0069B3;
    --info-bg: #e8f4fc;

    /* Layout */
    --sidebar-width: 260px;
    --header-height: 64px;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-xs: 6px;

    /* Shadows */
    --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 -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition: 250ms ease;
    --transition-slow: 400ms ease;

    /* Light theme (default) */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fb;
    --bg-tertiary: #f1f3f5;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #6b7685;
    --border-color: #e3e6ea;
    --card-bg: #ffffff;
    --input-bg: #ffffff;
    --hover-bg: #f1f3f5;
}

/* ===== Dark Theme (Support only) ===== */
[data-theme="dark"] {
    --bg-primary: #0f1419;
    --bg-secondary: #1a202c;
    --bg-tertiary: #2d3748;
    --text-primary: #f1f3f5;
    --text-secondary: #cdd2d9;
    --text-muted: #a0a8b4;
    --border-color: #2d3748;
    --card-bg: #1a202c;
    --input-bg: #2d3748;
    --hover-bg: #2d3748;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.3);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

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

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

a:hover {
    color: var(--primary-dark);
}

/* ===== Login Page ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0069B3 0%, #004d85 50%, #003a66 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
    top: -200px;
    right: -100px;
    animation: float 20s ease-in-out infinite;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 50%;
    bottom: -100px;
    left: -50px;
    animation: float 15s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(20px, -30px) rotate(5deg); }
    50% { transform: translate(-10px, 20px) rotate(-3deg); }
    75% { transform: translate(30px, 10px) rotate(3deg); }
}

.login-card {
    background: var(--white);
    border-radius: 20px;
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s ease-out;
}

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

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo img {
    height: 50px;
    width: auto;
}

.login-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.login-subtitle {
    text-align: center;
    font-size: 0.9rem;
    color: var(--gray-500);
    margin-bottom: 32px;
}

.form-group {
    margin-bottom: 20px;
}

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

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--input-bg);
    transition: all var(--transition-fast);
    outline: none;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 105, 179, 0.15);
}

.form-input::placeholder {
    color: var(--gray-400);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    line-height: 1;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--gray-200);
    color: var(--text-primary);
}

[data-theme="dark"] .btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .btn-secondary:hover {
    background: var(--hover-bg);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #c0392b;
    color: var(--white);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-full {
    width: 100%;
}

.btn-icon {
    padding: 8px;
    border-radius: var(--border-radius-xs);
}

.alert {
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    font-size: 0.9rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(231, 76, 60, 0.2);
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(13, 159, 110, 0.2);
}

/* ===== App Layout ===== */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
    transition: background-color var(--transition), border-color var(--transition);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.header-logo img {
    height: 32px;
    width: auto;
}

.header-logo span {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
}

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

.header-nav a {
    padding: 8px 16px;
    border-radius: var(--border-radius-xs);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.header-nav a:hover,
.header-nav a.active {
    background: var(--primary-lighter);
    color: var(--primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: background var(--transition-fast);
    position: relative;
}

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

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.user-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    z-index: 200;
    overflow: hidden;
}

.user-dropdown.show {
    display: block;
    animation: fadeIn 0.15s ease;
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: background var(--transition-fast);
}

.user-dropdown a:hover {
    background: var(--hover-bg);
}

.user-dropdown .divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

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

/* ===== Systems Menu Dropdown ===== */
.systems-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--bg-primary);
    color: var(--primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    border: 1px solid var(--border-color);
}

.systems-menu:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary);
}

.systems-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--primary-lighter);
    border-radius: var(--border-radius-sm);
    box-shadow: 0 10px 25px rgba(0, 105, 179, 0.15);
    width: 320px;
    z-index: 200;
    overflow: hidden;
    padding: 8px;
}

[data-theme="dark"] .systems-dropdown {
    border-color: var(--border-color);
    box-shadow: var(--shadow-lg);
}

.systems-dropdown.show {
    display: block;
    animation: fadeIn 0.15s ease;
}

.systems-dropdown .system-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: var(--border-radius-xs);
    color: var(--text-primary);
    transition: background var(--transition-fast);
    text-decoration: none;
    border: 1px solid transparent;
    margin-bottom: 4px;
}

.systems-dropdown .system-link:last-child {
    margin-bottom: 0;
}

.systems-dropdown .system-link:hover {
    background: var(--primary-lighter);
    border-color: rgba(0, 105, 179, 0.1);
}

[data-theme="dark"] .systems-dropdown .system-link:hover {
    background: var(--hover-bg);
}

.systems-dropdown .system-link img {
    height: 42px;
    width: 32px;
    object-fit: contain;
}

.systems-dropdown .system-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.systems-dropdown .system-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
}

.systems-dropdown .system-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.3;
}

/* Theme toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    background: var(--bg-tertiary);
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
    font-size: 1.1rem;
}

.theme-toggle:hover {
    border-color: var(--primary);
}

/* ===== Main Content ===== */
.app-main {
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}

.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* ===== Hero / Help Center Home ===== */
.hero {
    background: var(--primary-gradient);
    padding: 60px 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.hero p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 32px;
}

/* Search Box */
.search-box {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-box input {
    width: 100%;
    padding: 16px 20px 16px 52px;
    border: none;
    border-radius: 16px;
    font-size: 1.05rem;
    font-family: inherit;
    background: var(--white);
    color: var(--gray-800);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    outline: none;
    transition: box-shadow var(--transition);
}

.search-box input:focus {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2), 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.search-box input::placeholder {
    color: var(--gray-400);
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 1.2rem;
}

.search-results-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 50;
}

.search-results-dropdown.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

.search-result-item {
    padding: 14px 20px;
    border-bottom: 1px solid var(--gray-100);
    transition: background var(--transition-fast);
    display: block;
    color: var(--gray-800);
}

.search-result-item:hover {
    background: var(--gray-50);
    color: var(--gray-800);
}

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

.search-result-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.search-result-excerpt {
    font-size: 0.85rem;
    color: var(--gray-500);
    line-height: 1.4;
}

.search-result-category {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-lighter);
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 6px;
}

.search-section-title {
    padding: 10px 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--gray-50);
}

.ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-lighter);
    padding: 3px 8px;
    border-radius: 20px;
    margin-left: 8px;
}

/* ===== Category Cards ===== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 32px;
}

.category-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 28px 24px;
    transition: all var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.category-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-sm);
    background: var(--primary-lighter);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.category-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.category-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.category-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ===== Section Headers ===== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.section-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary);
}

/* ===== Article Cards ===== */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.article-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px 24px;
    transition: all var(--transition);
    display: block;
    color: var(--text-primary);
}

.article-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
    color: var(--text-primary);
}

.article-card h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.article-card p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.article-tag {
    display: inline-block;
    background: var(--primary-lighter);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* ===== Article Detail ===== */
.article-detail {
    max-width: 800px;
    margin: 0 auto;
}

.article-detail h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.article-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 32px;
    line-height: 1.8;
    font-size: 1rem;
    color: var(--text-primary);
}

.article-content h2 {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 24px 0 12px;
    color: var(--text-primary);
}

.article-content h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 20px 0 8px;
}

.article-content p {
    margin-bottom: 16px;
}

.article-content ul, .article-content ol {
    margin: 12px 0;
    padding-left: 24px;
}

.article-content li {
    margin-bottom: 8px;
}

.article-content code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

.article-content pre {
    background: var(--gray-800);
    color: #e2e8f0;
    padding: 16px 20px;
    border-radius: var(--border-radius-sm);
    overflow-x: auto;
    margin: 16px 0;
    font-size: 0.9rem;
}

/* ===== Tabs (Confluence docs) ===== */
.tabs {
    margin-top: 24px;
}

.tab-list {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    gap: 0;
    overflow-x: auto;
}

.tab-btn {
    padding: 12px 20px;
    border: none;
    background: none;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition-fast);
    white-space: nowrap;
    font-family: inherit;
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab-panel {
    display: none;
    padding: 24px 0;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.confluence-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    margin-bottom: 12px;
    transition: all var(--transition-fast);
    color: var(--text-primary);
}

.confluence-link:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
    color: var(--text-primary);
}

.confluence-link .icon {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-xs);
    background: #0052CC;
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.confluence-link .info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.confluence-link .info p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===== Breadcrumb ===== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--primary);
}

.breadcrumb .separator {
    color: var(--gray-300);
}

/* ===== Tickets ===== */
.ticket-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ticket-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transition: all var(--transition-fast);
    text-decoration: none;
    color: var(--text-primary);
}

.ticket-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
    color: var(--text-primary);
}

.ticket-info h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

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

.ticket-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-open { background: var(--info-bg); color: var(--info); }
.badge-in_progress { background: var(--warning-bg); color: var(--warning); }
.badge-waiting { background: #f3e8ff; color: #7c3aed; }
.badge-resolved { background: var(--success-bg); color: var(--success); }
.badge-closed { background: var(--gray-100); color: var(--gray-500); }

.badge-low { background: var(--success-bg); color: var(--success); }
.badge-medium { background: var(--warning-bg); color: var(--warning); }
.badge-high { background: #fff1f2; color: #e11d48; }
.badge-critical { background: var(--danger-bg); color: var(--danger); }

/* ===== Ticket Detail / Messages ===== */
.ticket-header {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    margin-bottom: 20px;
}

.ticket-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.ticket-meta-row {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.ticket-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.messages-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.message-bubble {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px 20px;
}

.message-bubble.is-support {
    border-left: 3px solid var(--primary);
}

.message-bubble.is-internal {
    background: #fffbeb;
    border-left: 3px solid var(--warning);
}

[data-theme="dark"] .message-bubble.is-internal {
    background: rgba(230, 126, 34, 0.15);
}

.message-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.message-author {
    font-weight: 600;
    font-size: 0.9rem;
}

.message-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.message-content {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-primary);
}

.reply-box {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
}

.reply-box textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    outline: none;
    background: var(--input-bg);
    color: var(--text-primary);
    transition: border-color var(--transition-fast);
}

.reply-box textarea:focus {
    border-color: var(--primary);
}

.reply-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
}

/* ===== Support Layout ===== */
.support-layout {
    display: flex;
    min-height: calc(100vh - var(--header-height));
}

.support-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    padding: 24px 16px;
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    overflow-y: auto;
    transition: background-color var(--transition), border-color var(--transition);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--border-radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.sidebar-nav a:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.sidebar-nav a.active {
    background: var(--primary-lighter);
    color: var(--primary);
    font-weight: 600;
}

[data-theme="dark"] .sidebar-nav a.active {
    background: rgba(0, 105, 179, 0.15);
}

.sidebar-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.sidebar-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    padding: 0 14px;
    margin-bottom: 12px;
}

.support-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 32px;
    width: calc(100% - var(--sidebar-width));
}

/* ===== Dashboard Stats ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    transition: all var(--transition);
}

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

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 6px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-card.primary { border-top: 3px solid var(--primary); }
.stat-card.warning { border-top: 3px solid var(--warning); }
.stat-card.success { border-top: 3px solid var(--success); }
.stat-card.info { border-top: 3px solid #7c3aed; }

/* ===== Tables ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.data-table th {
    padding: 14px 20px;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 14px 20px;
    font-size: 0.9rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: var(--hover-bg);
}

.data-table a {
    font-weight: 500;
}

/* ===== Forms (support) ===== */
.form-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 32px;
}

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

.form-textarea {
    width: 100%;
    min-height: 200px;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    outline: none;
    background: var(--input-bg);
    color: var(--text-primary);
    transition: border-color var(--transition-fast);
}

.form-textarea:focus {
    border-color: var(--primary);
}

.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--input-bg);
    outline: none;
    cursor: pointer;
    transition: border-color var(--transition-fast);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b7685' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.form-select:focus {
    border-color: var(--primary);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-check label {
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* ===== Confluence Doc Forms ===== */
.doc-entry {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 16px;
    margin-bottom: 12px;
    position: relative;
}

.doc-entry .remove-doc {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--danger);
    color: var(--white);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.doc-entry .remove-doc:hover {
    opacity: 1;
}

/* ===== Quick Actions ===== */
.quick-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.action-form {
    display: inline-flex;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-muted);
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.95rem;
    max-width: 400px;
    margin: 0 auto;
}

/* ===== Filters ===== */
.filters-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.filter-chip:hover,
.filter-chip.active {
    background: var(--primary-lighter);
    color: var(--primary);
    border-color: var(--primary);
}

/* ===== Page Header ===== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ===== Related Articles Sidebar ===== */
.sidebar-articles {
    margin-top: 32px;
}

.sidebar-articles h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.related-article-link {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--primary);
    transition: color var(--transition-fast);
}

.related-article-link:hover {
    color: var(--primary-dark);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.6rem;
    }

    .categories-grid {
        grid-template-columns: 1fr;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }

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

    .support-sidebar {
        display: none;
    }

    .support-content {
        margin-left: 0;
        width: 100%;
    }

    .header-nav {
        display: none;
    }

    .content-wrapper {
        padding: 20px 16px;
    }

    .login-card {
        margin: 16px;
        padding: 32px 24px;
    }

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

    .ticket-item {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--gray-600);
}

/* ===== Utilities ===== */
.mt-4 { margin-top: 32px; }
.mt-3 { margin-top: 24px; }
.mt-2 { margin-top: 16px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* ============================================================
   AI CHAT — Floating Action Button + Chat Panel
   ============================================================ */

/* FAB Button */
.ai-chat-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e88e5 0%, #0d47a1 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(13, 71, 161, 0.45);
    z-index: 10000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    padding: 0;
}

.ai-chat-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 40px rgba(13, 71, 161, 0.6);
}

.ai-chat-fab.active {
    transform: scale(0.9);
    box-shadow: 0 8px 24px rgba(13, 71, 161, 0.4);
}

.ai-chat-fab-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.ai-chat-fab-icon {
    font-size: 28px;
    line-height: 1;
    transition: transform 0.3s ease;
}

.ai-chat-fab-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e88e5 0%, #0d47a1 100%);
    animation: aiFabPulse 2.5s ease-in-out infinite;
    z-index: -1;
    pointer-events: none;
}

.ai-chat-fab.active .ai-chat-fab-pulse {
    animation: none;
    opacity: 0;
}

@keyframes aiFabPulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.3); opacity: 0; }
}

/* Chat Panel */
.ai-chat-panel {
    position: fixed;
    bottom: 104px;
    right: 28px;
    width: 420px;
    height: 580px;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.12),
        0 8px 32px rgba(13, 71, 161, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(24px) scale(0.92);
    opacity: 0;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ai-chat-panel.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: all;
}

[data-theme="dark"] .ai-chat-panel {
    background: rgba(30, 34, 42, 0.97);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.4),
        0 8px 32px rgba(13, 71, 161, 0.15);
}

/* Chat Header */
.ai-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    background: linear-gradient(135deg, #1e88e5 0%, #0d47a1 100%);
    color: #fff;
    flex-shrink: 0;
}

.ai-chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    overflow: hidden;
}

.ai-chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.ai-chat-name {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.ai-chat-status {
    font-size: 0.78rem;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-chat-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34d399;
    display: inline-block;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.ai-chat-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.ai-chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Chat Messages Area */
.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

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

.ai-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 3px;
}

/* Welcome Screen */
.ai-chat-welcome {
    text-align: center;
    padding: 24px 8px;
    animation: fadeInUp 0.5s ease;
}

.ai-chat-welcome-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin: 0 auto 16px;
    box-shadow: 0 4px 16px rgba(13, 71, 161, 0.12);
    overflow: hidden;
}

.ai-chat-welcome-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

[data-theme="dark"] .ai-chat-welcome-icon {
    background: linear-gradient(135deg, rgba(30, 136, 229, 0.15) 0%, rgba(13, 71, 161, 0.15) 100%);
}

.ai-chat-welcome h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.ai-chat-welcome p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 20px;
}

/* Suggestions */
.ai-chat-suggestions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ai-chat-suggestion {
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.85rem;
    font-family: inherit;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.ai-chat-suggestion:hover {
    background: #e3f2fd;
    border-color: #1e88e5;
    color: #0d47a1;
    transform: translateX(4px);
}

[data-theme="dark"] .ai-chat-suggestion:hover {
    background: rgba(30, 136, 229, 0.1);
    color: #90caf9;
}

/* Message Bubbles */
.ai-msg {
    display: flex;
    gap: 10px;
    animation: fadeInUp 0.35s ease;
}

.ai-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e88e5 0%, #0d47a1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 2px;
    overflow: hidden;
}

.ai-msg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.ai-msg-bubble {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px 16px 16px 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.6;
    position: relative;
    word-break: break-word;
}

[data-theme="dark"] .ai-msg-bubble {
    background: rgba(255, 255, 255, 0.06);
}

.ai-msg-bubble p { margin-bottom: 8px; }
.ai-msg-bubble p:last-child { margin-bottom: 0; }
.ai-msg-bubble strong { font-weight: 600; }

.ai-msg-bubble ul, .ai-msg-bubble ol {
    padding-left: 18px;
    margin: 8px 0;
}

.ai-msg-bubble li {
    margin-bottom: 4px;
}

.ai-msg-bubble code {
    background: rgba(0, 0, 0, 0.06);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.85em;
}

[data-theme="dark"] .ai-msg-bubble code {
    background: rgba(255, 255, 255, 0.1);
}

/* User Messages */
.user-msg {
    display: flex;
    justify-content: flex-end;
    animation: fadeInUp 0.35s ease;
}

.user-msg-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px 16px 4px 16px;
    background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%);
    color: #fff;
    font-size: 0.9rem;
    line-height: 1.5;
    word-break: break-word;
}

/* Typing Indicator */
.ai-typing {
    display: flex;
    gap: 10px;
    animation: fadeInUp 0.35s ease;
}

.ai-typing-dots {
    display: flex;
    gap: 4px;
    padding: 14px 18px;
    background: var(--bg-secondary);
    border-radius: 16px 16px 16px 4px;
}

[data-theme="dark"] .ai-typing-dots {
    background: rgba(255, 255, 255, 0.06);
}

.ai-typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #90caf9;
    animation: typingBounce 1.4s ease-in-out infinite;
}

.ai-typing-dot:nth-child(2) { animation-delay: 0.16s; }
.ai-typing-dot:nth-child(3) { animation-delay: 0.32s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* Ticket Card (when AI returns JSON) */
.ai-ticket-card {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 1px solid #90caf9;
    border-radius: 14px;
    padding: 18px;
    margin-top: 8px;
    animation: fadeInUp 0.4s ease;
}

[data-theme="dark"] .ai-ticket-card {
    background: linear-gradient(135deg, rgba(30, 136, 229, 0.08) 0%, rgba(13, 71, 161, 0.08) 100%);
    border-color: rgba(30, 136, 229, 0.2);
}

.ai-ticket-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #0d47a1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

[data-theme="dark"] .ai-ticket-card-header {
    color: #90caf9;
}

.ai-ticket-field {
    margin-bottom: 10px;
}

.ai-ticket-field-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 3px;
}

.ai-ticket-field-value {
    font-size: 0.88rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.ai-ticket-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    width: 100%;
    justify-content: center;
}

.ai-ticket-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 71, 161, 0.3);
    color: #fff;
}

/* Error Message */
.ai-error-bubble {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px 16px 16px 4px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    font-size: 0.88rem;
    line-height: 1.5;
}

[data-theme="dark"] .ai-error-bubble {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

/* Chat Input Area */
.ai-chat-input-area {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
    flex-shrink: 0;
}

[data-theme="dark"] .ai-chat-input-area {
    border-top-color: rgba(255, 255, 255, 0.06);
}

.ai-chat-input-area input {
    flex: 1;
    padding: 11px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background: var(--input-bg);
    outline: none;
    transition: border-color 0.2s ease;
}

.ai-chat-input-area input:focus {
    border-color: #1e88e5;
}

.ai-chat-input-area input::placeholder {
    color: var(--text-muted);
}

#ai-chat-send {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    opacity: 0.5;
}

#ai-chat-send:not(:disabled) {
    opacity: 1;
}

#ai-chat-send:not(:disabled):hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(13, 71, 161, 0.35);
}

#ai-chat-send:disabled {
    cursor: not-allowed;
}

/* AI Pre-fill Banner */
.ai-prefill-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 1px solid #90caf9;
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 24px;
    font-size: 0.9rem;
    color: #0d47a1;
    animation: fadeInUp 0.5s ease;
}

[data-theme="dark"] .ai-prefill-banner {
    background: linear-gradient(135deg, rgba(30, 136, 229, 0.1) 0%, rgba(13, 71, 161, 0.1) 100%);
    border-color: rgba(30, 136, 229, 0.2);
    color: #90caf9;
}

.ai-prefill-banner-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .ai-chat-fab {
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
    }

    .ai-chat-fab-icon {
        font-size: 24px;
    }

    .ai-chat-panel {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        max-height: 100dvh;
    }

    .ai-chat-panel.open {
        transform: translateY(0) scale(1);
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .ai-chat-panel {
        width: calc(100vw - 40px);
        right: 20px;
        bottom: 92px;
        height: 500px;
    }
}

