﻿
[hidden] {
  display: none !important;
}
/* Espace Client - CSS Style */

:root {
  --primary: #00AEEF; 
  --primary-dark: #0077b3;
  --primary-glow: rgba(0, 174, 239, 0.25);
  --secondary: #003366; 
  --secondary-light: #004d99;
  --accent: #20C997;
  --bg-color: #f0f6fa;
  --text-main: #1E293B;
  --text-muted: #64748B;
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.8);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--text-main);
  background: linear-gradient(135deg, #f0f6fa 0%, #e0f2fe 100%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Glassmorphism utility card */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
}

/* Login Page Styles */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
  padding: 2rem;
}

.login-card {
  width: 100%;
  max-width: 450px;
  text-align: center;
}

.login-logo {
  height: 65px;
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--secondary);
}

.form-input {
  width: 100%;
  padding: 0.9rem 1.2rem;
  border: 2px solid transparent;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
  font-size: 1rem;
  font-family: inherit;
  transition: var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 2.2rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 8px 15px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 20px var(--primary-glow);
}

/* Dashboard Styles */
.dashboard-header {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 1rem 2rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.header-container {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.header-logo-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.logo-text {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--secondary);
  letter-spacing: 0.5px;
}
.logo-text-bold {
  font-weight: 800;
  color: var(--primary);
}

.user-badge {
  background: rgba(0, 174, 239, 0.1);
  color: var(--primary-dark);
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Simulator Switch */
.simulator-control {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: white;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: var(--shadow-lg);
}

.simulator-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.switch-btn {
  background: var(--text-muted);
  color: white;
  border: none;
  padding: 0.35rem 0.9rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.switch-btn.active-client {
  background: var(--primary);
}

.switch-btn.active-conseiller {
  background: var(--secondary);
}

.btn-logout {
  background: transparent;
  border: 2px solid var(--text-muted);
  color: var(--text-muted);
  padding: 0.5rem 1.2rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-logout:hover {
  background: var(--text-muted);
  color: white;
}

/* Main Layout Grid */
.dashboard-content {
  max-width: 1300px;
  margin: 2rem auto;
  padding: 0 2rem;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 2rem;
  flex-grow: 1;
}

@media (max-width: 1024px) {
  .dashboard-content {
    grid-template-columns: 1fr;
  }
}

.panel-title {
  color: var(--secondary);
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 2px solid rgba(0,0,0,0.05);
  padding-bottom: 0.5rem;
}

/* Web App Panel (Grid) */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1.2rem;
}

.app-tile {
  background: white;
  border-radius: 16px;
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid rgba(0,0,0,0.04);
  box-shadow: 0 4px 6px rgba(0,0,0,0.02);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
}

.app-tile:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(0, 174, 239, 0.2);
}

.app-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: rgba(0, 174, 239, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: var(--transition);
}

.app-tile:hover .app-icon {
  background: var(--primary);
  color: white;
}

.app-tile.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.app-tile.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.app-tile.disabled:hover {
  transform: none;
  box-shadow: none;
}

.app-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--secondary);
}

/* Chat Module: IsoConnect */
.connect-container {
  display: flex;
  flex-direction: column;
  height: 600px;
  padding: 1.5rem;
}

.chat-history {
  flex-grow: 1;
  overflow-y: auto;
  padding-right: 0.5rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Scrollbar styling */
.chat-history::-webkit-scrollbar {
  width: 6px;
}
.chat-history::-webkit-scrollbar-track {
  background: transparent;
}
.chat-history::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.1);
  border-radius: 10px;
}

.message-bubble {
  max-width: 75%;
  padding: 0.9rem 1.2rem;
  border-radius: 18px;
  line-height: 1.4;
  font-size: 0.95rem;
  position: relative;
  animation: fadeIn 0.3s ease-out;
}

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

.message-bubble.incoming {
  align-self: flex-start;
  background: #f1f5f9;
  color: var(--text-main);
  border-bottom-left-radius: 4px;
}

.message-bubble.outgoing {
  align-self: flex-end;
  background: var(--secondary);
  color: white;
  border-bottom-right-radius: 4px;
}

.message-bubble.outgoing-client {
  align-self: flex-end;
  background: var(--primary-dark);
  color: white;
  border-bottom-right-radius: 4px;
}

