/* ARGUS Social Admin UI — Dark Theme */
:root {
  --bg-primary: #0f0f1a;
  --bg-secondary: #1a1a2e;
  --bg-tertiary: #16213e;
  --bg-card: #1e1e3f;
  --text-primary: #e0e0ff;
  --text-secondary: #a0a0cc;
  --text-muted: #6a6a99;
  --accent: #7c3aed;
  --accent-hover: #8b5cf6;
  --accent-light: #a78bfa;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --border: #2d2d5a;
  --border-light: #3d3d6a;
  --shadow: 0 4px 20px rgba(0,0,0,0.4);
  --radius: 8px;
  --radius-lg: 12px;
  --transition: all 0.2s ease;
}

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

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

/* Loading state */
.loading-overlay {
  position: fixed; inset: 0; background: var(--bg-primary);
  display: flex; align-items: center; justify-content: center; z-index: 9999;
}
.loading-spinner {
  width: 48px; height: 48px; border: 3px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* FIX: Inline loading styles externalized */
.loading-inline {
  position: relative;
  min-height: 200px;
}

/* Login page */
.login-container {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.login-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 40px; width: 100%; max-width: 420px;
  box-shadow: var(--shadow);
}
.login-logo {
  text-align: center; margin-bottom: 32px;
}
.login-logo h1 {
  font-size: 28px; font-weight: 700; color: var(--text-primary);
  letter-spacing: -0.5px;
}
.login-logo p {
  color: var(--text-secondary); font-size: 14px; margin-top: 4px;
}
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px;
}
.form-input {
  width: 100%; padding: 12px 14px; background: var(--bg-secondary);
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-primary); font-size: 15px; transition: var(--transition);
}
.form-input:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}
.form-input::placeholder { color: var(--text-muted); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border: none; border-radius: var(--radius);
  font-size: 14px; font-weight: 600; cursor: pointer; transition: var(--transition);
  text-decoration: none;
}
.btn-primary {
  background: var(--accent); color: #fff; width: 100%;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-info { background: var(--info, #3b82f6); color: #fff; }
.btn-info:hover { background: #2563eb; }
.btn-outline {
  background: transparent; border: 1px solid var(--border); color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent-light); }

.error-message {
  background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3);
  color: var(--danger); padding: 12px 14px; border-radius: var(--radius);
  font-size: 13px; margin-bottom: 16px; display: none;
}
.error-message.visible { display: block; }

/* FIX: Error spacing class replaces inline style */
.error-spaced {
  margin-bottom: 16px;
}

