/* Google Sheets-like UI Styles */
:root {
  --sheet-green: #0f9d58;
  --sheet-green-dark: #0b8043;
  --sheet-grid-border: #e0e0e0;
  --sheet-header-bg: #f8f9fa;
  --sheet-selected-cell: #e8f0fe;
  --sheet-selected-border: #1a73e8;
}

body.sheets-mode {
  background-color: #f8f9fa;
  margin: 0;
  padding: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Sheets Top Navbar */
.sheets-navbar {
  background: white;
  border-bottom: 1px solid #e0e0e0;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sheets-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sheets-icon {
  width: 36px;
  height: 36px;
  background-color: var(--sheet-green);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  font-weight: bold;
}

.sheets-doc-name {
  font-size: 17px;
  font-weight: 600;
  color: #202124;
}

.sheets-tag {
  background: #e6f4ea;
  color: #137333;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

/* Toolbar */
.sheets-toolbar {
  background: white;
  border-bottom: 1px solid #e0e0e0;
  padding: 6px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid #dadce0;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  color: #3c4043;
  cursor: pointer;
  transition: all 0.15s;
}

.tool-btn:hover {
  background: #f1f3f4;
  border-color: #bdc1c6;
}

.tool-btn.primary {
  background: var(--sheet-green);
  color: white;
  border-color: var(--sheet-green-dark);
}

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

.tool-divider {
  width: 1px;
  height: 24px;
  background: #dadce0;
  margin: 0 4px;
}

.filter-select {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #dadce0;
  font-size: 13px;
  background: white;
}

.search-input {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #dadce0;
  font-size: 13px;
  min-width: 220px;
}

/* Stat Bar */
.stat-bar {
  display: flex;
  gap: 16px;
  padding: 8px 16px;
  background: #f1f3f4;
  border-bottom: 1px solid #e0e0e0;
  font-size: 13px;
  font-weight: 500;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-badge {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
}

.badge-all { background: #e8eaed; color: #3c4043; }
.badge-done { background: #e6f4ea; color: #137333; }
.badge-draft { background: #fef7e0; color: #b06000; }
.badge-pending { background: #fce8e6; color: #c5221f; }

/* Grid Table Container */
.grid-container {
  flex: 1;
  overflow: auto;
  position: relative;
  background: white;
}

.sheets-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: auto;
  white-space: nowrap;
}

.sheets-table th,
.sheets-table td {
  border: 1px solid var(--sheet-grid-border);
  padding: 8px 12px;
  text-align: left;
}

.sheets-table th {
  background: var(--sheet-header-bg);
  color: #5f6368;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 10;
  user-select: none;
}

.sheets-table th.col-letter {
  text-align: center;
  font-size: 11px;
  color: #80868b;
  width: 40px;
  background: #eaedf0;
}

.sheets-table td.row-num {
  background: var(--sheet-header-bg);
  text-align: center;
  font-size: 11px;
  color: #80868b;
  position: sticky;
  left: 0;
  z-index: 5;
  width: 40px;
}

.sheets-table tr:hover td {
  background-color: #f8fbff;
}

/* Editable Cell */
.sheets-table td.editable {
  cursor: cell;
  position: relative;
}

.sheets-table td.editable:focus {
  outline: 2px solid var(--sheet-selected-border);
  background-color: #fff;
  z-index: 2;
}

/* Status Pill */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.status-completed {
  background: #e6f4ea;
  color: #137333;
}

.status-draft {
  background: #fef7e0;
  color: #b06000;
}

.status-pending {
  background: #f1f3f4;
  color: #5f6368;
}

/* Action Cell */
.action-btn-group {
  display: flex;
  gap: 6px;
}

.btn-sm {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 4px;
}

/* Modal for Detail View */
.detail-modal-content {
  max-width: 900px;
  width: 95%;
}

.step-tabs {
  display: flex;
  border-bottom: 2px solid #e0e0e0;
  margin-bottom: 16px;
  overflow-x: auto;
}

.step-tab {
  padding: 10px 18px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: #5f6368;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.step-tab.active {
  color: var(--sheet-green);
  border-bottom-color: var(--sheet-green);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  background: #f8f9fa;
  padding: 16px;
  border-radius: 8px;
}

.detail-item {
  font-size: 13px;
}

.detail-label {
  font-weight: 600;
  color: #5f6368;
  margin-bottom: 2px;
}

.detail-value {
  font-weight: 500;
  color: #202124;
}

