/* SanMarcSoft Comms Hub - Dark Theme */
/* Using Tailwind-compatible utility classes via CDN in baseof.html */

/* Import Tailwind via CDN - add to baseof.html head block */
/* This file provides additional custom styles */

:root {
  --color-bg: #0F172A;
  --color-surface: #1E293B;
  --color-border: #334155;
  --color-text: #F8FAFC;
  --color-text-muted: #94A3B8;
  --color-primary: #3B82F6;
  --color-primary-dim: #1E40AF;
}

/* Base */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  display: flex;
}

/* Sidebar */
.fixed { position: fixed; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.left-0 { left: 0; }
.top-0 { top: 0; }
.h-screen { height: 100vh; }
.w-64 { width: 16rem; }
.ml-64 { margin-left: 16rem; }
.z-50 { z-index: 50; }

/* Layout */
.flex { display: flex; }
.flex-1 { flex: 1 1 0%; }
.flex-col { flex-direction: column; }
.min-h-screen { min-height: 100vh; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-8 { gap: 2rem; }
.flex-wrap { flex-wrap: wrap; }

/* Grid */
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 768px) { .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 768px) { .md\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 768px) { .md\:col-span-2 { grid-column: span 2 / span 2; } }
@media (min-width: 768px) { .md\:text-xl { font-size: 1.25rem; line-height: 1.75rem; } }
@media (min-width: 1024px) { .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .lg\:col-span-2 { grid-column: span 2 / span 2; } }

/* Spacing */
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-5 { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.px-1\.5 { padding-left: 0.375rem; padding-right: 0.375rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }

/* Typography */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.font-mono { font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace; }
.uppercase { text-transform: uppercase; }
.capitalize { text-transform: capitalize; }
.tracking-wider { letter-spacing: 0.05em; }
.leading-snug { line-height: 1.375; }
.italic { font-style: italic; }
.text-center { text-align: center; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Colors */
.text-white { color: #ffffff; }
.text-slate-200 { color: #e2e8f0; }
.text-slate-300 { color: #cbd5e1; }
.text-slate-400 { color: #94a3b8; }
.text-slate-500 { color: #64748b; }
.text-slate-600 { color: #475569; }
.text-blue-400 { color: #60a5fa; }
.text-amber-400 { color: #fbbf24; }
.text-green-400 { color: #4ade80; }
.text-purple-400 { color: #c084fc; }
.text-red-400 { color: #f87171; }

/* Backgrounds */
.bg-slate-800 { background-color: #1e293b; }
.bg-slate-900 { background-color: #0f172a; }
.bg-slate-950 { background-color: #020617; }
.bg-slate-700 { background-color: #334155; }
.bg-blue-600 { background-color: #2563eb; }
.bg-blue-600\/20 { background-color: rgba(37, 99, 235, 0.2); }
.bg-blue-900\/50 { background-color: rgba(30, 58, 138, 0.5); }
.bg-amber-900\/50 { background-color: rgba(120, 53, 15, 0.5); }
.bg-purple-900\/50 { background-color: rgba(88, 28, 135, 0.5); }
.bg-green-900\/50 { background-color: rgba(20, 83, 45, 0.5); }
.bg-red-900\/50 { background-color: rgba(127, 29, 29, 0.5); }
.bg-green-500 { background-color: #22c55e; }
.bg-amber-500 { background-color: #f59e0b; }

/* Borders */
.border { border-width: 1px; }
.border-b { border-bottom-width: 1px; }
.border-t { border-top-width: 1px; }
.border-r { border-right-width: 1px; }
.border-l-4 { border-left-width: 4px; }
.border-slate-700 { border-color: #334155; }
.border-slate-800 { border-color: #1e293b; }
.border-l-blue-500 { border-left-color: #3b82f6; }
.border-l-purple-500 { border-left-color: #a855f7; }
.border-l-amber-500 { border-left-color: #f59e0b; }
.border-l-green-500 { border-left-color: #22c55e; }
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-full { border-radius: 9999px; }

/* Sizing */
.w-2 { width: 0.5rem; }
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-8 { width: 2rem; }
.w-full { width: 100%; }
.w-1\.5 { width: 0.375rem; }
.h-2 { height: 0.5rem; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-8 { height: 2rem; }
.h-1\.5 { height: 0.375rem; }
.max-w-none { max-width: none; }
.max-w-4xl { max-width: 56rem; }

/* Interactive */
a { text-decoration: none; color: inherit; }
.block { display: block; }
.inline-flex { display: inline-flex; }
.transition-colors { transition-property: color, background-color, border-color; transition-duration: 150ms; }
.hover\:text-white:hover { color: #ffffff; }
.hover\:text-blue-400:hover { color: #60a5fa; }
.hover\:bg-slate-800:hover { background-color: #1e293b; }
.hover\:bg-slate-800\/80:hover { background-color: rgba(30, 41, 59, 0.8); }
.hover\:border-slate-600:hover { border-color: #475569; }
.focus\:outline-none:focus { outline: none; }
.focus\:ring-2:focus { box-shadow: 0 0 0 2px var(--color-primary); }

/* Prose for content preview */
.prose { max-width: 65ch; }
.prose-invert { color: #cbd5e1; }
.prose-sm { font-size: 0.875rem; }
.prose h1, .prose h2, .prose h3 { color: #f8fafc; margin-top: 1.5em; margin-bottom: 0.5em; }
.prose h2 { font-size: 1.25rem; }
.prose h3 { font-size: 1.1rem; }
.prose p { margin-bottom: 1em; line-height: 1.7; }
.prose a { color: #60a5fa; text-decoration: underline; }
.prose ul, .prose ol { padding-left: 1.5em; margin-bottom: 1em; }
.prose li { margin-bottom: 0.25em; }
.prose code { background: #1e293b; padding: 0.15em 0.4em; border-radius: 0.25em; font-size: 0.85em; }
.prose blockquote { border-left: 3px solid #3b82f6; padding-left: 1em; color: #94a3b8; font-style: italic; }
.prose strong { color: #f8fafc; }

/* Progress bar */
.bg-green-500 { background-color: #22c55e; }
.bg-blue-500 { background-color: #3b82f6; }
.transition-all { transition: all 150ms; }
.shrink-0 { flex-shrink: 0; }
.min-w-0 { min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mr-1 { margin-right: 0.25rem; }
.mr-2 { margin-right: 0.5rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-auto { margin-left: auto; }
.mt-0\.5 { margin-top: 0.125rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-8 { margin-top: 2rem; }
.text-right { text-align: right; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-\[10px\] { font-size: 10px; line-height: 14px; }
.w-2\.5 { width: 0.625rem; }
.w-3 { width: 0.75rem; }
.w-3\.5 { width: 0.875rem; }
.h-2\.5 { height: 0.625rem; }
.h-3 { height: 0.75rem; }
.h-3\.5 { height: 0.875rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.border-2 { border-width: 2px; }
.border-t-2 { border-top-width: 2px; }
.border-green-500 { border-color: #22c55e; }
.border-purple-500 { border-color: #a855f7; }
.border-blue-500 { border-color: #3b82f6; }
.border-amber-500 { border-color: #f59e0b; }
.border-slate-600 { border-color: #475569; }
.border-transparent { border-color: transparent; }
.min-h-\[200px\] { min-height: 200px; }
.space-y-0\.5 > * + * { margin-top: 0.125rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.bg-purple-500\/20 { background-color: rgba(168, 85, 247, 0.2); }
.bg-green-900\/40 { background-color: rgba(20, 83, 45, 0.4); }
.bg-blue-900\/40 { background-color: rgba(30, 58, 138, 0.4); }
.bg-purple-900\/40 { background-color: rgba(88, 28, 135, 0.4); }
.bg-amber-900\/40 { background-color: rgba(120, 53, 15, 0.4); }
.bg-purple-900\/30 { background-color: rgba(88, 28, 135, 0.3); }
.bg-slate-800\/50 { background-color: rgba(30, 41, 59, 0.5); }
.bg-slate-900\/50 { background-color: rgba(15, 23, 42, 0.5); }
.hover\:bg-slate-700:hover { background-color: #334155; }
.hover\:bg-slate-800\/50:hover { background-color: rgba(30, 41, 59, 0.5); }
.hover\:text-blue-300:hover { color: #93c5fd; }
.group:hover .group-hover\:text-blue-400 { color: #60a5fa; }

/* Tab panels */
.hidden { display: none; }
.tab-btn { cursor: pointer; background: none; border: none; font-family: inherit; }
.tab-btn:hover { color: #f8fafc; }

/* Kanban board */
@media (min-width: 768px) { .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

/* Filter hidden items */
.content-item.hidden { display: none; }

/* Animations */
@keyframes spin { to { transform: rotate(360deg); } }
.animate-spin { animation: spin 1s linear infinite; }
.opacity-75 { opacity: 0.75; }
.col-span-2 { grid-column: span 2 / span 2; }
.cursor-pointer { cursor: pointer; }
.overflow-y-auto { overflow-y: auto; }
.max-h-\[90vh\] { max-height: 90vh; }
.max-w-2xl { max-width: 42rem; }
.max-w-md { max-width: 28rem; }
.max-w-sm { max-width: 24rem; }
.disabled\:opacity-50:disabled { opacity: 0.5; }

/* Select styling */
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.5rem center; background-size: 1rem; padding-right: 2rem; }

/* ========================================
   Mobile-First Responsive System
   ======================================== */

/* --- Sidebar: hidden on mobile, slide-in overlay --- */
.sidebar {
  position: fixed;
  left: 0; top: 0;
  width: 16rem;
  height: 100vh;
  z-index: 50;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar.open { transform: translateX(0); }
@media (min-width: 768px) {
  .sidebar { transform: translateX(0); }
}

/* --- Sidebar backdrop --- */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 40;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.sidebar-backdrop.visible { display: block; opacity: 1; }
@media (min-width: 768px) {
  .sidebar-backdrop { display: none !important; }
}

/* --- Main content: no margin on mobile, ml-64 on tablet+ --- */
.main-content {
  margin-left: 0;
  transition: margin-left 0.3s ease;
}
@media (min-width: 768px) {
  .main-content { margin-left: 16rem; }
}

/* --- Hamburger: visible on mobile only --- */
.hamburger-btn { display: flex; }
@media (min-width: 768px) {
  .hamburger-btn { display: none; }
}

/* --- Sidebar close button: visible on mobile only --- */
.sidebar-close { display: flex; }
@media (min-width: 768px) {
  .sidebar-close { display: none; }
}

/* --- Responsive display utilities --- */
.sm\:block { display: none; }
.md\:block { display: none; }
.lg\:block { display: none; }
.sm\:hidden { display: block; }
.md\:hidden { display: block; }
.lg\:hidden { display: block; }

@media (min-width: 640px) {
  .sm\:block { display: block; }
  .sm\:hidden { display: none; }
  .sm\:flex { display: flex; }
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 768px) {
  .md\:block { display: block; }
  .md\:hidden { display: none; }
  .md\:flex { display: flex; }
  .md\:p-8 { padding: 2rem; }
  .md\:px-8 { padding-left: 2rem; padding-right: 2rem; }
  .md\:gap-4 { gap: 1rem; }
  .md\:gap-6 { gap: 1.5rem; }
}
@media (min-width: 1024px) {
  .lg\:block { display: block; }
  .lg\:hidden { display: none; }
  .lg\:flex { display: flex; }
}

/* --- Responsive grid: mobile-first --- */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
@media (min-width: 640px) {
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* --- Bottom sheet modal (mobile) --- */
.bottom-sheet {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 60;
  border-radius: 1rem 1rem 0 0;
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottom-sheet.open { transform: translateY(0); }

.bottom-sheet-handle {
  width: 2.5rem;
  height: 0.25rem;
  background: #475569;
  border-radius: 2px;
  margin: 0.75rem auto;
}

/* --- Modal overlay: no sidebar offset on mobile --- */
.modal-overlay { padding-left: 0; }
@media (min-width: 768px) {
  .modal-overlay { padding-left: 16rem; }
}

/* --- Horizontal scroll for kanban on mobile --- */
.overflow-x-auto { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.kanban-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* --- Touch-friendly tap targets --- */
.tap-target { min-height: 44px; min-width: 44px; }

/* --- Responsive padding --- */
.p-responsive { padding: 1rem; }
@media (min-width: 768px) { .p-responsive { padding: 2rem; } }

/* --- Responsive text: hide date on mobile --- */
.date-display { display: none; }
@media (min-width: 640px) { .date-display { display: block; } }
