/* Lumenary Relay - Shared Styles */

:root {
  --brand-primary: #3b82f6;
  --brand-light: #60a5fa;
  --brand-deep: #2563eb;
  --brand-green: #10b981;
  --bg-dark: #0f172a;
  --bg-mid: #1e293b;
  --bg-card: #334155;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #475569;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-mid) 50%, var(--bg-dark) 100%);
  color: var(--text-primary);
  min-height: 100vh;
}

/* Landing */
.landing .landing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.logo-img {
  width: 40px;
  height: 40px;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 600;
}

.header-nav {
  display: flex;
  gap: 0.5rem;
}

.btn {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}

.btn-ghost {
  color: var(--text-secondary);
  background: transparent;
}

.btn-ghost:hover {
  color: var(--text-primary);
}

.btn-primary {
  background: var(--brand-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--brand-deep);
}

.btn-danger {
  background: #dc2626;
  color: white;
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1.1rem;
}

.landing-main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.hero {
  text-align: center;
  margin-bottom: 4rem;
}

.hero-image-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.hero-image {
  max-width: 100%;
  width: min(400px, 90vw);
  height: auto;
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.hero-sub {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

.platforms h2, .features h2, .cta h2 {
  text-align: center;
  margin-bottom: 2rem;
}

.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 4rem;
}

.platform-card {
  background: rgba(51, 65, 85, 0.5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.platform-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin-bottom: 1rem;
}

.platform-icon.pi {
  background: var(--brand-primary);
}

.platform-icon.eo {
  background: var(--brand-green);
}

.platform-card h3 {
  margin: 0 0 0.5rem;
}

.platform-card ul {
  margin: 1rem 0;
  padding-left: 1.25rem;
  color: var(--text-secondary);
}

.platform-card li {
  margin: 0.25rem 0;
}

.platform-link {
  display: inline-block;
  margin-top: 1rem;
  color: var(--brand-light);
  text-decoration: none;
}

.platform-link:hover {
  text-decoration: underline;
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.85rem;
}

.status-ok {
  background: rgba(16, 185, 129, 0.2);
  color: var(--brand-green);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 4rem;
}

.feature-card {
  background: rgba(51, 65, 85, 0.4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.feature-icon {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 0.5rem;
}

.feature-card h4 {
  margin: 0 0 0.5rem;
}

.feature-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.cta {
  text-align: center;
  padding: 3rem;
}

.cta p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.landing-footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.landing-footer a {
  color: var(--brand-light);
}

/* Auth pages */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-card {
  background: rgba(51, 65, 85, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 400px;
}

.auth-card h1 {
  margin: 0 0 1.5rem;
  text-align: center;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.form-group input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-dark);
  color: var(--text-primary);
  font-size: 1rem;
}

.form-group input:focus {
  outline: none;
  border-color: var(--brand-primary);
}

.auth-card .btn {
  width: 100%;
  padding: 0.75rem;
  margin-top: 0.5rem;
}

.auth-card .error {
  color: #ef4444;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.auth-card .success {
  color: var(--brand-green);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0 0 1.5rem;
  text-align: center;
}

.forgot-link {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--brand-light);
  text-decoration: none;
}

.forgot-link:hover {
  text-decoration: underline;
}

.auth-card .footer {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--text-secondary);
}

.auth-card .footer a {
  color: var(--brand-light);
}

.auth-card-wide {
  max-width: 420px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group-checkbox {
  margin-bottom: 1rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: var(--text-secondary);
}

.checkbox-label input {
  width: auto;
}

/* Profile page */
.profile-card {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  background: rgba(51, 65, 85, 0.5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.profile-info,
.profile-form-wrap {
  flex: 1;
  min-width: 0;
}

.profile-form-wrap .form-group {
  margin-bottom: 1rem;
}

.profile-form-wrap .form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.profile-form-wrap .form-group input[type="text"],
.profile-form-wrap .form-group input[type="email"] {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-dark);
  color: inherit;
}

.profile-form-wrap .form-group input:focus {
  outline: none;
  border-color: var(--brand-primary);
}

.profile-readonly {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.profile-readonly-value {
  margin: 0;
  color: var(--text-secondary);
}

.profile-form-wrap .form-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.profile-info h2 {
  margin: 0 0 0.25rem;
}

.profile-email {
  color: var(--text-secondary);
  margin: 0 0 1rem;
}

.profile-details {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1.5rem;
}

.profile-details dt {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.profile-details dd {
  margin: 0;
}

/* Dashboard */
.dashboard-header .user {
  color: var(--text-secondary);
}

.dashboard-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
}

.dashboard-main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.dashboard-main-header h1 {
  margin: 0;
}

/* Add Frame modal */
.add-frame-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  visibility: hidden;
}

.add-frame-modal.open {
  pointer-events: auto;
  visibility: visible;
}

.add-frame-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.2s;
}

.add-frame-modal.open .add-frame-modal-backdrop {
  opacity: 1;
}

.add-frame-modal-card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: min(400px, 90vw);
  background: var(--bg-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
}

.add-frame-modal.open .add-frame-modal-card {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.add-frame-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.add-frame-modal-header h3 {
  margin: 0;
}

.add-frame-modal-body {
  padding: 1.25rem;
}

.add-frame-modal-body .form-group {
  margin-bottom: 1rem;
}

.add-frame-modal-body .form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.add-frame-modal-body .form-group input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-dark);
  color: var(--text-primary);
  font-size: 1rem;
}

.add-frame-modal-body .form-group input:focus {
  outline: none;
  border-color: var(--brand-primary);
}

.add-frame-modal-body .token-display {
  margin: 0;
}

.add-frame-modal-body #btn-generate-token,
.add-frame-modal-body #btn-done {
  margin-top: 0.5rem;
  width: 100%;
}

/* My Frames grid */
.empty-frames {
  color: var(--text-muted);
  font-style: italic;
  padding: 2rem;
  text-align: center;
}

.frames-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.frame-card {
  background: rgba(51, 65, 85, 0.5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s;
  display: flex;
  flex-direction: column;
}

.frame-card:hover {
  border-color: var(--brand-primary);
}

.frame-card-preview {
  display: block;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--bg-dark);
}

.frame-card-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.frame-card-preview .frame-preview-placeholder {
  width: 100%;
  height: 100%;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.frame-card.online .frame-card-status {
  color: var(--brand-green);
}

.frame-card.offline .frame-card-status {
  color: var(--text-muted);
}

.frame-card-header {
  padding: 1rem 1.25rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.frame-card-header-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.frame-card-name {
  font-weight: 600;
  word-break: break-word;
}

.frame-card-status {
  font-size: 0.9rem;
}

.frame-card-chevron {
  color: var(--text-muted);
  font-size: 0.8rem;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.frame-card.expanded .frame-card-chevron {
  transform: rotate(180deg);
}

.frame-card-expanded {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease-out;
}

.frame-card.expanded {
  grid-column: 1 / -1;
}

.frame-card.expanded .frame-card-expanded {
  max-height: 400px;
}

.frame-card-details {
  padding: 0 1.25rem 1rem;
  border-top: 1px solid var(--border);
}

.frame-detail-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.frame-detail-row:last-of-type {
  margin-bottom: 0;
}

.frame-detail-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.frame-detail-value {
  font-size: 0.9rem;
  word-break: break-all;
}

.frame-detail-row code {
  font-family: monospace;
  font-size: 0.85rem;
}

.frame-card-actions {
  display: flex;
  gap: 0.5rem;
  padding: 0 1.25rem 1.25rem;
}

.frame-card-actions .btn {
  flex: 1;
  text-align: center;
}

.frame-card-actions .btn-delete {
  background: #dc2626;
  color: white;
  flex: 0 0 auto;
  min-width: 80px;
}

.frame-card-actions .btn-delete:hover {
  background: #b91c1c;
  color: white;
}

.add-frame-card {
  border: 2px dashed var(--border);
  padding: 2rem;
  text-align: center;
}

.add-frame-card input {
  width: 100%;
  max-width: 300px;
  padding: 0.5rem;
  margin: 0.5rem 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-dark);
  color: var(--text-primary);
}

.token-display {
  background: var(--bg-dark);
  padding: 1rem;
  border-radius: 8px;
  font-family: monospace;
  word-break: break-all;
  margin: 1rem 0;
}

/* Admin */
.admin-header,
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
}

.nav-backdrop {
  display: none;
}

.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
}

.hamburger-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}

