:root {
  --primary: #2f4cff;
  --primary-dark: #2033b8;
  --accent: #11b981;
  --soft: #f5f7ff;
  --text: #1a1f36;
  --muted: #6b7280;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: var(--soft);
  color: var(--text);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 22px 80px;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(26, 31, 54, 0.08);
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  margin-top: 18px;
}

.sidebar {
  position: sticky;
  top: 20px;
  align-self: start;
}

.sidebar .menu {
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 6px;
}

.content.full {
  grid-column: 1 / -1;
}

.menu-group {
  background: #fff;
  padding: 14px;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(26, 31, 54, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-group summary {
  list-style: none;
  cursor: pointer;
  position: relative;
  padding-right: 18px;
}

.menu-group summary::-webkit-details-marker {
  display: none;
}

.menu-group summary::after {
  content: '▾';
  position: absolute;
  right: 0;
  font-size: 12px;
  color: var(--muted);
}

.menu-group[open] summary::after {
  content: '▴';
}

.menu-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.menu-link {
  padding: 8px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  display: block;
  width: 100%;
}

.menu-link.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
  }
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
}

.user-name {
  font-weight: 700;
}

.header h1 {
  font-size: 22px;
  margin: 0;
}

.header p {
  margin: 4px 0 0;
  color: var(--muted);
}

.card {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  margin-top: 20px;
  box-shadow: 0 12px 32px rgba(26, 31, 54, 0.08);
}

.card h2 {
  margin-top: 0;
  font-size: 18px;
}

.auth-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72vh;
  padding: 12px 0 24px;
}

.auth-card {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(280px, 1.2fr);
  gap: 24px;
  background: #fff;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 24px 60px rgba(26, 31, 54, 0.16);
  width: min(860px, 100%);
  position: relative;
  overflow: hidden;
}

.auth-panel {
  background: linear-gradient(145deg, #2f4cff 0%, #1d2fa6 100%);
  color: #fff;
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  position: relative;
  overflow: hidden;
}

.auth-panel::after {
  content: '';
  position: absolute;
  top: -60px;
  right: -40px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.auth-panel::before {
  content: '';
  position: absolute;
  bottom: -50px;
  left: -30px;
  width: 120px;
  height: 120px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.08);
  transform: rotate(12deg);
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  width: fit-content;
}

.auth-title {
  font-size: 22px;
  margin: 0;
}

.auth-subtitle {
  margin: 0;
  opacity: 0.85;
  line-height: 1.5;
}

.auth-meta {
  margin-top: auto;
  font-size: 13px;
  opacity: 0.85;
  display: grid;
  gap: 8px;
}

.auth-form h2 {
  margin-top: 0;
  font-size: 20px;
}

.auth-form .helper-text {
  margin-bottom: 16px;
}

.auth-form .grid {
  grid-template-columns: 1fr;
  gap: 14px;
}

.auth-form input[type="text"],
.auth-form input[type="password"] {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 12px 14px;
  border-radius: 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-form input[type="text"]:focus,
.auth-form input[type="password"]:focus {
  outline: none;
  border-color: #7c8cff;
  box-shadow: 0 0 0 3px rgba(47, 76, 255, 0.12);
}

.auth-form .btn {
  width: 100%;
  justify-content: center;
}

.auth-form .footer-actions {
  margin-top: 8px;
}

.auth-form .small {
  color: var(--muted);
  margin-top: 14px;
}

@media (max-width: 900px) {
  .auth-card {
    grid-template-columns: 1fr;
  }
  .auth-panel {
    min-height: 180px;
  }
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

label {
  font-weight: 600;
  font-size: 14px;
  display: block;
  margin-bottom: 8px;
}

input[type="text"],
input[type="date"],
select,
input[type="file"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d5d8e4;
  font-size: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: 0.2s ease;
}

.btn:hover {
  background: var(--primary-dark);
}

.btn.secondary {
  background: #eef2ff;
  color: var(--primary-dark);
}

.btn.secondary:hover {
  background: #e0e7ff;
}

.btn.small {
  padding: 6px 10px;
  font-size: 12px;
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #e5e7eb;
}

.btn.small:hover {
  background: #e5e7eb;
  color: #111827;
}

.btn.danger {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.btn.danger:hover {
  background: #fecaca;
  color: #7f1d1d;
}

.badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: #eef2ff;
  color: var(--primary-dark);
}

.notice {
  padding: 12px 14px;
  border-radius: 10px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  font-size: 14px;
}

.notice.error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th,
.table td {
  padding: 10px 12px;
  border-bottom: 1px solid #eef0f7;
  text-align: left;
  vertical-align: top;
}

.table td.actions {
  white-space: nowrap;
}

.table th {
  background: #f8fafc;
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.section-title {
  margin-top: 30px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.helper-text {
  color: var(--muted);
  font-size: 13px;
}

.footer-actions {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.footer {
  margin-top: 28px;
  background: #fff;
  border-radius: 16px;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 8px 24px rgba(26, 31, 54, 0.08);
}

.filters {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filters input[type="text"],
.filters select {
  max-width: 240px;
}

.card-inline {
  margin: 16px 0 20px;
  padding: 16px;
  border: 1px solid #eef0f7;
  border-radius: 12px;
  background: #fbfcff;
}

.inline-form input[type="text"] {
  width: 100%;
}

.inline-form {
  display: inline;
}

.checkbox-field {
  display: flex;
  align-items: center;
  padding-top: 28px;
}

.pagination {
  margin-top: 18px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.page-link {
  padding: 6px 10px;
  border-radius: 8px;
  text-decoration: none;
  border: 1px solid #e5e7eb;
  color: var(--text);
  background: #f8fafc;
  font-weight: 600;
}

.page-link.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.page-link.disabled {
  color: var(--muted);
  background: #f1f5f9;
  border-color: #e5e7eb;
  cursor: not-allowed;
}

.upload-log {
  margin-top: 16px;
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(26, 31, 54, 0.08);
  padding: 16px;
}

.upload-log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.upload-log-body {
  max-height: 220px;
  overflow-y: auto;
  overflow-x: auto;
  border: 1px solid #eef0f7;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fbfcff;
}

.upload-log-body ul {
  margin: 0;
  padding-left: 18px;
}

.log-item {
  padding: 4px 0;
  white-space: nowrap;
}

.upload-log-body .log-item.success {
  color: #166534;
  font-weight: 600;
}

.upload-log-body .log-item.error {
  color: #b42318;
  font-weight: 600;
}

.progress {
  height: 10px;
  background: #eef2ff;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #16a34a);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 2000;
}

.modal.open {
  display: flex;
}

.modal-content {
  background: #fff;
  border-radius: 16px;
  padding: 22px;
  width: min(900px, 95vw);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.action-inline {
  display: inline-flex;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: center;
  white-space: nowrap;
}

.action-inline .btn {
  padding: 6px 12px;
  font-size: 13px;
}

.small {
  font-size: 12px;
  color: var(--muted);
}
