/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #0f0f0f;
  color: #e0e0e0;
  line-height: 1.6;
}

a {
  color: #4fc3f7;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Navbar */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1a1a1a;
  padding: 0 24px;
  height: 60px;
  border-bottom: 1px solid #333;
}

.nav-brand a {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.nav-links {
  display: flex;
  gap: 8px;
}

.nav-links a {
  padding: 8px 16px;
  border-radius: 6px;
  color: #aaa;
  transition: all 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  background: #333;
  color: #fff;
  text-decoration: none;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

/* Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

/* Page Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

h1 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 24px;
}

h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 32px 0 16px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: #4fc3f7;
}

.stat-label {
  font-size: 14px;
  color: #888;
  margin-top: 8px;
}

/* Table */
.table {
  width: 100%;
  border-collapse: collapse;
  background: #1a1a1a;
  border-radius: 12px;
  overflow: hidden;
}

.table th,
.table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #333;
}

.table th {
  background: #252525;
  font-weight: 600;
  color: #aaa;
  font-size: 13px;
  text-transform: uppercase;
}

.table tbody tr:hover {
  background: #252525;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  background: #333;
  color: #fff;
  transition: all 0.2s;
}

.btn:hover {
  background: #444;
  text-decoration: none;
}

.btn-primary {
  background: #2196f3;
}

.btn-primary:hover {
  background: #1976d2;
}

.btn-danger {
  background: #f44336;
}

.btn-danger:hover {
  background: #d32f2f;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.badge-success {
  background: #1b5e20;
  color: #a5d6a7;
}

.badge-danger {
  background: #b71c1c;
  color: #ef9a9a;
}

.badge-warning {
  background: #e65100;
  color: #ffcc80;
}

.badge-info {
  background: #0277bd;
  color: #81d4fa;
}

.badge-primary {
  background: #1565c0;
  color: #90caf9;
}

.badge-secondary {
  background: #424242;
  color: #bdbdbd;
}

/* Form */
.form {
  max-width: 600px;
  background: #1a1a1a;
  padding: 32px;
  border-radius: 12px;
  border: 1px solid #333;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #aaa;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 1px solid #333;
  border-radius: 6px;
  background: #252525;
  color: #fff;
  font-size: 14px;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #4fc3f7;
}

.form-group input[readonly] {
  background: #1a1a1a;
  color: #888;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.checkbox-label input {
  width: auto;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

hr {
  border: none;
  border-top: 1px solid #333;
  margin: 24px 0;
}

/* Alerts */
.alert {
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.alert-error {
  background: #b71c1c;
  color: #ffcdd2;
}

/* Login Page */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-container {
  text-align: center;
  padding: 48px;
  background: #1a1a1a;
  border-radius: 16px;
  border: 1px solid #333;
}

.login-container h1 {
  margin-bottom: 8px;
}

.login-container > p {
  color: #888;
  margin-bottom: 32px;
}

.telegram-login {
  margin: 24px 0;
}

/* Error Page */
.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.error-container {
  text-align: center;
}

/* Utilities */
.text-center {
  text-align: center;
}

.text-muted {
  color: #888;
}

.text-success {
  color: #4caf50;
}

.text-danger {
  color: #f44336;
}

.mt-4 {
  margin-top: 24px;
}

.log-details code {
  font-size: 11px;
  color: #888;
  word-break: break-all;
}

.filter-form select {
  padding: 8px 16px;
  border: 1px solid #333;
  border-radius: 6px;
  background: #252525;
  color: #fff;
}
