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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

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

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.logo h1 {
    font-size: 1.8rem;
    color: #667eea;
    margin: 0;
}

.logo span {
    color: #764ba2;
    font-weight: 300;
}

.nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#user-name {
    font-weight: 500;
    margin-right: 1rem;
}

/* Main */
.main {
    padding: 2rem 0;
}

/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.btn-block {
    width: 100%;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    margin: 0 auto;
}

.card h2 {
    margin-bottom: 1.5rem;
    color: #333;
}

/* Auth Sections */
.auth-section {
    margin-top: 2rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.text-center {
    text-align: center;
    margin-top: 1rem;
}

.text-center a {
    color: #667eea;
    text-decoration: none;
}

.text-center a:hover {
    text-decoration: underline;
}

/* Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.dashboard-header h2 {
    color: #333;
}

/* Tickets List */
.tickets-list {
    display: grid;
    gap: 1rem;
}

/* Admin Controls */
.admin-controls {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.admin-controls select {
    padding: 0.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
}

.admin-controls select:focus {
    outline: none;
    border-color: #667eea;
}

.admin-controls .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.admin-badge {
    background: #667eea;
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.ticket-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.ticket-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.8rem;
}

.ticket-subject {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.ticket-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.8rem;
}

.ticket-date {
    color: #888;
    font-size: 0.9rem;
}

.ticket-user {
    color: #666;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Badges */
.status-badge,
.priority-badge,
.category-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-badge {
    background: #e3f2fd;
    color: #1976d2;
}

.status-badge.closed {
    background: #e8f5e9;
    color: #388e3c;
}

.status-badge.in_progress {
    background: #fff3e0;
    color: #f57c00;
}

.priority-badge.low {
    background: #e8f5e9;
    color: #388e3c;
}

.priority-badge.medium {
    background: #fff3e0;
    color: #f57c00;
}

.priority-badge.high {
    background: #ffebee;
    color: #d32f2f;
}

.priority-badge.urgent {
    background: #d32f2f;
    color: white;
}

.category-badge {
    background: #f3e5f5;
    color: #7b1fa2;
}

/* Ticket Detail */
.ticket-detail {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.ticket-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.ticket-info {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.ticket-description {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #f0f0f0;
}

.ticket-description h3 {
    margin-bottom: 0.8rem;
    color: #555;
}

.ticket-description p {
    color: #666;
    line-height: 1.6;
}

/* Messages */
.messages-section h3 {
    margin-bottom: 1rem;
    color: #555;
}

.messages-list {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 8px;
}

.message {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.message.admin {
    background: #e3f2fd;
    border-left: 4px solid #1976d2;
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

.message-user {
    font-weight: 600;
}

.message-content {
    color: #333;
    line-height: 1.5;
}

.message-form {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.message-form textarea {
    flex: 1;
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    resize: vertical;
}

.message-form textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #888;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .message-form {
        flex-direction: column;
    }

    .card {
        padding: 1.5rem;
    }
}
