@font-face {
  font-family: 'Rock Salt';
  src: url('../assets/fonts/rock_salt.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Caveat';
  src: url('../assets/fonts/caveat.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Typewriter Condensed';
  src: url('../assets/fonts/typewcond_regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'IB Special Elite';
  src: url('../assets/fonts/SpecialElite-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

.custom-drawing-text {
  font-family: 'Rock Salt', Arial, sans-serif;
  color: #000000; /* Black text */
}

.sticky-note {
  background-image: url("modules/investigation-board/assets/note_white.webp");
  width: 200px;
  height: 200px;
}

.photo-note {
  background-image: url("modules/investigation-board/assets/photoFrame.webp");
  width: 250px;
  height: 310px;
}

/* EDIT FORM  */
/* 
.note-config-wrapper {
  position: relative;
  width: 400px;
  min-height: 310px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
  border: none;
}

.note-config-wrapper.sticky-mode {
  background-image: url("../assets/note_white.webp");
  background-repeat: no-repeat;
  background-size: contain;
}

.note-config-wrapper.photo-mode {
  background-image: url("../assets/photoFrame.webp");
  background-repeat: no-repeat;
  background-size: cover;
}

.note-config-wrapper .window-content {
  background: none;
  border: none;
}

.note-config-wrapper form {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.note-type-group {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 150px;
}

.note-text-group {
  position: absolute;
  left: 20px;
  width: 360px;
}

.note-config-wrapper.sticky-mode .note-text-group {
  top: 100px;
}

.note-config-wrapper.photo-mode .note-text-group {
  top: 220px;
}

.note-image-group {
  position: absolute;
  top: 50px;
  right: 20px;
  width: 200px;
}

.note-save-group {
  position: absolute;
  bottom: 10px;
  right: 10px;
}

.note-config-wrapper input,
.note-config-wrapper textarea,
.note-config-wrapper select {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #ccc;
  border-radius: 2px;
  padding: 4px;
  font-size: 14px;
  font-family: Arial, sans-serif;
}

.note-config-wrapper label {
  font-size: 12px;
  font-weight: bold;
  color: #333;
  margin-bottom: 3px;
  display: inline-block;
}

.file-picker-button {
  margin-left: 5px;
  background: #eee;
  border: 1px solid #ccc;
  padding: 2px 4px;
  cursor: pointer;
}

.save-button {
  background: #3f51b5;
  color: #fff;
  border: none;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 14px;
  border-radius: 2px;
}
.save-button i {
  margin-right: 5px;
} */

/* Connect Mode Cursor Styles */
body.connect-mode-active {
  cursor: alias !important;
}

body.connect-mode-active canvas {
  cursor: alias !important;
}

body.connect-mode-active #board {
  cursor: alias !important;
}

body.connect-mode-active .drawing {
  cursor: alias !important;
}

body.connect-mode-active .drawing[data-investigation-note="true"]:hover {
  cursor: alias !important;
}

/* ========================= */
/* Investigation Board Mode  */
/* ========================= */

/* Highlight investigation notes when in Investigation Board mode */
body.investigation-board-mode .drawing[data-investigation-note="true"] {
  filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.5));
}

/* Dim non-investigation drawings when in Investigation Board mode */
body.investigation-board-mode .drawing:not([data-investigation-note="true"]) {
  opacity: 0.3;
  pointer-events: none;
}

/* ========================= */
/* Investigation Board HUD   */
/* ========================= */

.investigation-board-hud {
  background: rgba(0, 0, 0, 0.9);
  border: 2px solid #FFD700;
  border-radius: 5px;
  padding: 10px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.7);
  min-width: 200px;
}

.investigation-board-hud .hud-header {
  text-align: center;
  color: #FFD700;
  font-weight: bold;
  margin-bottom: 8px;
  text-transform: uppercase;
  font-size: 12px;
}

.investigation-board-hud .hud-body {
  margin-bottom: 8px;
}

.investigation-board-hud textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #ccc;
  padding: 5px;
  font-family: inherit;
  font-size: 12px;
  resize: vertical;
  box-sizing: border-box;
}

.investigation-board-hud .hud-controls {
  display: flex;
  gap: 5px;
  justify-content: space-around;
  margin-top: 10px;
}

.investigation-board-hud .control-icon {
  background: transparent;
  border: 1px solid #FFD700;
  color: #FFD700;
  padding: 5px 10px;
  cursor: pointer;
  transition: all 0.2s;
  flex: 1;
  text-align: center;
}

