* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f5f5f5; color: #333; line-height: 1.5; }

/* Layout */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #1a1a2e; color: #fff; padding: 20px 0; position: fixed; height: 100vh; }
.sidebar .logo { padding: 0 20px 20px; font-size: 18px; font-weight: bold; border-bottom: 1px solid #333; }
.sidebar nav { padding: 20px 0; }
.sidebar nav a { display: block; padding: 10px 20px; color: #aaa; text-decoration: none; }
.sidebar nav a:hover, .sidebar nav a.active { background: #16213e; color: #fff; }
.sidebar-footer { position: absolute; bottom: 0; width: 100%; padding: 15px 20px; border-top: 1px solid #333; font-size: 13px; }
.sidebar-footer a { color: #888; margin-left: 10px; }
.content { flex: 1; margin-left: 220px; padding: 30px; }

/* Auth */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #1a1a2e; }
.auth-box { background: #fff; padding: 40px; border-radius: 8px; width: 100%; max-width: 360px; }
.auth-box h1 { text-align: center; margin-bottom: 30px; color: #1a1a2e; }

/* Forms */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 500; font-size: 14px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: #2563eb; }
.form-group small { color: #888; font-size: 12px; }
.form-narrow { max-width: 500px; }

/* Buttons */
.btn { display: inline-block; padding: 10px 20px; border: none; border-radius: 4px; font-size: 14px; cursor: pointer; text-decoration: none; background: #e5e5e5; color: #333; }
.btn:hover { background: #d5d5d5; }
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-success { background: #10b981; color: #fff; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; }

/* Tables */
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.1); margin-bottom: 20px; }
.table th, .table td { padding: 12px 15px; text-align: left; border-bottom: 1px solid #eee; }
.table th { background: #f9f9f9; font-weight: 600; font-size: 13px; color: #666; }
.table tr:hover { background: #fafafa; }
.table tr.duplicate { background: #fff3cd; }

/* Alerts */
.alert { padding: 12px 15px; border-radius: 4px; margin-bottom: 20px; }
.alert.success { background: #d1fae5; color: #065f46; }
.alert.error { background: #fee2e2; color: #991b1b; }
.alert.warning { background: #fef3c7; color: #92400e; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; margin-bottom: 30px; }
.stat-card { background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.stat-value { font-size: 28px; font-weight: bold; color: #1a1a2e; }
.stat-label { color: #888; font-size: 14px; margin-top: 5px; }
.stats-inline { margin-bottom: 20px; }
.stats-inline span { margin-right: 20px; }
.stats-row { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-bottom: 30px; }
.stats-col h3 { margin-bottom: 15px; }

/* Balance */
.balance-card { background: linear-gradient(135deg, #2563eb, #1d4ed8); color: #fff; padding: 30px; border-radius: 12px; margin-bottom: 30px; max-width: 300px; }
.balance-value { font-size: 36px; font-weight: bold; }
.balance-label { opacity: 0.8; margin-top: 5px; }

/* Badges */
.badge { display: inline-block; padding: 3px 8px; border-radius: 3px; font-size: 11px; font-weight: 600; background: #e5e5e5; }
.badge.green { background: #d1fae5; color: #065f46; }
.badge.red { background: #fee2e2; color: #991b1b; }

/* Tabs */
.tabs { display: flex; gap: 5px; margin-bottom: 20px; border-bottom: 2px solid #e5e5e5; }
.tabs a { padding: 10px 20px; text-decoration: none; color: #666; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tabs a.active { color: #2563eb; border-bottom-color: #2563eb; }

/* Filters */
.filters { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.filters input, .filters select { padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px; }

/* Page header */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.page-header h1 { margin: 0; }

/* Pagination */
.pagination { display: flex; gap: 5px; margin-top: 20px; }
.pagination a { padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px; text-decoration: none; color: #333; }
.pagination a.active { background: #2563eb; color: #fff; border-color: #2563eb; }

/* Utils */
.text-green { color: #10b981; }
.text-red { color: #ef4444; }
.text-warning { color: #f59e0b; }
hr { border: none; border-top: 1px solid #eee; margin: 20px 0; }
h1, h2, h3 { margin-bottom: 20px; }
pre { background: #f5f5f5; padding: 15px; border-radius: 4px; overflow-x: auto; font-size: 13px; }
code { background: #f0f0f0; padding: 2px 6px; border-radius: 3px; font-size: 13px; }

/* Responsive */
@media (max-width: 768px) {
    .sidebar { width: 100%; height: auto; position: relative; }
    .content { margin-left: 0; }
    .layout { flex-direction: column; }
    .stats-row { grid-template-columns: 1fr; }
}
