* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: system-ui, -apple-system, sans-serif;
    background: #0d0d1a;
    color: #e0e0e0;
    min-height: 100vh;
    padding: 20px;
}
#app { max-width: 850px; margin: 0 auto; }

header {
    text-align: center;
    padding: 20px 0 15px;
    border-bottom: 1px solid #1e1e2e;
    margin-bottom: 20px;
}
header h1 {
    font-size: 30px;
    background: linear-gradient(135deg, #6c5ce7, #00b894);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
header p { color: #666; margin: 6px 0 12px; }

#auth button {
    background: #2a2a3e;
    border: none;
    color: #fff;
    padding: 6px 18px;
    border-radius: 20px;
    cursor: pointer;
    transition: opacity 0.2s;
}
#auth button:hover { opacity: 0.8; }

section {
    background: #16162a;
    padding: 20px;
    border-radius: 14px;
    margin-bottom: 18px;
    border: 1px solid #1e1e2e;
}
section h2 {
    font-size: 18px;
    margin-bottom: 14px;
    color: #fff;
}

#stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}
.stat-card {
    background: #1e1e2e;
    padding: 15px;
    border-radius: 12px;
    text-align: center;
}
.stat-number {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #6c5ce7;
}
.stat-label { font-size: 13px; color: #888; }

input, textarea {
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    border: none;
    background: #1e1e2e;
    color: #fff;
    outline: 2px solid #2a2a3e;
    margin-bottom: 10px;
    font-family: inherit;
}
input:focus, textarea:focus { outline-color: #6c5ce7; }
textarea { min-height: 80px; resize: vertical; }

button {
    padding: 10px 24px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #6c5ce7, #00b894);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
button:hover { opacity: 0.85; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

#chatMessages {
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    background: #0d0d1a;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 10px;
}
.message {
    padding: 8px 14px;
    border-radius: 10px;
    margin-bottom: 6px;
    max-width: 85%;
    word-wrap: break-word;
}
.message.user {
    background: #1a1a3e;
    margin-left: auto;
    text-align: right;
    border-left: 3px solid #6c5ce7;
}
.message.assistant {
    background: #1a1a2a;
    margin-right: auto;
    border-right: 3px solid #00b894;
}
.message .sources {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid #2a2a3e;
}
#chatInput { display: flex; gap: 10px; }
#chatInput input { margin-bottom: 0; }

.ticket-item {
    background: #1a1a2e;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 8px;
    border-right: 4px solid #6c5ce7;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.ticket-item .status {
    font-size: 12px;
    padding: 2px 12px;
    border-radius: 12px;
}
.ticket-item .status.open { background: #f5576c; color: #fff; }
.ticket-item .status.resolved { background: #00b894; color: #fff; }
.ticket-item .status.pending { background: #fdcb6e; color: #1a1a2e; }
.ticket-item .actions button {
    background: none;
    padding: 4px 10px;
    font-size: 13px;
    margin-left: 6px;
}
.ticket-item .actions button:hover { opacity: 0.7; }

#ticketStatus { margin-top: 10px; font-size: 14px; color: #888; }

footer {
    text-align: center;
    color: #333;
    font-size: 13px;
    padding: 15px 0;
    border-top: 1px solid #1a1a2e;
    margin-top: 15px;
}
footer a { color: #6c5ce7; text-decoration: none; }

.loading { color: #666; text-align: center; padding: 20px; }

.error { color: #f5576c; }
.success { color: #00b894; }
.warning { color: #fdcb6e; }
