/* Base - Modern Orange Theme */
* { box-sizing: border-box; }
body { font-family: 'Segoe UI', Verdana, Geneva, Arial, sans-serif; font-size: 12px; margin: 0; padding: 0; background: #f5f5f5; color: #333; }
a { color: #c24e00; text-decoration: none; }
a:hover { color: #a03d00; text-decoration: underline; }

.container { max-width: 1000px; margin: 0 auto; background: #fff; min-height: 100vh; box-shadow: 0 0 10px rgba(0,0,0,0.1); }

/* Top bar */
.topbar { background: linear-gradient(135deg, #d4621a 0%, #c24e00 100%); color: #fff; padding: 0; display: flex; justify-content: space-between; align-items: center; }
.topbar-title { font-size: 14pt; font-weight: bold; padding: 12px 15px; }
.topbar-user { font-size: 10px; padding-right: 15px; }
.topbar a { color: #ffd4b3; }
.topbar a:hover { color: #fff; }
.topbar-banner { display: block; width: 100%; height: auto; }

/* Navigation */
.nav { background: #fff8f3; padding: 8px 15px; border-bottom: 2px solid #c24e00; }
.nav a { color: #c24e00; margin-right: 15px; font-weight: bold; padding: 4px 10px; border-radius: 3px; }
.nav a:hover { background: #c24e00; color: #fff; text-decoration: none; }
.nav a.active { background: #c24e00; color: #fff; }

/* Content */
.content { padding: 15px; }
.content h2 { font-size: 13pt; color: #8b3a00; margin: 0 0 15px 0; border-bottom: 2px solid #e8d5c4; padding-bottom: 5px; }

/* Ticket list table */
table.ticket-list { width: 100%; border-collapse: collapse; }
table.ticket-list th { background: #c24e00; color: #fff; padding: 7px 8px; text-align: left; font-size: 11px; }
table.ticket-list td { padding: 7px 8px; border-bottom: 1px solid #ddd; font-size: 11px; }
table.ticket-list td:first-child { max-width: 90px; white-space: nowrap; }
table.ticket-list tr:hover { background: #fff5ee; }
table.ticket-list tr.row-alt { background: #f9f9f9; }

/* Forms */
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-weight: bold; margin-bottom: 3px; color: #8b3a00; }
.form-group input[type="text"],
.form-group select,
.form-group textarea {
    font: 400 12px Verdana, sans-serif; color: #000; background: #fff; border: 1px solid #ccc; padding: 5px; width: 100%;
}
.form-group textarea { min-height: 120px; resize: vertical; }
.form-group input[type="file"] { font: 400 11px Verdana, sans-serif; }
.form-hint { font-size: 10px; color: #888; margin-top: 2px; }

/* Buttons */
.btn { font: 400 12px Verdana, sans-serif; padding: 6px 18px; cursor: pointer; border: 1px solid #999; border-radius: 3px; }
.btn-primary { background: #c24e00; color: #fff; border-color: #c24e00; border-radius: 5px; }
.btn-primary:hover { background: #a03d00; }
.btn-success { background: #28a745; color: #fff; border-color: #28a745; }
.btn-success:hover { background: #1e7e34; }
.btn-sm { padding: 3px 10px; font-size: 11px; }

/* Status badges */
.badge { padding: 3px 10px; border-radius: 10px; font-size: 10px; font-weight: bold; color: #fff; display: inline-block; }
.badge-baru { background: #007bff; }
.badge-proses { background: #ffc107; color: #333; }
.badge-selesai { background: #28a745; }
.badge-ditutup { background: #6c757d; }

/* Priority */
.priority-tinggi { color: #dc3545; font-weight: bold; }
.priority-sederhana { color: #e68a00; font-weight: bold; }
.priority-rendah { color: #28a745; }

/* Ticket detail */
.ticket-detail { border: 1px solid #C2CFD8; margin-bottom: 15px; }
.ticket-detail-header { background: linear-gradient(135deg, #d4621a, #c24e00); color: #fff; padding: 10px 12px; font-weight: bold; }
.ticket-detail-body { padding: 12px; line-height: 1.6; }
.ticket-meta { display: flex; flex-wrap: wrap; gap: 15px; margin-bottom: 10px; font-size: 11px; color: #555; }
.ticket-meta span { background: #f5f5f5; padding: 3px 8px; border-radius: 3px; }

/* Reply thread */
.reply { border: 1px solid #C2CFD8; margin-bottom: 10px; border-radius: 3px; }
.reply-header { background: #fff5ee; padding: 7px 10px; font-size: 11px; color: #555; border-bottom: 1px solid #e8d5c4; }
.reply-header.admin { background: #c24e00; color: #fff; }
.reply-body { padding: 10px; line-height: 1.5; }

/* Audit trail */
.audit-item { padding: 5px 10px; font-size: 10px; color: #666; border-left: 3px solid #C2CFD8; margin-bottom: 5px; background: #fafafa; }
.audit-item .audit-time { color: #999; }

/* Filter bar */
.filter-bar { background: #f5f5f5; padding: 10px; margin-bottom: 15px; border: 1px solid #ddd; border-radius: 3px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filter-bar select, .filter-bar input[type="text"] { font: 400 11px Verdana; padding: 4px; border: 1px solid #ccc; }

/* Pagination */
.pagination { text-align: center; margin-top: 15px; }
.pagination a, .pagination span { padding: 4px 10px; margin: 0 2px; border: 1px solid #ccc; font-size: 11px; }
.pagination span.current { background: #c24e00; color: #fff; border-color: #c24e00; }
.pagination a:hover { background: #fff5ee; text-decoration: none; }

/* Info box */
.info-box { padding: 10px; border-radius: 3px; margin-bottom: 15px; }
.info-success { background: #d4edda; border: 1px solid #c3e6cb; color: #155724; }
.info-error { background: #f8d7da; border: 1px solid #f5c6cb; color: #721c24; }

/* Footer */
.footer { background: linear-gradient(135deg, #d4621a, #c24e00); color: #fff; text-align: center; padding: 10px; font-size: 10px; }
.footer a { color: #ffd4b3; }

/* Admin panel */
.admin-panel { background: #fff3cd; border: 1px solid #ffc107; padding: 10px; margin-bottom: 15px; border-radius: 3px; }
.admin-panel h3 { margin: 0 0 8px 0; font-size: 11px; color: #856404; }

/* Login page — split layout */
.login-page-body { background: #f0f0f0; }
.login-split { display: flex; min-height: 100vh; }
.login-left { flex: 1; background: linear-gradient(135deg, rgba(232,114,58,0.88) 0%, rgba(194,78,0,0.92) 50%, rgba(160,61,0,0.95) 100%), url('/img/login-bg.jpg') center/cover no-repeat; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px; color: #fff; position: relative; overflow: hidden; }
.login-left::before { content: ''; position: absolute; top: -50%; right: -50%; width: 100%; height: 100%; background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%); }
.login-left h1 { font-family: 'Segoe UI', sans-serif; font-size: 32px; font-weight: 700; margin: 0 0 10px 0; text-shadow: 0 2px 10px rgba(0,0,0,0.2); position: relative; z-index: 1; }
.login-left p { font-size: 14px; opacity: 0.9; max-width: 320px; text-align: center; line-height: 1.6; position: relative; z-index: 1; }
.login-left .login-icon { font-size: 64px; margin-bottom: 20px; position: relative; z-index: 1; }
.login-right { flex: 1; display: flex; justify-content: center; align-items: center; padding: 40px; background: #fff; }
.login-box { width: 400px; padding: 0; border: none; border-radius: 0; background: transparent; box-shadow: none; }
.login-box h2 { text-align: center; color: #c24e00; margin-bottom: 25px; border-bottom: 2px solid #f0e0d0; padding-bottom: 12px; font-size: 20px; }
.login-box .form-group label { color: #555; font-size: 12px; }
.login-box .form-group input[type="text"],
.login-box .form-group input[type="password"] { border: 1px solid #ddd; border-radius: 8px; padding: 10px 12px; font-size: 13px; transition: border-color 0.2s; }
.login-box .form-group input:focus { border-color: #c24e00; outline: none; box-shadow: 0 0 0 3px rgba(194,78,0,0.1); }
.login-box .btn-primary { border-radius: 8px; padding: 12px; font-size: 14px; font-weight: 600; letter-spacing: 0.5px; transition: background 0.2s; }
.login-logo { text-align: center; margin-bottom: 15px; }
.login-logo img { max-width: 100%; height: auto; }
.login-footer-links a { color: #c24e00; font-size: 12px; }
.login-footer-links a:hover { color: #a03d00; }
@media (max-width: 768px) {
    .login-split { flex-direction: column; }
    .login-left { min-height: 200px; padding: 30px; }
    .login-left h1 { font-size: 24px; }
    .login-right { padding: 20px; }
    .login-box { width: 100%; }
}

/* Dedicated admin reply header */
.reply-header.dedicated { background: #5b2c6f; color: #fff; }

/* =============================================
   ANALYTICS DASHBOARD
   ============================================= */

.analytics-page h2 { margin-bottom: 5px; }

.analytics-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 15px; }
.analytics-range { display: flex; gap: 4px; }
.range-btn { display: inline-block; padding: 4px 12px; font-size: 11px; border: 1px solid #ccc; border-radius: 3px; color: #333; background: #f5f5f5; }
.range-btn:hover { background: #fff5ee; text-decoration: none; color: #c24e00; }
.range-btn.active { background: #c24e00; color: #fff; border-color: #c24e00; }

/* KPI Grid */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 15px; }
.kpi-card { background: #fff; border: 1px solid #ddd; border-radius: 6px; padding: 15px; text-align: center; border-top: 3px solid #ccc; }
.kpi-card.kpi-blue { border-top-color: #007bff; }
.kpi-card.kpi-orange { border-top-color: #ffc107; }
.kpi-card.kpi-green { border-top-color: #28a745; }
.kpi-card.kpi-teal { border-top-color: #17a2b8; }
.kpi-card.kpi-red { border-top-color: #dc3545; }
.kpi-value { font-size: 28px; font-weight: bold; color: #333; line-height: 1.2; }
.kpi-unit { font-size: 14px; font-weight: normal; color: #888; }
.kpi-label { font-size: 10px; color: #666; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.kpi-sub { font-size: 10px; color: #dc3545; margin-top: 3px; }

/* Chart Layout */
.chart-row { display: flex; gap: 15px; margin-bottom: 15px; }
.chart-box { background: #fff; border: 1px solid #ddd; border-radius: 6px; padding: 15px; }
.chart-box h3 { font-size: 11px; color: #8b3a00; margin: 0 0 10px 0; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid #eee; padding-bottom: 5px; }
.chart-wide { flex: 2; }
.chart-narrow { flex: 1; }
.chart-half { flex: 1; }
.chart-full { flex: 1; width: 100%; }

.analytics-section { background: #fff; border: 1px solid #ddd; border-radius: 6px; padding: 15px; margin-bottom: 15px; }
.analytics-section h3 { font-size: 11px; color: #8b3a00; margin: 0 0 10px 0; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid #eee; padding-bottom: 5px; }

/* Responsive analytics */
@media (max-width: 768px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .chart-row { flex-direction: column; }
    .chart-wide, .chart-narrow, .chart-half { flex: none; width: 100%; }
    .analytics-header { flex-direction: column; align-items: flex-start; }
}