.msg-meta {
  display: block;
  font-size: 0.75rem;
  margin-top: 0.4rem;
  opacity: 0.7;
}

.msg-sender {
  font-weight: 700;
  font-size: 0.8rem;
  margin-bottom: 0.2rem;
  display: block;
}

/* Chat Input Controls */
.chat-input-bar {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  background: white;
  padding: 0.4rem;
  border-radius: 50px;
  border: 1px solid rgba(0,0,0,0.08);
}

.chat-input {
  flex-grow: 1;
  border: none;
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  background: transparent;
}

.btn-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: var(--transition);
}

.btn-icon:hover {
  background: #f1f5f9;
  color: var(--secondary);
}

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

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

/* File Upload Display */
.file-upload-section {
  border-top: 1px solid rgba(0,0,0,0.05);
  margin-top: 1rem;
  padding-top: 1rem;
}

.files-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 120px;
  overflow-y: auto;
  margin-top: 0.5rem;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.05);
  font-size: 0.85rem;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--secondary);
  font-weight: 600;
}

.file-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-action-icon {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.2rem;
  border-radius: 4px;
  transition: var(--transition);
}

.btn-action-icon:hover {
  background: #f1f5f9;
}

.btn-delete:hover {
  color: #ef4444;
}

/* Hide file input */
#file-input {
  display: none;
}

/* Advisor Notification banner */
.advisor-banner {
  background: linear-gradient(90deg, var(--secondary), var(--secondary-light));
  color: white;
  text-align: center;
  padding: 0.6rem;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* Prototype access page */
.portal-card {
  max-width: 560px;
  text-align: left;
}

.portal-logo {
  justify-content: center;
  margin-bottom: 1.5rem;
}

.portal-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 174, 239, 0.1);
  color: var(--primary-dark);
  font-weight: 800;
  font-size: 0.82rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.portal-title {
  color: var(--secondary);
  font-family: 'Outfit', sans-serif;
  font-size: 2.15rem;
  line-height: 1.1;
  margin-bottom: 0.85rem;
}

.portal-intro {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.55;
  margin-bottom: 2rem;
}

.portal-form {
  margin-bottom: 1.2rem;
}

.portal-note {
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.45;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 14px;
  padding: 1rem;
}

@media (max-width: 720px) {
  .portal-title {
    font-size: 1.75rem;
  }

  .dashboard-header {
    padding: 1rem;
  }

  .header-container,
  .header-left,
  .header-right,
  .simulator-control {
    align-items: stretch;
    flex-direction: column;
  }

  .header-right {
    width: 100%;
  }

  .simulator-control {
    border-radius: 18px;
    gap: 0.55rem;
  }

  .message-bubble {
    max-width: 92%;
  }

  .chat-input-bar {
    border-radius: 18px;
  }
}

/* Simple subject exchange app */
.simple-app-shell {
  width: 100%;
  max-width: 1280px;
  margin: 2rem auto;
  padding: 0 2rem 2rem;
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 1.5rem;
  flex-grow: 1;
}

.subjects-panel,
.exchange-panel {
  padding: 1.5rem;
}

.simple-section-heading,
.subject-detail-header,
.form-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.simple-section-heading {
  margin-bottom: 1.5rem;
}

.admin-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-end;
}

.admin-heading-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
}

.admin-create-panel .simple-section-heading {
  align-items: flex-start;
  flex-direction: column;
}

.admin-create-panel .admin-header-actions {
  justify-content: stretch;
  width: 100%;
}

.admin-create-panel .admin-header-actions .secondary-action {
  flex: 1;
  min-width: 0;
}

.purge-action:hover {
  border-color: #fca5a5;
  color: #b91c1c;
  background: #fef2f2;
}

.modal-backdrop {
  align-items: center;
  background: rgba(15, 23, 42, 0.42);
  bottom: 0;
  display: flex;
  justify-content: center;
  left: 0;
  padding: 1.25rem;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 500;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  background: #ffffff;
  border: 1px solid #dbe7f3;
  border-radius: 18px;
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.24);
  max-width: 560px;
  padding: 1.5rem;
  width: min(100%, 560px);
}

