:root {
  --bg: #f9f8f5;            /* Warm Off-White / Natural Ivory */
  --panel: #ffffff;         /* Pure Clean White for Cards */
  --panel-2: #f2efe9;       /* Light Warm Beige for Accents/Borders */
  --border: #e3ded5;        /* Soft Organic Beige Border */
  --text: #202421;          /* Deep Elegant Charcoal */
  --muted: #6e7870;         /* Muted Earthy Green-Gray */
  --accent: #22c55e;        /* Crisp Energetic Parrot Green */
  --accent-light: #ecfdf3;  /* Very Soft Parrot Green Wash */
  --accent-hover: #16a34a;  /* Deep Leaf Green */
  --danger: #ef4444;        /* Soft Coral Red */
  --ok: #15803d;            /* Natural Forest Green */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(34, 197, 94, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }

/* === LOGIN SCREEN === */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at top, #f2efe9 0%, #f9f8f5 100%);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 36px 32px;
  text-align: center;
  box-shadow: var(--shadow-md);
}
.login-card h1 { 
  margin: 14px 0 6px; 
  font-size: 24px; 
  font-weight: 800; 
  letter-spacing: -0.02em; 
  color: var(--text);
}
.muted { color: var(--muted); font-size: 13px; margin-bottom: 20px; line-height: 1.5; }
.brand-badge {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent-hover);
  border: 1px solid rgba(34, 197, 94, 0.3);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

/* === BUTTONS & INPUTS === */
.btn {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.btn:hover {
  background: #e8e3d8;
  border-color: #d1c9bd;
}
.btn.primary {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.28);
}
.btn.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.btn.ghost:hover {
  color: var(--danger);
  background: #fef2f2;
}
.btn.full { width: 100%; }

input[type="password"], input[type="text"] {
  width: 100%;
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  margin-bottom: 14px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

/* === MAIN APP SHELL === */
.app-shell {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 270px;
  background: #f4f1ea;
  border-right: 1px solid var(--border);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex-shrink: 0;
}
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
.section-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.08em;
  margin: 6px 0 2px;
}

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.nav-tab {
  background: transparent;
  color: var(--text);
  border: 1px solid transparent;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.18s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-tab:hover {
  background: rgba(34, 197, 94, 0.08);
  color: var(--accent-hover);
}
.nav-tab.active {
  background: var(--panel);
  color: var(--accent-hover);
  border-color: var(--border);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.drive-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 220px;
  overflow-y: auto;
}
.drive-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: all 0.15s ease;
}
.drive-btn:hover {
  background: rgba(0, 0, 0, 0.03);
}
.drive-btn.active {
  background: var(--panel);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.drive-name { font-size: 13px; font-weight: 600; color: var(--text); }
.drive-email { font-size: 11px; color: var(--muted); }

.vm-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: auto;
}

/* === MAIN WORK AREA === */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow-y: auto;
}
.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}
.breadcrumbs {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.crumb {
  color: var(--muted);
  cursor: pointer;
}
.crumb:hover { color: var(--accent-hover); text-decoration: underline; }
.actions { display: flex; gap: 8px; }

.status-banner {
  background: var(--accent-light);
  color: var(--accent-hover);
  border-bottom: 1px solid rgba(34, 197, 94, 0.25);
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 600;
}

/* Table */
.file-table-wrap {
  padding: 20px 24px;
}
.file-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.file-table th {
  background: #f4f1ea;
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.file-table td {
  padding: 12px 16px;
  font-size: 13px;
  border-bottom: 1px solid #f2efe9;
}
.file-table tr:hover td {
  background: #faf8f5;
}
.file-table th.right, .file-table td.right { text-align: right; }
.item-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}
.item-link:hover { color: var(--accent-hover); }

/* === YOUTUBE ANALYZER TAB === */
.yt-container {
  padding: 28px;
  max-width: 860px;
  margin: 0 auto;
}
.yt-search-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.yt-search-box h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}
.search-input-group {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.search-input-group input {
  margin-bottom: 0;
}
.yt-loading {
  text-align: center;
  padding: 30px;
  color: var(--accent-hover);
  font-weight: 700;
}
.yt-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--shadow-md);
}
.yt-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.yt-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  object-fit: cover;
  background: var(--panel-2);
}
.yt-meta h3 {
  font-size: 19px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text);
}
.yt-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.badge {
  background: #f2efe9;
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.badge.highlight {
  background: var(--accent-light);
  border-color: rgba(34, 197, 94, 0.4);
  color: var(--accent-hover);
  font-weight: 800;
}
.yt-desc-box {
  background: #fbf9f6;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin: 10px 0 20px;
  max-height: 120px;
  overflow-y: auto;
}
.yt-checklist {
  list-style: none;
  margin-top: 10px;
}
.yt-checklist li {
  padding: 10px 14px;
  background: #fbf9f6;
  border: 1px solid #ede8e0;
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 500;
}
.yt-checklist li::before {
  content: "✔";
  color: var(--accent);
  font-weight: 800;
}

/* === GRIDS (CLIENTS & TOOLS) === */
.clients-grid, .tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding: 24px;
}
.client-card, .tool-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.client-card:hover, .tool-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}
.client-badge {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-hover);
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.client-card h3, .tool-card h3 {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--text);
}
.client-details {
  background: #fbf9f6;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin: 14px 0;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.status-live {
  color: var(--accent-hover);
  font-weight: 700;
}
.tool-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(32, 36, 33, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.modal-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  max-width: 700px;
  width: 100%;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.modal-head {
  padding: 16px 20px;
  background: #f4f1ea;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
}
.modal-body {
  padding: 20px;
  max-height: 70vh;
  overflow-y: auto;
}
