/* ===================== CSS VARIABLES ===================== */
:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #818cf8;
  --primary-bg: #eef2ff;
  --danger: #ef4444;
  --danger-dark: #dc2626;
  --success: #22c55e;
  --warning: #f59e0b;
  --info: #3b82f6;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
  --transition: all 0.2s ease;
}

/* ===================== RESET & BASE ===================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--gray-800);
  line-height: 1.6;
  background: var(--gray-50);
  min-height: 100vh;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ===================== BUTTONS ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn:active {
  transform: translateY(0);
}

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

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

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

.btn-danger:hover {
  background: var(--danger-dark);
}

.btn-outline {
  background: white;
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
}

.btn-outline:hover {
  background: var(--gray-100);
  border-color: var(--gray-400);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-full {
  width: 100%;
  justify-content: center;
  padding: 12px;
  font-size: 15px;
}

/* ===================== FORMS ===================== */
.form-group {
  margin-bottom: 16px;
  flex: 1;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-700);
}

.form-group input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  transition: var(--transition);
  background: white;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.form-row {
  display: flex;
  gap: 16px;
  align-items: flex-end;
}

.error-msg {
  background: #fef2f2;
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
  border: 1px solid #fecaca;
}

/* ===================== LOGIN PAGE ===================== */
.login-page {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-container {
  width: 100%;
  max-width: 420px;
}

.login-card {
  background: white;
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow-xl);
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 28px;
  color: white;
}

.login-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--gray-900);
}

.login-header p {
  color: var(--gray-500);
  font-size: 15px;
  margin-top: 4px;
}

/* ===================== HEADER ===================== */
.header {
  background: white;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo {
  font-size: 24px;
  color: var(--primary);
}

.header-left h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
}

.badge {
  background: var(--primary-bg);
  color: var(--primary);
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.header-right {
  display: flex;
  gap: 8px;
}

/* ===================== MAIN CONTENT ===================== */
.main-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* ===================== CREATE ROOM SECTION ===================== */
.create-room-section {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 32px;
  box-shadow: var(--shadow);
}

.create-room-section h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--gray-800);
}

.create-room-section h2 i {
  color: var(--primary);
  margin-right: 4px;
}

/* ===================== ROOMS SECTION ===================== */
.rooms-section h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--gray-800);
}

.rooms-section h2 i {
  color: var(--primary);
  margin-right: 4px;
}

.rooms-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ===================== ROOM CARD ===================== */
.room-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
}

.room-card:hover {
  box-shadow: var(--shadow-md);
}

.room-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px 12px;
}

.room-info h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--gray-900);
}

.room-info h3 i {
  color: var(--primary);
  margin-right: 6px;
}

.room-desc {
  color: var(--gray-500);
  font-size: 14px;
  margin-top: 4px;
}

.room-link-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 24px;
  background: var(--gray-50);
  border-top: 1px solid var(--gray-100);
  border-bottom: 1px solid var(--gray-100);
}

.room-link {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  font-size: 13px;
  color: var(--gray-500);
  overflow: hidden;
}

.room-link i {
  color: var(--primary-light);
}

.room-link a {
  color: var(--primary);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===================== UPLOAD AREA ===================== */
.room-upload-area {
  padding: 16px 24px;
}

.upload-dropzone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-sm);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--gray-50);
}

.upload-dropzone:hover {
  border-color: var(--primary-light);
  background: var(--primary-bg);
}

.upload-dropzone.dragover {
  border-color: var(--primary);
  background: var(--primary-bg);
  transform: scale(1.01);
}

.upload-dropzone i {
  font-size: 32px;
  color: var(--primary-light);
  margin-bottom: 8px;
  display: block;
}

.upload-dropzone p {
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-600);
}

/* ===================== FILES LIST ===================== */
.room-files {
  padding: 16px 24px 20px;
}

.files-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.files-header i {
  margin-right: 4px;
}

.files-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.file-item:hover {
  background: var(--gray-100);
}

.file-icon {
  font-size: 22px;
  color: var(--primary);
  width: 36px;
  text-align: center;
  flex-shrink: 0;
}

.file-info {
  flex: 1;
  min-width: 0;
}

.file-name {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  font-size: 12px;
  color: var(--gray-400);
}

.file-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* ===================== EMPTY STATE ===================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-400);
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
}

.empty-state p {
  font-size: 16px;
  font-weight: 500;
}

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

.text-center {
  text-align: center;
}

/* ===================== TOAST NOTIFICATIONS ===================== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: white;
  box-shadow: var(--shadow-lg);
  transform: translateX(120%);
  transition: transform 0.3s ease;
  min-width: 280px;
}

.toast.show {
  transform: translateX(0);
}

.toast-success {
  background: var(--success);
}

.toast-error {
  background: var(--danger);
}

.toast-info {
  background: var(--info);
}

/* ===================== MODAL ===================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: white;
  border-radius: var(--radius);
  width: 90%;
  max-width: 440px;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.3s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 600;
}

.modal-header h3 i {
  color: var(--warning);
  margin-right: 6px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--gray-400);
  padding: 0 4px;
}

.modal-close:hover {
  color: var(--gray-700);
}

.modal-body {
  padding: 0 24px 20px;
  color: var(--gray-600);
  font-size: 15px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--gray-200);
}

/* ===================== SALA (PUBLIC ROOM) PAGE ===================== */
.sala-page {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
}

.sala-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.sala-header {
  text-align: center;
  margin-bottom: 24px;
}

.sala-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.sala-logo i {
  font-size: 24px;
}

.sala-content {
  flex: 1;
}

.sala-info {
  background: white;
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  text-align: center;
}

.sala-info h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 8px;
}

.sala-info h1 i {
  color: var(--primary);
  margin-right: 8px;
}

.sala-desc {
  color: var(--gray-500);
  font-size: 16px;
  margin-bottom: 16px;
}

.sala-stats {
  display: flex;
  gap: 24px;
  justify-content: center;
  font-size: 14px;
  color: var(--gray-400);
}

.sala-stats i {
  margin-right: 4px;
}

/* ===================== SALA FILES GRID ===================== */
.sala-files-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sala-file-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.sala-file-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.sala-file-icon {
  font-size: 32px;
  width: 48px;
  text-align: center;
  flex-shrink: 0;
}

.sala-file-info {
  flex: 1;
  min-width: 0;
}

.sala-file-info h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.sala-file-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--gray-400);
}

.sala-file-meta i {
  margin-right: 4px;
}

.btn-download {
  flex-shrink: 0;
  text-decoration: none;
}

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

/* ===================== SALA EMPTY & ERROR ===================== */
.sala-empty, .sala-error {
  text-align: center;
  padding: 80px 20px;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.sala-empty i, .sala-error i {
  font-size: 56px;
  color: var(--gray-300);
  margin-bottom: 16px;
  display: block;
}

.sala-empty h3, .sala-error h2 {
  color: var(--gray-600);
  margin-bottom: 8px;
}

.sala-empty p, .sala-error p {
  color: var(--gray-400);
}

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

/* ===================== SALA FOOTER ===================== */
.sala-footer {
  text-align: center;
  padding: 24px;
  color: var(--gray-400);
  font-size: 14px;
}

.sala-footer strong {
  color: var(--primary);
}

/* ===================== LOADING ===================== */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--gray-400);
  font-size: 16px;
}

.loading i {
  margin-right: 8px;
}