.hamburger-btn[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger-btn[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.hamburger-btn[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.header-nav,
  .admin-header nav,
.dashboard-header nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link {
  background: none;
  font: inherit;
  cursor: pointer;
}

.dashboard-header nav button.nav-link {
  padding: 0.5rem 1rem;
}

.admin-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.admin-section {
  margin-bottom: 2rem;
}

.admin-section h2 {
  margin-bottom: 1rem;
}

/* Users grid */
.users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: rgba(51, 65, 85, 0.5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}

.user-card:hover {
  border-color: var(--brand-primary);
  background: rgba(51, 65, 85, 0.7);
}

.user-card-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.user-card-body {
  flex: 1;
  min-width: 0;
}

.user-card-email {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-card-name {
  display: block;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.user-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.user-card-frames {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.user-card-arrow {
  color: var(--text-muted);
  font-size: 1.25rem;
}

/* User detail panel (slide-over) */
.user-panel {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  visibility: hidden;
}

.user-panel.open {
  pointer-events: auto;
  visibility: visible;
}

.user-panel-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.2s;
}

.user-panel.open .user-panel-backdrop {
  opacity: 1;
}

.user-panel-content {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100%);
  background: var(--bg-mid);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease-out;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.3);
}

.user-panel.open .user-panel-content {
  transform: translateX(0);
}

.user-panel-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.user-panel-header h3 {
  flex: 1;
  margin: 0;
  font-size: 1.1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-icon {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background: var(--border);
  color: var(--text-primary);
}

.btn-close {
  font-size: 1.75rem;
}

.user-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
}

.user-info-section,
.reset-password-section,
.user-frames-section,
.delete-user-section {
  margin-bottom: 1.5rem;
}

.user-info-section h4,
.reset-password-section h4,
.user-frames-section h4,
.delete-user-section h4 {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
}

.reset-password-hint,
.delete-user-hint {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.user-info-dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1.5rem;
}

.user-info-dl dt {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.user-info-dl dd {
  margin: 0;
}

.editable-field {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.editable-input {
  flex: 1;
  min-width: 160px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-dark);
  color: var(--text-primary);
  font-size: 0.95rem;
}

.editable-input:focus {
  outline: none;
  border-color: var(--brand-primary);
}

.admin-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}

.admin-toggle input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--brand-primary);
}

.toggle-label {
  font-size: 0.95rem;
}

.reset-password-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.reset-password-form input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-dark);
  color: var(--text-primary);
  font-size: 1rem;
}

