/* ===== DASHBOARD STYLES ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #d4a017;
    --primary-dark: #b8860b;
    --bg: #f7fafc;
    --bg-white: #ffffff;
    --text: #2d3748;
    --text-light: #718096;
    --text-muted: #a0aec0;
    --border: #e2e8f0;
    --sidebar-bg: #1a202c;
    --sidebar-text: #a0aec0;
    --sidebar-active: #d4a017;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --radius: 10px;
    --radius-sm: 6px;
    --transition: 0.2s ease;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform var(--transition);
}

.sidebar-header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
}

.sidebar-logo .logo-text { color: var(--primary); }
.sidebar-close { display: none; background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; }

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition);
}

.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active { background: var(--sidebar-active); color: #fff; font-weight: 600; }
.nav-item i { width: 20px; text-align: center; font-size: 15px; }

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #fff;
}

.user-info { display: flex; flex-direction: column; }
.user-name { font-size: 14px; font-weight: 600; color: #fff; }
.user-role { font-size: 12px; color: var(--sidebar-text); }

.btn-logout {
    width: 100%;
    padding: 8px;
    background: rgba(255,255,255,0.06);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}

.btn-logout:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
}

.topbar {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 0 32px;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-menu { display: none; background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text); }
.topbar-title { font-size: 20px; font-weight: 700; flex: 1; }
.topbar-actions { display: flex; gap: 12px; }

/* ===== PAGES ===== */
.page { display: none; padding: 32px; }
.page.active { display: block; }

/* ===== STATS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
}

.bg-blue { background: #4299e1; }
.bg-green { background: #48bb78; }
.bg-purple { background: #9f7aea; }
.bg-orange { background: #ed8936; }
.bg-red { background: var(--primary); }

.stat-info { display: flex; flex-direction: column; }
.stat-value { font-size: 28px; font-weight: 800; line-height: 1; }
.stat-label { font-size: 13px; color: var(--text-light); margin-top: 4px; }

/* ===== CARDS ===== */
.content-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

