/* ===== CSS Variables ===== */
:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --sidebar-bg: #1e2a3b;
    --sidebar-hover: #2d3e52;
    --sidebar-active: #3b82f6;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border-color: #e5e7eb;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --purple: #8b5cf6;
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-light);
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 14px;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ===== App Container ===== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
    width: 220px;
    background: var(--sidebar-bg);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 24px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo-circle {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #2dd4bf 0%, #3b82f6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}

.company-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.company-name {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.company-email {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: rgba(255,255,255,0.7);
    transition: all 0.2s;
    position: relative;
    font-size: 14px;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.nav-item.active {
    background: transparent;
    color: #fff;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
    border-radius: 0 2px 2px 0;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 8px 0;
}

.notif-dot {
    position: absolute;
    right: 20px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    margin-left: 220px;
    min-height: 100vh;
    background: var(--bg-light);
}

/* ===== Dashboard Header ===== */
.dashboard-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 32px;
    background: #fff;
    border-bottom: 1px solid var(--border-color);
}

.dashboard-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.event-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #f3f4f6;
    border-radius: 20px;
    cursor: pointer;
}

.event-avatars {
    display: flex;
}

.event-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #fff;
    margin-left: -8px;
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.event-avatar:first-child {
    margin-left: 0;
}

.event-selector-text {
    color: var(--primary);
    font-weight: 500;
    font-size: 14px;
}

.event-selector i {
    color: var(--primary);
    font-size: 12px;
}

/* ===== Dashboard Content ===== */
.dashboard-content {
    padding: 24px 32px;
}

/* ===== Tickets Sold Chart (Blue Gradient) ===== */
.tickets-sold-card {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    color: #fff;
}

.tickets-sold-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.tickets-sold-header h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.tickets-sold-header p {
    font-size: 13px;
    opacity: 0.8;
}

.period-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.2);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
}

.tickets-chart-container {
    height: 200px;
    position: relative;
}

/* ===== Two Column Grid ===== */
.two-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

/* ===== Card Base ===== */
.card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.card-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

.card-menu {
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
}

/* ===== Sales Card ===== */
.sales-chart-wrapper {
    display: flex;
    gap: 24px;
}

.sales-chart-area {
    flex: 1;
    height: 180px;
}

.sales-total {
    text-align: right;
}

.sales-amount {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.sales-today {
    font-size: 14px;
    color: var(--success);
    margin-top: 4px;
}

/* ===== Booking Capacity ===== */
.capacity-content {
    display: flex;
    flex-direction: column;
}

.capacity-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
}

.capacity-stat {
    text-align: center;
}

.capacity-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
}

.capacity-label {
    font-size: 13px;
    color: var(--text-muted);
}

.capacity-chart-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.donut-chart-container {
    width: 160px;
    height: 160px;
    position: relative;
}

.donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.donut-percent {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.donut-label {
    font-size: 12px;
    color: var(--text-muted);
}

.capacity-tooltip {
    position: absolute;
    right: -20px;
    top: 10px;
    background: #1f2937;
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 10;
}

.capacity-tooltip::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: #1f2937;
}

.tooltip-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.tooltip-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    margin-top: 4px;
}

.tooltip-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.tooltip-dot.issued {
    background: var(--primary);
}

.tooltip-dot.max {
    background: var(--text-muted);
}

/* ===== Ticket Orders Card ===== */
.order-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-light);
    border-radius: 12px;
    border-left: 4px solid var(--primary);
}

.order-info {
    display: flex;
    flex-direction: column;
}

