*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f5f5f6;
  color: #111827;
}

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: #111827;
  color: #f9fafb;
  display: flex;
  flex-direction: column;
  padding: 1rem 1.25rem;
}

.sidebar-header {
  margin-bottom: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  color: #f9fafb;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #f97316, #fb923c);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
}

.brand-text {
  font-weight: 700;
  letter-spacing: 0.03em;
  font-size: 1rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: auto;
}

.sidebar-link {
  display: block;
  padding: 0.5rem 0.7rem;
  border-radius: 0.5rem;
  color: #e5e7eb;
  text-decoration: none;
  font-size: 0.9rem;
}

.sidebar-link:hover {
  background: rgba(249, 115, 22, 0.15);
  color: #ffffff;
}

.sidebar-footer {
  margin-top: 1.5rem;
  border-top: 1px solid #1f2937;
  padding-top: 1rem;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #f97316;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: #111827;
}

.user-meta {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.user-logout {
  font-size: 0.8rem;
  color: #f97316;
  text-decoration: none;
}

.user-logout:hover {
  text-decoration: underline;
}

.layout-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 56px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
}

.topbar-title {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7280;
}

.container {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  margin-top: 1.5rem;
  width: 100%;
  padding: 0 1rem;
}

.section {
  background: #ffffff;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  padding: 1.5rem;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.04);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

h1,
h2 {
  margin: 0 0 0.75rem;
}

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

.card {
  background: #ffffff;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  padding: 1rem;
  box-shadow: 0 6px 12px rgba(15, 23, 42, 0.04);
}

.card p {
  font-size: 0.9rem;
  color: #4b5563;
}

.btn-primary,
.btn-secondary {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: none;
}

.btn-primary {
  background: #f97316;
  color: #111827;
  font-weight: 600;
}

.btn-secondary {
  background: transparent;
  border: 1px solid #d1d5db;
  color: #111827;
  margin-left: 0.5rem;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
}

.form-group label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

input,
textarea {
  background: #ffffff;
  border-radius: 0.375rem;
  border: 1px solid #d1d5db;
  color: #111827;
  padding: 0.45rem 0.6rem;
  font: inherit;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: #f97316;
}

.full-width {
  grid-column: 1 / -1;
}

.form-actions {
  margin-top: 0.5rem;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.4rem 0.75rem;
  margin-top: 0.35rem;
}

.checkbox-inline {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
}

.checkbox-inline input[type='checkbox'] {
  width: auto;
  accent-color: #f97316;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.9rem;
}

.table th,
.table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #e5e7eb;
}

.table th {
  text-align: left;
  font-weight: 600;
  color: #6b7280;
}

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

.media-card {
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  box-shadow: 0 4px 8px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.media-thumb {
  height: 140px;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.media-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.media-meta {
  padding: 0.75rem;
}

.media-name {
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-url {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.media-url input {
  flex: 1;
  min-width: 0;
  font-size: 0.75rem;
}

.btn-copy {
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
}

.alert {
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.alert-error {
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid #f97316;
  color: #b91c1c;
}

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #f5f5f6;
}

.login-card {
  background: #ffffff;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  padding: 1.5rem;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
}

.login-card h1 {
  text-align: center;
  margin-bottom: 1rem;
}

.login-card form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.login-card .btn-primary {
  width: 100%;
  margin-top: 0.75rem;
}

.hint {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: #6b7280;
  text-align: center;
}

