:root {
  --primary: #1f2a44;
  --primary-dark: #16202f;
  --accent: #2c7be5;
  --accent-hover: #1a68d1;
  --success-color: #00b894;
  --success-bg: #d4edda;
  --error-color: #e74c3c;
  --error-bg: #f8d7da;
  --warning-color: #f39c12;
  --bg: #f4f6f9;
  --card-bg: #ffffff;
  --text: #2c3e50;
  --text-light: #6c757d;
  --border: #e1e5eb;
  --radius: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --transition: all 0.2s ease;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

main.container {
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.topbar {
  background: var(--primary);
  color: #fff;
  padding: 1rem 0;
  box-shadow: var(--shadow-md);
  position: relative;
}

.topbar h1 {
  font-size: 1.5rem;
  font-weight: 600;
}

.topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-menu {
  display: flex;
  gap: 0.5rem;
}

.nav-menu a {
  color: #fff;
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  transition: var(--transition);
}

.nav-menu a:hover {
  background: rgba(255,255,255,0.1);
}

.nav-toggle {
  display: none;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}

.footer {
  background: var(--primary-dark);
  color: #fff;
  padding: 1.5rem 0;
  text-align: center;
  margin-top: 2rem;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-weight: 500;
}

.alert-success {
  background: var(--success-bg);
  color: #155724;
  border-left: 4px solid var(--success-color);
}

.alert-error {
  background: var(--error-bg);
  color: #721c24;
  border-left: 4px solid var(--error-color);
}

.alert-warning {
  background: #fff3cd;
  color: #856404;
  border-left: 4px solid var(--warning-color);
}

form label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 500;
}

form input[type="text"],
form input[type="email"],
form input[type="password"],
form input[type="number"],
form input[type="file"],
form select,
form textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  background: #fff;
  transition: var(--transition);
}

form input:focus,
form select:focus,
form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(44,123,229,0.1);
}

button,
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  font-size: 1rem;
  transition: var(--transition);
}

button:hover,
.btn:hover {
  background: var(--accent-hover);
  color: #fff;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 1rem;
}

.table th,
.table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table th {
  background: #f8fafc;
  font-weight: 600;
  color: var(--text-light);
}

.table tbody tr:hover {
  background: #f1f5f9;
}

.table-responsive {
  overflow-x: auto;
  margin-top: 1rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.stat-card {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.stat-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.stat-card p {
  color: var(--text-light);
  margin-bottom: 0.75rem;
}

.stat-card a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.file-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  background: var(--card-bg);
  padding: 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
}

.file-actions form {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0;
}

.file-actions input,
.file-actions select {
  margin-bottom: 0;
}

.auth-form {
  max-width: 400px;
  margin: 2rem auto;
  background: var(--card-bg);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.auth-form h2 {
  margin-bottom: 1.5rem;
  text-align: center;
}

.editor {
  min-height: 300px;
  font-family: 'Courier New', Courier, monospace;
}

@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--primary);
    flex-direction: column;
    padding: 1rem;
    box-shadow: var(--shadow-md);
    gap: 0.5rem;
  }
  .nav-menu.open {
    display: flex;
  }
  .file-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .file-actions form {
    flex-wrap: wrap;
  }
}