:root {
  --primary: #f97316;
  --primary-dark: #ea580c;
  --primary-light: #fff7ed;
  --sidebar-bg: #1a1f2e;
  --sidebar-text: #94a3b8;
  --sidebar-active: #f97316;
  --body-bg: #f8fafc;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --text-primary: #0f172a;
  --text-muted: #64748b;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --info: #0284c7;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --radius: 10px;
  --radius-sm: 6px;
}

* {
  font-family: 'Inter', sans-serif;
  box-sizing: border-box;
}

body.dw-portal {
  background: var(--body-bg);
  margin: 0;
  color: var(--text-primary);
}

.dw-sidebar {
  width: 240px;
  min-height: 100vh;
  background: var(--sidebar-bg);
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s;
}

.dw-sidebar-logo {
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.dw-logo-mark {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 15px;
  flex-shrink: 0;
}

.dw-logo-text {
  color: white;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
}

.dw-logo-sub {
  color: var(--sidebar-text);
  font-size: 11px;
}

.dw-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.dw-nav-section {
  padding: 16px 16px 6px;
  color: #475569;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.dw-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
  margin: 1px 8px;
  border-radius: 8px;
}

.dw-nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: white;
}

.dw-nav-item.active {
  background: rgba(249, 115, 22, 0.15);
  color: var(--primary);
}

.dw-nav-item.active i {
  color: var(--primary);
}

.dw-nav-item i {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.dw-nav-badge {
  margin-left: auto;
  background: var(--primary);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 600;
}

.dw-sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.dw-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
}

.dw-avatar {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.dw-main {
  margin-left: 240px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.dw-topbar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 99;
}

.dw-page-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.dw-breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
}

.dw-content {
  padding: 24px;
  flex: 1;
}

.dw-card,
.panel-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.dw-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dw-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.dw-card-body {
  padding: 20px;
}

.dw-stat {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.dw-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
}

.dw-stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.dw-stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.btn-primary-dw {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary-dw:hover {
  background: var(--primary-dark);
  color: white;
}

.dw-table {
  width: 100%;
  border-collapse: collapse;
}

.dw-table th {
  background: #f8fafc;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.dw-table td {
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-primary);
  border-bottom: 1px solid #f1f5f9;
}

.dw-table tr:hover td {
  background: #fafafa;
}

.dw-badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dw-badge-success {
  background: #dcfce7;
  color: #16a34a;
}

.dw-badge-warning {
  background: #fef3c7;
  color: #d97706;
}

.dw-badge-danger {
  background: #fee2e2;
  color: #dc2626;
}

.dw-badge-info {
  background: #dbeafe;
  color: #0284c7;
}

.dw-badge-gray {
  background: #f1f5f9;
  color: #64748b;
}

.dw-input {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 14px;
  color: var(--text-primary);
  width: 100%;
  transition: border-color 0.2s;
  background: white;
}

.dw-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
  outline: none;
}

.dw-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
  display: block;
}

.dw-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.dw-page-header h1 {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}

.text-muted-dw {
  color: var(--text-muted);
}

/* Auth split layout */
.dw-auth-page {
  min-height: 100vh;
  display: flex;
}

.dw-auth-brand {
  width: 45%;
  background: var(--sidebar-bg);
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px;
}

.dw-auth-form-side {
  width: 55%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.dw-auth-card {
  width: 100%;
  max-width: 400px;
}

.dw-auth-features {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
}

.dw-auth-features li {
  padding: 8px 0;
  font-size: 14px;
  color: #e2e8f0;
}

.dw-auth-features li::before {
  content: '✓ ';
  color: var(--primary);
  font-weight: 700;
}

/* LMS student cards on light theme */
.lms-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.lms-card--upgrade {
  border-color: var(--primary);
  background: var(--primary-light);
}

.lms-card--active {
  border-color: #86efac;
  background: #f0fdf4;
}

.lms-card--ended {
  border-color: var(--border);
  background: #f8fafc;
}

.btn-orange {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

.btn-orange:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
}

.dw-content--wide {
  padding-left: 0;
  padding-right: 0;
  max-width: none;
}

.lms-welcome-banner {
  background: linear-gradient(135deg, #fff7ed 0%, #ffffff 60%);
  border: 1px solid #fed7aa;
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
}

.lms-video-thumb {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #f97316, #ea580c);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.85);
  position: relative;
  overflow: hidden;
}

.lms-video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lms-video-locked {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
  padding: 1rem;
  z-index: 2;
}

.lms-player-layout .video-frame {
  border: 0;
  border-radius: 8px;
  width: 100%;
  height: 100%;
}

.lms-playlist-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
}

.lms-playlist-item:hover {
  background: #f8fafc;
}

.lms-playlist-item.active {
  background: var(--primary-light);
  border-color: #fed7aa;
}

.lms-playlist-thumb {
  width: 72px;
  height: 48px;
  border-radius: 6px;
  background: linear-gradient(135deg, #f97316, #ea580c);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
}

.password-strength {
  height: 4px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin-top: 0.5rem;
}

.password-strength-bar {
  height: 100%;
  width: 0;
  background: #ef4444;
  transition: width 0.2s, background 0.2s;
}

@media (max-width: 768px) {
  .dw-sidebar {
    transform: translateX(-100%);
  }

  .dw-sidebar.open {
    transform: translateX(0);
  }

  .dw-main {
    margin-left: 0;
  }

  .dw-auth-brand {
    display: none;
  }

  .dw-auth-form-side {
    width: 100%;
  }
}