/* Dashboard layout — shared across all pages */
.dashboard, .page-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; background: var(--bg-secondary); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: fixed; height: 100vh; z-index: 100;
  top: 0; left: 0;
}
/* Mobile: sidebar collapses to hamburger */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0 !important; padding: 16px !important; }
  .mobile-menu-toggle {
    display: block !important;
    position: fixed; top: 16px; left: 16px; z-index: 101;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 10px 12px;
    color: var(--text-primary); font-size: 18px; cursor: pointer;
  }
}
@media (min-width: 769px) {
  .mobile-menu-toggle { display: none !important; }
}
.sidebar-header {
  padding: 20px; border-bottom: 1px solid var(--border);
}
.sidebar-header h2 { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.sidebar-header p { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.sidebar-nav { flex: 1; padding: 12px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border-radius: var(--radius); color: var(--text-secondary);
  font-size: 14px; cursor: pointer; transition: var(--transition); border: none; background: none; width: 100%; text-align: left;
  text-decoration: none;
}
.nav-item:hover { background: var(--bg-tertiary); color: var(--text-primary); text-decoration: none; }
.nav-item.active { background: var(--accent); color: #fff; }
.nav-item .icon { width: 20px; text-align: center; font-size: 16px; }

/* FIX #2: Sidebar footer layout */
.sidebar-footer {
  padding: 16px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.user-info {
  display: flex; align-items: center; gap: 10px;
  flex: 1; min-width: 0;
}
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; color: #fff;
  flex-shrink: 0;
}
.user-details { min-width: 0; }
.user-name {
  font-size: 13px; font-weight: 600; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-role {
  font-size: 11px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.logout-btn {
  background: transparent; border: 1px solid var(--border); color: var(--text-secondary);
  padding: 8px; border-radius: var(--radius); cursor: pointer; font-size: 16px;
  transition: var(--transition); flex-shrink: 0;
}
.logout-btn:hover {
  border-color: var(--danger); color: var(--danger);
}

.main-content {
  flex: 1; margin-left: 240px; padding: 24px 32px;
  min-height: 100vh;
}
/* Standalone pages use same layout */
body > .main-content {
  margin-left: 240px;
}
.page-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px;
}
.page-header h1 { font-size: 24px; font-weight: 700; }
.page-header p { color: var(--text-secondary); font-size: 14px; }

/* Cards */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px; margin-bottom: 20px;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px;
}
.card-header h3 { font-size: 16px; font-weight: 600; }
.card-header p { font-size: 13px; color: var(--text-muted); }

/* Stats grid */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
}
.stat-card .stat-value {
  font-size: 28px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px;
}
.stat-card .stat-label {
  font-size: 13px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px;
}
.stat-card .stat-change {
  font-size: 12px; margin-top: 8px; font-weight: 500;
}
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* FIX #1: Platform list with actions container */
.platform-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px;
}
.platform-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px; display: flex; align-items: center; gap: 16px;
  flex-wrap: wrap;
}
.platform-icon {
  width: 48px; height: 48px; border-radius: var(--radius); background: var(--bg-tertiary);
  display: flex; align-items: center; justify-content: center; font-size: 24px;
  flex-shrink: 0;
}
.platform-info { flex: 1; min-width: 120px; }
.platform-info h4 { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.platform-info p { font-size: 12px; color: var(--text-muted); }

/* FIX #1: Platform actions container prevents overlap */
.platform-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  margin-left: auto;
}

.platform-status {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border-radius: 20px; font-size: 12px; font-weight: 500;
  white-space: nowrap;
}
.status-connected { background: rgba(16,185,129,0.15); color: var(--success); }
.status-disconnected { background: rgba(239,68,68,0.15); color: var(--danger); }
.status-dot {
  width: 6px; height: 6px; border-radius: 50%; display: inline-block;
}
.status-connected .status-dot { background: var(--success); }
.status-disconnected .status-dot { background: var(--danger); }

/* Empty state */
.empty-state {
  text-align: center; padding: 60px 20px;
}
.empty-state .icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.empty-state p { color: var(--text-secondary); font-size: 14px; max-width: 400px; margin: 0 auto 20px; }

/* Table */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; padding: 12px 16px; font-size: 12px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 14px 16px; font-size: 14px; border-bottom: 1px solid var(--border-light);
}
.data-table tr:hover td { background: var(--bg-tertiary); }