.order-code {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.order-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.order-stats {
    display: flex;
    align-items: center;
    gap: 24px;
}

.order-tickets {
    color: var(--success);
    font-weight: 500;
}

.order-amount {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 60px;
    text-align: right;
}

.view-all-btn {
    display: block;
    text-align: center;
    padding: 14px;
    margin-top: 12px;
    color: var(--text-primary);
    font-weight: 500;
    background: var(--bg-light);
    border-radius: 12px;
    transition: background 0.2s;
}

.view-all-btn:hover {
    background: #e5e7eb;
}

/* ===== Ticket Types Card ===== */
.ticket-types-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ticket-type-item {
    display: flex;
    align-items: center;
    gap: 16px;
}

.type-progress {
    width: 48px;
    height: 48px;
    position: relative;
}

.type-progress svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.type-progress-bg {
    fill: none;
    stroke: #e5e7eb;
    stroke-width: 4;
}

.type-progress-value {
    fill: none;
    stroke: var(--primary);
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.3s;
}

.type-info {
    flex: 1;
}

.type-count {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.type-name {
    font-size: 13px;
    color: var(--text-muted);
}

.type-price {
    text-align: center;
    min-width: 80px;
}

.type-price-value {
    font-weight: 600;
    color: var(--text-primary);
}

.type-price-label {
    font-size: 12px;
    color: var(--text-muted);
}

.type-total {
    text-align: right;
    min-width: 80px;
}

.type-total-value {
    font-weight: 700;
    color: var(--text-primary);
}

.type-total-label {
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== Sellers Card ===== */
.sellers-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.seller-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.seller-avatar-wrapper {
    position: relative;
}

.seller-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.seller-status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background: var(--success);
    border: 2px solid #fff;
    border-radius: 50%;
}

.seller-info {
    flex: 1;
}

.seller-name {
    font-weight: 600;
    color: var(--text-primary);
}

.seller-company {
    font-size: 12px;
    color: var(--text-muted);
}

.seller-location {
    color: var(--text-secondary);
    font-size: 13px;
    min-width: 80px;
}

.seller-sales {
    text-align: right;
    min-width: 100px;
}

.seller-count {
    color: var(--success);
    font-weight: 500;
}

/* ===== Scan Activity Card ===== */
.scan-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.scan-stat {
    flex: 1;
    text-align: center;
    padding: 16px;
    background: var(--bg-light);
    border-radius: 12px;
}

.scan-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.scan-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.scan-log {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.scan-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-light);
    border-radius: 8px;
}

.scan-time {
    font-size: 13px;
    color: var(--text-muted);
}

.scan-code {
    font-weight: 500;
    color: var(--text-primary);
}

.scan-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.scan-status.valid {
    color: var(--success);
}

.scan-status.invalid {
    color: var(--danger);
}

/* ===== Auth Pages ===== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e2a3b 0%, #3b82f6 100%);
    padding: 20px;
}

.auth-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo .logo-circle {
    margin: 0 auto 16px;
}

.auth-title {
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    width: 100%;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--bg-light);
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    background: #059669;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 500;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error, .alert-danger {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fee2e2;
}

.alert-success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #dcfce7;
}

/* ===== Page Header ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 32px;
    background: #fff;
    border-bottom: 1px solid var(--border-color);
}

.page-title {
    font-size: 24px;
    font-weight: 600;
}

/* ===== Events Grid ===== */
.events-grid, .cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    padding: 24px 32px;
}

.event-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.event-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.event-card-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 48px;
}

.event-card-body {
    padding: 20px;
}

.event-card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.event-card-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 16px;
}

.event-card-meta i {
    width: 16px;
    margin-right: 8px;
    color: var(--primary);
}

.event-card-footer {
    display: flex;
    justify-content: space-between;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.event-stat-item {
    text-align: center;
}

.event-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.event-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* ===== Tables ===== */
.table-container, .table-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    margin: 24px 32px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.table-title {
    font-size: 18px;
    font-weight: 600;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--bg-light);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover td {
    background: #fafafa;
}

/* ===== Badges & Status ===== */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success, .status-active {
    background: #d1fae5;
    color: #059669;
}

.badge-warning, .status-pending {
    background: #fef3c7;
    color: #d97706;
}

.badge-danger, .status-cancelled {
    background: #fee2e2;
    color: #dc2626;
}

.status-completed {
    background: #d1fae5;
    color: #059669;
}

.status-fraud {
    background: #fed7aa;
    color: #92400e;
}

.status-refunded {
    background: #dbeafe;
    color: #1e40af;
}

.badge-info {
    background: #dbeafe;
    color: #2563eb;
}

.status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

/* ===== Page Content ===== */
.page-content {
    padding: 24px 32px 24px 16px;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

/* ===== Form Select ===== */
.form-select {
    padding: 10px 35px 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .two-col-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .dashboard-content,
    .page-content {
        padding: 16px;
    }
}