/* ===================== ANIMATIONS ===================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 768px) {
  .header {
    padding: 12px 16px;
    flex-direction: column;
    gap: 12px;
  }

  .header-right {
    width: 100%;
    justify-content: flex-end;
  }

  .form-row {
    flex-direction: column;
  }

  .form-row .btn {
    width: 100%;
    justify-content: center;
  }

  .main-content {
    padding: 20px 12px;
  }

  .room-card-header,
  .room-link-bar,
  .room-upload-area,
  .room-files {
    padding-left: 16px;
    padding-right: 16px;
  }

  .sala-info {
    padding: 24px 16px;
  }

  .sala-info h1 {
    font-size: 22px;
  }

  .sala-stats {
    flex-direction: column;
    gap: 8px;
  }

  .sala-file-card {
    flex-direction: column;
    text-align: center;
    padding: 20px;
  }

  .sala-file-meta {
    justify-content: center;
  }

  .btn-download {
    width: 100%;
    justify-content: center;
  }

  .file-item {
    flex-wrap: wrap;
  }

  .file-actions {
    width: 100%;
    justify-content: flex-end;
    margin-top: 4px;
  }

  .toast-container {
    left: 12px;
    right: 12px;
  }

  .toast {
    min-width: auto;
  }
}

/* ===================== CURRENT APP SHELL ===================== */
:root {
  --ink: #172033;
  --muted: #718096;
  --surface: rgba(255, 255, 255, 0.88);
  --line: rgba(23, 32, 51, 0.1);
  --accent: #ff6b4a;
  --accent-dark: #e65335;
  --mint: #c8f3e5;
}

body {
  color: var(--ink);
  background: #f5f7fb;
  font-family: 'Inter', sans-serif;
}

body.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  overflow: hidden;
  background: #152238;
  background-image: radial-gradient(circle at 12% 18%, rgba(255, 107, 74, 0.32), transparent 28%), radial-gradient(circle at 90% 80%, rgba(89, 208, 174, 0.28), transparent 30%), linear-gradient(135deg, #152238 0%, #263d5b 100%);
}

body.auth-page::before,
body.auth-page::after {
  content: '';
  position: fixed;
  width: 280px;
  height: 280px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 42% 58% 65% 35%;
  animation: drift 12s ease-in-out infinite alternate;
}

body.auth-page::before { top: -90px; right: 10%; transform: rotate(24deg); }
body.auth-page::after { bottom: -110px; left: 8%; animation-delay: -4s; transform: rotate(-18deg); }

.auth-container { width: min(100%, 430px); position: relative; z-index: 1; }
.auth-card {
  padding: 42px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 30px 80px rgba(5, 16, 31, 0.34);
  animation: cardIn 0.7s cubic-bezier(.2,.8,.2,1) both;
}
.auth-header { text-align: center; margin-bottom: 30px; }
.auth-icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 22px;
  color: white;
  font-size: 30px;
  background: linear-gradient(145deg, var(--accent), #ff9a63);
  box-shadow: 0 12px 24px rgba(255, 107, 74, 0.28);
  transform: rotate(-5deg);
}
.auth-header h1 { color: var(--ink); font-size: 32px; letter-spacing: -1px; }
.auth-header p { color: var(--muted); margin-top: 5px; }
.auth-card .form-group { margin-bottom: 18px; }
.auth-card .form-group label { color: var(--ink); }
.auth-card .form-group label i { color: var(--accent); width: 18px; }
.auth-card .form-group input { height: 48px; border: 1px solid var(--line); background: #f8fafc; }
.auth-card .form-group input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 107, 74, 0.13); }
.auth-card .btn-primary { background: var(--accent); box-shadow: 0 8px 18px rgba(255, 107, 74, 0.24); }
.auth-card .btn-primary:hover { background: var(--accent-dark); }
.auth-footer { margin-top: 24px; padding-top: 20px; text-align: center; border-top: 1px solid var(--line); color: var(--muted); }
.auth-footer a { color: var(--accent-dark); font-weight: 700; }