/* Toast */
.toast-container {
  position: fixed; top: 20px; right: 20px; z-index: 1000;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  padding: 14px 18px; border-radius: var(--radius); font-size: 14px;
  box-shadow: var(--shadow); animation: slideIn 0.3s ease;
  max-width: 400px;
}
.toast.success { background: var(--bg-card); border-left: 4px solid var(--success); }
.toast.error { background: var(--bg-card); border-left: 4px solid var(--danger); }
.toast.info { background: var(--bg-card); border-left: 4px solid var(--info); }
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Posts page */
.posts-list { display: flex; flex-direction: column; gap: 16px; }
.post-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.post-card .post-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.status-badge {
  padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.status-badge.draft { background: var(--bg-tertiary); color: var(--text-muted); }
.status-badge.scheduled { background: #1e3a5f; color: #60a5fa; }
.status-badge.published { background: #064e3b; color: #34d399; }
.status-badge.failed { background: #450a0a; color: #f87171; }
.post-card .post-content { margin-bottom: 12px; line-height: 1.6; }
.post-card .post-meta {
  display: flex; gap: 16px; font-size: 13px; color: var(--text-muted);
}

/* Calendar */
.calendar-grid { margin-top: 20px; }
.calendar-header {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 8px; margin-bottom: 8px;
}
.day-header { text-align: center; font-size: 12px; color: var(--text-muted); padding: 8px; }
.calendar-days {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.day {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); min-height: 100px; padding: 8px;
}
.day.empty { background: transparent; border: none; }
.day-number { font-size: 14px; font-weight: 600; }
.day .event {
  font-size: 11px; padding: 2px 6px; border-radius: 4px;
  margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.day .event.scheduled { background: #1e3a5f; color: #60a5fa; }
.day .event.published { background: #064e3b; color: #34d399; }

/* Upcoming posts */
.upcoming-posts { margin-top: 40px; }
.upcoming-posts h2 { font-size: 18px; margin-bottom: 16px; }
.upcoming-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
}
.upcoming-item .upcoming-time { font-size: 13px; color: var(--text-muted); }
.upcoming-item .upcoming-platforms { font-size: 12px; color: var(--accent-light); margin-left: 12px; }

/* Analytics */
.metrics-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
  margin: 24px 0;
}
.metric-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; text-align: center;
}
.metric-card h3 { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.metric-value { font-size: 36px; font-weight: 700; color: var(--accent-light); }
.chart-section { margin-top: 40px; }
.chart-section h2 { font-size: 18px; margin-bottom: 20px; }
.bar-chart {
  display: flex; align-items: flex-end; gap: 12px;
  height: 200px; padding: 20px 0;
}
.bar-wrapper { flex: 1; display: flex; flex-direction: column; align-items: center; }
.bar {
  width: 100%; background: var(--accent);
  border-radius: 4px 4px 0 0; min-height: 4px;
}
.bar-label { font-size: 11px; color: var(--text-muted); margin-top: 8px; }

/* Composer */
.composer-form { max-width: 600px; }
.form-group { margin-bottom: 24px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.form-group textarea, .form-group input[type="datetime-local"] {
  width: 100%; padding: 12px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-primary); font-size: 14px;
}
.form-group textarea:focus { outline: none; border-color: var(--accent); }
.char-count { text-align: right; font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.char-count.warning { color: var(--danger); }
.platform-selector { display: flex; gap: 16px; flex-wrap: wrap; }
.platform-selector label {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer;
}
.platform-selector label:hover { border-color: var(--accent); }
.form-actions { display: flex; gap: 12px; }
.preview-panel {
  margin-top: 40px; padding: 24px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.preview-panel h2 { font-size: 16px; margin-bottom: 16px; }
.preview-post { padding: 16px; background: var(--bg-primary); border-radius: var(--radius); }
.preview-post p { margin-bottom: 12px; line-height: 1.6; }
.preview-meta { font-size: 12px; color: var(--text-muted); display: flex; justify-content: space-between; }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { width: 100%; position: relative; height: auto; }
  .main-content { margin-left: 0; }
  .dashboard { flex-direction: column; }
  .platform-grid { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Platform Keys / Brand Mail pages */
.platforms-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 1.5rem;
}
.platforms-grid .platform-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem;
}
.platforms-grid .platform-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem;
}
.platforms-grid .platform-name {
  display: flex; align-items: center; gap: 0.75rem;
  font-size: 1.25rem; font-weight: 600;
}
.platforms-grid .platform-icon { font-size: 1.5rem; }
.platforms-grid .status-badge {
  padding: 0.25rem 0.75rem; border-radius: 9999px;
  font-size: 0.75rem; font-weight: 600;
}
.platforms-grid .status-configured {
  background: rgba(16,185,129,0.15); color: var(--success); border: 1px solid rgba(16,185,129,0.25);
}
.platforms-grid .status-missing {
  background: rgba(239,68,68,0.15); color: var(--danger); border: 1px solid rgba(239,68,68,0.25);
}
.platforms-grid .form-group {
  margin-bottom: 1rem;
}
.platforms-grid .form-group label {
  display: block; font-size: 0.875rem; color: var(--text-muted); margin-bottom: 0.25rem;
}
.platforms-grid .form-group input {
  width: 100%; padding: 0.75rem; background: var(--bg-primary);
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-primary); font-size: 0.875rem; font-family: monospace;
}
.platforms-grid .form-group input:focus {
  outline: none; border-color: var(--accent);
}
.platforms-grid .input-hint {
  font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem;
}
.platforms-grid .toggle-container {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 0; border-top: 1px solid var(--border); margin-top: 0.5rem;
}
.platforms-grid .toggle-label { font-size: 0.875rem; color: var(--text-muted); }
.platforms-grid .toggle {
  position: relative; width: 48px; height: 24px;
  background: #333; border-radius: 12px; cursor: pointer; transition: background 0.2s;
}
.platforms-grid .toggle.active { background: var(--success); }
.platforms-grid .toggle::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; background: #fff; border-radius: 50%;
  transition: transform 0.2s;
}
.platforms-grid .toggle.active::after { transform: translateX(24px); }
.platforms-grid .message {
  padding: 0.75rem; border-radius: var(--radius); margin-top: 0.75rem;
  font-size: 0.875rem; display: none;
}
.platforms-grid .message.show { display: block; }
.platforms-grid .message-success {
  background: rgba(16,185,129,0.15); color: var(--success); border: 1px solid rgba(16,185,129,0.25);
}
.platforms-grid .message-error {
  background: rgba(239,68,68,0.15); color: var(--danger); border: 1px solid rgba(239,68,68,0.25);
}

/* Email cards */
.email-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1rem;
}
.email-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; color: var(--text-primary); }
.email-card .meta { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 1rem; }
.gdpr-notice {
  background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--radius); padding: 1rem; margin: 1rem 0;
  font-size: 0.875rem; color: var(--warning);
}

