* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #f5f3f0 0%, #e8e4df 100%);
  min-height: 100vh;
  padding: 0;
  color: #1a1815;
}
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px;
}
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  padding: 0 0 24px 0;
  border-bottom: 1px solid #d9d4cf;
}
h1 {
  color: #1a1815;
  font-size: 2em;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.02em;
}
.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}
.layout-toggle-group {
  display: flex;
  gap: 4px;
  align-items: center;
}
.layout-toggle-btn {
  background: transparent;
  color: #6e645a;
  border: none;
  padding: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.layout-toggle-btn:hover {
  background: #f5f3f0;
  color: #1a1815;
}
.layout-toggle-btn.active {
  background: #1a1815;
  color: white;
}
.layout-toggle-btn svg {
  display: block;
}
.builder-btn {
  background: #1a1815;
  color: white;
  border: none;
  padding: 12px 20px;
  cursor: pointer;
  font-size: 0.9em;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  transition: all 0.15s ease;
  text-decoration: none;
  display: inline-block;
  letter-spacing: -0.01em;
}
.builder-btn:hover {
  background: #2d2925;
}
.user-profile {
  position: relative;
}
.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a1815 0%, #6e645a 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
}
.user-avatar:hover {
  transform: scale(1.05);
  border-color: #1a1815;
  box-shadow: 0 4px 12px rgba(26, 24, 21, 0.2);
}
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: white;
  border: 1px solid #d9d4cf;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  min-width: 220px;
  display: none;
  z-index: 1000;
  animation: slideDown 0.2s ease;
}
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.user-dropdown.show {
  display: block;
}
.user-dropdown-header {
  padding: 16px;
  border-bottom: 1px solid #e8e4df;
  background: #fafaf9;
}
.user-dropdown-name {
  font-weight: 600;
  font-size: 0.9em;
  color: #1a1815;
  margin-bottom: 4px;
}
.user-dropdown-email {
  font-size: 0.75em;
  color: #6e645a;
}
.user-dropdown-item {
  padding: 12px 16px;
  cursor: pointer;
  font-size: 0.85em;
  font-weight: 500;
  color: #1a1815;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: 'Inter', sans-serif;
  transition: background 0.15s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-dropdown-item:hover {
  background: #fafaf9;
}
.user-dropdown-divider {
  height: 1px;
  background: #e8e4df;
  margin: 4px 0;
}
.user-dropdown-item.logout {
  color: #c93434;
}
.user-dropdown-item.logout:hover {
  background: #fee;
}
.filter-section {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 64px;
  z-index: 100;
  background: linear-gradient(135deg, #f5f3f0 0%, #e8e4df 100%);
  padding: 16px 0;
  margin-left: -32px;
  margin-right: -32px;
  padding-left: 32px;
  padding-right: 32px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.filter-group-wrapper {
  position: relative;
  flex: 1;
  overflow: hidden;
}
.filter-group {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  position: relative;
}
.filter-group::-webkit-scrollbar {
  display: none;
}
.filter-fade-right {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 60px;
  background: linear-gradient(to left, rgba(245, 243, 240, 1) 0%, rgba(245, 243, 240, 0) 100%);
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.3s ease;
  z-index: 1;
}
.filter-fade-right.hidden {
  opacity: 0;
}
.filter-fade-left {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 60px;
  background: linear-gradient(to right, rgba(245, 243, 240, 1) 0%, rgba(245, 243, 240, 0) 100%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}
.filter-fade-left.visible {
  opacity: 1;
}
.search-section {
  display: none;
}
.search-bar {
  position: relative;
  width: 280px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.search-input {
  width: 100%;
  padding: 8px 16px 8px 36px;
  border: 1px solid #d9d4cf;
  background: white;
  font-family: 'Inter', sans-serif;
  font-size: 0.8em;
  color: #1a1815;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 0;
  line-height: 1.5;
  height: 100%;
}
.search-input:focus {
  outline: none;
  border-color: #1a1815;
  box-shadow: 0 0 0 3px rgba(26, 24, 21, 0.08);
}
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #6e645a;
  pointer-events: none;
  z-index: 10;
}
.layout-toggle-group {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}
.filter-label {
  color: #6e645a;
  font-size: 0.85em;
  font-weight: 500;
  margin-right: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}
.filter-btn {
  padding: 6px 16px;
  background: white;
  border: 1px solid #d9d4cf;
  color: #6e645a;
  cursor: pointer;
  font-size: 0.8em;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: -0.01em;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.5;
  display: inline-flex;
  align-items: center;
}
.filter-btn-static {
  margin-right: 8px;
  flex-shrink: 0;
}
.filter-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(26, 24, 21, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease;
}
.filter-btn:hover::before {
  width: 200%;
  height: 200%;
}
.filter-btn:hover {
  background: #fafaf9;
  border-color: #c9c3bb;
  transform: translateY(-1px);
}
.filter-btn.active {
  background: #1a1815;
  color: white;
  border-color: #1a1815;
  transform: translateY(-1px);
}
.filter-btn:active {
  transform: translateY(0);
}
.playbooks-section {
  margin-bottom: 48px;
}
.section-header {
  font-size: 0.85em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #1a1815;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #d9d4cf;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 128px;
  background: linear-gradient(135deg, #f5f3f0 0%, #e8e4df 100%);
  padding-top: 12px;
  z-index: 99;
  margin-left: -32px;
  margin-right: -32px;
  padding-left: 32px;
  padding-right: 32px;
}
.section-badge {
  background: #1a1815;
  color: white;
  padding: 4px 12px;
  font-size: 0.75em;
  font-weight: 600;
  border-radius: 12px;
}
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes cardSlideIn {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes cardHoverGlow {
  0%, 100% {
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.08);
  }
  50% {
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 12px 32px rgba(0,0,0,0.12);
  }
}
.file-card {
  background: white;
  border: 1px solid #d9d4cf;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  position: relative;
  opacity: 1;
  animation: cardSlideIn 0.6s ease forwards;
  z-index: 1;
}
.file-card:has(.dropdown-menu.show) {
  z-index: 101;
}

.file-card:nth-child(1) { animation-delay: 0.05s; }
.file-card:nth-child(2) { animation-delay: 0.1s; }
.file-card:nth-child(3) { animation-delay: 0.15s; }
.file-card:nth-child(4) { animation-delay: 0.2s; }
.file-card:nth-child(5) { animation-delay: 0.25s; }
.file-card:nth-child(6) { animation-delay: 0.3s; }
.file-card:nth-child(7) { animation-delay: 0.35s; }
.file-card:nth-child(8) { animation-delay: 0.4s; }
.file-card:nth-child(9) { animation-delay: 0.45s; }
.file-card:nth-child(10) { animation-delay: 0.5s; }
.file-card:nth-child(n+11) { animation-delay: 0.55s; }
.file-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 8px 20px rgba(0,0,0,0.08);
  border-color: #c9bfb3;
}
.file-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e8e4df;
  background: #fafaf9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}
.file-card-actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
@keyframes starPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3) rotate(15deg); }
  100% { transform: scale(1) rotate(0deg); }
}
@keyframes starShine {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.3) drop-shadow(0 0 8px #d4af37); }
}
.favorite-star {
  background: none;
  border: none;
  font-size: 1.1em;
  cursor: pointer;
  color: #c9a96e;
  padding: 4px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}
.favorite-star:hover {
  color: #d4af37;
  transform: scale(1.15) rotate(-5deg);
}
.favorite-star.favorited {
  color: #d4af37;
  animation: starPop 0.5s ease;
}
.favorite-star:active {
  animation: starPop 0.3s ease;
}
.favorites-section {
  margin-bottom: 40px;
}
.favorites-header {
  font-size: 0.85em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #1a1815;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #d4af37;
}
.file-card-icon-section {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}
.file-category-badge {
  font-size: 0.7em;
  font-weight: 600;
  padding: 4px 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border: 1px solid;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}
.tag-selector {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border: 1px solid #d9d4cf;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 1000;
  min-width: 160px;
  margin-top: 4px;
}
.tag-option {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.85em;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  transition: background 0.15s ease;
  border-bottom: 1px solid #e8e4df;
}
.tag-option:last-child {
  border-bottom: none;
}
.tag-option:hover {
  background: #fafaf9;
}
.file-card-content {
  padding: 20px;
  flex: 1;
  cursor: pointer;
}
.file-title {
  font-size: 0.95em;
  font-weight: 500;
  color: #1a1815;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.file-subtitle {
  font-size: 0.8em;
  color: #6e645a;
  line-height: 1.4;
}
.file-card-body {
  padding: 12px 20px;
  background: #fafaf9;
  border-top: 1px solid #e8e4df;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}
.file-meta {
  display: flex;
  gap: 16px;
  font-size: 0.75em;
  color: #6e645a;
  align-items: center;
  line-height: 1;
}
.ownership-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.85em;
  font-weight: 600;
  letter-spacing: 0.3px;
  border: 1px solid;
}
.ownership-badge.mine {
  background: rgba(46, 125, 50, 0.08);
  color: #2e7d32;
  border-color: rgba(46, 125, 50, 0.2);
}
.ownership-badge.system {
  background: rgba(110, 100, 90, 0.08);
  color: #6e645a;
  border-color: rgba(110, 100, 90, 0.2);
}
.ownership-badge.shared {
  background: rgba(33, 150, 243, 0.08);
  color: #1976d2;
  border-color: rgba(33, 150, 243, 0.2);
}
.ownership-badge.imported {
  background: rgba(156, 39, 176, 0.08);
  color: #7b1fa2;
  border-color: rgba(156, 39, 176, 0.2);
}
.file-actions {
  position: relative;
}
.file-card-body .file-actions {
  display: block;
}
.dropdown-toggle {
  background: none;
  border: none;
  color: #6e645a;
  cursor: pointer;
  padding: 6px;
  font-size: 1.2em;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}
.dropdown-toggle:hover {
  background-color: #e8e4df;
  color: #1a1815;
}
.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border: 1px solid #d9d4cf;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 10;
  min-width: 140px;
  margin-top: 4px;
  display: none;
}
.dropdown-menu.show {
  display: block;
}
.dropdown-item {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 0.85em;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  transition: background 0.15s ease;
  border: none;
  border-bottom: 1px solid #e8e4df;
  color: #1a1815;
  background: none;
  width: 100%;
  text-align: left;
}
.dropdown-item:last-child {
  border-bottom: none;
}
.dropdown-item:hover {
  background: #fafaf9;
}
.dropdown-item.delete-item {
  color: #c93434;
}
.dropdown-item.delete-item:hover {
  background: #fef4f4;
}