.investigation-board-hud .control-icon:hover {
  background: #FFD700;
  color: #000;
}

/* ========================= */
/* Connections Section       */
/* ========================= */

.connections-section {
  display: flex;
  flex-direction: column;
  margin-top: 5px;
  border-top: 2px solid #ccc;
}

.connections-header {
  font-weight: bold;
  display: block;
  margin-bottom: 12px;
  width: 100%;
}

.connections-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.connection-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
  flex: 1;
  min-width: 100px;
}

.connection-target {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-controls {
  display: flex;
  gap: 6px;
  align-items: center;
}

.connection-item input[type="color"] {
  width: 40px;
  height: 30px;
  border: 1px solid #ccc;
  border-radius: 3px;
  cursor: pointer;
  padding: 2px;
}

.remove-connection-btn {
  background: #d32f2f;
  color: white;
  border: none;
  padding: 6px 10px;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.2s;
}

.remove-connection-btn:hover {
  background: #b71c1c;
}

.remove-connection-btn i {
  font-size: 12px;
}

/* ========================= */
/* Note Edit Dialog          */
/* ========================= */

/* File picker layout - keep input and button on same line */
.file-picker {
  display: flex;
  gap: 8px;
  align-items: center;
}

.file-picker input[type="text"] {
  flex: 1;
  min-width: 0; /* Allow input to shrink if needed */
}

.file-picker-button {
  flex-shrink: 0; /* Prevent button from shrinking */
  white-space: nowrap;
}

/* Button group for save and cancel */
.button-group {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.save-button,
.cancel-button {
  flex: 1;
  padding: 8px 16px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.save-button {
  background: #3f51b5;
  color: white;
}

.save-button:hover {
  background: #303f9f;
}

.cancel-button {
  background: #757575;
  color: white;
}

.cancel-button:hover {
  background: #616161;
}

.save-button i,
.cancel-button i {
  margin-right: 5px;
}

/* ========================= */
/* Handout Size Controls     */
/* ========================= */

.size-controls {
  margin-top: 10px;
}

.size-inputs {
  display: flex;
  gap: 15px;
  margin-top: 8px;
  margin-bottom: 10px;
}

.size-input-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.size-input-group label {
  font-size: 12px;
  font-weight: 500;
  color: #333;
}

.size-input-group input[type="number"] {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 14px;
}

.aspect-ratio-lock {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
}

.aspect-ratio-lock input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.aspect-ratio-lock label {
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.size-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 10px;
  background: rgba(63, 81, 181, 0.1);
  border-left: 3px solid #3f51b5;
  border-radius: 3px;
}

.size-hint i {
  color: #3f51b5;
  font-size: 14px;
  margin-top: 2px;
  flex-shrink: 0;
}

.size-hint span {
  font-size: 12px;
  line-height: 1.4;
  color: #555;
}

/* Font Settings (for other note types) */
.font-settings {
  display: flex;
  gap: 15px;
  margin-top: 10px;
}

.font-select-group,
.font-size-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.font-select-group label,
.font-size-group label {
  font-size: 12px;
  font-weight: 500;
  color: #333;
}

.font-select-group select,
.font-size-group input[type="number"] {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 14px;
}

/* Color Mosaic Styles */
.color-settings {
  display: flex;
  flex-direction: row;
  gap: 15px;
  margin: 5px 0;
  align-items: center;
  flex-wrap: nowrap;
}

.color-mosaic-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  flex: 0 1 auto;
}

.color-mosaic-group label {
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  margin: 0;
}

.color-mosaic {
  display: flex;
  gap: 3px;
  flex-wrap: nowrap;
}

.color-option {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.2);
  cursor: pointer;
  transition: transform 0.1s;
  position: relative;
}

.color-option:hover {
  transform: scale(1.1);
  border-color: rgba(0,0,0,0.5);
  z-index: 1;
}

.color-option.active {
  border: 2px solid #3f51b5;
  box-shadow: 0 0 5px rgba(63, 81, 181, 0.6);
}

.color-option.active::after {
  content: '\f00c';
  font-family: 'Font Awesome 6 Pro';
  font-weight: 900;
  font-size: 10px;
  color: rgba(0,0,0,0.7);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Light checkmark for dark ink colors */
.color-option.active[data-color="#000000"]::after,
.color-option.active[data-color="#cc0000"]::after,
.color-option.active[data-color="#006600"]::after,
.color-option.active[data-color="#0000cc"]::after {
  color: rgba(255,255,255,0.8);
}

/* ========================= */
/* Context Menu              */
/* ========================= */

.ib-context-menu {
  background: #1a1c1e;
  border: 1px solid #4b4a44;
  border-radius: 3px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
  padding: 4px 0;
  min-width: 140px;
  font-family: "Signika", sans-serif;
  font-size: 14px;
  color: #f0f0e0;
  pointer-events: auto;
}

.ib-context-menu-item {
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.1s;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ib-context-menu-item i {
  width: 16px;
  text-align: center;
  color: #7a7971;
}

.ib-context-menu-item:hover {
  background: #4b4a44;
  color: #ff6400;
}

.ib-context-menu-item:hover i {
  color: #ff6400;
}

.ib-context-menu-item.disabled {
  color: #7a7971;
  cursor: default;
}

.ib-context-menu-item.disabled:hover {
  background: transparent;
  color: #7a7971;
}

.ib-context-menu-item.disabled:hover i {
  color: #7a7971;
}

/* ========================= */
/* Linked Object & Drop Zone */
/* ========================= */

.linked-object-container {
  position: relative;
  width: 100%;
}

.ib-drop-zone {
  border: 2px dashed transparent;
  transition: all 0.2s;
  padding: 5px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.03);
}

.ib-drop-zone.drag-over {
  border-color: #ff6400;
  background: rgba(255, 100, 0, 0.1);
}

.drop-hint {
  font-size: 10px;
  color: #666;
  margin-top: 2px;
  font-style: italic;
}

.linked-object-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 5px;
}

.linked-object-display {
  flex: 1;
  background: rgba(0, 0, 0, 0.05);
  padding: 8px;
  border-radius: 4px;
  border: 1px solid #ccc;
  min-height: 38px;
  display: flex;
  align-items: center;
}

.no-link {
  color: #777;
  font-size: 13px;
  font-style: italic;
}

.remove-link-btn {
  background: #d32f2f;
  color: white;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.remove-link-btn:hover {
  background: #b71c1c;
}

.enriched-link a.content-link {
  margin: 0;
  border: 1px solid #888;
  padding: 2px 5px;
  border-radius: 4px
}

.linked-object-container input {
  width: 100%;
}

/* ========================= */
/* Note Previewer            */
/* ========================= */

.note-preview-app .window-content {
  padding: 0;
  overflow: hidden;
  background: transparent;
  transition: background 0.3s, color 0.3s;
}

/* Dark Theme Overrides */
.theme-dark .note-preview-app .window-content {
  background: transparent;
}

.ib-note-preview {
  display: flex;
  flex-direction: column;
  padding: 20px;
  max-height: 85vh;
  overflow-y: auto;
  color: #222; /* Dark text for light mode */
}

.theme-dark .ib-note-preview {
  color: #f0f0e0; /* Light text for dark mode */
}

/* Force dark text for notes with paper/texture backgrounds */
.theme-dark .sticky-preview .preview-text,
.theme-dark .index-preview .preview-text,
.theme-dark .photo-preview .photo-frame-text {
  color: #111;
}

.preview-image-container {
  width: 100%;
  margin-bottom: 20px;
  text-align: center;
  position: relative;
}

.preview-image-container img {
  max-width: 100%;
  max-height: 60vh;
  display: block;
  margin: 0 auto;
}

/* Photo Frame Styles */
.photo-frame-wrapper {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

.photo-frame {
  display: block;
  max-width: 100%;
  height: auto;
  border: none !important;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3) !important;
}

.photo-content {
  position: absolute;
  top: 15.1%;    /* heightOffset / 2 */
  left: 6.66%;   /* widthOffset / 2 */
  width: 86.66%; /* frameWidth / width */
  height: 69.75%;/* frameHeight / height */
  overflow: hidden;
}

.user-photo {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  object-position: top;
  border: none !important;
  box-shadow: none !important;
}

.photo-frame-text {
  position: absolute;
  bottom: 5%;
  left: 10%;
  right: 10%;
  height: 12%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 1.4em;
  color: #111;
  overflow: hidden;
  line-height: 1.1;
}

/* Font variants for frame text */
.photo-frame-text.rock-salt { font-family: 'Rock Salt', cursive; }
.photo-frame-text.caveat {
  font-family: 'Caveat', cursive;
  font-size: 2.2em; /* Increased from 1.4em */
}
.photo-frame-text.courier-new { font-family: 'Courier New', monospace; }
.photo-frame-text.times-new-roman { font-family: 'Times New Roman', serif; }
.photo-frame-text.signika { font-family: 'Signika', sans-serif; }
.photo-frame-text.arial { font-family: 'Arial', sans-serif; }
.photo-frame-text.typewriter-condensed { font-family: 'Typewriter Condensed', monospace; }
.photo-frame-text.special-elite { font-family: 'IB Special Elite', cursive; }

/* Futuristic mode overrides for preview */
.futuristic-mode.photo-preview {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 20px;
}

.futuristic-mode.photo-preview .preview-image-container {
  flex: 0 0 300px;
  margin-bottom: 0;
}

.futuristic-mode.photo-preview .preview-text-container {
  flex: 1;
  margin-bottom: 0;
  height: 100%;
}

.futuristic-mode .photo-content {
  top: 5%;
  left: 5%;
  width: 90%;
  height: 90%;
}

.preview-identity-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  color: #00ffff;
  padding: 8px;
  font-family: "Courier New", monospace;
  font-weight: bold;
  text-align: center;
  font-size: 1.1em;
}

/* Media/Cassette Preview Styles */
.media-preview-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 10px;
}

