:root {
  --primary: #7ec8e3;
  --primary-dark: #3aa7d8;
  --secondary: #bfeeff;
  --accent: #ffffff;
  --dark: #071827;
  --glass-bg: rgba(255, 255, 255, 0.12);
  --glass-strong: rgba(255, 255, 255, 0.18);
  --glass-border: rgba(255, 255, 255, 0.25);
  --text-main: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.72);
  --success: #7ee7c7;
  --warning: #ffd166;
  --danger: #ff8fa3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Vazirmatn", Tahoma, Arial, sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top right, rgba(126, 200, 227, 0.35), transparent 35%),
    radial-gradient(circle at bottom left, rgba(58, 167, 216, 0.25), transparent 40%),
    linear-gradient(135deg, #06121f, #0b2438, #071827);
}

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

button {
  cursor: pointer;
}

.app-shell {
  width: min(1240px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, #bfeeff, #54b7df);
  box-shadow: 0 18px 45px rgba(58, 167, 216, 0.34);
  color: #082033;
  font-size: 26px;
  font-weight: 800;
}

.brand-title {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
}

.brand-subtitle {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: 22px;
  box-shadow: 0 24px 80px rgba(0, 80, 140, 0.22);
}

.login-layout {
  min-height: calc(100vh - 56px);
  display: grid;
  place-items: center;
}

.login-card {
  width: min(470px, 100%);
  padding: 34px;
}

.login-card .brand {
  margin-bottom: 26px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field label {
  color: var(--text-muted);
  font-size: 13px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 11px 14px;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.09);
  outline: none;
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(126, 200, 227, 0.12);
}

.primary-btn,
.ghost-btn,
.danger-btn,
.icon-btn {
  min-height: 42px;
  border: 0;
  border-radius: 14px;
  padding: 0 16px;
  color: var(--text-main);
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 12px 30px rgba(58, 167, 216, 0.35);
  font-weight: 700;
}

.ghost-btn,
.icon-btn {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
}

.danger-btn {
  background: rgba(255, 143, 163, 0.2);
  border: 1px solid rgba(255, 143, 163, 0.45);
}

.hint,
.error,
.success {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.8;
}

.hint {
  color: var(--text-muted);
}

.error {
  color: var(--danger);
}

.success {
  color: var(--success);
}

.dashboard {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 18px;
}

.sidebar {
  position: sticky;
  top: 20px;
  height: calc(100vh - 40px);
  padding: 22px;
}

.nav {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

.nav button {
  width: 100%;
  text-align: right;
}

.nav button.active {
  background: rgba(126, 200, 227, 0.2);
  border-color: rgba(126, 200, 227, 0.5);
}

.content {
  display: grid;
  gap: 18px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 20px;
}

.page-title {
  margin: 0;
  font-size: 24px;
}

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

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

.stat-card {
  padding: 18px;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.toolbar input,
.toolbar select {
  min-width: 210px;
}

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

.video-card {
  min-height: 250px;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.cover {
  height: 116px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(126, 200, 227, 0.28), rgba(255, 255, 255, 0.08)),
    rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--secondary);
  font-size: 36px;
  font-weight: 800;
}

.video-card h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.7;
}

.meta-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.07);
  font-size: 12px;
}

.details {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 18px;
}

.video-player {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 20px;
  background: #02070d;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.panel {
  padding: 20px;
}

.panel h2,
.panel h3 {
  margin-top: 0;
}

.training-text {
  line-height: 2;
  color: rgba(255, 255, 255, 0.86);
}

.table-list {
  display: grid;
  gap: 10px;
}

.list-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

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

.form-grid .wide {
  grid-column: 1 / -1;
}

.empty {
  padding: 34px;
  text-align: center;
  color: var(--text-muted);
}

.security-note {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 209, 102, 0.35);
  background: rgba(255, 209, 102, 0.1);
  color: rgba(255, 244, 211, 0.96);
  line-height: 1.8;
}

@media (max-width: 960px) {
  .dashboard,
  .details {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .stats,
  .video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 20px, 1240px);
    padding: 10px 0;
  }

  .login-card {
    padding: 22px;
  }

  .topbar,
  .list-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .stats,
  .video-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* Final RTL polish, Syn-Tech logo usage, and professional video covers */
html, body, #app {
  direction: rtl;
  text-align: right;
}

body {
  background:
    radial-gradient(circle at top right, rgba(142, 214, 242, 0.36), transparent 34%),
    radial-gradient(circle at bottom left, rgba(68, 179, 224, 0.24), transparent 40%),
    linear-gradient(135deg, #030711, #071827 44%, #0d2f46);
}

button, input, select, textarea {
  direction: rtl;
}

input, select, textarea {
  text-align: right;
}

.field input[type="file"] {
  padding: 10px;
  color: var(--text-muted);
}

.brand-mark {
  display: none;
}

.brand-logo {
  width: 158px;
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 14px 30px rgba(126, 200, 227, 0.28));
}

.primary-btn {
  color: #06121f;
}

.actions {
  justify-content: flex-start;
}

.cover {
  position: relative;
  height: 138px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(126, 200, 227, 0.3), rgba(7, 24, 39, 0.2)),
    rgba(255, 255, 255, 0.08);
  color: var(--accent);
  isolation: isolate;
  font-size: initial;
}

.cover::before,
.cover::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  z-index: -1;
}

.cover::before {
  width: 180px;
  height: 180px;
  left: -42px;
  top: -70px;
  background: rgba(191, 238, 255, 0.24);
}

.cover::after {
  width: 118px;
  height: 118px;
  right: -36px;
  bottom: -42px;
  background: rgba(58, 167, 216, 0.3);
}

.cover-img {
  padding: 0;
  background-size: cover;
  background-position: center;
}

.cover-img::before {
  inset: 0;
  width: auto;
  height: auto;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(3, 7, 17, 0.05), rgba(3, 7, 17, 0.54));
}

.cover-logo {
  width: 88px;
  height: auto;
  object-fit: contain;
  filter: brightness(1.08);
}

.cover-kicker {
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  font-weight: 600;
}

.cover-title {
  max-width: 86%;
  margin: 0;
  font-size: 18px;
  line-height: 1.55;
}

.cover-play {
  position: absolute;
  left: 16px;
  bottom: 16px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #071827;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
}

.cover-preview {
  min-height: 150px;
  margin-top: 2px;
}

.mini-cover {
  width: 118px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
}

/* Final click and compact logo refinements */
.clickable-card {
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.clickable-card:hover,
.clickable-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(126, 200, 227, 0.55);
  box-shadow: 0 28px 90px rgba(58, 167, 216, 0.28);
  outline: none;
}

.brand-logo {
  width: 76px;
}

.login-card .brand {
  justify-content: center;
  text-align: center;
}

.login-card .brand-logo {
  width: 92px;
}

.login-card .brand {
  flex-direction: column;
}

.cover-logo {
  width: 54px;
}

/* Logo size correction */
.brand-logo {
  width: 26px;
  min-width: 26px;
}

.login-card .brand-logo {
  width: 32px;
  min-width: 32px;
}

.cover-logo {
  width: 22px;
}

.brand {
  gap: 10px;
}
