﻿:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #6b7280;
  --primary: #4f46e5;
  --primary-2: #4338ca;
  --danger: #e53e3e;
  --border: #e5e7eb;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  font-family: "Inter", Arial, sans-serif;
  margin: 0;
  background: radial-gradient(circle at 10% 20%, rgba(79,70,229,0.08), transparent 30%), var(--bg);
  color: var(--text);
}

.login {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.login .card {
  padding: 28px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 360px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

input, textarea, select, button {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
  color: var(--text);
}

button {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  border: none;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 18px rgba(79,70,229,0.25);
}

button:hover { transform: translateY(-1px); }
button:active { transform: translateY(1px); }
button.danger { background: var(--danger); box-shadow: 0 8px 18px rgba(229,62,62,0.25); }
.error { color: var(--danger); font-size: 13px; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: var(--card);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand img {
  max-height: 48px;
  width: auto;
  display: block;
  object-fit: contain;
}
.user { display: flex; gap: 10px; align-items: center; }
.user button { width: auto; padding: 8px 12px; box-shadow: none; }

.sidebar {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 58px;
  z-index: 9;
}

.sidebar a {
  text-decoration: none;
  color: var(--text);
  padding: 9px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--border);
  transition: all 0.15s ease;
}

.sidebar a:hover { border-color: var(--primary); color: var(--primary); box-shadow: var(--shadow); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px,1fr));
  gap: 18px;
  padding: 20px;
}

.card {
  background: var(--card);
  padding: 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}

.card:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(15,23,42,0.12); }
.card .ico { font-size: 30px; }

.content { padding: 20px; }

h1, h2 { margin: 0 0 12px; }
h2 { margin-top: 20px; color: var(--muted); font-weight: 600; }

form.card { gap: 10px; }

.table-wrapper { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
}

th, td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 14px;
}

th { background: #f8fafc; font-weight: 600; }
tr:hover td { background: #f9fafb; }

summary { cursor: pointer; color: var(--primary); }
details { margin-top: 8px; }
.inline { display: flex; flex-wrap: wrap; gap: 8px; }
.inline input, .inline textarea, .inline select { width: calc(50% - 8px); }
.inline textarea { width: 100%; min-height: 80px; }

@media (max-width: 900px) {
  .sidebar { flex-wrap: wrap; position: static; top: 0; }
}

@media (max-width: 720px) {
  .inline input, .inline textarea, .inline select { width: 100%; }
  table { box-shadow: none; }
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  width: 95%;
  min-width: 280px;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