.cassette-wrapper {
  position: relative;
  display: inline-block;
}

.cassette-image {
  width: 400px !important;
  max-width: 100%;
  height: auto !important;
  filter: drop-shadow(2px 2px 12px rgba(0, 0, 0, 0.8));
  border-radius: 10px;
  position: relative;
  z-index: 1;
}

.cassette-reels {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  display: none; /* Only show when playing */
}

.cassette-wrapper.playing .cassette-reels {
  display: block;
}

.reel {
  position: absolute;
  width: 42px;
  height: 42px;
  border: 7px dotted rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  top: 46%;
  animation: spin 3s linear reverse infinite;
}

.reel.left {
  left: 24%;
}

.reel.right {
  right: 24%;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.media-interface {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 15px;
  background: rgba(0,0,0,0.05);
  padding: 15px;
  border-radius: 15px;
}

.theme-dark .media-interface {
  background: rgba(255, 255, 255, 0.05);
}

.audio-player-container {
  width: 100%;
}

.audio-player-container audio {
  width: 100%;
}

.gm-broadcast-section {
  display: flex;
  justify-content: center;
  border-top: 1px solid rgba(0,0,0,0.1);
  padding-top: 10px;
}

.theme-dark .gm-broadcast-section {
  border-top-color: rgba(255, 255, 255, 0.1);
}

.play-btn {
  padding: 10px 25px;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s;
  color: white;
}

.global-toggle {
  background: #ff6400;
  min-width: 200px;
}

.global-toggle:hover {
  background: #e65a00;
}

.global-toggle.active {
  background: #d32f2f !important;
  box-shadow: 0 0 15px rgba(211, 47, 47, 0.4);
}

.global-toggle.active i {
  animation: pulse-icon 1s infinite alternate;
}

@keyframes pulse-icon {
  from { transform: scale(1); }
  to { transform: scale(1.2); }
}

.no-audio-msg {
  color: #d32f2f;
  font-style: italic;
  font-weight: bold;
}

.preview-text-container {
  padding: 20px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.1);
  margin-bottom: 20px;
  position: relative;
  isolation: isolate; /* Create a new stacking context */
}

