* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
}

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--gray-100); color: var(--gray-900); }

.hidden { display: none !important; }

/* Login */
.login-container { max-width: 400px; margin: 100px auto; padding: 2rem; background: white; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.login-container h1 { text-align: center; margin-bottom: 2rem; color: var(--primary); }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; color: var(--gray-700); }
input, select, textarea { width: 100%; padding: 0.75rem; border: 1px solid var(--gray-300); border-radius: 6px; font-size: 1rem; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.error { color: var(--danger); font-size: 0.875rem; margin-top: 0.5rem; }

/* Buttons */
.btn { padding: 0.75rem 1.5rem; border: none; border-radius: 6px; font-size: 1rem; cursor: pointer; transition: all 0.2s; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--gray-200); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-300); }
.btn-danger { background: var(--danger); color: white; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.875rem; }
.btn-icon { padding: 0.5rem; background: transparent; }
.btn-icon:hover { background: var(--gray-100); }

/* Layout */
#main-app { display: flex; min-height: 100vh; }

#sidebar { width: 250px; background: var(--gray-900); color: white; display: flex; flex-direction: column; }
.sidebar-header { padding: 1.5rem; border-bottom: 1px solid var(--gray-700); }
.sidebar-header h2 { font-size: 1.5rem; }
.nav-menu { list-style: none; flex: 1; padding: 1rem 0; }
.nav-link { display: block; padding: 0.75rem 1.5rem; color: var(--gray-300); text-decoration: none; transition: all 0.2s; }
.nav-link:hover, .nav-link.active { background: var(--gray-700); color: white; }
.sidebar-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--gray-700); display: flex; justify-content: space-between; align-items: center; }
#user-name { font-size: 0.875rem; color: var(--gray-300); }

#content { flex: 1; padding: 2rem; overflow-y: auto; }

/* Page Header */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.page-header h1 { font-size: 1.75rem; }
.page-header p { color: var(--gray-500); margin-top: 0.25rem; }

/* Cards */
.card { background: white; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.card-header { padding: 1rem 1.5rem; border-bottom: 1px solid var(--gray-200); font-weight: 600; }
.card-body { padding: 1.5rem; }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.stat-card { background: white; padding: 1.5rem; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.stat-card h3 { font-size: 0.875rem; color: var(--gray-500); margin-bottom: 0.5rem; }
.stat-card .value { font-size: 2rem; font-weight: 700; }

/* Table */
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--gray-200); }
th { background: var(--gray-50); font-weight: 600; color: var(--gray-700); }
tr:hover { background: var(--gray-50); }

/* Badge */
.badge { display: inline-block; padding: 0.25rem 0.75rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 500; }
.badge-draft { background: var(--gray-200); color: var(--gray-700); }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-approved { background: #d1fae5; color: #065f46; }
.badge-published { background: #dbeafe; color: #1e40af; }
.badge-rejected { background: #fee2e2; color: #991b1b; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-content { background: white; border-radius: 8px; width: 90%; max-width: 600px; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.5rem; border-bottom: 1px solid var(--gray-200); }
.modal-header h3 { font-size: 1.25rem; }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--gray-500); }
#modal-body { padding: 1.5rem; }
.modal-actions { display: flex; gap: 1rem; justify-content: flex-end; margin-top: 1.5rem; }

/* Filters */
.filters { display: flex; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.filters input, .filters select { width: auto; min-width: 200px; }

/* Pagination */
.pagination { display: flex; justify-content: space-between; align-items: center; padding: 1rem; border-top: 1px solid var(--gray-200); }
.pagination-info { color: var(--gray-500); font-size: 0.875rem; }
.pagination-btns { display: flex; gap: 0.5rem; }

/* Actions */
.actions { display: flex; gap: 0.5rem; }

/* Loading */
.loading { text-align: center; padding: 2rem; color: var(--gray-500); }

/* Form Grid */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }


/* User link in sidebar */
.user-link { color: var(--gray-300); text-decoration: none; cursor: pointer; transition: color 0.2s; }
.user-link:hover { color: white; text-decoration: underline; }