.reset-password-form input:focus {
  outline: none;
  border-color: var(--brand-primary);
}

.form-feedback {
  font-size: 0.9rem;
}

.form-feedback.success {
  color: var(--brand-green);
}

.form-feedback.error {
  color: #ef4444;
}

/* Frames grid in user panel */
.frames-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}

.frame-tile {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.frame-tile-preview {
  display: block;
  aspect-ratio: 4/3;
  overflow: hidden;
  position: relative;
}

.frame-tile-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.frame-tile-preview .frame-preview-placeholder {
  width: 100%;
  height: 100%;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-dark);
}

.frame-tile-info {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.frame-tile-name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.frame-tile-status {
  font-size: 0.85rem;
}

.frame-tile-status.online {
  color: var(--brand-green);
}

.frame-tile-status.offline {
  color: var(--text-muted);
}

.empty-state {
  color: var(--text-muted);
  font-style: italic;
  margin: 0;
}

.frame-preview {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg-dark);
}

.frame-preview-placeholder {
  width: 120px;
  height: 90px;
  background: var(--bg-dark);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.frame-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0.5rem 0;
}

.frame-row .frame-name {
  flex: 1;
}

.frame-row .frame-status {
  font-size: 0.85rem;
}

/* Mobile-friendly: Admin & Dashboard */
@media (max-width: 768px) {
  .admin-header,
  .dashboard-header {
    flex-wrap: nowrap;
    padding: 0.75rem 1rem;
    gap: 0.75rem;
  }

  .hamburger-btn {
    display: flex;
    margin-left: auto;
  }

  .header-nav,
  .admin-header nav,
  .dashboard-header nav {
    position: fixed;
    top: 0;
    right: 0;
    width: min(280px, 85vw);
    height: 100vh;
    background: var(--bg-mid);
    border-left: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 4rem 1rem 1rem;
    gap: 0.5rem;
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.2s ease;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
  }

  .header-nav.open,
  .admin-header nav.open,
  .dashboard-header nav.open {
    transform: translateX(0);
  }

  .admin-header nav .user,
  .dashboard-header nav .user {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
  }

  .admin-header nav .nav-link,
  .dashboard-header nav .nav-link {
    justify-content: flex-start;
    padding: 0.75rem 1rem;
    text-align: left;
  }

  .nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
  }

  .nav-backdrop.open {
    display: block;
  }

  .admin-header .logo-text,
  .dashboard-header .logo-text {
    font-size: 1.1rem;
  }

  .admin-header .user,
  .dashboard-header .user {
    font-size: 0.85rem;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .admin-main,
  .dashboard-main {
    padding: 1rem;
  }

  .admin-section h2 {
    font-size: 1.25rem;
  }

  .users-grid {
    grid-template-columns: 1fr;
  }

  .user-panel-content {
    width: 100%;
  }

  .frames-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .frame-row {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .frame-row .frame-name {
    min-width: 0;
  }

  .frame-preview {
    width: 80px;
    height: 60px;
  }

  .frame-preview-placeholder {
    width: 80px;
    height: 60px;
    font-size: 0.7rem;
  }

  .frames-grid {
    grid-template-columns: 1fr;
  }

  .frame-card.expanded .frame-card-expanded {
    max-height: 450px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .profile-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .add-frame-card input {
    max-width: none;
  }

  .token-display {
    font-size: 0.85rem;
    padding: 0.75rem;
  }
}

/* Small phones */
@media (max-width: 480px) {
  .admin-header,
  .dashboard-header {
    padding: 0.5rem 0.75rem;
  }

  .logo-img {
    width: 32px;
    height: 32px;
  }

  .btn:not(.btn-sm) {
    padding: 0.5rem 0.875rem;
    font-size: 0.9rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .frame-preview {
    width: 64px;
    height: 48px;
  }

  .frame-preview-placeholder {
    width: 64px;
    height: 48px;
  }
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
}