.preview-text-container.has-background {
  background: transparent !important;
  border: none !important;
}

/* Sticky note tinting in preview */
.preview-text-container.has-background.sticky-note-tinted {
  background: transparent !important;
}

/* Fix for dark mode labels */
.theme-dark .ib-note-config-form label,
.theme-dark .ib-note-config-form .form-group label,
.theme-dark .color-mosaic-group label,
.theme-dark .investigation-board-hud label,
.theme-dark .size-input-group label,
.theme-dark .font-select-group label,
.theme-dark .font-size-group label {
  color: #f0f0e0 !important;
}

/* Sticky note tinting in preview */
.sticky-paper-container {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.sticky-tint-mask {
  position: relative;
  display: inline-block;
  background-color: var(--sticky-tint, #ffffff);
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.3));
}

.sticky-texture-overlay {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.preview-text-container.has-background {
  border: none;
  padding: 10px; /* More padding for paper edges */
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 450px;
  background: transparent !important;
}

.preview-background-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 1; /* Use positive z-index */
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
  pointer-events: none;
}

.preview-text {
  line-height: 1.4;
  white-space: pre-wrap;
  word-wrap: break-word;
  word-break: break-word;
  position: relative;
  z-index: 2;
  text-align: center;
  width: 100%;
  padding: 0 60px; /* Increased internal safety margin on paper */
}

