@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

:root {
  --yt-bg: #f9f9f9;
  --yt-surface: #ffffff;
  --yt-border: #e5e5e5;
  --yt-text: #0f0f0f;
  --yt-muted: #606060;
  --yt-subtle: #909090;
  --yt-red: #ff0000;
  --yt-red-dark: #cc0000;
  --yt-blue: #065fd4;
  --yt-green: #0f9d58;
  --yt-sidebar: #ffffff;
  --yt-sidebar-width: 240px;
  --yt-radius: 12px;
  --yt-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: Roboto, Arial, sans-serif;
  color: var(--yt-text);
  background: var(--yt-bg);
}

a { color: var(--yt-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, textarea, select { font: inherit; }

.yt-app {
  display: grid;
  grid-template-columns: var(--yt-sidebar-width) 1fr;
  min-height: 100vh;
}

.yt-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--yt-sidebar);
  border-right: 1px solid var(--yt-border);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.yt-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 18px;
}

.yt-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff4d6d, var(--yt-red));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.yt-brand strong {
  display: block;
  font-size: 0.95rem;
}

.yt-brand small {
  color: var(--yt-muted);
  font-size: 0.78rem;
}

.yt-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.yt-nav-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--yt-text);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
}

.yt-nav-btn:hover { background: #f2f2f2; }

.yt-nav-btn.is-active {
  background: #f2f2f2;
  font-weight: 700;
}

.yt-nav-icon {
  width: 22px;
  text-align: center;
  opacity: 0.85;
}

.yt-sidebar-footer {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--yt-border);
}

.yt-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.yt-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 28px;
  background: rgba(249, 249, 249, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--yt-border);
}

.yt-topbar h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 500;
}

.yt-topbar p {
  margin: 4px 0 0;
  color: var(--yt-muted);
  font-size: 0.88rem;
}

.yt-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.yt-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--yt-border);
  border-radius: 999px;
  background: #fff;
  color: var(--yt-muted);
  font-size: 0.84rem;
}

.yt-content {
  padding: 24px 28px 40px;
}

.yt-panel { display: none; }
.yt-panel.is-active { display: block; }

.yt-flash {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 10px;
  background: #e6f4ea;
  color: #137333;
  border: 1px solid #ceead6;
  font-size: 0.92rem;
}

.yt-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.yt-metric-card {
  background: var(--yt-surface);
  border: 1px solid var(--yt-border);
  border-radius: var(--yt-radius);
  padding: 18px 18px 14px;
  box-shadow: var(--yt-shadow);
}

.yt-metric-label {
  color: var(--yt-muted);
  font-size: 0.82rem;
  margin-bottom: 8px;
}

.yt-metric-value {
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1;
  margin-bottom: 10px;
}

.yt-metric-sub {
  color: var(--yt-subtle);
  font-size: 0.78rem;
}

.yt-sparkline {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 36px;
}

.yt-sparkline span {
  flex: 1;
  border-radius: 3px 3px 0 0;
  background: #ffd6d6;
  min-height: 6px;
}

.yt-sparkline span:nth-child(odd) { background: #ffb3b3; }
.yt-sparkline span:last-child { background: var(--yt-red); }

.yt-grid-2 {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.yt-card {
  background: var(--yt-surface);
  border: 1px solid var(--yt-border);
  border-radius: var(--yt-radius);
  box-shadow: var(--yt-shadow);
  overflow: hidden;
}

.yt-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--yt-border);
}

.yt-card-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
}

.yt-card-body { padding: 18px; }

.yt-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  min-height: 220px;
  padding-top: 12px;
}

.yt-bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.yt-bar {
  width: 100%;
  max-width: 56px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #ff6b6b, var(--yt-red));
  min-height: 12px;
}

.yt-bar-label {
  font-size: 0.72rem;
  color: var(--yt-muted);
  text-align: center;
  line-height: 1.3;
  word-break: break-word;
}

.yt-bar-value {
  font-size: 0.82rem;
  font-weight: 500;
}

