:root {
    --primary: #667eea;
    --primary-dark: #5a6fd6;
    --success: #27ae60;
    --danger: #e74c3c;
    --warning: #f39c12;
    --info: #3498db;
    --gray: #6c757d;
    --light: #f8f9fa;
    --border: #dee2e6;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #f5f5f5; color: #333; font-size: 14px; }

/* Layout */
.app-layout { display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: #2c3e50; color: #ecf0f1; position: fixed; height: 100vh; overflow-y: auto; }
.sidebar-header { padding: 20px; background: #1a252f; }
.sidebar-header h2 { font-size: 18px; }
.sidebar-user { padding: 15px 20px; border-bottom: 1px solid #34495e; display: flex; align-items: center; gap: 10px; }
.avatar { width: 40px; height: 40px; background: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; }
.user-info .name { font-weight: 600; }
.user-info .role { font-size: 12px; opacity: 0.7; }
.nav-list { list-style: none; padding: 10px 0; }
.nav-label { padding: 10px 20px 5px; font-size: 11px; text-transform: uppercase; opacity: 0.5; }
.nav-link { display: block; padding: 10px 20px; color: #ecf0f1; text-decoration: none; transition: background 0.2s; }
.nav-link:hover, .nav-link.active { background: rgba(255,255,255,0.1); }
.nav-link.active { border-left: 3px solid var(--primary); }

.main-content { margin-left: 240px; flex: 1; min-height: 100vh; }
.top-bar { background: #fff; padding: 15px 25px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.page-title { font-size: 20px; font-weight: 600; }
.content-wrapper { padding: 25px; }

/* Cards */
.card { background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); margin-bottom: 20px; }
.card-header { padding: 15px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.card-header h3 { font-size: 16px; }
.card-body { padding: 20px; }

/* Forms */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 600; color: #555; }
.form-control { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 4px; font-size: 14px; }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(102,126,234,0.2); }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-inline { display: flex; align-items: flex-end; gap: 15px; flex-wrap: wrap; }
.form-inline .form-group { margin-bottom: 0; }

/* Buttons */
.btn { display: inline-block; padding: 8px 16px; border: none; border-radius: 4px; font-size: 14px; cursor: pointer; text-decoration: none; transition: all 0.2s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c0392b; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: #333; }
.btn-outline:hover { background: var(--light); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-group { display: flex; gap: 8px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Tables */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 15px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--light); font-weight: 600; color: #555; }
tr:hover { background: #f8f9fa; }
.text-xs { font-size: 11px; }
.text-center { text-align: center; }

/* Badges */
.badge { display: inline-block; padding: 3px 8px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.badge-success { background: #d4edda; color: #155724; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-info { background: #d1ecf1; color: #0c5460; }
.badge-primary { background: #d6d8f8; color: #1a237e; }

/* Alerts */
.alert { padding: 12px 15px; border-radius: 4px; margin-bottom: 15px; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }

/* Modal */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); display: none; align-items: center; justify-content: center; z-index: 1000; }
.modal-overlay.active { display: flex; }
.modal { background: #fff; padding: 25px; border-radius: 8px; width: 90%; max-width: 500px; max-height: 90vh; overflow-y: auto; }
.modal h3 { margin-bottom: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* Stats */
.stats-row { display: flex; gap: 20px; flex-wrap: wrap; }
.stat-item { flex: 1; min-width: 150px; padding: 15px; background: var(--light); border-radius: 4px; text-align: center; }
.stat-label { font-size: 12px; color: var(--gray); margin-bottom: 5px; }
.stat-value { font-size: 24px; font-weight: 700; color: var(--primary); }

/* Pagination */
.pagination { display: flex; justify-content: center; align-items: center; gap: 15px; padding: 15px; }
.page-info { color: var(--gray); }

/* Filter */
.filter-form { display: flex; gap: 10px; align-items: center; }
.filter-form .form-control { width: auto; }

/* DateTime */
.datetime-display { color: var(--gray); font-size: 13px; }

/* Responsive */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; }
    .form-row { grid-template-columns: 1fr; }
    .form-inline { flex-direction: column; align-items: stretch; }
}