.preview-footer {
  display: flex;
  justify-content: flex-start;
  gap: 4px;
  margin: 5px;
  padding: 5px;
  border-bottom: 1px solid #ccc;
}

.theme-dark .preview-footer {
  border-top-color: #444;
}

.preview-link-label {
  font-size: 12px;
  font-weight: bold;
  color: #666;
  margin-bottom: 5px;
}

.theme-dark .preview-link-label {
  color: #aaa;
}

.preview-controls {
  margin-top: 20px;
  text-align: center;
  display: flex;
  justify-content: center;
  gap: 15px;
}

.close-preview-btn,
.edit-note-btn {
  padding: 10px 25px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.close-preview-btn {
  background: #757575;
  color: white;
}

.close-preview-btn:hover {
  background: #616161;
}

.edit-note-btn {
  background: #3f51b5;
  color: white;
}

.edit-note-btn:hover {
  background: #303f9f;
}

/* Font variants for preview */
.preview-text-container.rock-salt { font-family: 'Rock Salt', cursive; }
.preview-text-container.caveat { font-family: 'Caveat', cursive; }
.preview-text-container.courier-new { font-family: 'Courier New', monospace; }
.preview-text-container.times-new-roman { font-family: 'Times New Roman', serif; }
.preview-text-container.signika { font-family: 'Signika', sans-serif; }
.preview-text-container.typewriter-condensed { font-family: 'Typewriter Condensed', monospace; }
.preview-text-container.special-elite { font-family: 'IB Special Elite', cursive; }
/* ========================= */
/* Setup Warning Dialog      */
/* ========================= */

.ib-setup-warning {
  padding: 10px;
  font-family: "Signika", sans-serif;
}

.permissions-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 15px 0;
  padding: 10px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}

.theme-dark .permissions-summary {
  background: rgba(255, 255, 255, 0.05);
}

.permission-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.permission-item.enabled { color: #2e7d32; }
.theme-dark .permission-item.enabled { color: #81c784; }
.permission-item.disabled { color: #d32f2f; }
.theme-dark .permission-item.disabled { color: #e57373; }

.permission-explanation {
  background: rgba(46, 125, 50, 0.1);
  border-left: 4px solid #2e7d32;
  padding: 10px;
  font-size: 13px;
  margin: 10px 0;
  color: #1b5e20;
}

.theme-dark .permission-explanation {
  background: rgba(129, 199, 132, 0.1);
  border-left-color: #81c784;
  color: #c8e6c9;
}

.user-permissions-table-container {
  max-height: 250px;
  overflow-y: auto;
  margin: 10px 0;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

.ib-permissions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.8);
  color: #222;
}

.theme-dark .ib-permissions-table {
  background: rgba(0, 0, 0, 0.2);
  color: #f0f0e0;
}

.ib-permissions-table th {
  background: rgba(0, 0, 0, 0.05);
  padding: 8px;
  text-align: left;
  border-bottom: 2px solid rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1;
}

.theme-dark .ib-permissions-table th {
  background: rgba(255, 255, 255, 0.1);
  border-bottom-color: rgba(255, 255, 255, 0.2);
}

.ib-permissions-table td {
  padding: 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.theme-dark .ib-permissions-table td {
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

.ib-permissions-table tr:hover {
  background: rgba(0, 0, 0, 0.02);
}

.theme-dark .ib-permissions-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

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

.missing-list {
  margin: 4px 0 0 15px;
  padding: 0;
  font-size: 13px;
  color: #d32f2f;
}

.security-note {
  font-size: 12px;
  font-style: italic;
  margin-top: 15px;
  padding: 8px;
  background: #fff8e1;
  border-left: 4px solid #ffc107;
  color: #5d4037;
}

.theme-dark .security-note {
  background: rgba(255, 193, 7, 0.05);
  border-left-color: #ffc107;
  color: #ffe082;
}

.ib-dialog-buttons {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.ib-btn {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: filter 0.2s;
}

.ib-btn.ok {
  background: #3f51b5;
  color: white;
}

.ib-btn.disable {
  background: #757575;
  color: white;
}

.ib-btn:hover {
  filter: brightness(1.1);
}