.modal-header {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.modal-header h2 {
  color: var(--secondary);
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  line-height: 1.1;
}

.modal-close {
  align-items: center;
  background: #f1f7fd;
  border: 1px solid #dbe7f3;
  border-radius: 999px;
  color: #607086;
  cursor: pointer;
  display: inline-flex;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.modal-close:hover {
  background: #eaf4ff;
  color: var(--primary-dark);
}

.eyebrow {
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.simple-section-heading h1,
.subject-detail-header h2,
.empty-state h2 {
  color: var(--secondary);
  font-family: 'Outfit', sans-serif;
  line-height: 1.1;
}

.simple-section-heading h1 {
  font-size: 2rem;
}

.count-badge {
  min-width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 174, 239, 0.12);
  color: var(--primary-dark);
  font-weight: 900;
}

.new-subject-form,
.question-form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.new-subject-form {
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.new-subject-form label,
.question-form label {
  color: var(--secondary);
  font-size: 0.9rem;
  font-weight: 800;
}



.share-select-panel {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.share-select-panel label {
  align-items: center;
  color: var(--secondary);
  display: flex;
  font-size: 0.9rem;
  font-weight: 800;
  gap: 0.45rem;
}

.share-select {
  min-height: 54px;
  padding: 0.7rem 0.95rem;
}

.share-select option {
  padding: 0.45rem 0.35rem;
}

.share-select-help {
  color: var(--text-muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.share-panel {
  background: #f8fbff;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  padding: 0.9rem;
}

.share-panel-title {
  align-items: center;
  color: var(--secondary);
  display: flex;
  font-size: 0.88rem;
  font-weight: 900;
  gap: 0.45rem;
  margin: 0 0 0.65rem;
}

.share-users-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.share-user-option {
  align-items: center;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
}

.share-user-option input {
  accent-color: var(--primary-dark);
  height: 18px;
  width: 18px;
}

.share-user-option span {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.share-user-option strong {
  color: var(--secondary);
  font-size: 0.9rem;
}

.share-user-option small {
  color: var(--text-muted);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.shared-subject-pill {
  align-items: center;
  align-self: flex-start;
  background: #eaf4ff;
  border-radius: 999px;
  color: var(--primary-dark);
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 800;
  gap: 0.35rem;
  margin-top: 0.25rem;
  padding: 0.32rem 0.58rem;
}


.subject-settings-panel {
  margin: 1rem 0 1.25rem;
}

.share-settings-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.share-settings-heading .share-panel-title {
  margin-bottom: 0;
}

#participant-settings-body {
  margin-top: 0.75rem;
}

.share-save-btn {
  justify-content: center;
  margin-top: 0.75rem;
  width: 100%;
}

.archive-folder-card {
  background: #f8fafc;
  border-style: dashed;
}

.new-subject-form textarea,
.question-form textarea {
  resize: vertical;
  min-height: 110px;
}

.subjects-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.subject-card {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1rem 1rem 1rem 1rem;
  position: relative;
  text-align: left;
  transition: var(--transition);
}

.unread-subject-card {
  background: #fff7f7;
  border: 2px solid #ef4444;
  box-shadow: 0 16px 28px rgba(220, 38, 38, 0.16);
  padding: 3.15rem 1rem 1rem 1.15rem;
}

.unread-subject-card::before {
  background: #dc2626;
  border-radius: 16px 0 0 16px;
  bottom: 0;
  content: "";
  left: 0;
  position: absolute;
  top: 0;
  width: 6px;
}

.archived-client-card {
  opacity: 0.58;
}

.archived-discussion-card {
  background: #f8fafc;
  border: 1px dashed #94a3b8;
  opacity: 0.78;
}

.archived-discussion-card.active {
  opacity: 1;
}

.archive-pill {
  background: #e5e7eb;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  color: #475569;
  flex: 0 0 auto;
  font-size: 0.7rem;
  font-weight: 900;
  padding: 0.34rem 0.55rem;
  text-transform: uppercase;
}

.client-card-admin {
  border-left: 8px solid var(--client-color, var(--secondary));
  cursor: default;
}

.client-color-card .subject-title {
  color: var(--client-color, var(--secondary));
}

.client-color-card:hover,
.client-color-card.active {
  border-color: var(--client-color, var(--secondary));
  border-left-color: var(--client-color, var(--secondary));
}

.client-color-card.active {
  box-shadow: 0 0 0 3px rgba(0, 174, 239, 0.14), 0 12px 28px rgba(0, 51, 102, 0.1);
}

.client-color-dot {
  background: var(--client-color, var(--secondary));
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.9);
  flex: 0 0 auto;
  height: 0.72rem;
  width: 0.72rem;
}

.client-card-main {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  font: inherit;
  gap: 0.3rem;
  padding: 0;
  text-align: left;
  width: 100%;
}

.client-card-main:focus {
  outline: none;
}

.client-card-footer {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.85rem;
}

.archive-inline-btn {
  align-items: center;
  background: #ffffff;
  border: 1px solid #dbe4ef;
  border-radius: 999px;
  color: #607086;
  cursor: pointer;
  display: inline-flex;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  gap: 0.45rem;
  justify-content: center;
  padding: 0.48rem 0.75rem;
  transition: var(--transition);
  width: auto;
}

.archive-inline-btn:hover {
  background: #fff7ed;
  border-color: #fb923c;
  color: #9a3412;
}

.archive-inline-btn.edit:hover {
  background: #eff6ff;
  border-color: #60a5fa;
  color: #1d4ed8;
}

.archive-inline-btn.restore {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

.archive-inline-btn.restore:hover {
  background: #d1fae5;
  border-color: #34d399;
}

.selected-client-actions {
  margin: -0.45rem 0 1rem;
}

.archive-selected-btn {
  align-items: center;
  background: #fff7ed;
  border: 2px solid #fb923c;
  border-radius: 14px;
  color: #9a3412;
  cursor: pointer;
  display: inline-flex;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 900;
  gap: 0.55rem;
  justify-content: center;
  padding: 0.8rem 1rem;
  transition: var(--transition);
  width: 100%;
}

.archive-selected-btn:hover {
  background: #ffedd5;
  transform: translateY(-1px);
}

.archive-selected-btn.restore {
  background: #ecfdf5;
  border-color: #34d399;
  color: #047857;
}

.archive-selected-btn.restore:hover {
  background: #d1fae5;
}

.edit-client-form {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(0, 174, 239, 0.18);
  border-radius: 16px;
  margin-top: -0.35rem;
  padding: 1rem;
}

.subject-card:hover,
.subject-card.active {
  border-color: rgba(0, 174, 239, 0.45);
  box-shadow: 0 10px 20px rgba(0, 51, 102, 0.08);
  transform: translateY(-2px);
}

.subject-card.active {
  background: white;
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.subject-title {
  color: var(--secondary);
  font-weight: 900;
  overflow-wrap: anywhere;
  align-items: center;
  display: inline-flex;
  gap: 0.45rem;
}

.subject-alert-icon {
  color: #dc2626;
  font-size: 1rem;
}

.subject-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
}

.unread-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.13);
  flex: 0 0 auto;
}

.unread-ribbon {
  align-items: center;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  border: 1px solid #b91c1c;
  border-radius: 0 0 12px 12px;
  color: white;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 900;
  gap: 0.45rem;
  line-height: 1;
  letter-spacing: 0.02em;
  left: 1rem;
  padding: 0.62rem 0.85rem;
  position: absolute;
  top: 0;
  box-shadow: 0 8px 18px rgba(185, 28, 28, 0.22);
  text-transform: uppercase;
}

.subject-meta,
.subject-date,
.simple-document span,
.message-topline span {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.subject-detail {
  min-height: 680px;
  display: flex;
  flex-direction: column;
}

.subject-detail-header {
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.small-danger-btn,
.secondary-action {
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: white;
  border-radius: 999px;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 800;
  padding: 0.65rem 1rem;
  transition: var(--transition);
}

.small-danger-btn:hover {
  border-color: #fecaca;
  color: #dc2626;
  background: #fef2f2;
}

.secondary-action:hover {
  border-color: rgba(0, 174, 239, 0.35);
  color: var(--primary-dark);
  background: rgba(0, 174, 239, 0.08);
}

.simple-messages {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.25rem 0;
  overflow-y: auto;
  padding-right: 0.35rem;
}

.simple-message {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 16px;
  padding: 1rem;
  max-width: min(78%, 720px);
}

.message-client {
  align-self: flex-end;
  background: var(--message-color, #2f6f9f);
  border-color: var(--message-color, #2f6f9f);
  color: white;
}

.message-admin {
  align-self: flex-start;
  background: #0f3a68;
  border-color: #0f3a68;
  color: white;
}

.simple-message.message-admin .message-topline strong,
.simple-message.message-admin .message-topline span,
.simple-message.message-admin p {
  color: white;
}

.simple-message.message-client .message-topline strong,
.simple-message.message-client .message-topline span,
.simple-message.message-client p {
  color: white;
}

.message-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.55rem;
}

.message-topline strong {
  color: var(--secondary);
}

.simple-message p {
  color: var(--text-main);
  line-height: 1.55;
  white-space: pre-wrap;
}

.message-edited {
  font-size: 0.78rem;
  font-weight: 800;
  opacity: 0.72;
}

.message-actions {
  display: flex;
  gap: 0.38rem;
  justify-content: flex-end;
  margin-top: 0.65rem;
}

.simple-message .message-action-btn {
  align-items: center;
  -webkit-appearance: none;
  appearance: none;
  background: #f4f8fc;
  border: 1px solid rgba(52, 109, 168, 0.2);
  border-radius: 50%;
  box-shadow: none;
  color: #346da8;
  cursor: pointer;
  display: inline-flex;
  font-family: inherit;
  font-size: 0.78rem;
  height: 30px;
  justify-content: center;
  line-height: 30px;
  margin: 0;
  min-height: 0;
  min-width: 0;
  outline: none;
  padding: 0;
  text-align: center;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  width: 30px;
}

.simple-message .message-action-btn:hover {
  background: #e8f3ff;
  border-color: rgba(52, 109, 168, 0.36);
  transform: translateY(-1px);
}

.simple-message .message-action-btn.danger {
  background: #fff5f2;
  border-color: rgba(160, 76, 48, 0.2);
  color: #944827;
}

.simple-message .message-action-btn.danger:hover {
  background: #ffe9e2;
  border-color: rgba(160, 76, 48, 0.36);
}

.simple-message.message-admin .message-action-btn {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  color: white;
}

.simple-message.message-admin .message-action-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.simple-message.message-admin .message-action-btn.danger {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  color: white;
}

.question-form {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.compact-btn {
  width: auto;
  min-width: 150px;
}

#document-input {
  display: none;
}

.documents-block {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.documents-block h3 {
  color: var(--secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
}

.simple-documents {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.simple-document {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  padding: 0.85rem 1rem;
}

.simple-document div {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.simple-document strong {
  color: var(--secondary);
  overflow-wrap: anywhere;
}

.simple-document button {
  border: none;
  background: #f8fafc;
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  height: 34px;
  width: 34px;
  flex: 0 0 auto;
}

.simple-document button:hover {
  color: #dc2626;
  background: #fef2f2;
}

.empty-state,
.list-empty {
  color: var(--text-muted);
  text-align: center;
}

.empty-state {
  min-height: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
}

.empty-state i {
  color: var(--primary);
  font-size: 3rem;
}

.list-empty {
  background: rgba(255, 255, 255, 0.7);
  border: 1px dashed rgba(0, 0, 0, 0.12);
  border-radius: 14px;
  padding: 1rem;
}

@media (max-width: 900px) {
  .simple-app-shell {
    grid-template-columns: 1fr;
    padding: 0 1rem 1.5rem;
  }

  .subject-detail {
    min-height: auto;
  }
}

@media (max-width: 620px) {
  .simple-section-heading,
  .subject-detail-header,
  .form-actions-row,
  .message-topline {
    align-items: stretch;
    flex-direction: column;
  }

  .compact-btn,
  .secondary-action,
  .small-danger-btn {
    width: 100%;
  }
}

.simple-app-shell.no-active-subject {
  max-width: 760px;
  grid-template-columns: 1fr;
}

.simple-app-shell.no-active-subject .exchange-panel {
  display: none;
}


.link-button {
  background: transparent;
  border: none;
  color: var(--primary-dark);
  cursor: pointer;
  display: inline-flex;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  justify-content: center;
  margin: 0 auto 1rem;
  padding: 0.4rem;
  text-decoration: underline;
}

.link-button:hover {
  color: var(--secondary);
}

.password-change-overlay {
  align-items: center;
  background: rgba(15, 58, 104, 0.62);
  bottom: 0;
  display: flex;
  justify-content: center;
  left: 0;
  padding: 1.5rem;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 500;
}

.password-change-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  max-width: 520px;
  width: 100%;
}

.password-change-card h2 {
  color: var(--secondary);
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
}

.password-change-card p {
  color: var(--text-muted);
  line-height: 1.5;
}

.password-change-card label {
  color: var(--secondary);
  font-weight: 800;
}

/* Admin client workspace */
.admin-app-shell {
  width: 100%;
  max-width: 1680px;
  margin: 1.5rem auto;
  padding: 0 2rem 2rem;
  display: grid;
  grid-template-columns: minmax(340px, 430px) minmax(0, 1fr);
  grid-template-areas:
    "companies thread"
    "users thread"
    "subjects thread";
  gap: 1.25rem;
  align-items: start;
  flex-grow: 1;
}

.admin-create-panel,
.admin-users-panel,
.admin-subjects-panel {
  min-width: 0;
  padding: 1.25rem;
}

.admin-thread-panel {
  min-width: 0;
  padding: 1.75rem;
}

.admin-create-panel {
  grid-area: companies;
}

.admin-users-panel {
  grid-area: users;
}

.admin-subjects-panel {
  grid-area: subjects;
}

.admin-thread-panel {
  grid-area: thread;
  min-height: calc(100vh - 170px);
}

.admin-thread-panel .subject-detail {
  min-height: calc(100vh - 225px);
}

.admin-create-panel .btn {
  border-radius: 14px;
}

.admin-thread-panel .empty-state {
  min-height: calc(100vh - 225px);
}

.admin-create-panel .subjects-list,
.admin-users-panel .subjects-list,
.admin-subjects-panel .subjects-list {
  max-height: 230px;
  overflow: auto;
  padding-right: 0.2rem;
}

.admin-users-panel .subjects-list {
  max-height: 270px;
}

.admin-subjects-panel .subjects-list {
  max-height: 320px;
}

.admin-create-panel .new-subject-form,
.admin-users-panel .new-subject-form {
  margin-bottom: 1rem;
}

.admin-create-panel .simple-section-heading h1,
.admin-users-panel .simple-section-heading h2,
.admin-subjects-panel .simple-section-heading h2 {
  font-size: clamp(1.65rem, 3vw, 2.15rem);
}

.admin-thread-panel .simple-messages {
  max-height: 52vh;
  min-height: 280px;
}

#admin-document-input {
  display: none;
}

@media (max-width: 1180px) {
  .admin-app-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "companies"
      "users"
      "subjects"
      "thread";
    padding: 0 1rem 1.5rem;
  }
}


.video-help-button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin: 0 0 0.9rem;
  padding: 0.95rem 1.15rem;
  border: 1px solid rgba(75, 134, 197, 0.26);
  border-radius: 999px;
  background: #f4f9ff;
  color: var(--primary-dark);
  font-weight: 800;
  font-size: 0.98rem;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(30, 55, 101, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.video-help-button:hover {
  transform: translateY(-1px);
  background: #eaf4ff;
  box-shadow: 0 14px 28px rgba(30, 55, 101, 0.12);
}

body.modal-open {
  overflow: hidden;
}

.video-modal[hidden] {
  display: none;
}

.video-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(6px);
}

.video-modal-panel {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  border-radius: 24px;
  background: #ffffff;
  border: 1px solid rgba(215, 230, 244, 0.95);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
  padding: 1.4rem;
}

.video-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(100, 116, 139, 0.2);
  border-radius: 50%;
  background: #ffffff;
  color: var(--secondary);
  cursor: pointer;
  font-size: 1.1rem;
}

.video-modal-heading {
  padding-right: 3.5rem;
  margin-bottom: 1rem;
}

.video-modal-heading .portal-kicker {
  margin-bottom: 0.7rem;
}

.video-modal-heading h2 {
  margin: 0;
  color: var(--secondary);
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.45rem, 3vw, 2.2rem);
}

.video-modal video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  background: #0f172a;
}

.video-direct-link {
  display: inline-flex;
  margin-top: 0.9rem;
  color: var(--primary-dark);
  font-weight: 800;
  text-decoration: underline;
}
