@font-face {
  font-family: "IRANSans";
  src: url("../fonts/IRANSansWeb_Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --primary: #2a364d;
  --primary-dark: #1e2840;
  --primary-light: #3d4f6f;
  --purple: #2a364d;
  --purple-dark: #1e2840;
  --accent: #4a7dff;
  --green: #10b981;
  --red: #ef4444;
  --amber: #f59e0b;
  --gray-50: #f8f9fb;
  --gray-100: #f1f3f6;
  --gray-200: #e2e5ea;
  --gray-300: #cdd1d9;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 12px rgba(42, 54, 77, 0.08);
  --shadow-lg: 0 8px 32px rgba(42, 54, 77, 0.12);
  --grad: linear-gradient(135deg, #2a364d 0%, #3d4f6f 100%);
  --grad-blue: linear-gradient(135deg, #2a364d 0%, #4a7dff 100%);
  --grad-green: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --grad-red: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  --header-h: 64px;
  --font: "IRANSans", "Vazirmatn", Tahoma, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--gray-100);
  color: var(--gray-800);
  direction: rtl;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
textarea {
  font-family: inherit;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-h);
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}

.site-header.scrolled {
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(16px);
  border-bottom-color: rgba(229, 231, 235, 0.5);
}

.header-inner {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1rem, 4vw, 3rem);
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: opacity 0.2s;
}
.brand:hover {
  opacity: 0.85;
}
.brand img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 6px;
}
.brand span {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.025em;
}

/* Desktop nav */
.nav-desktop {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.nav-link {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--gray-500);
  padding: 0.45rem 0.85rem;
  border-radius: 10px;
  transition: all 0.2s;
  white-space: nowrap;
  position: relative;
}
.nav-link:hover {
  color: var(--gray-800);
  background: rgba(0, 0, 0, 0.03);
}
.nav-link.active {
  color: var(--purple);
  background: rgba(102, 126, 234, 0.06);
  font-weight: 600;
}
@media (max-width: 768px) {
  .nav-desktop { display: none; }
}

/* Header end (right side for RTL) */
.header-end {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* CTA button in nav */
.nav-cta {
  font-size: 0.82rem;
  font-weight: 600;
  color: white;
  background: var(--grad);
  padding: 0.45rem 1.2rem;
  border-radius: 10px;
  transition: all 0.2s;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(42, 54, 77, 0.25);
}
.nav-cta:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(42, 54, 77, 0.35);
}

/* User avatar button */
.user-avatar-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
}

/* Burger */
.burger {
  display: none;
  flex-direction: column;
  gap: 4.5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: background 0.2s;
}
.burger:hover { background: rgba(0,0,0,0.04); }
.burger span {
  width: 20px;
  height: 2px;
  background: var(--gray-700);
  border-radius: 2px;
  transition: all 0.25s;
}
@media (max-width: 768px) {
  .burger { display: flex; }
  .nav-cta { display: none; }
}

/* Mobile overlay */
.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.mobile-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile drawer */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: -300px;
  width: min(300px, 85vw);
  height: 100vh;
  background: white;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  transition: right 0.35s cubic-bezier(.4,0,.2,1);
  box-shadow: -8px 0 32px rgba(0,0,0,0.1);
}
.mobile-drawer.open {
  right: 0;
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-200);
}
.drawer-close {
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid var(--gray-200);
  background: white;
  font-size: 1.3rem;
  color: var(--gray-500);
  cursor: pointer;
  display: grid; place-items: center;
  transition: all 0.2s;
}
.drawer-close:hover {
  background: var(--gray-50);
  color: var(--gray-800);
}
.drawer-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0.75rem;
}
.drawer-nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--gray-700);
  transition: all 0.2s;
}
.drawer-nav a:hover {
  background: var(--gray-50);
}
.drawer-nav a.active {
  background: rgba(102, 126, 234, 0.06);
  color: var(--purple);
  font-weight: 600;
}
.drawer-foot {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--gray-200);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-500);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.25rem;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
}
.user-btn:hover {
  color: var(--gray-700);
  background: rgba(107, 114, 128, 0.08);
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gray-500);
  color: white;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 8px rgba(107, 114, 128, 0.25);
}
.avatar svg {
  width: 16px;
  height: 16px;
}

.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(229, 231, 235, 0.7);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
  display: none;
  z-index: 20;
}
.user-menu.open {
  display: block;
  animation: fadeIn 0.15s ease;
}
.user-menu-wrap {
  position: relative;
}
.user-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 0.9rem;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--gray-800);
  transition: background 0.2s, transform 0.2s;
}
.user-menu button:hover {
  background: rgba(14, 165, 233, 0.08);
  transform: translateX(-2px);
}
.user-menu button.danger {
  color: var(--red);
}
.user-menu button.danger:hover {
  background: rgba(239, 68, 68, 0.08);
}
.user-menu hr {
  border: none;
  border-top: 1px solid rgba(229, 231, 235, 0.7);
  margin: 0.35rem 0;
}