/* Company Switcher */
.company-switcher {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-tertiary);
}
.company-switcher-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.company-switcher-select {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}
.company-switcher-select:hover {
  border-color: var(--accent);
}
.company-switcher-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}
.company-switcher-empty {
  font-size: 12px;
  color: var(--text-muted);
  padding: 8px 0;
}

/* ─── Composer Page ─── */
.composer-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  max-width: 1200px;
}

@media (max-width: 1024px) {
  .composer-layout {
    grid-template-columns: 1fr;
  }
}

.composer-editor {
  min-width: 0;
}

.composer-form .form-group {
  margin-bottom: 20px;
}

.composer-form label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.composer-form label .required {
  color: var(--danger);
}

.composer-form .form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.composer-textarea {
  font-family: inherit;
  font-size: 15px;
  line-height: 1.6;
  resize: vertical;
  min-height: 160px;
}

.composer-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}

/* Character count */
.char-count {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-muted);
  transition: var(--transition);
}

.char-count.near-limit {
  color: var(--warning);
}

.char-count.over-limit {
  color: var(--danger);
}

.char-status {
  font-weight: 500;
}

.char-status.ok { color: var(--success); }
.char-status.warning { color: var(--warning); }
.char-status.error { color: var(--danger); }

/* Platform grid */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.platform-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.platform-chip:hover {
  border-color: var(--border-light);
  background: var(--bg-tertiary);
}

.platform-chip.selected {
  border-color: var(--accent);
  background: rgba(124,58,237,0.1);
}

.platform-chip-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.platform-chip-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
}

.platform-chip-limit {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-primary);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Validation errors */
.validation-errors {
  margin-top: 10px;
}

.validation-error {
  padding: 8px 12px;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--radius);
  color: var(--danger);
  font-size: 13px;
  margin-bottom: 6px;
}