/* Compliance Badge Styles */
.compliance-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: linear-gradient(135deg, #d4af37 0%, #f4d03f 100%);
  color: #1a1815;
  font-size: 0.7em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 3px;
  box-shadow: 0 2px 4px rgba(212, 175, 55, 0.3);
  border: 1px solid rgba(212, 175, 55, 0.4);
  cursor: help;
  transition: all 0.2s ease;
}

.compliance-badge:hover {
  background: linear-gradient(135deg, #f4d03f 0%, #d4af37 100%);
  box-shadow: 0 3px 8px rgba(212, 175, 55, 0.4);
  transform: translateY(-1px);
}

/* Compliance Frameworks Tags */
.compliance-frameworks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e8e4df;
}

.framework-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: #f5f3f0;
  color: #6e645a;
  font-size: 0.7em;
  font-weight: 600;
  border: 1px solid #d9d4cf;
  border-radius: 3px;
  letter-spacing: 0.2px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.framework-tag:hover {
  background: #e8e4df;
  border-color: #c9bfb3;
  color: #1a1815;
}

.framework-tag.more {
  background: #6e645a;
  color: white;
  border-color: #6e645a;
  cursor: help;
  font-weight: 700;
}

.framework-tag.more:hover {
  background: #1a1815;
  border-color: #1a1815;
}