/* Main */
.main {
  padding-bottom: 3rem;
  min-height: 100vh;
}

.container {
  width: min(1400px, 92%);
  margin: 0 auto;
}

.container-sm {
  width: min(480px, 92%);
  margin: 0 auto;
}

/* Page header */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.page-head-title {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.icon-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--grad);
  display: grid;
  place-items: center;
  color: white;
  box-shadow: 0 4px 12px rgba(42, 54, 77, 0.25);
  flex-shrink: 0;
}
.icon-box svg {
  width: 22px;
  height: 22px;
}
.page-head h1 {
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.025em;
}
.page-head p {
  color: var(--gray-500);
  font-size: 0.875rem;
  margin-top: 0.15rem;
}

/* Search */
.search-wrap {
  position: relative;
  margin-bottom: 1.5rem;
}
.search-wrap input {
  width: 100%;
  padding: 0.9rem 1rem 0.9rem 2.75rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: white;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  text-align: right;
}
.search-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}
.search-wrap .search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  pointer-events: none;
}
.search-wrap .search-icon svg {
  width: 20px;
  height: 20px;
}

/* Cards grid */
.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(1, 1fr);
}
@media (min-width: 640px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 900px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .grid-4 {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 1100px) {
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
  transform: translateY(-2px);
}
.card.clickable,
.clickable {
  cursor: pointer;
}

@media (max-width: 520px) {
  .hide-xs {
    display: none !important;
  }
}
.card-body {
  padding: 1.25rem;
  flex: 1;
}
.card-foot {
  padding: 0.75rem 1rem;
  border-top: 1px solid #f3f4f6;
  display: flex;
  justify-content: flex-end;
  gap: 0.25rem;
}
.card-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.card-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--grad);
  display: grid;
  place-items: center;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(42, 54, 77, 0.25);
}
.card-avatar svg {
  width: 20px;
  height: 20px;
}
.card-avatar.blue {
  background: var(--grad-blue);
}
.card-avatar.green {
  background: var(--grad-green);
}
.card-avatar.red {
  background: var(--grad-red);
}
.card-text {
  min-width: 0;
  flex: 1;
}
.card-text h3 {
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-text span {
  font-size: 0.75rem;
  color: var(--gray-500);
  font-weight: 500;
}

.dash-card .card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 180px;
  gap: 0.5rem;
}
.dash-card .card-avatar {
  width: 60px;
  height: 60px;
  margin-bottom: 0.35rem;
}
.dash-card .card-avatar svg {
  width: 28px;
  height: 28px;
}
.dash-card h3 {
  font-size: 1.1rem;
}
.dash-card p {
  font-size: 0.8rem;
  color: var(--gray-500);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}
.btn-primary {
  background: var(--grad);
  color: white;
  box-shadow: 0 4px 12px rgba(42, 54, 77, 0.25);
}
.btn-primary:hover:not(:disabled) {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(42, 54, 77, 0.35);
}
.btn-sky {
  background: var(--primary);
  color: white;
}
.btn-sky:hover:not(:disabled) {
  background: var(--primary-dark);
}
.btn-outline {
  background: white;
  border: 1px solid var(--gray-200);
  color: var(--gray-700);
}
.btn-outline:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: #f0f9ff;
}
.btn-ghost {
  background: transparent;
  color: var(--gray-500);
}
.btn-ghost:hover:not(:disabled) {
  background: #f3f4f6;
}
.btn-danger {
  background: var(--red);
  color: white;
}
.btn-danger:hover:not(:disabled) {
  background: #dc2626;
}
.btn-lg {
  padding: 0.85rem 2.5rem;
  border-radius: 999px;
  font-size: 1rem;
}
.btn-block {
  width: 100%;
}
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--gray-500);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.2s;
}
.btn-icon:hover {
  transform: scale(1.08);
}
.btn-icon svg {
  width: 18px;
  height: 18px;
}
.btn-icon.edit:hover {
  background: #fef3c7;
  color: var(--amber);
}
.btn-icon.copy:hover {
  background: #f0fdf4;
  color: var(--green);
}
.btn-icon.delete:hover {
  background: #fef2f2;
  color: var(--red);
}
.btn-icon.share:hover {
  background: #eff6ff;
  color: var(--primary);
}
.btn-icon.download:hover {
  background: #f0fdf4;
  color: var(--green);
}
.btn-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: white;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow);
  color: var(--gray-700);
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 50;
  transition: all 0.3s;
}
.btn-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}
.btn-fab svg {
  width: 24px;
  height: 24px;
  transform: rotate(90deg);
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  color: var(--gray-500);
  font-weight: 500;
}
.form-control {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s;
  text-align: right;
}
.form-control:hover {
  background: #f1f5f9;
}
.form-control:focus {
  background: white;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}

