/* Design tokens + base resets now live in css/brand.css (linked before this file). */
body {
  font-family: var(--font);
  background: #eef0f2;
  color: var(--gray-90);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  margin: 0;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
/* Re-enable text selection for content users need to copy */
input, textarea, select, code, pre, .selectable, .result-box, .tracking-item, .result-table {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

.app-shell {
  max-width: 1400px;
  margin: 16px auto;
  background: var(--white);
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  border-radius: 10px;
  overflow: hidden;
}

/* Gradient Header */
.app-header {
  background: linear-gradient(90deg, var(--purple) 0%, #671CAA 40%, #B83F6A 75%, var(--orange) 100%);
  padding: 18px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.app-header .tag {
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  margin-bottom: 4px;
  font-weight: 600;
}
.app-header h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1.2;
  margin: 0;
}
.app-header .subtitle {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.85);
  margin-top: 4px;
}
.app-header .user-area {
  color: rgba(255,255,255,0.9);
  font-size: 0.9rem;
}
.app-header .user-area .logout-link {
  margin-left: 16px;
  color: rgba(255,255,255,0.85);
  font-size: 0.8rem;
  text-decoration: none;
  white-space: nowrap;
}
.app-header .user-area .logout-link:hover { text-decoration: underline; }
.app-header .status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--green);
  border-radius: 50%;
  margin-right: 6px;
}

/* Layout */
.app-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 600px;
}

/* Sidebar */
.sidebar {
  background: var(--gray-10);
  border-right: 1px solid var(--gray-30);
  padding: 20px 0;
}
.sidebar .nav-label {
  font-size: 0.7rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gray-50);
  padding: 0 20px 8px;
  font-weight: 700;
}
.sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--gray-80);
  text-decoration: none;
  font-size: 0.95rem;
  border-left: 3px solid transparent;
  transition: all 0.1s;
}
.sidebar .nav-item:hover {
  background: var(--white);
  color: var(--purple);
}
.sidebar .nav-item.active {
  background: var(--white);
  color: var(--purple);
  border-left-color: var(--orange);
  font-weight: 600;
}
.sidebar .nav-item .icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  font-size: 0.8rem;
}
.sidebar .nav-section {
  margin-bottom: 18px;
}

/* Content */
.content {
  padding: 28px 36px 40px;
}
.section {
  margin-bottom: 24px;
  border-bottom: 1px solid var(--gray-30);
  padding-bottom: 18px;
}
.section:last-child { border-bottom: none; margin-bottom: 0; }
.section h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--purple);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section h2::before {
  content: '';
  width: 4px; height: 18px;
  background: var(--orange);
  display: inline-block;
  flex-shrink: 0;
}
.section h3 {
  font-size: 1.0rem;
  font-weight: 600;
  color: var(--gray-90);
  margin: 14px 0 8px;
}
.section p { font-size: 0.95rem; color: var(--gray-80); margin-bottom: 8px; }
.section strong { color: var(--gray-90); }
.section code {
  background: var(--gray-10);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.88em;
  color: var(--blue);
}

/* Tool Cards */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin: 16px 0;
}
.tool-card {
  background: var(--white);
  border: 1px solid var(--gray-30);
  border-radius: 8px;
  padding: 18px;
  transition: all 0.15s;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  color: inherit;
}
.tool-card:hover {
  border-color: var(--purple);
  box-shadow: 0 4px 12px rgba(77,20,140,0.1);
  transform: translateY(-2px);
}
.tool-card .badge {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 10px;
  font-weight: 600;
}
.tool-card .badge.active { background: #e6f4e6; color: var(--green); }
.tool-card .badge.planned { background: #fff7f0; color: var(--orange); }
.tool-card h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  color: var(--purple);
  font-weight: 700;
}
.tool-card .tool-subtitle {
  display: block;
  margin: 0 0 8px;
  font-size: 0.72rem;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--orange);
  font-weight: 600;
}
.tool-card p {
  margin: 0 0 12px;
  font-size: 0.88rem;
  color: var(--gray-80);
  line-height: 1.45;
}
.tool-card .open-btn {
  display: inline-block;
  padding: 6px 14px;
  background: var(--blue);
  color: var(--white);
  border-radius: 5px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: auto;
  align-self: flex-start;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin: 12px 0;
}
thead { background: var(--gray-90); color: var(--white); }
th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}
td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--gray-30);
  vertical-align: top;
}
tr:nth-child(even) { background: var(--gray-10); }

/* Footer */
.page-footer {
  background: var(--gray-10);
  border-top: 2px solid var(--gray-30);
  padding: 10px 32px;
  font-size: 0.72rem;
  color: var(--gray-50);
  display: flex;
  justify-content: space-between;
}

/* Responsive */
@media (max-width: 900px) {
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { border-right: none; border-bottom: 1px solid var(--gray-30); }
  .content { padding: 20px 20px 30px; }
}
