/* IT Assist - Modern UI */
:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #dbeafe;
    --secondary: #0f172a;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --success: #059669;
    --success-bg: #d1fae5;
    --error: #dc2626;
    --error-bg: #fee2e2;
    --warning: #d97706;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition: 0.2s ease;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* Header */
.site-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    background: rgba(255,255,255,0.92);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--secondary);
}

.logo-icon { font-size: 1.5rem; }

.main-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.main-nav a { color: var(--text-muted); font-weight: 500; font-size: 0.95rem; }
.main-nav a:hover { color: var(--primary); }

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

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,0.35); }

.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { background: #1e293b; color: #fff; }

.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-ghost { background: transparent; color: var(--text-muted); padding: 6px 12px; }
.btn-ghost:hover { background: var(--bg); color: var(--primary); }

.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-block { width: 100%; }

/* Hero */
.hero {
    padding: 80px 0 100px;
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 50%, #fff 100%);
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.badge {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.hero h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.15;
    color: var(--secondary);
    margin-bottom: 20px;
    font-weight: 800;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-lead { font-size: 1.125rem; color: var(--text-muted); margin-bottom: 32px; max-width: 520px; }

.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 48px; }

.hero-stats { display: flex; gap: 40px; }
.stat strong { display: block; font-size: 1.5rem; color: var(--secondary); }
.stat span { font-size: 0.85rem; color: var(--text-muted); }

.hero-visual { display: flex; justify-content: center; }

.mock-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 380px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.mock-header {
    background: var(--secondary);
    color: #fff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-family: monospace;
}

.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.red { background: #ef4444; }
.dot.yellow { background: #eab308; }
.dot.green { background: #22c55e; }

.mock-body { padding: 24px; }
.mock-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.mock-row .label { color: var(--text-muted); }
.mock-row .code { font-family: monospace; font-size: 1.1rem; letter-spacing: 3px; color: var(--primary); font-weight: 700; }

/* Sections */
.section { padding: 80px 0; }
.section-alt { background: var(--bg-card); }

.section-header { text-align: center; margin-bottom: 56px; }
.section-header h2 { font-size: 2rem; color: var(--secondary); margin-bottom: 12px; }
.section-header p { color: var(--text-muted); font-size: 1.1rem; }

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 28px;
    transition: all var(--transition);
}

.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--primary-light); }

.feature-icon { font-size: 2rem; margin-bottom: 16px; }
.feature-card h3 { font-size: 1.1rem; margin-bottom: 10px; color: var(--secondary); }
.feature-card p { color: var(--text-muted); font-size: 0.95rem; }

.steps { list-style: none; max-width: 700px; margin: 0 auto; }
.steps li {
    display: flex;
    gap: 24px;
    padding: 28px 0;
    border-bottom: 1px solid var(--border);
    align-items: flex-start;
}

.step-num {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.steps h3 { margin-bottom: 6px; color: var(--secondary); }

.cta-section { padding: 60px 0 80px; }
.cta-box {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff;
    text-align: center;
    padding: 60px 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.cta-box h2 { font-size: 1.75rem; margin-bottom: 12px; }
.cta-box p { opacity: 0.9; margin-bottom: 28px; }
.cta-box .btn-primary { background: #fff; color: var(--primary-dark); }
.cta-box .btn-primary:hover { background: var(--primary-light); }

/* Footer */
.site-footer {
    margin-top: auto;
    background: var(--secondary);
    color: #94a3b8;
    padding: 32px 0;
    text-align: center;
    font-size: 0.9rem;
}

.footer-sub { font-size: 0.8rem; margin-top: 4px; opacity: 0.7; }

/* Alerts */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin: 16px auto;
    font-size: 0.95rem;
    max-width: 1200px;
}

.alert-success { background: var(--success-bg); color: #065f46; border: 1px solid #6ee7b7; }
.alert-error { background: var(--error-bg); color: #991b1b; border: 1px solid #fca5a5; }

/* Login */
.page-login { background: linear-gradient(135deg, #1e40af 0%, #0f172a 100%); min-height: 100vh; }

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}

.login-brand { text-align: center; margin-bottom: 32px; }
.login-brand .logo-icon { font-size: 2.5rem; }
.login-brand h1 { font-size: 1.75rem; color: var(--secondary); margin: 8px 0 4px; }
.login-brand p { color: var(--text-muted); }

.login-form .form-group { margin-bottom: 20px; }
.login-footer { text-align: center; margin-top: 24px; font-size: 0.9rem; }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 8px; color: var(--secondary); }
.form-group label small { font-weight: 400; color: var(--text-muted); }

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    background: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

.input-disabled { background: var(--bg); color: var(--text-muted); cursor: not-allowed; }

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

.file-upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    position: relative;
    transition: all var(--transition);
    cursor: pointer;
}

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

.file-upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-upload-text span { display: block; font-weight: 500; margin-bottom: 4px; }
.file-upload-text small { color: var(--text-muted); }

/* Status pills */
.status-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-open { background: #dbeafe; color: #1e40af; }
.status-progress { background: #fef3c7; color: #92400e; }
.status-remote { background: #ede9fe; color: #5b21b6; }
.status-resolved { background: var(--success-bg); color: #065f46; }
.status-closed { background: #f1f5f9; color: #475569; }

/* Panel layout */
.panel-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 32px;
    padding: 32px 24px;
    min-height: calc(100vh - 130px);
}

.panel-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    height: fit-content;
    position: sticky;
    top: 88px;
}

.sidebar-header h2 { font-size: 1.1rem; color: var(--secondary); margin-bottom: 8px; }
.company-badge {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.sidebar-nav { margin: 24px 0; display: flex; flex-direction: column; gap: 4px; }
.sidebar-nav a {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
}
.sidebar-nav a:hover,
.sidebar-nav a.active { background: var(--primary-light); color: var(--primary-dark); }

.user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    text-transform: uppercase;
}

.user-card strong { display: block; font-size: 0.9rem; }
.user-card small { color: var(--text-muted); font-size: 0.8rem; }

.panel-main { min-width: 0; }

.ticket-form-section,
.ticket-list-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 24px;
}

.ticket-form-section h2,
.ticket-list-section h2 { font-size: 1.35rem; color: var(--secondary); margin-bottom: 8px; }
.section-desc { color: var(--text-muted); margin-bottom: 28px; }

.ticket-table-wrap { overflow-x: auto; }
.ticket-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.ticket-table th { text-align: left; padding: 12px 16px; border-bottom: 2px solid var(--border); color: var(--text-muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; }
.ticket-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.ticket-table tr:hover td { background: var(--bg); }
.ticket-table code { background: var(--bg); padding: 2px 8px; border-radius: 4px; font-size: 0.85rem; }

/* Ticket detail */
.ticket-detail { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; }
.back-link { display: inline-block; margin-bottom: 20px; font-size: 0.9rem; color: var(--text-muted); }
.ticket-detail-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.ticket-num { font-family: monospace; color: var(--primary); font-weight: 600; font-size: 0.9rem; }
.ticket-detail-header h2 { font-size: 1.5rem; color: var(--secondary); margin-top: 4px; }

.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 28px;
    padding: 20px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.detail-item span { display: block; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 2px; }
.detail-item strong { font-size: 0.95rem; }

.quick-assist-box {
    background: linear-gradient(135deg, #ede9fe, #dbeafe);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 28px;
    text-align: center;
}

.assist-code {
    font-family: monospace;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 6px;
    color: var(--primary-dark);
    margin: 12px 0;
}

.ticket-description h3,
.attachments h3,
.replies h3 { font-size: 1rem; color: var(--secondary); margin-bottom: 12px; }
.ticket-description p { color: var(--text); white-space: pre-wrap; }

.attachments ul { list-style: none; }
.attachments li { padding: 8px 0; }
.attachments a { display: flex; align-items: center; gap: 8px; }

.replies { margin-top: 28px; }
.reply-item {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 12px;
    border-left: 3px solid var(--primary);
}

.reply-internal { border-left-color: var(--warning); background: #fffbeb; }
.reply-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; font-size: 0.85rem; }
.reply-meta time { color: var(--text-muted); margin-left: auto; }
.internal-badge { background: #fef3c7; color: #92400e; padding: 2px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 600; }

.empty-state { text-align: center; padding: 48px; color: var(--text-muted); }

/* Assistant panel */
.assistant-layout { padding: 32px 24px; }

.assistant-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 24px;
}

.assistant-header h1 { font-size: 1.75rem; color: var(--secondary); }
.assistant-header p { color: var(--text-muted); }

.stats-row { display: flex; gap: 16px; flex-wrap: wrap; }
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 24px;
    text-align: center;
    min-width: 90px;
}

.stat-num { display: block; font-size: 1.75rem; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); }
.stat-progress .stat-num { color: var(--warning); }
.stat-remote .stat-num { color: #7c3aed; }
.stat-resolved .stat-num { color: var(--success); }

.assistant-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
    min-height: 600px;
}

.assistant-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

.assistant-sidebar h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 12px; }
.sidebar-list-title { margin-top: 20px; }
.sidebar-empty { font-size: 0.85rem; color: var(--text-muted); padding: 12px; background: var(--bg); border-radius: var(--radius-sm); line-height: 1.5; }

.filter-nav { display: flex; flex-direction: column; gap: 2px; margin-bottom: 24px; }
.filter-nav a {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}
.filter-nav a:hover,
.filter-nav a.active { background: var(--primary-light); color: var(--primary-dark); }

.mini-ticket {
    display: block;
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-bottom: 8px;
    transition: all var(--transition);
}

.mini-ticket:hover,
.mini-ticket.active { border-color: var(--primary); background: var(--primary-light); }
.mini-ticket code { font-size: 0.75rem; color: var(--primary); }
.mini-ticket span { display: block; font-size: 0.85rem; margin: 4px 0; color: var(--text); }

.assistant-main { min-width: 0; }
.assistant-empty { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 80px 40px; text-align: center; }
.assistant-empty h2 { margin-bottom: 8px; color: var(--secondary); }
.muted { color: var(--text-muted); margin-top: 8px; }

.action-panels {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 28px 0;
}

.action-panel {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
}

.action-panel h3 { font-size: 0.95rem; margin-bottom: 12px; color: var(--secondary); }

.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form select,
.inline-form input[type="text"] { flex: 1; min-width: 120px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; font-family: inherit; }

.quick-assist-panel { background: linear-gradient(135deg, #f5f3ff, #eff6ff); }

.replies-section { margin-top: 28px; }
.reply-form textarea { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: inherit; resize: vertical; }
.reply-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; flex-wrap: wrap; gap: 12px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--text-muted); cursor: pointer; }

.status-log { margin-top: 24px; font-size: 0.9rem; }
.status-log summary { cursor: pointer; font-weight: 600; color: var(--text-muted); padding: 8px 0; }
.status-log ul { list-style: none; margin-top: 12px; }
.status-log li { padding: 8px 0; border-bottom: 1px solid var(--border); color: var(--text-muted); }
.status-log time { color: var(--text); margin-right: 8px; }

/* Admin panel */
.admin-layout { padding: 32px 24px; }
.admin-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 28px; flex-wrap: wrap; gap: 16px; }
.admin-header h1 { font-size: 1.75rem; color: var(--secondary); }
.admin-header p { color: var(--text-muted); }
.admin-tabs { display: flex; gap: 4px; margin-bottom: 28px; border-bottom: 2px solid var(--border); }
.admin-tabs a { padding: 12px 20px; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -2px; }
.admin-tabs a:hover { color: var(--primary); }
.admin-tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }
.admin-grid { display: grid; grid-template-columns: 380px 1fr; gap: 24px; align-items: start; }
.admin-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.admin-card h2 { font-size: 1.15rem; color: var(--secondary); margin-bottom: 20px; }
.admin-list-card { min-width: 0; }
.admin-password-card { max-width: 520px; }
.form-actions { display: flex; gap: 12px; margin-top: 8px; }
.block-muted { display: block; color: var(--text-muted); font-size: 0.8rem; margin-top: 2px; }
.checkbox-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.admin-table-wrap { overflow-x: auto; }

/* Responsive */
@media (max-width: 1024px) {
    .admin-grid { grid-template-columns: 1fr; }
    .hero-grid { grid-template-columns: 1fr; }
    .hero-visual { order: -1; }
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .panel-layout { grid-template-columns: 1fr; }
    .panel-sidebar { position: static; }
    .assistant-grid { grid-template-columns: 1fr; }
    .assistant-sidebar { max-height: 300px; }
    .action-panels { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .main-nav { display: none; }
    .main-nav.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-card);
        padding: 20px 24px;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
    }
    .mobile-toggle { display: block; }
    .features-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .hero { padding: 48px 0 60px; }
    .hero-stats { gap: 24px; }
    .stats-row { width: 100%; justify-content: space-between; }
    .stat-card { flex: 1; min-width: 70px; padding: 12px; }
}
