:root {
  --bg: #0f0f0f;
  --bg-panel: #1a1a1a;
  --bg-input: #242424;
  --text-primary: #f5f5f5;
  --text-secondary: #a0a0a0;
  --text-tertiary: #666666;
  --border: #333333;
  --accent: #e8e8e8;
  --accent-hover: #ffffff;
  --danger: #ff4444;
  --success: #44ff88;
  --radius: 12px;
  --shadow: 0 8px 32px rgba(0,0,0,0.6);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
}

/* LOGIN SCREEN */
.login-screen {
  width: 100%;
  max-width: 420px;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.login-box {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px 40px;
  box-shadow: var(--shadow);
  width: 100%;
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
}

.login-logo svg { width: 36px; height: 36px; stroke: var(--accent); }
.login-logo span { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; }

.login-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 36px;
}

.login-form { display: flex; flex-direction: column; gap: 18px; }
.input-group { display: flex; flex-direction: column; gap: 6px; }
.input-group label {
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.input-group input {
  padding: 14px 16px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-input); color: var(--text-primary); font-size: 15px;
  font-family: inherit; transition: all 0.2s; outline: none;
}
.input-group input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232,232,232,0.08); }
.input-group input::placeholder { color: var(--text-tertiary); }

.login-btn {
  padding: 14px; border-radius: 8px; border: none; background: var(--accent);
  color: #000; font-size: 14px; font-weight: 700; cursor: pointer;
  transition: all 0.2s; margin-top: 8px; text-transform: uppercase; letter-spacing: 0.5px;
}
.login-btn:hover { background: var(--accent-hover); transform: translateY(-1px); }
.login-btn:active { transform: translateY(0); }

.login-error { color: var(--danger); font-size: 13px; text-align: center; min-height: 20px; margin-top: 4px; }

.login-hint {
  text-align: center; color: var(--text-tertiary); font-size: 11px;
  margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border);
}
.login-hint code {
  background: var(--bg-input); padding: 2px 6px; border-radius: 4px;
  font-family: 'SF Mono', Monaco, monospace; color: var(--accent);
}

/* APP */
.app-container { width: 100%; min-height: 100vh; display: flex; }

.sidebar-logout {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-bottom: 4px;
  text-decoration: none;
}
.sidebar-logout:hover { background: rgba(255,68,68,0.08); color: var(--danger); }