/* Login */
.login-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  padding: 2rem;
  margin-top: 2rem;
}
.login-card h1 {
  text-align: center;
  margin-bottom: 0.35rem;
  font-size: 1.5rem;
}
.login-card .subtitle {
  text-align: center;
  color: var(--gray-500);
  font-size: 0.875rem;
  margin-bottom: 1.75rem;
}

/* Alert */
.alert {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}
.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
}
.alert-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #059669;
}

/* Empty / loading / error */
.state-box {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 3rem 1.5rem;
  text-align: center;
}
.state-box .state-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #f3f4f6;
  display: grid;
  place-items: center;
  margin: 0 auto 1rem;
  color: var(--gray-400);
}
.state-box h3 {
  color: var(--gray-700);
  margin-bottom: 0.35rem;
}
.state-box p {
  color: var(--gray-500);
  font-size: 0.875rem;
}

.skeleton-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.skeleton {
  height: 140px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.fade-in {
  animation: fadeIn 0.4s ease both;
}

/* Landing */
.hero {
  text-align: center;
  padding: clamp(2rem, 6vw, 4rem) 1rem;
  margin-bottom: 1.5rem;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}
.hero p {
  color: var(--gray-500);
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  max-width: 600px;
  margin: 0 auto 1.75rem;
  line-height: 1.7;
}

.section {
  background: white;
  border-radius: 16px;
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1rem, 3vw, 2rem);
  margin-bottom: 1.5rem;
}
.section.muted {
  background: var(--gray-50);
}
.section-title {
  text-align: center;
  margin-bottom: 2rem;
}
.section-title h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  margin-bottom: 0.5rem;
}
.section-title p {
  color: var(--gray-500);
  font-size: 1.05rem;
}

.service-card {
  text-align: center;
  padding: 1.5rem 1rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: white;
  height: 100%;
  transition: transform 0.3s, box-shadow 0.3s;
}
.service-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}
.service-card .card-avatar {
  margin: 0 auto 0.85rem;
}
.service-card h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}
.service-card p {
  font-size: 0.875rem;
  color: var(--gray-500);
}

.counter-num {
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-weight: 700;
  color: var(--purple);
  text-align: center;
}
.counter-label {
  text-align: center;
  color: var(--gray-500);
  font-size: 1.25rem;
  margin-top: 0.35rem;
}

.about-row {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  direction: rtl;
}
.about-row .card-avatar {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}
.about-row .card-avatar svg {
  width: 36px;
  height: 36px;
}
.about-row h2 {
  margin-bottom: 1rem;
  font-size: clamp(1.4rem, 3vw, 2rem);
}
.about-row p {
  color: var(--gray-500);
  font-size: 1.05rem;
  line-height: 1.85;
  margin-bottom: 1rem;
}
@media (max-width: 768px) {
  .about-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

.site-footer {
  background: var(--gray-800);
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  padding: 1.5rem;
  border-radius: 16px;
  font-size: 0.875rem;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-backdrop.open {
  display: flex;
  animation: fadeIn 0.15s ease;
}
.modal {
  background: white;
  border-radius: 16px;
  width: min(480px, 100%);
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow: auto;
  animation: fadeIn 0.2s ease;
}
.modal.modal-lg {
  width: min(720px, 100%);
}
.modal-header {
  padding: 1.25rem 1.5rem 0.5rem;
  text-align: center;
}
.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 600;
}
.modal-body {
  padding: 1rem 1.5rem;
}
.modal-footer {
  padding: 0.75rem 1.5rem 1.5rem;
  display: flex;
  gap: 0.5rem;
  justify-content: flex-start;
  flex-direction: row-reverse;
}

.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 1rem;
}
.tab {
  flex: 1;
  padding: 0.75rem;
  border: none;
  background: none;
  cursor: pointer;
  font-weight: 600;
  color: var(--gray-500);
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}
.copy-box {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  font-size: 0.8rem;
  word-break: break-all;
  direction: ltr;
  text-align: left;
  margin-bottom: 0.75rem;
  max-height: 140px;
  overflow: auto;
}

.progress {
  height: 8px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.75rem;
}
.progress-bar {
  height: 100%;
  background: var(--grad);
  width: 0%;
  transition: width 0.2s;
}

/* Toast */
.toast-wrap {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: min(400px, 92%);
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-sm);
  background: white;
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  animation: fadeIn 0.2s ease;
  border-right: 4px solid var(--green);
}
.toast.error {
  border-right-color: var(--red);
}
.toast button {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--gray-400);
  font-size: 1.1rem;
  line-height: 1;
}

/* Video player */
.video-frame {
  width: 100%;
  border-radius: 12px;
  background: #000;
  aspect-ratio: 16 / 9;
}
.video-frame video {
  width: 100%;
  height: 100%;
  border-radius: 12px;
}

.file-hint {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-top: 0.35rem;
}

.hidden {
  display: none !important;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--gray-500);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1rem;
  transition: color 0.2s;
}
.back-link:hover {
  color: var(--primary);
}
.back-link svg {
  width: 18px;
  height: 18px;
}