.validation-warning {
  padding: 8px 12px;
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--radius);
  color: var(--warning);
  font-size: 13px;
  margin-bottom: 6px;
}

/* Form actions */
.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.form-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.form-actions .btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-icon {
  font-size: 14px;
}

/* Composer preview panel */
.composer-preview {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.preview-panel {
  flex: 1;
}

.preview-panel h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

/* Preview cards */
.preview-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  transition: var(--transition);
}

.preview-card.near-limit {
  border-color: var(--warning);
}

.preview-card.over-limit {
  border-color: var(--danger);
  background: rgba(239,68,68,0.05);
}

.preview-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.preview-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.preview-platform {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.preview-count {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.preview-count.error { color: var(--danger); }
.preview-count.warning { color: var(--warning); }

.preview-body {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
  word-break: break-word;
}

.preview-body p {
  margin: 0;
  white-space: pre-wrap;
}

.preview-error {
  margin-top: 8px;
  padding: 6px 10px;
  background: rgba(239,68,68,0.1);
  border-radius: 4px;
  font-size: 12px;
  color: var(--danger);
}

/* Platform limits panel */
.platform-limits {
  padding: 16px;
}

.platform-limits h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.limits-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.limit-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  transition: var(--transition);
}

.limit-item.ok {
  background: rgba(16,185,129,0.1);
}

.limit-item.warning {
  background: rgba(245,158,11,0.1);
}

.limit-item.error {
  background: rgba(239,68,68,0.1);
}

.limit-icon {
  font-size: 14px;
}

.limit-name {
  flex: 1;
  color: var(--text-secondary);
}

.limit-value {
  color: var(--text-muted);
  font-weight: 500;
}

.limit-item.ok .limit-value { color: var(--success); }
.limit-item.warning .limit-value { color: var(--warning); }
.limit-item.error .limit-value { color: var(--danger); }

/* Error banner */
.error-banner {
  padding: 12px 16px;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--radius);
  color: var(--danger);
  font-size: 14px;
  margin-bottom: 16px;
}

/* ─── Posts Page ─── */
.posts-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.posts-filters {
  display: flex;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.posts-filters input[type="text"] {
  flex: 1;
  min-width: 200px;
}

.posts-filters select {
  width: auto;
  min-width: 160px;
}

.bulk-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.bulk-actions span {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Post cards */
.post-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  transition: var(--transition);
  cursor: pointer;
}

.post-card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow);
}

.post-select {
  padding-top: 2px;
}

.post-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.post-main {
  flex: 1;
  min-width: 0;
}