.app-layout { display: flex; min-height: 100vh; width: 100%; }
.sidebar {
  width: 220px; background: var(--bg-panel); border-right: 1px solid var(--border);
  padding: 20px 12px; display: flex; flex-direction: column; gap: 4px;
  position: fixed; height: 100vh; overflow-y: auto; z-index: 100;
}
.sidebar-logo {
  font-size: 16px; font-weight: 700; padding: 8px 10px 18px 10px;
  border-bottom: 1px solid var(--border); margin-bottom: 10px;
  display: flex; align-items: center; gap: 10px;
}
.sidebar-logo svg { width: 24px; height: 24px; stroke: var(--accent); }
.nav-section {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--text-tertiary); padding: 16px 10px 6px 10px; font-weight: 700;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); transition: all 0.15s;
  border: none; background: none; width: 100%; text-align: left;
}
.nav-item:hover { background: rgba(255,255,255,0.04); color: var(--text-primary); }
.nav-item.active { background: var(--accent); color: #000; }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.main-content { flex: 1; margin-left: 220px; padding: 28px 32px; max-width: calc(100% - 220px); }
.screen { display: none; animation: fadeIn 0.3s ease; }
.screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.screen-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.screen-title { font-size: 22px; font-weight: 700; margin: 0; }
.screen-actions { display: flex; gap: 10px; }
.btn {
  padding: 8px 16px; border-radius: 10px; font-size: 13px; font-weight: 600;
  cursor: pointer; border: 1px solid var(--border); background: var(--bg-panel);
  color: var(--text-primary); transition: all 0.15s; display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { background: rgba(255,255,255,0.06); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #000; border-color: var(--accent); }
.btn-primary:hover { opacity: 0.9; }
.btn-success { background: var(--success); color: #000; border-color: var(--success); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.card { background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card h4 {
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--text-tertiary); font-weight: 700; margin-bottom: 14px;
}
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.stat-label { font-size: 11px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 700; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.stat-change { font-size: 12px; font-weight: 600; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }
.content-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dashboard-preview-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 900px) { .dashboard-preview-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .dashboard-preview-grid { grid-template-columns: 1fr; } }
.dashboard-preview-card { background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; }
.dashboard-preview-header { text-align: center; font-size: 12px; font-weight: 700; margin-bottom: 8px; color: var(--text-secondary); }
.dashboard-preview-phone {
  background: var(--bg-panel); border: 2px solid var(--border); border-radius: 22px; padding: 10px;
  flex: 1; aspect-ratio: 9/18; display: flex; flex-direction: column; overflow: hidden;
}
.dashboard-preview-image { width: 100%; height: 42%; object-fit: cover; border-radius: 12px; display: block; flex-shrink: 0; }
.dashboard-preview-image-placeholder { width: 100%; height: 42%; border-radius: 12px; background: var(--bg-input); display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--text-tertiary); flex-shrink: 0; }
.dashboard-preview-caption { margin-top: 8px; font-size: 12px; line-height: 1.5; color: var(--text-primary); flex: 1; overflow-y: auto; padding: 4px; border-radius: 4px; outline: none; white-space: pre-wrap; }
.dashboard-preview-caption:focus { background: rgba(255,255,255,0.03); }
.dashboard-preview-buttons { display: flex; gap: 4px; margin-top: 8px; flex-shrink: 0; }
.dashboard-preview-btn-pill { flex: 1; text-align: center; font-size: 10px; padding: 7px 2px; border: 1px solid var(--border); border-radius: 8px; color: var(--text-secondary); }
.dashboard-preview-native-actions { display: flex; gap: 12px; margin-top: 8px; font-size: 14px; color: var(--text-tertiary); flex-shrink: 0; }
.content-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.posts-list { display: flex; flex-direction: column; gap: 10px; }
.post-item {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
  transition: all 0.15s; background: var(--bg-panel);
}
.post-item:hover { border-color: var(--accent); }
.post-thumb { width: 48px; height: 48px; border-radius: 8px; background: rgba(255,255,255,0.04); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 20px; }
.post-info { flex: 1; min-width: 0; }
.post-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-meta { font-size: 12px; color: var(--text-tertiary); margin-top: 3px; }
.post-status { font-size: 11px; padding: 4px 10px; border-radius: 6px; font-weight: 600; white-space: nowrap; }
.status-published { background: rgba(68,255,136,0.1); color: var(--success); }
.status-scheduled { background: rgba(232,232,232,0.08); color: var(--accent); }
.status-draft { background: rgba(255,255,255,0.04); color: var(--text-secondary); }
.status-review { background: rgba(255,200,0,0.08); color: #ffaa00; }
.generator-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.form-group input, .form-group select, .form-group textarea {
  padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; background: var(--bg-input); color: var(--text-primary); font-family: inherit; transition: border-color 0.15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--accent); }
.form-group textarea { min-height: 80px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.tag {
  padding: 5px 12px; border-radius: 8px; font-size: 12px; font-weight: 500;
  cursor: pointer; border: 1px solid var(--border); background: rgba(255,255,255,0.03); color: var(--text-secondary); transition: all 0.15s;
}
.tag:hover { border-color: var(--accent); color: var(--text-primary); }
.tag.active { background: var(--accent); color: #000; border-color: var(--accent); }
.preview-panel {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 20px;
  margin-top: 20px; background: rgba(255,255,255,0.02);
}
.preview-panel h4 { margin: 0 0 16px 0; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-tertiary); }
.preview-phone {
  width: 240px; margin: 0 auto; border: 2px solid var(--accent); border-radius: 24px;
  padding: 10px; background: var(--bg-panel); box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.preview-phone-screen { border-radius: 16px; overflow: hidden; border: 1px solid var(--border); min-height: 400px; position: relative; background: var(--bg); }
.phone-header { padding: 12px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; background: var(--bg-panel); }
.phone-avatar-small { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); opacity: 0.2; }
.phone-content { padding: 14px; }
.phone-video-placeholder {
  width: 100%; aspect-ratio: 9/16; background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.01) 100%);
  border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; position: relative; overflow: hidden;
}
.avatar-in-video { width: 90px; height: 90px; border-radius: 50%; background: var(--accent); opacity: 0.1; display: flex; align-items: center; justify-content: center; }
.caption-bar { position: absolute; bottom: 14px; left: 14px; right: 14px; padding: 10px 12px; background: rgba(0,0,0,0.8); border-radius: 8px; color: #fff; font-size: 12px; line-height: 1.5; }
.phone-caption { margin-top: 12px; font-size: 13px; line-height: 1.6; color: var(--text-secondary); }
.phone-actions { display: flex; gap: 14px; margin-top: 12px; font-size: 12px; color: var(--text-tertiary); }
.studio-layout { display: grid; grid-template-columns: 1fr 300px; gap: 20px; }
.studio-preview {
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; min-height: 360px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 20px;
}
.studio-avatar-large {
  width: 160px; height: 160px; border-radius: 50%; background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 100%);
  display: flex; align-items: center; justify-content: center; position: relative; border: 3px solid var(--border);
}
.studio-avatar-large svg { width: 120px; height: 120px; }
.recording-dot { position: absolute; bottom: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%; background: var(--danger); border: 4px solid var(--bg-panel); animation: pulse 1.5s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(0.9); } }
.studio-controls { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.studio-sidebar { display: flex; flex-direction: column; gap: 14px; }
.studio-panel { background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.studio-panel h4 { margin: 0 0 12px 0; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-tertiary); }
.script-text { font-size: 13px; line-height: 1.7; color: var(--text-secondary); padding: 12px; background: rgba(255,255,255,0.03); border-radius: 8px; max-height: 160px; overflow-y: auto; }
.timeline-track { display: flex; align-items: center; gap: 8px; padding: 10px; background: rgba(255,255,255,0.03); border-radius: 8px; margin-bottom: 8px; font-size: 12px; }
.track-bar { height: 8px; border-radius: 4px; background: var(--accent); opacity: 0.3; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.calendar-day-header { text-align: center; font-size: 11px; font-weight: 700; color: var(--text-tertiary); padding: 8px; text-transform: uppercase; }
.calendar-day { aspect-ratio: 1; border: 1px solid var(--border); border-radius: 10px; padding: 8px; font-size: 13px; position: relative; cursor: pointer; transition: all 0.15s; min-height: 72px; background: var(--bg-panel); }
.calendar-day:hover { border-color: var(--accent); }
.calendar-day .day-num { font-weight: 600; margin-bottom: 6px; }
.calendar-day .day-posts { display: flex; flex-direction: column; gap: 3px; }
.day-post-dot { height: 5px; border-radius: 3px; font-size: 0; }
.day-post-dot.telegram { background: var(--accent); }
.day-post-dot.vk { background: var(--success); }
.day-post-dot.dzen { background: #ffaa00; }
.day-post-dot.pending { background: transparent; border: 1px dashed var(--text-tertiary); }
.day-post-dot.failed { background: transparent; border: 1px dashed var(--danger); }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
}
.modal-box {
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius);
  max-width: 540px; width: 100%; max-height: 85vh; overflow-y: auto; box-shadow: var(--shadow);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 15px; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-tertiary); font-size: 20px; cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--text-primary); }