.card {
    background: var(--bg-white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 { font-size: 16px; font-weight: 700; }
.card-body { padding: 24px; }

.link-action { font-size: 13px; font-weight: 600; color: var(--primary); }

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

.empty-state i { font-size: 40px; margin-bottom: 12px; display: block; }
.empty-state p { margin-bottom: 16px; }

/* ===== BUTTONS ===== */
.btn-primary {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 20px; background: var(--primary); color: #fff; border: none;
    border-radius: 100px; font-weight: 600; font-size: 14px; cursor: pointer;
    transition: all var(--transition); font-family: inherit;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-primary.btn-sm { padding: 8px 16px; font-size: 13px; }

.btn-outline {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 20px; background: none; border: 1px solid var(--border); color: var(--text);
    border-radius: 100px; font-weight: 600; font-size: 14px; cursor: pointer;
    transition: all var(--transition); font-family: inherit;
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-outline.btn-sm { padding: 8px 16px; font-size: 13px; }

/* ===== FORMS ===== */
.event-form { max-width: 800px; }

.form-section {
    background: var(--bg-white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 24px;
    margin-bottom: 20px;
}

.form-section h3 {
    font-size: 16px; font-weight: 700; margin-bottom: 20px;
    display: flex; align-items: center; gap: 8px;
}
.form-section h3 i { color: var(--primary); }

.form-row { display: flex; gap: 16px; margin-bottom: 16px; }
.form-row:last-child { margin-bottom: 0; }
.form-row.cols-2 > .form-group { flex: 1; }
.form-row.cols-3 > .form-group { flex: 1; }
.form-group.full { flex: 1; }

.form-group { display: flex; flex-direction: column; }
.form-group label { font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }

.form-group input, .form-group select, .form-group textarea, .form-control {
    width: 100%; padding: 10px 14px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 14px; font-family: inherit; color: var(--text);
    transition: border-color var(--transition);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus, .form-control:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(229,62,62,0.1);
}
.form-group textarea { resize: vertical; }

.form-actions {
    display: flex; gap: 12px; justify-content: flex-end;
    padding: 24px 0;
}

/* Image Upload */
.image-upload {
    border: 2px dashed var(--border); border-radius: var(--radius);
    padding: 40px; text-align: center; cursor: pointer;
    transition: all var(--transition);
}
.image-upload:hover { border-color: var(--primary); }
.upload-placeholder i { font-size: 40px; color: var(--text-muted); margin-bottom: 12px; }
.upload-placeholder p { font-weight: 600; color: var(--text); margin-bottom: 4px; }
.upload-placeholder span { font-size: 13px; color: var(--text-muted); }
.image-upload img { max-width: 100%; max-height: 300px; margin: 0 auto; border-radius: var(--radius-sm); }

/* Ticket Type Rows */
.ticket-type-row {
    display: flex; gap: 12px; align-items: flex-end;
    padding: 16px; background: var(--bg); border-radius: var(--radius-sm);
    margin-bottom: 12px; border: 1px solid var(--border);
}
.ticket-type-row .form-group { flex: 1; margin-bottom: 0; }
.ticket-type-row .form-group.narrow { flex: 0 0 100px; }
.btn-remove-tt {
    width: 36px; height: 36px; border-radius: 50%; border: none;
    background: #fed7d7; color: var(--primary); cursor: pointer;
    font-size: 14px; flex-shrink: 0; margin-bottom: 2px;
}
.btn-remove-tt:hover { background: var(--primary); color: #fff; }

/* ===== TABS ===== */
.filter-tabs { display: flex; gap: 4px; }
.tab {
    padding: 6px 16px; border: 1px solid var(--border); border-radius: 100px;
    background: none; font-size: 13px; font-weight: 500; cursor: pointer;
    color: var(--text-light); font-family: inherit; transition: all var(--transition);
}
.tab:hover { border-color: var(--primary); color: var(--primary); }
.tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.page-actions { margin-bottom: 24px; display: flex; justify-content: space-between; align-items: center; }

/* ===== DATA TABLES ===== */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    text-align: left; padding: 10px 16px; font-size: 12px; font-weight: 600;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}
.data-table td {
    padding: 12px 16px; font-size: 14px; border-bottom: 1px solid var(--border);
}
.data-table tr:hover td { background: var(--bg); }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

.badge {
    display: inline-block; padding: 3px 10px; border-radius: 100px;
    font-size: 11px; font-weight: 600; text-transform: uppercase;
}
.badge-active { background: #c6f6d5; color: #276749; }
.badge-draft { background: #e2e8f0; color: #4a5568; }
.badge-completed { background: #bee3f8; color: #2a4365; }
.badge-cancelled { background: #fed7d7; color: #9b2c2c; }
.badge-pending { background: #fefcbf; color: #975a16; }

/* Event list items */
.event-list-item {
    display: flex; align-items: center; gap: 16px; padding: 16px;
    border: 1px solid var(--border); border-radius: var(--radius);
    margin-bottom: 12px; background: var(--bg-white); transition: all var(--transition);
}
.event-list-item:hover { box-shadow: var(--shadow-md); }
.event-list-thumb {
    width: 80px; height: 56px; border-radius: var(--radius-sm);
    overflow: hidden; flex-shrink: 0; display: flex;
    align-items: center; justify-content: center; font-size: 24px;
}
.event-list-info { flex: 1; }
.event-list-title { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.event-list-meta { font-size: 13px; color: var(--text-light); }
.event-list-stats { display: flex; gap: 20px; text-align: right; }
.event-list-stat-value { font-size: 16px; font-weight: 700; display: block; }
.event-list-stat-label { font-size: 11px; color: var(--text-muted); }
.event-list-actions { display: flex; gap: 8px; }
.btn-icon {
    width: 32px; height: 32px; border-radius: var(--radius-sm); border: 1px solid var(--border);
    background: none; cursor: pointer; font-size: 14px; color: var(--text-light);
    display: flex; align-items: center; justify-content: center; transition: all var(--transition);
}
.btn-icon:hover { border-color: var(--primary); color: var(--primary); }

/* Scanner */
.scanner-container { max-width: 600px; margin: 0 auto; }
.scanner-select, .scanner-input { margin-bottom: 24px; text-align: left; }
.scanner-select label, .scanner-input label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 14px; }

.scan-result {
    margin: 24px 0; padding: 20px; border-radius: var(--radius);
    font-size: 16px; font-weight: 600; text-align: center;
}
.scan-result.valid { background: #c6f6d5; color: #276749; border: 2px solid #48bb78; }
.scan-result.invalid { background: #fed7d7; color: #9b2c2c; border: 2px solid #e53e3e; }

.scan-stats {
    display: flex; gap: 24px; justify-content: center; margin-top: 32px;
    padding-top: 24px; border-top: 1px solid var(--border);
}
.scan-stat { text-align: center; }
.scan-stat-value { font-size: 28px; font-weight: 800; display: block; }
.scan-stat-label { font-size: 12px; color: var(--text-muted); }

/* Promo form */
.promo-form {
    padding: 20px; background: var(--bg); border-radius: var(--radius);
    margin-bottom: 20px; border: 1px solid var(--border);
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast {
    position: fixed; bottom: 24px; right: 24px; padding: 14px 24px;
    border-radius: var(--radius); font-size: 14px; font-weight: 600;
    box-shadow: var(--shadow-md); z-index: 1000; transform: translateY(100px);
    opacity: 0; transition: all 0.3s ease;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: #276749; color: #fff; }
.toast.error { background: #9b2c2c; color: #fff; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-close { display: block; }
    .main-content { margin-left: 0; }
    .topbar-menu { display: block; }
    .topbar { padding: 0 16px; }
    .page { padding: 20px 16px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stat-card { padding: 16px; }
    .stat-value { font-size: 22px; }
    .form-row { flex-direction: column; gap: 12px; }
    .form-row.cols-2 > .form-group, .form-row.cols-3 > .form-group { flex: none; }
    .ticket-type-row { flex-wrap: wrap; }
    .data-table { font-size: 13px; }
    .data-table th, .data-table td { padding: 8px 10px; }
    .event-list-item { flex-wrap: wrap; }
    .event-list-stats { width: 100%; justify-content: space-around; margin-top: 8px; }
}