.post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.status-badge.status-draft     { background: rgba(107,114,128,0.2); color: #9ca3af; }
.status-badge.status-scheduled { background: rgba(59,130,246,0.2);  color: #60a5fa; }
.status-badge.status-queued    { background: rgba(245,158,11,0.2);  color: #fbbf24; }
.status-badge.status-published { background: rgba(16,185,129,0.2);  color: #34d399; }
.status-badge.status-failed    { background: rgba(239,68,68,0.2);   color: #f87171; }

.post-time {
  font-size: 12px;
  color: var(--text-muted);
}

.post-content {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 10px;
  word-break: break-word;
}

.post-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.post-platforms {
  display: flex;
  gap: 6px;
}

.post-platform {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.post-jobs {
  font-size: 12px;
  color: var(--text-muted);
}

/* ─── Modals ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.modal-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}

.modal-panel.modal-wide {
  max-width: 700px;
}

.modal-panel.modal-sm {
  max-width: 400px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

/* Detail view */
.detail-section {
  margin-bottom: 20px;
}

.detail-section:last-child {
  margin-bottom: 0;
}

.detail-section label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.detail-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.detail-id {
  font-size: 13px;
  color: var(--text-muted);
  font-family: monospace;
}

.detail-content {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}

.detail-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-platform {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

.detail-times {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.detail-times div {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
}

.detail-times span {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.detail-jobs {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.job-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
}

.job-row.completed { border-color: rgba(16,185,129,0.3); }
.job-row.failed    { border-color: rgba(239,68,68,0.3); }
.job-row.running   { border-color: rgba(245,158,11,0.3); }

.job-icon {
  font-size: 14px;
}

.job-platform {
  flex: 1;
  color: var(--text-secondary);
}

.job-status {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.job-error {
  color: var(--danger);
  cursor: help;
}

/* Pagination */
.pagination {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
  .posts-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .posts-filters {
    flex-direction: column;
  }

  .posts-filters input[type="text"],
  .posts-filters select {
    width: 100%;
    min-width: auto;
  }

  .modal-panel {
    max-height: 95vh;
    margin: 10px;
  }

  .detail-times {
    grid-template-columns: 1fr;
  }
}

/* ─── Calendar Page ─── */
.calendar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.calendar-month-label {
  font-weight: 600;
  font-size: 18px;
  min-width: 160px;
  text-align: center;
}

/* Calendar grid */
.calendar-grid {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
}

.calendar-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
}

.day-header {
  padding: 12px 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  min-height: 480px;
}

.day-cell {
  min-height: 100px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 8px;
  position: relative;
  transition: var(--transition);
  cursor: pointer;
}

.day-cell:nth-child(7n) {
  border-right: none;
}

.day-cell.empty {
  background: var(--bg-primary);
}

.day-cell:hover {
  background: var(--bg-tertiary);
}

.day-cell.today {
  background: rgba(124,58,237,0.08);
}

.day-cell.today .day-number {
  background: var(--accent);
  color: white;
}

.day-cell.drag-over {
  background: rgba(124,58,237,0.2);
  border-color: var(--accent);
}

.day-cell-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.day-number {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.day-count {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-primary);
  padding: 2px 6px;
  border-radius: 10px;
}

.day-cell-events {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* Event chips */
.event-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-left: 3px solid;
  border-radius: 4px;
  font-size: 11px;
  cursor: grab;
  transition: var(--transition);
  overflow: hidden;
}

.event-chip:hover {
  background: var(--bg-tertiary);
}

.event-chip.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.event-time {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
  flex-shrink: 0;
}

.event-platform {
  font-size: 11px;
  flex-shrink: 0;
}

.event-title {
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-more {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  padding: 2px;
}

/* Upcoming posts sidebar */
.upcoming-posts {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.upcoming-posts h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.upcoming-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.upcoming-item:last-child {
  border-bottom: none;
}

.upcoming-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.upcoming-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-light);
}

.upcoming-platforms {
  display: flex;
  gap: 4px;
  font-size: 13px;
}

.upcoming-content {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  line-height: 1.4;
}

.upcoming-content:hover {
  color: var(--text-primary);
}

/* Mobile upcoming (shown on small screens instead of grid) */
.mobile-upcoming {
  margin-bottom: 24px;
}

.mobile-upcoming h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

/* Day panel (slides in) */
.day-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 100%;
  height: 100vh;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  z-index: 10001;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 20px rgba(0,0,0,0.4);
  animation: slideInRight 0.2s ease;
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.day-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.day-panel-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.day-panel-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  transition: var(--transition);
}

.day-panel-close:hover {
  color: var(--text-primary);
}

.day-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

/* Day post cards in panel */
.day-post {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  transition: var(--transition);
}

.day-post:hover {
  border-color: var(--border-light);
}

.day-post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.day-post-time {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-light);
}

.day-post-status {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
}

.day-post-content {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 10px;
  word-break: break-word;
}

.day-post-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.day-post-platforms {
  display: flex;
  gap: 6px;
  font-size: 14px;
}

/* Small button variant */
.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

/* Empty state variants */
.empty-state.small {
  padding: 24px;
}

.empty-state.small .icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.empty-state.small p {
  font-size: 13px;
  margin-bottom: 12px;
}

/* Small loading spinner */
.loading-spinner.small {
  width: 24px;
  height: 24px;
  border-width: 2px;
}

/* Responsive calendar */
@media (max-width: 768px) {
  .calendar-grid {
    display: none;
  }

  .mobile-upcoming {
    display: block;
  }

  .upcoming-posts {
    display: none;
  }

  .calendar-nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .calendar-month-label {
    order: -1;
    width: 100%;
    margin-bottom: 8px;
  }
}

@media (min-width: 769px) {
  .mobile-upcoming {
    display: none;
  }
}

/* ─── Analytics Page ─── */
.analytics-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--transition);
}

.metric-card:hover {
  border-color: var(--border-light);
}

.metric-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.metric-card h3 {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.metric-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

/* Charts grid */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.chart-card.chart-wide {
  grid-column: 1 / -1;
}

.chart-header {
  margin-bottom: 16px;
}

.chart-header h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.chart-body {
  position: relative;
  min-height: 280px;
}

.chart-body canvas {
  max-height: 280px;
}

.chart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  text-align: center;
}

.chart-empty .icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.chart-empty p {
  color: var(--text-muted);
  font-size: 14px;
}

/* Activity timeline */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 400px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 6px;
  flex-shrink: 0;
}

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.activity-action {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.activity-time {
  font-size: 12px;
  color: var(--text-muted);
}

.activity-detail {
  font-size: 13px;
  color: var(--text-secondary);
}

.activity-details {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  font-family: monospace;
}

/* Responsive analytics */
@media (max-width: 1024px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }

  .chart-card.chart-wide {
    grid-column: 1;
  }
}

@media (max-width: 768px) {
  .analytics-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .metric-value {
    font-size: 24px;
  }
}

/* ─── Settings Page ─── */
.settings-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.tab-btn {
  padding: 10px 20px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.settings-card h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.settings-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.settings-card-header h2 {
  margin-bottom: 0;
}

/* Profile */
.profile-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.profile-row:last-child {
  border-bottom: none;
}

.profile-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.profile-value {
  font-size: 14px;
  color: var(--text-primary);
  text-align: right;
}

.profile-value.mono,
.mono {
  font-family: 'SF Mono', 'Fira Code', 'JetBrains Mono', monospace;
  font-size: 12px;
}

/* Active company badge */
.active-company-badge {
  display: inline-block;
  padding: 8px 16px;
  background: var(--accent-bg);
  color: var(--accent);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
}

/* Audit filters */
.audit-filters {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.form-input-sm {
  padding: 6px 10px;
  font-size: 13px;
  width: auto;
  min-width: 140px;
}

/* Data table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table td {
  color: var(--text-secondary);
}

.data-table tr:hover td {
  background: var(--bg-tertiary);
}

/* Badges */
.role-badge {
  display: inline-block;
  padding: 2px 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: capitalize;
}

.action-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius);
  font-size: 11px;
  font-weight: 500;
}

.action-create { background: rgba(16,185,129,0.15); color: #10b981; }
.action-update { background: rgba(59,130,246,0.15); color: #3b82f6; }
.action-delete { background: rgba(239,68,68,0.15); color: #ef4444; }
.action-publish { background: rgba(16,185,129,0.15); color: #10b981; }
.action-schedule { background: rgba(245,158,11,0.15); color: #f59e0b; }
.action-login { background: rgba(124,58,237,0.15); color: #7c3aed; }
.action-logout { background: rgba(107,114,128,0.15); color: #6b7280; }

.audit-details {
  font-family: 'SF Mono', 'Fira Code', 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Disabled button tooltip */
.btn:disabled,
.btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Responsive settings */
@media (max-width: 1024px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .settings-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .audit-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .audit-filters .form-input-sm {
    width: 100%;
  }

  .data-table {
    font-size: 12px;
  }

  .data-table th,
  .data-table td {
    padding: 8px;
  }

  .audit-details {
    max-width: 120px;
  }
}

/* Utility */
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