/* List Layout Styles */
body.list-layout .file-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
@keyframes morphToList {
  from {
    opacity: 0.6;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
body.list-layout .file-card {
  flex-direction: row;
  align-items: stretch;
  animation: morphToList 0.3s ease-out;
}
body.list-layout .file-card-header {
  flex-direction: row;
  justify-content: center;
  align-items: center;
  width: 180px;
  border-bottom: none;
  border-right: 1px solid #e8e4df;
  gap: 8px;
  padding: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
body:not(.list-layout) .file-card {
  animation: morphToList 0.3s ease-out;
}
body.list-layout .file-card-icon-section {
  flex-direction: row;
  align-items: center;
  flex: 1;
}
body.list-layout .file-card-actions-group {
  flex-direction: row;
  gap: 0;
  order: -1;
}
body.list-layout .file-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
body.list-layout .file-card-body {
  width: 140px;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  border-top: none;
  border-left: 1px solid #e8e4df;
}
body.list-layout .file-card-body .file-actions {
  position: relative;
  top: auto;
  right: auto;
}
body.list-layout .file-meta {
  flex-direction: row;
  gap: 8px;
}

/* Mobile Styles */
/* Floating Action Button (FAB) - Hidden by default */
.fab {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  background: #1a1815;
  color: white;
  border: none;
  border-radius: 30px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  z-index: 1000;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.8) translateY(20px);
  pointer-events: none;
  overflow: hidden;
  white-space: nowrap;
  text-decoration: none;
  padding: 0;
  gap: 0;
}

.fab.visible {
  display: flex;
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

.fab:hover {
  background: #2d2925;
  width: auto;
  min-width: 180px;
  border-radius: 30px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  padding: 0 20px;
  gap: 10px;
}

.fab:active {
  transform: scale(0.98) translateY(0);
}

.fab svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fab:hover svg {
  transform: rotate(90deg);
}

.fab::after {
  content: 'Create Playbook';
  font-size: 14px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: -0.01em;
}

.fab:hover::after {
  opacity: 1;
  max-width: 200px;
  margin-left: 4px;
}

@media (max-width: 768px) {
  .layout-toggle-group {
    display: none;
  }

  .builder-btn {
    display: none;
  }

  .fab.visible {
    display: flex;
  }

  body {
    padding: 16px;
  }

  .header {
    margin-bottom: 24px;
    padding-bottom: 16px;
  }

  h1 {
    font-size: 1.5em;
  }

  .filter-section {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .search-bar {
    width: 100%;
  }
}
