body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f8f9fa;
  color: #3c4043;
  height: 100vh;
  min-width: 320px;
  overflow-x: hidden;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.app-layout {
  display: flex;
  height: 100%;
}

/* SIDEBAR */
.sidebar-light {
  width: 240px;
  background: #ffffff;
  border-right: 1px solid #dadce0;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-menu li {
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 500;
  color: #5f6368;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  border-right: 3px solid transparent;
}

.sidebar-menu li svg {
  color: #5f6368;
}

.sidebar-menu li:hover {
  background: #f1f3f4;
}

.sidebar-menu li.active {
  background: #e8f0fe;
  color: #1a73e8;
  border-right: 3px solid #1a73e8;
}

.sidebar-menu li.active svg {
  color: #1a73e8;
}

/* HEADER & BREADCRUMBS */
.workspace-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #f8f9fa;
}

.workspace-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 40px;
}

.workspace-header h1 {
  margin: 0;
  font-size: 22px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-link {
  font-weight: 700;
  color: #202124;
  text-decoration: none;
  transition: color 0.2s;
}

.brand-link:hover {
  color: #1a73e8;
}

.divider {
  color: #94a3b8;
  font-weight: 400;
}

.current-page {
  font-weight: 600;
  color: #5f6368;
}

/* BUTTONS */
.btn-primary {
  background: #1a73e8;
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
  background: #1557b0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.btn-secondary {
  background: transparent;
  color: #5f6368;
  border: 1px solid #dadce0;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: #f1f3f4;
  color: #202124;
}

/* GRID & CARDS */
.file-system-grid {
  padding: 0 40px 40px 40px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  overflow-y: auto;
  align-content: start;
}

.file-card {
  background: #ffffff;
  border: 1px solid #dadce0;
  border-radius: 8px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.file-card:hover {
  border-color: #1a73e8;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.file-card .icon-wrapper {
  margin-bottom: 16px;
}

.file-card h3 {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
  color: #202124;
}

.file-card .file-meta {
  font-size: 12px;
  font-weight: 400;
  color: #94a3b8;
  margin-top: auto;
}

/* MODAL STYLES */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(32, 33, 36, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-overlay.hidden {
  display: none;
}

.modal-content {
  background: #ffffff;
  border: 1px solid #dadce0;
  border-radius: 12px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 12px 24px rgba(0,0,0,0.15);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #dadce0;
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #202124;
}

.icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
}

.modal-body {
  padding: 24px;
}

.input-wrapper {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid #dadce0; 
  border-radius: 6px;
  padding: 8px 12px;
  gap: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrapper:focus-within {
  border-color: #1a73e8;
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.input-wrapper input {
  background: transparent;
  border: none;
  color: #202124;
  font-size: 15px;
  font-weight: 500;
  width: 100%;
  outline: none;
}

.input-wrapper input::selection {
  background: rgba(26, 115, 232, 0.2);
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-top: 1px solid #dadce0;
  background: #f8f9fa;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

.step-text {
  font-size: 13px;
  color: #94a3b8;
}

.modal-actions {
  display: flex;
  gap: 12px;
}

/* RESPONSIVE */
@media (max-width: 1024px) and (orientation: portrait), 
       (max-height: 600px) and (orientation: landscape) {
  .app-layout {
    flex-direction: column;
  }
  .sidebar-light {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #dadce0;
    padding: 12px 0;
  }
  .sidebar-menu {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    padding: 0 16px;
    -webkit-overflow-scrolling: touch;
  }
  .sidebar-menu li {
    border-right: none;
    border-bottom: 3px solid transparent;
  }
  .sidebar-menu li.active {
    border-right: none;
    border-bottom: 3px solid #1a73e8;
  }
  .workspace-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
    gap: 16px;
  }
  .file-system-grid {
    grid-template-columns: 1fr;
    padding: 0 20px 20px 20px;
  }
}
/* --- DRAFT SELECTION CHECKLIST IN MODAL --- */
.draft-selection-container {
  margin-top: 20px;
  border-top: 1px solid #dadce0;
  padding-top: 16px;
}

.draft-list {
  max-height: 140px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.draft-checkbox-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: #202124;
  cursor: pointer;
  padding: 4px 0;
}

.draft-checkbox-label input[type="checkbox"] {
  accent-color: #4A90E2;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* --- CLICKABLE BREADCRUMBS --- */
.breadcrumb-link {
  cursor: pointer;
  color: #5f6368;
  transition: color 0.2s;
}

.breadcrumb-link:hover {
  color: #1a73e8;
  text-decoration: underline;
}