.yt-list {
  display: grid;
  gap: 12px;
}

.yt-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f1f1;
}

.yt-list-item:last-child { border-bottom: 0; padding-bottom: 0; }

.yt-list-meta strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
}

.yt-list-meta span {
  color: var(--yt-muted);
  font-size: 0.8rem;
}

.yt-status {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: capitalize;
}

.yt-status-pending { background: #fff8e1; color: #b06000; }
.yt-status-approved { background: #e6f4ea; color: #137333; }
.yt-status-rejected { background: #fce8e6; color: #c5221f; }

.yt-table-wrap { overflow-x: auto; }

table.yt-table {
  width: 100%;
  border-collapse: collapse;
}

.yt-table th,
.yt-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f1f1;
  text-align: left;
  vertical-align: middle;
}

.yt-table th {
  color: var(--yt-muted);
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.yt-video-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 240px;
}

.yt-video-cell img {
  width: 120px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  background: #eee;
}

.yt-video-cell strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 4px;
}

.yt-video-cell small {
  color: var(--yt-muted);
  font-size: 0.78rem;
}

.yt-tag {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 4px;
  background: #f2f2f2;
  color: var(--yt-muted);
  font-size: 0.75rem;
  font-weight: 500;
}

.yt-tag-premium {
  background: #ffe5e5;
  color: var(--yt-red-dark);
}

.yt-form-grid {
  display: grid;
  gap: 14px;
}

.yt-form-grid label {
  display: grid;
  gap: 6px;
  font-size: 0.84rem;
  color: var(--yt-muted);
  font-weight: 500;
}

.yt-form-grid input,
.yt-form-grid textarea,
.yt-form-grid select,
.yt-inline-form input,
.yt-inline-form select {
  width: 100%;
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid var(--yt-border);
  border-radius: 8px;
  background: #fff;
  color: var(--yt-text);
}

.yt-form-grid textarea { min-height: 96px; resize: vertical; }

.yt-form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.yt-checkbox {
  display: flex !important;
  align-items: center;
  gap: 10px;
  color: var(--yt-text) !important;
}

.yt-checkbox input { width: auto; }

.yt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 18px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
}

.yt-btn:hover { text-decoration: none; }

.yt-btn-primary {
  background: var(--yt-blue);
  color: #fff;
}

.yt-btn-primary:hover { background: #0553bf; }

.yt-btn-secondary {
  background: #f2f2f2;
  color: var(--yt-text);
  border-color: var(--yt-border);
}

.yt-btn-danger {
  background: #fff;
  color: #c5221f;
  border-color: #f5c2c0;
}

.yt-btn-ghost {
  background: #fff;
  color: var(--yt-text);
  border-color: var(--yt-border);
}

.yt-inline-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.yt-split {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 16px;
}

.yt-search-card {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--yt-border);
  border-radius: 12px;
  background: #fafafa;
}

.yt-search-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
}

.yt-search-results {
  display: grid;
  gap: 14px;
}

.yt-muted { color: var(--yt-muted); }

.yt-login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(255, 0, 0, 0.08), transparent 28%),
    var(--yt-bg);
}

.yt-login-card {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--yt-border);
  border-radius: 16px;
  box-shadow: var(--yt-shadow);
  padding: 28px;
}

.yt-login-card h1 {
  margin: 8px 0 6px;
  font-size: 1.5rem;
  font-weight: 500;
}

.yt-login-card p {
  margin: 0 0 18px;
  color: var(--yt-muted);
  line-height: 1.5;
}

.yt-error {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fce8e6;
  color: #c5221f;
  border: 1px solid #f5c2c0;
  font-size: 0.9rem;
}

@media (max-width: 1100px) {
  .yt-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .yt-grid-2, .yt-split, .yt-form-grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .yt-app { grid-template-columns: 1fr; }
  .yt-sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--yt-border);
  }
  .yt-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .yt-topbar, .yt-content { padding-left: 16px; padding-right: 16px; }
}
