* { box-sizing: border-box; }
body { font-family: system-ui, -apple-system, sans-serif; margin: 0; padding: 0; background: #f5f5f5; color: #333; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Login */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.login-box { background: #fff; padding: 2rem; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.08); width: 100%; max-width: 360px; }
.login-box h1 { margin: 0 0 0.25rem; font-size: 1.5rem; }
.login-box .subtitle { margin: 0 0 1.5rem; color: #666; font-size: 0.9rem; }

/* Header */
.header { background: #fff; padding: 1rem 1.5rem; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.header h1 { margin: 0; font-size: 1.25rem; }
.header nav { display: flex; gap: 1.5rem; }

/* Main */
.main { max-width: 1100px; margin: 0 auto; padding: 1.5rem; }

/* Toolbar */
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; gap: 1rem; }
.toolbar h2 { margin: 0; font-size: 1.25rem; }
.toolbar-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.filters { display: flex; gap: 0.5rem; }
.bulk-actions { display: flex; gap: 0.5rem; }
.filter-btn { padding: 0.4rem 0.8rem; border-radius: 4px; background: #e5e7eb; color: #374151; font-size: 0.9rem; }
.filter-btn:hover { background: #d1d5db; }
.filter-btn.active { background: #2563eb; color: #fff; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.35rem; font-size: 0.9rem; font-weight: 500; }
input[type="text"], input[type="password"], input[type="email"], input[type="file"] { width: 100%; padding: 0.5rem 0.75rem; border: 1px solid #d1d5db; border-radius: 4px; font-size: 1rem; }
.btn { padding: 0.5rem 1rem; border: none; border-radius: 4px; font-size: 1rem; cursor: pointer; }
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary { background: #e5e7eb; color: #374151; }
.btn-secondary:hover { background: #d1d5db; }
.btn-sm { padding: 0.35rem 0.6rem; font-size: 0.85rem; }
.btn-send { background: #059669; color: #fff; }
.btn-send:hover { background: #047857; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-danger-outline { background: transparent; color: #dc2626; border: 1px solid #dc2626; }
.btn-danger-outline:hover { background: #fef2f2; }
.form-actions { display: flex; gap: 0.5rem; margin-top: 1rem; }
.checkbox-label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; font-weight: normal; }

/* Alerts */
.alert { padding: 0.75rem 1rem; border-radius: 4px; margin-bottom: 1rem; }
.alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }

/* Table */
.ticket-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.ticket-table th, .ticket-table td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid #e5e7eb; }
.ticket-table th { background: #f9fafb; font-weight: 600; font-size: 0.85rem; color: #6b7280; }
.ticket-table .actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.badge { display: inline-block; padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.8rem; font-weight: 500; }
.badge-used { background: #dbeafe; color: #1d4ed8; }
.badge-unused { background: #d1fae5; color: #047857; }
.winner-cell { max-width: 200px; word-break: break-word; }

.empty { color: #6b7280; padding: 2rem; text-align: center; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 1rem; }
.modal[hidden] { display: none; }
.modal-content { background: #fff; padding: 1.5rem; border-radius: 8px; width: 100%; max-width: 400px; box-shadow: 0 10px 40px rgba(0,0,0,0.2); }
.modal-content h3 { margin: 0 0 1rem; font-size: 1.1rem; }

/* Upload */
.upload-area { background: #fff; padding: 2rem; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); margin-bottom: 1.5rem; }
.upload-area input[type="file"] { padding: 0.5rem 0; }
.upload-hint { font-size: 0.9rem; color: #6b7280; margin-bottom: 1rem; }
.upload-progress { margin-top: 1rem; }
.progress-bar { height: 8px; background: #e5e7eb; border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: #059669; width: 0; transition: width 0.3s; }
.upload-result { margin-top: 1rem; }

@media (max-width: 640px) {
    .header { flex-direction: column; align-items: stretch; gap: 0.5rem; }
    .ticket-table { font-size: 0.9rem; }
    .ticket-table th, .ticket-table td { padding: 0.5rem; }
    .ticket-table .actions { flex-direction: column; }
}