.app-page { background: linear-gradient(135deg, #f5f7fb 0%, #edf5f3 100%); }
.header { padding: 16px clamp(18px, 4vw, 52px); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.82); backdrop-filter: blur(18px); }
.header-logo { color: var(--accent); }
.header-left h1 { color: var(--ink); letter-spacing: -0.5px; }
.header-left .badge { background: var(--mint); color: #1a8068; }
.btn { border-radius: 10px; }
.btn-primary { background: var(--accent); }
.btn-primary:hover { background: var(--accent-dark); }
.card, .room-card, .stat-card { border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 10px 30px rgba(23,32,51,.06); }
.room-card { animation: cardIn .55s both; }
.room-card:hover { transform: translateY(-5px); box-shadow: 0 18px 36px rgba(23,32,51,.12); }
.room-card-header > i { color: var(--accent); font-size: 22px; }
.badge-green { background: #d9f7e9; color: #168052; }
.badge-yellow { background: #fff1cc; color: #986a00; }
.badge-blue { background: #dcecff; color: #2564a5; }
.avatar { width: 30px; height: 30px; display: inline-grid; place-items: center; border-radius: 50%; color: white; font-weight: 700; font-size: 13px; }
.modal-content { border: 1px solid var(--line); border-radius: 20px; }
.modal-overlay { background: rgba(14, 25, 42, .58); }
.toast { border-radius: 12px; }

.app-layout { display: flex; min-height: calc(100vh - 73px); }
.sidebar { width: 244px; flex: 0 0 244px; padding: 24px 14px; border-right: 1px solid var(--line); background: rgba(255,255,255,.68); }
.nav-item { width: 100%; display: flex; align-items: center; gap: 11px; margin-bottom: 6px; padding: 12px 14px; border: 0; border-radius: 11px; color: var(--muted); background: transparent; font: inherit; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; transition: .2s ease; }
.nav-item i { width: 18px; text-align: center; }
.nav-item:hover { color: var(--ink); background: rgba(255,107,74,.1); transform: translateX(3px); }
.nav-item.active { color: white; background: var(--accent); box-shadow: 0 8px 18px rgba(255,107,74,.22); }
.nav-badge { margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: 10px; color: white; background: var(--danger); text-align: center; font-size: 11px; }
.main-content { flex: 1; max-width: none; padding: 38px clamp(20px, 4vw, 54px); }
.main-content > .tab-content > h2 { margin-bottom: 24px; color: var(--ink); font-size: 25px; letter-spacing: -.5px; }
.main-content > .tab-content > h2 i { color: var(--accent); margin-right: 8px; }
.tab-content { display: none; animation: cardIn .35s both; }
.tab-content.active { display: block; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 34px; }
.stat-card { display: flex; align-items: center; gap: 14px; padding: 20px; background: var(--surface); }
.stat-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; color: white; font-size: 18px; }
.stat-value { color: var(--ink); font-size: 25px; font-weight: 800; line-height: 1; }
.stat-label { margin-top: 5px; color: var(--muted); font-size: 13px; }
.card { background: var(--surface); padding: 22px; }
.card-row { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.card-row-info { flex: 1; min-width: 0; }
.card-row-info strong { color: var(--ink); }
.card-row-actions { display: flex; gap: 6px; }
.room-card-admin { margin-bottom: 14px; }
.room-card-top { display: flex; justify-content: space-between; gap: 16px; }
.room-card-top h3 { color: var(--ink); }
.room-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.room-actions-bar { display: flex; gap: 8px; margin-top: 14px; }
.checkbox-label { display: flex !important; align-items: center; gap: 8px; }
.checkbox-label input { width: auto !important; }
.alert { padding: 11px 14px; border-radius: 10px; font-size: 14px; }
.alert-error { color: #a52828; border: 1px solid #fecaca; background: #fff1f1; }
.alert-success { color: #176d47; border: 1px solid #b9efd1; background: #ecfff5; }
.alert-warning { color: #8b6200; border: 1px solid #f9df99; background: #fff9e8; }

@media (max-width: 800px) {
  .app-layout { display: block; }
  .sidebar { width: 100%; display: flex; gap: 6px; overflow-x: auto; padding: 10px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .nav-item { width: auto; flex: 0 0 auto; margin: 0; white-space: nowrap; }
  .main-content { padding: 26px 16px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .room-card-top { flex-direction: column; }
  .room-badges { justify-content: flex-start; }
}

@keyframes cardIn { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes drift { from { border-radius: 42% 58% 65% 35%; transform: translate3d(0, 0, 0) rotate(24deg); } to { border-radius: 63% 37% 35% 65%; transform: translate3d(24px, 18px, 0) rotate(52deg); } }

@media (max-width: 600px) {
  body.auth-page { padding: 16px; }
  .auth-card { padding: 30px 22px; border-radius: 20px; }
}


/* ===================== NOTIFICAÇÕES (sino + painel lateral) ===================== */
.notif-btn { position: relative; }
.notif-badge {
  position: absolute; top: -7px; right: -7px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.slide-panel { position: fixed; inset: 0; z-index: 1000; display: flex; justify-content: flex-end; }
.slide-panel-overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.4); }
.slide-panel-content {
  position: relative; width: 380px; max-width: 100%; height: 100%;
  background: #fff; box-shadow: var(--shadow-xl);
  display: flex; flex-direction: column;
}
.slide-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--gray-200);
}
.slide-panel-header h3 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.slide-panel-header button {
  background: none; border: none; font-size: 26px; line-height: 1;
  color: var(--gray-500); cursor: pointer;
}
.slide-panel-header button:hover { color: var(--gray-800); }
.slide-panel-body { flex: 1; overflow-y: auto; padding: 8px 0; }
.slide-panel-footer { padding: 12px 16px; border-top: 1px solid var(--gray-200); }
.notif-item { padding: 12px 20px; border-bottom: 1px solid var(--gray-100); }
.notif-unread { background: var(--primary-bg); border-left: 3px solid var(--primary); }
.notif-title { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.notif-msg { font-size: 13px; color: var(--gray-600); margin-bottom: 4px; }


/* ===================== BOTÃO DE TEMA (canto superior esquerdo) ===================== */
.theme-toggle { width: 38px; height: 38px; display: inline-grid; place-items: center; flex: none; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font-size: 15px; transition: .2s ease; }
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle-fixed { position: fixed; top: 14px; left: 14px; z-index: 60; }
.sala-left { display: flex; align-items: center; gap: 12px; }

/* ===================== QUEM ENVIOU + RENOMEAR ===================== */
.uploader-tag { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 2px 10px 2px 3px; border-radius: 99px; font-size: 12px; font-weight: 600; color: var(--accent-dark); background: rgba(255,107,74,.1); border: 1px solid rgba(255,107,74,.28); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uploader-dot { width: 18px; height: 18px; flex: none; display: inline-grid; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; font-size: 10px; }
.file-main { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; flex: 1; }
.file-main .file-row-name { max-width: 100%; }
.file-btns { display: flex; gap: 6px; flex: none; }
.sala-file-info .uploader-tag { margin-bottom: 4px; }
.sala-file-actions { display: flex; gap: 8px; align-items: center; }

.rename-modal { position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; padding: 16px; }
.rename-overlay { position: absolute; inset: 0; background: rgba(14,25,42,.6); }
.rename-box { position: relative; width: min(100%, 440px); padding: 22px; border-radius: 18px; background: #fff; border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(5,16,31,.4); animation: cardIn .25s both; }
.rename-box h3 { margin-bottom: 14px; color: var(--ink); font-size: 17px; }
.rename-box h3 i { color: var(--accent); margin-right: 6px; }
.rename-field { display: flex; align-items: center; gap: 8px; }
.rename-field input { flex: 1; min-width: 0; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 15px; background: #f8fafc; color: var(--ink); }
.rename-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255,107,74,.14); }
.rename-ext { color: var(--muted); font-weight: 600; }
.rename-error { margin-top: 10px; padding: 9px 12px; border-radius: 10px; font-size: 13px; color: #a52828; background: #fff1f1; border: 1px solid #fecaca; }
.rename-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ===================== TEMA ESCURO (roxo, menos brilho) ===================== */
html[data-theme="dark"] {
  color-scheme: dark;
  --primary: #8b5cf6; --primary-dark: #7c3aed; --primary-light: #a78bfa; --primary-bg: rgba(139,92,246,.16);
  --accent: #8b5cf6; --accent-dark: #a78bfa;
  --ink: #ece6ff; --muted: #a79bc7; --surface: rgba(28,20,50,.86); --line: rgba(167,139,250,.2); --mint: rgba(139,92,246,.22);
  --gray-50: #120d22; --gray-100: #1a1330; --gray-200: #2a2048; --gray-300: #3d3166; --gray-400: #7d70a8;
  --gray-500: #a094c6; --gray-600: #b9aedb; --gray-700: #d4ccec; --gray-800: #e6e0f7; --gray-900: #f5f2ff;
  --shadow: 0 1px 3px rgba(0,0,0,.5); --shadow-md: 0 4px 10px rgba(0,0,0,.45); --shadow-lg: 0 10px 20px rgba(0,0,0,.45); --shadow-xl: 0 20px 30px rgba(0,0,0,.5);
}
html[data-theme="dark"] body { background: #0d0818; color: var(--ink); }
html[data-theme="dark"] .app-page { background: linear-gradient(135deg, #0d0818 0%, #150f2b 100%); }
html[data-theme="dark"] .sala-page { background: linear-gradient(135deg, #0d0818 0%, #1a1233 100%); }
html[data-theme="dark"] .header { background: rgba(18,13,34,.85); border-bottom-color: var(--line); }
html[data-theme="dark"] .sidebar { background: rgba(18,13,34,.7); }
html[data-theme="dark"] .nav-item:hover { background: rgba(139,92,246,.16); }
html[data-theme="dark"] .nav-item.active { box-shadow: 0 8px 18px rgba(139,92,246,.28); }
html[data-theme="dark"] .card, html[data-theme="dark"] .room-card, html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .create-room-section, html[data-theme="dark"] .sala-info,
html[data-theme="dark"] .sala-file-card, html[data-theme="dark"] .sala-empty, html[data-theme="dark"] .sala-error { background: var(--surface); border-color: var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.35); }
html[data-theme="dark"] .modal-content, html[data-theme="dark"] .slide-panel-content, html[data-theme="dark"] .rename-box { background: #181030; border-color: var(--line); }
html[data-theme="dark"] .modal-overlay, html[data-theme="dark"] .slide-panel-overlay, html[data-theme="dark"] .rename-overlay { background: rgba(5,3,12,.72); }
html[data-theme="dark"] .btn-outline { background: rgba(255,255,255,.04); color: var(--gray-700); border-color: var(--gray-300); }
html[data-theme="dark"] .btn-outline:hover { background: rgba(139,92,246,.16); border-color: var(--primary-light); }
html[data-theme="dark"] .btn-primary { background: #7c3aed; }
html[data-theme="dark"] .btn-primary:hover { background: #6d28d9; }
html[data-theme="dark"] .form-group input, html[data-theme="dark"] .rename-field input,
html[data-theme="dark"] .form-row input { background: #120d22; color: var(--ink); border-color: var(--gray-300); }
html[data-theme="dark"] .form-group input:focus, html[data-theme="dark"] .rename-field input:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(139,92,246,.22); }
html[data-theme="dark"] .header-left .badge { background: rgba(139,92,246,.22); color: #c4b5fd; }
html[data-theme="dark"] .badge-green { background: rgba(34,197,94,.16); color: #86efac; }
html[data-theme="dark"] .badge-yellow { background: rgba(245,158,11,.16); color: #fcd34d; }
html[data-theme="dark"] .badge-blue { background: rgba(96,165,250,.16); color: #93c5fd; }
html[data-theme="dark"] .badge-red { background: rgba(239,68,68,.16); color: #fca5a5; }
html[data-theme="dark"] .alert-error, html[data-theme="dark"] .rename-error { color: #fca5a5; background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.35); }
html[data-theme="dark"] .alert-success { color: #86efac; background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.35); }
html[data-theme="dark"] .alert-warning { color: #fcd34d; background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.35); }
html[data-theme="dark"] .uploader-tag { color: #d8c8ff; background: rgba(139,92,246,.16); border-color: rgba(139,92,246,.4); }
html[data-theme="dark"] .uploader-dot { background: #7c3aed; }
html[data-theme="dark"] .sala-back { background: var(--surface) !important; color: var(--gray-700) !important; }
html[data-theme="dark"] .sala-logo, html[data-theme="dark"] .sala-footer { color: var(--gray-600); }
html[data-theme="dark"] .theme-toggle { color: #c4b5fd; }
html[data-theme="dark"] .notif-unread { background: rgba(139,92,246,.14); border-left-color: var(--primary-light); }
html[data-theme="dark"] a { color: var(--primary-light); }
html[data-theme="dark"] .toast { box-shadow: 0 8px 24px rgba(0,0,0,.5); }

/* ===================== LOGIN CIBERNÉTICO ===================== */
body.auth-page {
  --cy: #ff6b4a; --cy2: #ffb36b; --cy-rgb: 255,107,74;
  font-family: 'Rajdhani', 'Inter', sans-serif;
  background: #0a0610; background-image: radial-gradient(ellipse at 50% -10%, rgba(var(--cy-rgb),.22), transparent 55%);
}
html[data-theme="dark"] body.auth-page { --cy: #a855f7; --cy2: #6d7bff; --cy-rgb: 168,85,247; background-color: #06040d; }
body.auth-page::before, body.auth-page::after { content: none; }
#cyberRain { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: .55; }
.cy-grid { position: fixed; left: -60%; right: -60%; bottom: 0; height: 70vh; z-index: 0; pointer-events: none;
  background-image: linear-gradient(rgba(var(--cy-rgb),.4) 1px, transparent 1px), linear-gradient(90deg, rgba(var(--cy-rgb),.4) 1px, transparent 1px);
  background-size: 60px 60px; transform: perspective(380px) rotateX(64deg); transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(to top, #000 5%, transparent 85%); mask-image: linear-gradient(to top, #000 5%, transparent 85%);
  animation: cyGrid 2.4s linear infinite; }
.cy-scan { position: fixed; inset: 0; z-index: 2; pointer-events: none; overflow: hidden;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.03) 0 1px, transparent 1px 3px); }
.cy-scan::after { content: ''; position: absolute; left: 0; right: 0; height: 140px; top: -140px;
  background: linear-gradient(to bottom, transparent, rgba(var(--cy-rgb),.09), transparent); animation: cySweep 7s linear infinite; }

body.auth-page .auth-container { z-index: 3; filter: drop-shadow(0 0 26px rgba(var(--cy-rgb),.38)); }
body.auth-page .auth-card { position: relative; overflow: hidden; padding: 40px 38px 34px; border: 0; border-radius: 0; background: transparent; box-shadow: none; backdrop-filter: none;
  clip-path: polygon(0 18px, 18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%); }
body.auth-page .auth-card::before { content: ''; position: absolute; inset: -80%; z-index: 0; background: conic-gradient(from 0deg, transparent 0 62%, var(--cy) 82%, var(--cy2) 100%); animation: cySpin 6s linear infinite; }
body.auth-page .auth-card::after { content: ''; position: absolute; inset: 1.5px; z-index: 0; background: linear-gradient(160deg, #130b1d 0%, #0a0612 100%);
  clip-path: polygon(0 17px, 17px 0, 100% 0, 100% calc(100% - 17px), calc(100% - 17px) 100%, 0 100%); }
body.auth-page .auth-card > * { position: relative; z-index: 1; }

body.auth-page .auth-icon { width: 66px; height: 66px; border-radius: 0; transform: none; color: #0a0612; font-size: 26px;
  background: linear-gradient(145deg, var(--cy), var(--cy2)); box-shadow: none;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); animation: cyPulse 2.8s ease-in-out infinite; }
.glitch { position: relative; display: inline-block; font-family: 'Orbitron', sans-serif; font-weight: 800; font-size: 29px; letter-spacing: .16em; color: #fff; text-shadow: 0 0 16px rgba(var(--cy-rgb),.8); }
.glitch::before, .glitch::after { content: attr(data-text); position: absolute; inset: 0; }
.glitch::before { color: var(--cy); clip-path: inset(0 0 55% 0); animation: cyGlitch 4.5s steps(1) infinite; }
.glitch::after { color: var(--cy2); clip-path: inset(55% 0 0 0); animation: cyGlitch 4.5s steps(1) infinite reverse; }
body.auth-page .auth-header h1 { letter-spacing: normal; }
.cy-status { min-height: 22px; margin-top: 10px; font-family: 'Share Tech Mono', monospace; font-size: 13px; color: var(--cy); }
.cy-caret { display: inline-block; width: 8px; height: 14px; margin-left: 3px; vertical-align: -2px; background: var(--cy); animation: cyBlink 1s steps(1) infinite; }
body.auth-page .auth-header p { color: var(--cy); }

body.auth-page .auth-card .form-group label { color: #d9cfe9; font-weight: 600; letter-spacing: .04em; font-size: 14px; }
body.auth-page .auth-card .form-group label i { color: var(--cy); }
body.auth-page .auth-card .form-group input { height: 48px; border-radius: 2px; color: #f3ecff; background: rgba(255,255,255,.04); border: 1px solid rgba(var(--cy-rgb),.32); font-family: inherit; font-size: 16px; transition: .2s ease; }
body.auth-page .auth-card .form-group input::placeholder { color: rgba(217,207,233,.4); }
body.auth-page .auth-card .form-group input:focus { border-color: var(--cy); background: rgba(var(--cy-rgb),.07); box-shadow: 0 0 0 1px var(--cy), 0 0 20px rgba(var(--cy-rgb),.35); }
body.auth-page .auth-card input:-webkit-autofill { -webkit-box-shadow: 0 0 0 100px #160d22 inset; -webkit-text-fill-color: #f3ecff; caret-color: #fff; }
body.auth-page .auth-card .btn-primary, body.auth-page .auth-card .btn-success { position: relative; overflow: hidden; border-radius: 0; color: #0a0612; font-family: 'Orbitron', sans-serif; font-weight: 700; font-size: 13px; letter-spacing: .14em; background: linear-gradient(90deg, var(--cy), var(--cy2)); box-shadow: none;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px)); }
body.auth-page .auth-card .btn-primary::after, body.auth-page .auth-card .btn-success::after { content: ''; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent); transform: skewX(-20deg); }
body.auth-page .auth-card .btn-primary:hover::after, body.auth-page .auth-card .btn-success:hover::after { animation: cyShine .8s ease; }
body.auth-page .auth-card .btn-primary:hover, body.auth-page .auth-card .btn-success:hover { filter: brightness(1.12); transform: translateY(-1px); }
body.auth-page .auth-footer { border-top-color: rgba(var(--cy-rgb),.25); color: #b9aed0; }
body.auth-page .auth-footer a { color: var(--cy); text-decoration: none; }
body.auth-page .auth-footer a:hover { text-shadow: 0 0 10px var(--cy); }
body.auth-page .alert-error { color: #ff9b9b; background: rgba(255,60,60,.1); border: 1px solid rgba(255,80,80,.5); border-radius: 2px; margin-bottom: 14px; animation: cyShake .4s; }
body.auth-page .alert-success { color: #8dffc0; background: rgba(40,220,120,.1); border: 1px solid rgba(60,230,140,.5); border-radius: 2px; margin-bottom: 14px; }
body.auth-page .alert-warning { color: #ffd27a; background: rgba(255,180,40,.1); border: 1px solid rgba(255,190,60,.5); border-radius: 2px; }
body.auth-page .pending-icon { color: var(--cy); filter: drop-shadow(0 0 12px rgba(var(--cy-rgb),.7)); }
body.auth-page .auth-card .btn-outline { color: var(--cy); background: transparent; border: 1px solid var(--cy); border-radius: 0; }
body.auth-page .auth-card .btn-outline:hover { background: rgba(var(--cy-rgb),.14); }
body.auth-page .auth-card .btn-danger { border-radius: 0; background: transparent; color: #ff8a8a; border: 1px solid #ff6b6b; }
body.auth-page .theme-toggle { background: rgba(10,6,16,.75); border-color: rgba(var(--cy-rgb),.55); color: var(--cy); border-radius: 2px; }
.cy-lead { color: #c9bfe0; margin-bottom: 24px; line-height: 1.7; }

@keyframes cyGrid { to { background-position: 0 60px; } }
@keyframes cySweep { to { transform: translateY(calc(100vh + 280px)); } }
@keyframes cySpin { to { transform: rotate(360deg); } }
@keyframes cyPulse { 0%, 100% { filter: drop-shadow(0 0 4px rgba(var(--cy-rgb),.5)); } 50% { filter: drop-shadow(0 0 16px rgba(var(--cy-rgb),.95)); } }
@keyframes cyGlitch { 0%, 91%, 100% { transform: translate(0); } 92% { transform: translate(-4px, 1px); } 94% { transform: translate(4px, -1px); } 96% { transform: translate(-2px, 0); } }
@keyframes cyBlink { 50% { opacity: 0; } }
@keyframes cyShine { to { left: 130%; } }
@keyframes cyShake { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }

@media (prefers-reduced-motion: reduce) {
  .cy-grid, .cy-scan::after, body.auth-page .auth-card::before, body.auth-page .auth-icon, .glitch::before, .glitch::after, .cy-caret, body.auth-page .alert-error { animation: none !important; }
  #cyberRain { display: none; }
}
@media (max-width: 600px) { body.auth-page .auth-card { padding: 32px 22px 28px; } .glitch { font-size: 24px; } }

body.auth-page .pending-icon { font-size: 44px; }
.file-row .uploader-tag { align-self: flex-start; }


/* =====================================================================
   INTERIOR CIBERNÉTICO — vale para painel, admin e salas
   (claro = laranja, escuro = roxo; as cores vêm de --cy / --cy-rgb)
   ===================================================================== */
:root {
  --cy: #ff6b4a; --cy2: #ffb36b; --cy-rgb: 255,107,74;
  --bg1: #f6f7fb; --bg2: #eceff5; --bubble: #ffffff; --field: #ffffff;
  --mono: 'Share Tech Mono', ui-monospace, monospace; --disp: 'Orbitron', 'Inter', sans-serif; --ui: 'Rajdhani', 'Inter', sans-serif;
  --hex: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
html[data-theme="dark"] { --cy: #a855f7; --cy2: #7c8bff; --cy-rgb: 168,85,247; --bg1: #0d0818; --bg2: #150f2b; --bubble: rgba(255,255,255,.06); --field: #120d22; }

/* fundo: grade técnica + linhas de varredura bem leves */
:root body.app-page, :root body.sala-page {
  background-color: var(--bg1);
  background-image: linear-gradient(rgba(var(--cy-rgb),.07) 1px, transparent 1px), linear-gradient(90deg, rgba(var(--cy-rgb),.07) 1px, transparent 1px), linear-gradient(135deg, var(--bg1), var(--bg2));
  background-size: 46px 46px, 46px 46px, auto; background-attachment: fixed;
}
body.app-page::after, body.sala-page::after { content: ''; position: fixed; inset: 0; z-index: 900; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0,0,0,.025) 0 1px, transparent 1px 3px); }

/* cabeçalho: linha de neon correndo na base */
.header { position: sticky; }
.header::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; pointer-events: none; background: linear-gradient(90deg, transparent, var(--cy), var(--cy2), transparent); background-size: 200% 100%; animation: cyLine 6s linear infinite; box-shadow: 0 0 12px rgba(var(--cy-rgb),.6); }
.header-left h1, .sala-logo { font-family: var(--disp); font-weight: 800; font-size: 17px; letter-spacing: .14em; text-transform: uppercase; }
.header-left .badge, .badge { font-family: var(--mono); font-weight: 400; border-radius: 2px; letter-spacing: .06em; border: 1px solid rgba(var(--cy-rgb),.35); }
.header-logo, .sala-logo i { filter: drop-shadow(0 0 6px rgba(var(--cy-rgb),.8)); }

/* títulos */
.main-content > .tab-content > h2, .dashboard-intro h2, .sala-info h1, .modal-header h3 { font-family: var(--disp); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.main-content > .tab-content > h2, .dashboard-intro h2 { font-size: 19px; }
.sala-info h1 { font-size: 22px; }
.modal-header h3 { font-size: 15px; }
.modal-header h3 i { color: var(--cy); }
.stat-value { font-family: var(--disp); font-weight: 800; }
.stat-label, .text-muted { font-family: var(--mono); letter-spacing: .02em; }
.stat-icon { border-radius: 0; clip-path: var(--hex); width: 50px; height: 50px; }

/* cartões com cantos de HUD (sem recortar sombra nem foco) */
.card, .room-card, .stat-card, .sala-info, .sala-file-card, .create-room-section, .modal-content, .rename-box { position: relative; border-radius: 4px; border: 1px solid rgba(var(--cy-rgb),.24); }
.card::before, .room-card::before, .stat-card::before, .sala-info::before, .sala-file-card::before, .create-room-section::before, .modal-content::before, .rename-box::before,
.card::after, .room-card::after, .stat-card::after, .sala-info::after, .sala-file-card::after, .create-room-section::after, .modal-content::after, .rename-box::after { content: ''; position: absolute; width: 14px; height: 14px; pointer-events: none; z-index: 2; transition: .25s ease; }
.card::before, .room-card::before, .stat-card::before, .sala-info::before, .sala-file-card::before, .create-room-section::before, .modal-content::before, .rename-box::before { top: 0; left: 0; border-top: 2px solid var(--cy); border-left: 2px solid var(--cy); }
.card::after, .room-card::after, .stat-card::after, .sala-info::after, .sala-file-card::after, .create-room-section::after, .modal-content::after, .rename-box::after { right: 0; bottom: 0; border-right: 2px solid var(--cy); border-bottom: 2px solid var(--cy); }
.card:hover::before, .room-card:hover::before, .stat-card:hover::before, .sala-file-card:hover::before { width: 24px; height: 24px; }
.card:hover::after, .room-card:hover::after, .stat-card:hover::after, .sala-file-card:hover::after { width: 24px; height: 24px; }
.room-card:hover, .stat-card:hover, .sala-file-card:hover { border-color: rgba(var(--cy-rgb),.55); box-shadow: 0 0 0 1px rgba(var(--cy-rgb),.25), 0 0 26px rgba(var(--cy-rgb),.16); }
.modal-content { box-shadow: 0 0 0 1px rgba(var(--cy-rgb),.2), 0 0 50px rgba(var(--cy-rgb),.22), 0 24px 60px rgba(0,0,0,.35); }
.room-card-header > i, .sala-file-icon { filter: drop-shadow(0 0 6px rgba(var(--cy-rgb),.45)); }

/* botões: cantos cortados, rótulos em Rajdhani */
.btn { border-radius: 2px; font-family: var(--ui); font-weight: 700; font-size: 15px; letter-spacing: .06em; }
.btn-primary, html[data-theme="dark"] .btn-primary, .btn-danger, .btn-success {
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 9px 100%, 0 calc(100% - 9px));
}
.btn-primary, html[data-theme="dark"] .btn-primary { color: #0a0612; background: linear-gradient(90deg, var(--cy), var(--cy2)); }
.btn-primary:hover, html[data-theme="dark"] .btn-primary:hover { filter: brightness(1.12); background: linear-gradient(90deg, var(--cy), var(--cy2)); box-shadow: none; }
.btn-sm.btn-primary, .btn-sm.btn-danger, .btn-sm.btn-success { clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px)); }
.btn-outline, html[data-theme="dark"] .btn-outline { background: transparent; color: var(--ink); border: 1px solid rgba(var(--cy-rgb),.5); }
.btn-outline:hover, html[data-theme="dark"] .btn-outline:hover { background: rgba(var(--cy-rgb),.14); border-color: var(--cy); box-shadow: 0 0 14px rgba(var(--cy-rgb),.25); }
.btn:focus-visible, .nav-item:focus-visible, .dropzone:focus-within { outline: 2px solid var(--cy); outline-offset: 2px; }

/* campos */
.form-group input, .rename-field input, .chat-compose input { border-radius: 2px; border: 1px solid rgba(var(--cy-rgb),.35); background: var(--field); color: var(--ink); }
.form-group input:focus, .rename-field input:focus, .chat-compose input:focus, html[data-theme="dark"] .form-group input:focus { outline: none; border-color: var(--cy); box-shadow: 0 0 0 1px var(--cy), 0 0 16px rgba(var(--cy-rgb),.3); }
.form-group label { font-family: var(--ui); font-weight: 700; letter-spacing: .05em; font-size: 15px; }

/* menu lateral */
.nav-item { border-radius: 2px; border-left: 3px solid transparent; font-family: var(--ui); font-weight: 700; font-size: 15px; letter-spacing: .06em; }
.nav-item:hover { background: rgba(var(--cy-rgb),.1); }
.nav-item.active, html[data-theme="dark"] .nav-item.active { color: var(--ink); background: linear-gradient(90deg, rgba(var(--cy-rgb),.3), transparent); border-left-color: var(--cy); box-shadow: none; text-shadow: 0 0 10px rgba(var(--cy-rgb),.55); }
.avatar { border-radius: 0; clip-path: var(--hex); font-family: var(--disp); }

/* avisos e painéis */
.toast { border-radius: 2px; font-family: var(--mono); font-size: 13px; color: #f3ecff; background: #120b1f; border: 1px solid rgba(var(--cy-rgb),.45); border-left-width: 4px; box-shadow: 0 0 20px rgba(var(--cy-rgb),.25); }
.toast-success { background: #120b1f; border-left-color: #3ddc97; }
.toast-error { background: #1d0b16; border-left-color: #ff5a6e; }
.toast-info { background: #120b1f; border-left-color: var(--cy); }
.slide-panel-content { border-left: 1px solid rgba(var(--cy-rgb),.5); box-shadow: -10px 0 40px rgba(var(--cy-rgb),.2); }
.slide-panel-header h3 { font-family: var(--disp); font-size: 14px; letter-spacing: .1em; text-transform: uppercase; }
.loading i { color: var(--cy); }
* { scrollbar-width: thin; scrollbar-color: rgba(var(--cy-rgb),.55) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; } ::-webkit-scrollbar-thumb { background: rgba(var(--cy-rgb),.5); } ::-webkit-scrollbar-track { background: transparent; }

/* títulos de seção dentro da sala */
.section-title { display: flex; align-items: center; gap: 8px; margin: 22px 0 10px; font-family: var(--disp); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); }
.section-title i { color: var(--cy); }
.section-title::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(var(--cy-rgb),.6), transparent); }
.section-count { font-family: var(--mono); font-weight: 400; color: var(--muted); letter-spacing: 0; }

/* lista de arquivos (painel e admin) */
.file-list, .room-files-list { display: grid; gap: 8px; margin-top: 12px; }
.file-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; background: rgba(var(--cy-rgb),.05); border: 1px solid rgba(var(--cy-rgb),.16); border-left: 3px solid var(--cy); transition: .2s ease; }
.file-row:hover { background: rgba(var(--cy-rgb),.1); transform: translateX(2px); }
.file-row-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-weight: 600; }
.room-files-list .file-row-name { flex: 0 1 auto; }
.file-row .text-muted { font-size: 12px; white-space: nowrap; }
.room-actions-bar { flex-wrap: wrap; align-items: center; }
.upload-hint { font-family: var(--mono); font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.upload-hint i { color: #f5a524; } .upload-hint b { color: var(--ink); font-weight: 400; }

/* ---------- ARRASTAR E SOLTAR + AVISO DE LIMITE ---------- */
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 16px; text-align: center; cursor: pointer; overflow: hidden; border: 1.5px dashed rgba(var(--cy-rgb),.6); background: rgba(var(--cy-rgb),.05); transition: .2s ease; }
.dropzone:hover { background: rgba(var(--cy-rgb),.11); border-color: var(--cy); box-shadow: inset 0 0 30px rgba(var(--cy-rgb),.12); }
.dz-icon { font-size: 30px; color: var(--cy); filter: drop-shadow(0 0 8px rgba(var(--cy-rgb),.6)); animation: cyFloat 2.4s ease-in-out infinite; }
.dz-title { font-family: var(--ui); font-weight: 700; font-size: 17px; letter-spacing: .03em; color: var(--ink); }
.dz-title u { color: var(--accent-dark); text-underline-offset: 3px; }
.touch-only { display: none; }
.dz-limit { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px; font-family: var(--mono); font-size: 12.5px; color: var(--muted); border: 1px solid rgba(245,165,36,.55); background: rgba(245,165,36,.1); }
.dz-limit i { color: #f5a524; } .dz-limit b { color: var(--ink); font-weight: 400; }
.dz-progress { display: block; width: 100%; height: 6px; background: rgba(var(--cy-rgb),.16); }
.dz-bar { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cy), var(--cy2)); box-shadow: 0 0 10px var(--cy); transition: width .2s ease; }
.dz-status { max-width: 100%; min-height: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.drop-target { position: relative; }
.drop-veil { display: none; position: absolute; inset: 0; z-index: 20; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 12px; pointer-events: none; text-align: center; color: #fff; font-family: var(--disp); font-size: 14px; letter-spacing: .1em; text-transform: uppercase; background: rgba(10,6,16,.84); border: 2px dashed var(--cy); box-shadow: inset 0 0 40px rgba(var(--cy-rgb),.35); text-shadow: 0 0 12px var(--cy); }
.drop-veil i { font-size: 38px; color: var(--cy); animation: cyFloat 1s ease-in-out infinite; }
.drop-target.drag-over > .drop-veil { display: flex; }
@media (hover: none) { .drop-hint-desktop { display: none; } .touch-only { display: inline; } }

/* ---------- CHAT ---------- */
.chat-box { display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(var(--cy-rgb),.3); background: rgba(var(--cy-rgb),.04); }
.chat-list { display: flex; flex-direction: column; gap: 10px; height: min(340px, 42vh); min-height: 200px; overflow-y: auto; padding: 14px; }
.chat-empty { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.chat-empty i { font-size: 26px; color: var(--cy); opacity: .8; }
.msg { display: flex; align-items: flex-start; gap: 8px; max-width: 84%; align-self: flex-start; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg.cont { margin-top: -6px; }
.msg.cont .msg-avatar { visibility: hidden; }
.msg-avatar { width: 30px; height: 30px; flex: none; display: grid; place-items: center; color: #fff; font: 700 12px var(--disp); clip-path: var(--hex); }
.msg-bubble { min-width: 0; padding: 8px 12px; text-align: left; background: var(--bubble); border: 1px solid var(--line); border-left: 3px solid rgba(var(--cy-rgb),.7); border-radius: 2px 12px 12px 12px; }
.msg.me .msg-bubble { background: linear-gradient(135deg, rgba(var(--cy-rgb),.2), rgba(var(--cy-rgb),.08)); border: 1px solid rgba(var(--cy-rgb),.45); border-right: 3px solid var(--cy); border-radius: 12px 2px 12px 12px; }
.msg-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.msg-meta b { font-weight: 400; color: var(--accent-dark); }
.msg-text { color: var(--ink); font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.chat-compose { display: flex; align-items: stretch; gap: 8px; padding: 10px; border-top: 1px solid rgba(var(--cy-rgb),.3); background: rgba(var(--cy-rgb),.05); }
.chat-compose input { flex: 1; min-width: 0; width: auto; height: 44px; padding: 0 14px; font: inherit; font-size: 15px; }
.chat-compose input::placeholder { color: var(--muted); }
.chat-send { width: 48px; padding: 0; justify-content: center; flex: none; }
@media (max-width: 640px) { .msg { max-width: 92%; } .chat-list { height: 260px; } .dz-title { font-size: 16px; } }

@keyframes cyLine { to { background-position: -200% 0; } }
@keyframes cyFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .header::after, .dz-icon, .drop-veil i { animation: none !important; } }


/* ===== Novidades: confirmação de envio, ADM, verde, tipo/tempo ===== */
.btn-green { background: linear-gradient(135deg,#16a34a,#22c55e); color: #fff !important; border: 1px solid #15803d; box-shadow: 0 4px 14px rgba(34,197,94,.35); }
.btn-green:hover { background: linear-gradient(135deg,#15803d,#16a34a); text-decoration: none; transform: translateY(-1px); }
.btn-download.btn-green { background: linear-gradient(135deg,#16a34a,#22c55e); }
.adm-badge { display: inline-block; padding: 1px 6px; margin-left: 4px; border-radius: 4px; font: 800 9.5px/1.4 var(--mono, monospace); letter-spacing: .08em; color: #231a00; background: #fbbf24; box-shadow: 0 0 8px rgba(251,191,36,.7); vertical-align: middle; }
.uploader-tag.is-admin { color: #92400e; background: rgba(251,191,36,.18); border-color: rgba(245,158,11,.7); }
.uploader-tag.is-admin .uploader-dot { background: #f59e0b; color: #231a00; }
.msg-meta.is-admin b { color: #d97706; font-weight: 700; text-shadow: 0 0 8px rgba(251,191,36,.55); }
.msg-avatar.is-admin { box-shadow: 0 0 0 2px #fbbf24; }
html[data-theme="dark"] .uploader-tag.is-admin { color: #fde68a; background: rgba(251,191,36,.16); border-color: rgba(251,191,36,.7); }
html[data-theme="dark"] .msg-meta.is-admin b { color: #fbbf24; }
.chat-link { color: #2563eb; text-decoration: underline; word-break: break-all; }
html[data-theme="dark"] .chat-link { color: #7dd3fc; }
.file-meta-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; margin-top: 3px; }
.kind-badge { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: rgba(139,92,246,.12); color: #6d28d9; border: 1px solid rgba(139,92,246,.3); }
html[data-theme="dark"] .kind-badge { color: #ddd0ff; }
.time-ago { color: var(--muted, #6b7280); white-space: nowrap; }
.intro-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.duration-pick { display: flex; gap: 8px; }
.duration-pick button { flex: 1; padding: 10px; border-radius: 10px; border: 1px solid var(--border, #d1d5db); background: transparent; color: inherit; font-weight: 700; cursor: pointer; }
.duration-pick button.active { background: #22c55e; border-color: #16a34a; color: #fff; }
.confirm-box { max-width: 560px; width: calc(100% - 24px); }
.confirm-list { display: flex; flex-direction: column; gap: 10px; max-height: 52vh; overflow: auto; margin: 10px 0 14px; }
.confirm-item { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; border: 1px solid var(--border, rgba(128,128,128,.3)); }
.confirm-thumb { width: 84px; height: 84px; flex: none; object-fit: cover; border-radius: 10px; background: rgba(128,128,128,.15); }
.confirm-icon { display: grid; place-items: center; align-content: center; gap: 4px; font-size: 26px; color: #8b5cf6; }
.confirm-icon span { font-size: 11px; font-weight: 700; }
.confirm-info { flex: 1; min-width: 0; }
.confirm-info small { display: block; margin-top: 4px; opacity: .7; }
.confirm-modal { z-index: 10000; }


/* ===== Rolagem corrigida nos modais ===== */
.modal { padding: 12px; overflow: hidden; }
.modal-content { display: flex; flex-direction: column; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow: hidden; }
.modal-content > .modal-header, .modal-content > .modal-footer { flex: 0 0 auto; }
.modal-content > .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; max-height: none; }
.modal-header { position: sticky; top: 0; z-index: 3; gap: 10px; }
.modal-header h3 { min-width: 0; overflow-wrap: anywhere; margin-right: auto; }
.room-head-btns { display: flex; align-items: center; gap: 8px; flex: none; }
.chat-list { max-height: 320px; overflow-y: auto; overscroll-behavior: contain; }
.file-list { max-height: none; }
html, body { overflow-x: hidden; }
body.app-page, body.sala-page { overflow-y: auto; }
@media (max-width: 600px) { .modal-content { max-height: 94dvh; } .modal-body { max-height: none !important; } }

/* ===== Cursor bolha cyber ===== */
html.has-bubble, html.has-bubble * { cursor: none !important; }
.cy-bubble, .cy-dot { position: fixed; left: 0; top: 0; z-index: 2147483647; pointer-events: none; opacity: 0; transition: opacity .2s ease; will-change: transform; }
html.bubble-on .cy-bubble, html.bubble-on .cy-dot { opacity: 1; }
.cy-bubble { --bc: 255,107,74; --bc2: 255,179,107; }
html[data-theme="dark"] .cy-bubble { --bc: 168,85,247; --bc2: 109,123,255; }
.cy-b-ring { position: absolute; left: -17px; top: -17px; width: 34px; height: 34px; border-radius: 50%;
  border: 1.5px solid rgba(var(--bc), .9);
  background: radial-gradient(circle at 32% 28%, rgba(255,255,255,.55), rgba(var(--bc2), .16) 38%, rgba(var(--bc), .06) 70%);
  box-shadow: 0 0 14px rgba(var(--bc), .55), inset 0 0 12px rgba(var(--bc2), .35);
  animation: cyWobble 3.2s ease-in-out infinite, cyPulse 2s ease-in-out infinite;
  transition: width .22s ease, height .22s ease, left .22s ease, top .22s ease, background .2s ease, border-radius .2s ease; }
.cy-b-shine { position: absolute; left: -8px; top: -9px; width: 8px; height: 5px; border-radius: 50%; background: rgba(255,255,255,.8); filter: blur(.6px); transform: rotate(-30deg); transition: opacity .2s ease; }
.cy-bubble.is-link .cy-b-ring { width: 52px; height: 52px; left: -26px; top: -26px; background: radial-gradient(circle at 32% 28%, rgba(255,255,255,.4), rgba(var(--bc2), .3) 45%, rgba(var(--bc), .14) 75%); box-shadow: 0 0 22px rgba(var(--bc), .8), inset 0 0 16px rgba(var(--bc2), .5); }
.cy-bubble.is-link .cy-b-shine { left: -14px; top: -16px; }
.cy-bubble.is-text .cy-b-ring { width: 4px; height: 26px; left: -2px; top: -13px; border-radius: 3px; animation: none; background: rgba(var(--bc), .9); }
.cy-bubble.is-text .cy-b-shine { opacity: 0; }
.cy-bubble.is-down .cy-b-ring { width: 22px; height: 22px; left: -11px; top: -11px; }
.cy-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px 2px rgba(255,107,74,.9); }
html[data-theme="dark"] .cy-dot { box-shadow: 0 0 8px 2px rgba(168,85,247,.95); }
.cy-trail { position: fixed; z-index: 2147483646; pointer-events: none; border-radius: 50%; transform: translate(-50%,-50%); border: 1px solid rgba(255,107,74,.8); background: rgba(255,179,107,.18); box-shadow: 0 0 8px rgba(255,107,74,.6); animation: cyRise .8s ease-out forwards; }
html[data-theme="dark"] .cy-trail { border-color: rgba(168,85,247,.85); background: rgba(109,123,255,.18); box-shadow: 0 0 8px rgba(168,85,247,.7); }
.cy-ripple { position: fixed; z-index: 2147483646; pointer-events: none; width: 10px; height: 10px; border-radius: 50%; transform: translate(-50%,-50%); border: 2px solid rgba(255,107,74,.9); animation: cyRipple .65s ease-out forwards; }
html[data-theme="dark"] .cy-ripple { border-color: rgba(168,85,247,.95); }
@keyframes cyWobble { 0%,100% { border-radius: 50% 50% 50% 50%; } 25% { border-radius: 56% 44% 52% 48%; } 50% { border-radius: 46% 54% 44% 56%; } 75% { border-radius: 52% 48% 56% 44%; } }
@keyframes cyPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes cyRise { to { transform: translate(-50%, -34px) scale(.3); opacity: 0; } }
@keyframes cyRipple { to { width: 70px; height: 70px; opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cy-b-ring { animation: none; } }


/* ===================== MOBILE ===================== */
:root { --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px); }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
img, video, canvas, svg { max-width: 100%; }
@media (max-width: 800px) {
  .header { padding: calc(10px + var(--safe-t)) 14px 10px; flex-direction: row; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
  .header-left { gap: 8px; min-width: 0; flex-wrap: wrap; }
  .header-left h1 { font-size: 17px; }
  .header-right { width: auto; flex: 1 1 auto; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
  .profile-pill { max-width: 46vw; overflow: hidden; }
  .profile-pill #userName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .btn { min-height: 42px; }
  .btn-sm { min-height: 38px; padding: 8px 12px; }
  .sidebar { position: sticky; top: 0; z-index: 20; scrollbar-width: none; }
  .sidebar::-webkit-scrollbar { display: none; }
  .nav-item { min-height: 42px; padding: 10px 14px; }
  .main-content { padding: 18px 14px calc(24px + var(--safe-b)); }
  .main-content > .tab-content > h2, .dashboard-intro h2 { font-size: 16px; }
  .dashboard-content { padding: 16px 14px calc(24px + var(--safe-b)); }
  .dashboard-intro { flex-direction: column; align-items: stretch; gap: 12px; }
  .intro-actions { width: 100%; }
  .intro-actions .btn { flex: 1; justify-content: center; }
  .rooms-grid { grid-template-columns: 1fr !important; gap: 12px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-card { padding: 14px; }
  .card-row { flex-wrap: wrap; align-items: flex-start; }
  .card-row-info { flex: 1 1 60%; }
  .card-row-actions { flex-wrap: wrap; width: 100%; }
  .card-row-actions .btn { flex: 1; justify-content: center; }
  .form-row { grid-template-columns: 1fr !important; flex-direction: column; }
  .file-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .file-main { min-width: 0; }
  .file-row-name { overflow-wrap: anywhere; white-space: normal; }
  .file-btns { display: flex; gap: 8px; width: 100%; }
  .file-btns .btn { flex: 1; justify-content: center; min-height: 44px; }
  .file-btns .btn-green { flex: 2; }
  table { display: block; overflow-x: auto; white-space: nowrap; max-width: 100%; }
}
@media (max-width: 600px) {
  input, select, textarea { font-size: 16px !important; } /* evita o zoom automático do iPhone */
  .modal { padding: 0; align-items: flex-end !important; }
  .modal-content { width: 100% !important; max-width: 100% !important; max-height: 94dvh; border-radius: 18px 18px 0 0 !important; padding-bottom: var(--safe-b); animation: sheetUp .28s ease; }
  .modal-header { padding: 14px 16px 10px; }
  .modal-body { padding: 0 16px 16px; }
  .modal-footer { padding: 12px 16px; }
  .modal-footer .btn { flex: 1; justify-content: center; }
  .room-head-btns { flex-wrap: wrap; justify-content: flex-end; }
  .room-head-btns .btn { min-height: 36px; padding: 6px 10px; font-size: 12px; }
  .drop-zone, .dz { padding: 18px 12px; }
  .chat-list { height: 46dvh !important; max-height: 46dvh; }
  .chat-form, .chat-input-row { gap: 6px; }
  .msg { max-width: 94%; }
  .rename-box, .confirm-box { width: 100% !important; max-width: 100% !important; border-radius: 18px 18px 0 0; align-self: end; max-height: 92dvh; overflow: auto; }
  .rename-modal { align-items: end !important; padding: 0 !important; }
  .confirm-thumb { width: 64px; height: 64px; }
  .confirm-item { flex-wrap: wrap; }
  .toast-container { left: 12px; right: 12px; top: calc(12px + var(--safe-t)); }
  .toast { width: 100%; }
  .slide-panel, .slide-panel-body { max-width: 100vw; }
  .slide-panel { width: 100vw !important; }
  .sala-container { padding-left: 12px; padding-right: 12px; }
  .sala-file-card { flex-direction: column; }
  .sala-file-card .btn { width: 100%; justify-content: center; min-height: 46px; }
}
@media (max-width: 380px) { .stats-grid { grid-template-columns: 1fr; } .header-left .badge { display: none; } }
@media (max-height: 520px) and (orientation: landscape) { .modal-content { max-height: 98dvh; } .chat-list { height: 40dvh !important; } }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }


/* ===== Correções finais: logo inteira + notificações responsivas ===== */
.header-left { min-width: 0; }
.header-logo {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 24px;
}
.sala-logo i {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.fs-toast-box {
  position: fixed;
  top: calc(12px + var(--safe-t, env(safe-area-inset-top, 0px)));
  right: max(12px, env(safe-area-inset-right, 0px));
  z-index: 2147483000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, calc(100vw - 24px));
  pointer-events: none;
}
.fs-toast {
  width: 100%;
  box-sizing: border-box;
  overflow-wrap: anywhere;
  word-break: break-word;
}
@media (max-width: 600px) {
  .header-logo { flex-basis: 28px; width: 28px; height: 28px; font-size: 22px; }
  .fs-toast-box {
    left: max(10px, env(safe-area-inset-left, 0px));
    right: max(10px, env(safe-area-inset-right, 0px));
    width: auto;
  }
}


/* Corrige o badge vermelho do sino: ele fica parcialmente fora do botão e não pode ser recortado pelo efeito ripple. */
.notif-btn { overflow: visible !important; isolation: isolate; }
.notif-btn .notif-badge {
  z-index: 5;
  top: -6px;
  right: -6px;
  min-width: 18px;
  width: max-content;
  height: 18px;
  padding: 0 5px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  line-height: 18px;
}