.modal-body { padding: 20px; }
.modal-body textarea { width: 100%; min-height: 160px; }
.calendar-day.today { border-color: var(--accent); background: rgba(255,255,255,0.02); box-shadow: 0 0 0 2px var(--accent); }
.calendar-legend { display: flex; gap: 20px; margin-top: 16px; justify-content: center; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; }
.chart-container { background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.chart-container h4 { margin: 0 0 16px 0; font-size: 14px; font-weight: 700; }
.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 160px; padding-bottom: 28px; position: relative; }
.bar-chart::after { content: ''; position: absolute; bottom: 28px; left: 0; right: 0; height: 1px; background: var(--border); }
.bar-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.bar-fill { width: 100%; border-radius: 5px 5px 0 0; min-height: 4px; transition: height 0.5s ease; }
.bar-label { font-size: 11px; color: var(--text-tertiary); font-weight: 600; }
.platform-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.platform-stat { background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; text-align: center; }
.platform-stat .plat-name { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.platform-stat .plat-metric { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.platform-stat .plat-label { font-size: 11px; color: var(--text-tertiary); margin-top: 4px; }
.avatar-settings-grid { display: grid; grid-template-columns: 280px 1fr; gap: 24px; }
.avatar-preview-large {
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.avatar-preview-large .avatar-svg-wrap {
  width: 180px; height: 180px; border-radius: 50%; background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 100%);
  display: flex; align-items: center; justify-content: center; border: 3px solid var(--border); position: relative;
}
.avatar-preview-large .avatar-svg-wrap svg { width: 140px; height: 140px; }
.avatar-mood-badge {
  position: absolute; bottom: 0; right: 0; background: var(--accent); color: #000;
  font-size: 11px; padding: 4px 10px; border-radius: 12px; font-weight: 600;
}
.avatar-config { display: flex; flex-direction: column; gap: 16px; }
.config-section { background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.config-section h4 { margin: 0 0 14px 0; font-size: 13px; font-weight: 700; }
.config-option { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.config-option:last-child { border-bottom: none; }
.config-option select, .config-option input[type="range"] { width: 160px; }
.config-option input[type="range"] { -webkit-appearance: none; height: 5px; border-radius: 3px; background: var(--border); outline: none; }
.config-option input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); cursor: pointer; }
.mood-options { display: flex; gap: 10px; flex-wrap: wrap; }
.mood-btn {
  padding: 8px 16px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-panel); cursor: pointer; font-size: 13px; font-weight: 500; transition: all 0.15s; color: var(--text-secondary);
}
.mood-btn:hover { border-color: var(--accent); color: var(--text-primary); }
.mood-btn.active { background: var(--accent); color: #000; border-color: var(--accent); }
.compliance-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.compliance-input { background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.gen-image-slot { position: relative; transition: box-shadow 0.15s ease; border-radius: var(--radius); }
.gen-image-slot.selected { box-shadow: 0 0 0 2px var(--success); }
.gen-image-slot.selected::before {
  content: "✓ Выбрано"; position: absolute; top: 14px; right: 14px; z-index: 1;
  font-size: 11px; font-weight: 700; color: #000; background: var(--success);
  padding: 2px 6px; border-radius: 4px;
}
.media-item { transition: box-shadow 0.15s ease; }
.media-item.selected { box-shadow: 0 0 0 2px var(--success); }
.media-item.selected::after {
  content: "✓"; position: absolute; top: 4px; left: 4px; z-index: 1;
  width: 16px; height: 16px; border-radius: 50%; font-size: 10px; font-weight: 700;
  color: #000; background: var(--success); display: flex; align-items: center; justify-content: center;
}

.compliance-input h4 { margin: 0 0 14px 0; font-size: 14px; font-weight: 700; }
.compliance-input textarea {
  width: 100%; min-height: 280px; padding: 14px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; line-height: 1.7; font-family: inherit; resize: vertical; background: var(--bg-input); color: var(--text-primary);
}
.compliance-input textarea:focus { outline: none; border-color: var(--accent); }
.compliance-result { background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.compliance-result h4 { margin: 0 0 14px 0; font-size: 14px; font-weight: 700; }
.compliance-score { display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: 10px; margin-bottom: 16px; }
.compliance-score.pass { background: rgba(68,255,136,0.08); }
.compliance-score.warn { background: rgba(255,200,0,0.08); }
.compliance-score.fail { background: rgba(255,68,68,0.08); }
.score-circle { width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; flex-shrink: 0; color: #fff; }
.score-circle.pass { background: var(--success); }
.score-circle.warn { background: #ffaa00; }
.score-circle.fail { background: var(--danger); }
.score-info h5 { font-size: 16px; margin-bottom: 4px; }
.score-info p { font-size: 13px; color: var(--text-secondary); margin: 0; }
.check-list { display: flex; flex-direction: column; gap: 10px; }
.check-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border-radius: 10px; background: rgba(255,255,255,0.02); }
.check-icon { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; margin-top: 2px; }
.check-icon.ok { background: rgba(68,255,136,0.1); color: var(--success); }
.check-icon.warn { background: rgba(255,200,0,0.1); color: #ffaa00; }
.check-icon.fail { background: rgba(255,68,68,0.1); color: var(--danger); }
.check-text h5 { font-size: 13px; margin-bottom: 3px; }
.check-text p { font-size: 12px; color: var(--text-secondary); margin: 0; line-height: 1.5; }
.integrations-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.integration-card { background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; transition: all 0.2s; }
.integration-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.integration-card.connected { border-color: var(--success); }
.integration-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.integration-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 22px; background: rgba(255,255,255,0.04); }
.integration-title { font-size: 14px; font-weight: 700; }
.integration-title .status { display: block; font-size: 11px; font-weight: 500; color: var(--text-tertiary); margin-top: 2px; }
.integration-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.integration-stat { text-align: center; padding: 10px; background: rgba(255,255,255,0.02); border-radius: 8px; }
.integration-stat .val { font-size: 16px; font-weight: 700; }
.integration-stat .lbl { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }
.integration-actions { display: flex; gap: 8px; }
.integration-actions .btn { flex: 1; justify-content: center; }

@media (max-width: 900px) {
  .sidebar { width: 64px; padding: 16px 8px; }
  .sidebar-logo span, .nav-section, .nav-item span { display: none; }
  .sidebar-logo { justify-content: center; padding: 8px 0 16px 0; }
  .nav-item { justify-content: center; padding: 12px; }
  .main-content { margin-left: 64px; max-width: calc(100% - 64px); padding: 20px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .content-grid, .content-grid-3, .compliance-layout, .integrations-grid, .avatar-settings-grid, .studio-layout { grid-template-columns: 1fr; }
  .platform-stats { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .login-box { padding: 32px 24px; }
}
@media (max-width: 600px) { .stats-row { grid-template-columns: 1fr; } }

/* MOBILE PHONE (<=640px): sidebar becomes an off-canvas drawer instead of
   the icon-only compact mode used for tablets — icon-only with no labels
   is unusable for a first-time touch user who doesn't know the icons yet. */
.mobile-topbar { display: none; }
.mobile-nav-overlay { display: none; }

@media (max-width: 640px) {
  .mobile-topbar {
    display: flex; align-items: center; gap: 14px;
    position: fixed; top: 0; left: 0; right: 0; height: 56px;
    background: var(--bg-panel); border-bottom: 1px solid var(--border);
    padding: 0 16px; z-index: 200;
  }
  .mobile-menu-btn {
    background: none; border: none; color: var(--text-primary); padding: 6px;
    display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
  }
  .mobile-menu-btn svg { width: 24px; height: 24px; }
  .mobile-topbar-title { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .sidebar {
    width: 78vw; max-width: 280px; padding: 20px 14px;
    transform: translateX(-100%); transition: transform 0.25s ease; z-index: 300;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-logo span, .nav-section, .nav-item span { display: block; }
  .sidebar-logo { justify-content: flex-start; }
  .nav-item { justify-content: flex-start; padding: 12px; }

  .mobile-nav-overlay.open {
    display: block; position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 250;
  }

  .main-content { margin-left: 0; max-width: 100%; padding: 72px 14px 24px 14px; }

  .screen-header { flex-direction: column; align-items: stretch; gap: 10px; }
  .screen-actions { flex-wrap: wrap; }
  .screen-title { font-size: 19px; }

  .calendar-grid, .calendar-week-grid { gap: 4px; }
  .calendar-day { min-height: 52px; padding: 5px; font-size: 11px; }
  .calendar-day .day-num { margin-bottom: 3px; }
  .calendar-legend { flex-wrap: wrap; gap: 10px 16px; }

  .modal-box { max-height: 90vh; }
  .modal-body { padding: 14px; }
  .modal-header { padding: 14px 16px; }

  .card, .studio-panel, .config-section, .compliance-input, .compliance-result, .stat-card, .integration-card, .platform-stat { padding: 14px; }
  .login-box { padding: 28px 20px; }

  table { display: block; overflow-x: auto; white-space: nowrap; }
}
