@import url('design-system.css');
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: var(--font-primary); color: #141821; background: linear-gradient(180deg, #f8fafc 0%, #f7f7fb 100%); }
a { color: #0b5fff; text-decoration: none; transition: color .15s ease; }
a:hover { color: #0a4fe6; }
.container { max-width: 1080px; margin: 0 auto; padding: 24px; }
.layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.layout.no-sidebar { grid-template-columns: 1fr; }
.sidebar { position: sticky; top: 0; align-self: start; height: 100vh; padding: 14px 12px; border-right: 1px solid #e5e7eb; background: #fff; 
  display: flex; flex-direction: column; overflow: hidden; z-index: 40; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 10px 8px 16px; }
.sidebar .brand .brand-text { color: #111827; }
.sidenav { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.sidenav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: #111827; }
.sidebar .sidenav a, .sidebar .sidenav .submenu a { color: #111827 !important; }
.sidenav a:hover { background: #f3f4f6; }
.sidenav a.active { background: #eef2f7; color: #111827; border: 1px solid #e5e7eb; }
.sidenav .icon { width: 18px; height: 18px; color: currentColor; opacity: .9; }
.sidenav .nav-item { display: block; }
.sidenav .nav-item .nav-link { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: #111827; }
.sidenav .nav-item .nav-link:hover { background: #f3f4f6; }
.sidenav .nav-item .nav-link .chev { margin-left: auto; opacity: .7; font-size: 12px; }
.sidenav .nav-item .submenu { list-style: none; margin: 4px 0 8px 0; padding: 0; display: none; }
.sidenav .submenu { list-style: none; margin: 4px 0 8px 0; padding-left: 0; }
.sidenav .submenu li { list-style: none; margin: 0; padding: 0; }
.sidenav .nav-item .submenu li a { display: block; padding: 8px 12px 8px 36px; border-radius: 10px; color: #374151; }
.sidenav .nav-item .submenu li a.active { background: #eef2f7; color: #111827; border: 1px solid #e5e7eb; }
.sidenav .nav-item .submenu li a { display: block; padding: 8px 12px 8px 36px; border-radius: 10px; color: #374151; }
.sidenav .nav-item .submenu li a:hover { background: #f8fafc; }
.sidenav .nav-item.open .submenu { display: block; }
.sidenav .nav-item.open .nav-link .chev { transform: rotate(180deg); }
.content { padding: 24px; }
.layout.sidebar-collapsed { grid-template-columns: 64px 1fr; }
.sidebar.sidebar-collapsed { width: 64px; padding-left: 8px; padding-right: 8px; }
.sidebar.sidebar-collapsed .brand { padding: 8px; }
.sidebar.sidebar-collapsed .brand .brand-text { display: none; }
/* Match actual markup for logo/text */
.sidebar.sidebar-collapsed .sidebar-header { padding: 8px; }
.sidebar.sidebar-collapsed .sidebar-logo-text { display: none; }
.sidebar.sidebar-collapsed .sidenav a { justify-content: center; padding: 10px; }
.sidebar.sidebar-collapsed .sidenav a span { display: none; }
.sidebar.sidebar-collapsed .sidenav .icon { width: 20px; height: 20px; }
.sidebar.sidebar-collapsed .nav-item .submenu { display: none !important; }
/* Hide text labels in top-level nav-link when collapsed */
.sidebar.sidebar-collapsed .nav-item .nav-link span { display: none; }
.sidebar-header { padding: var(--space-6); border-bottom: 1px solid var(--border-light); }
.sidebar-logo { display:flex; align-items:center; gap: var(--space-3); text-decoration: none; }
.sidebar-logo img { height: 32px; width: auto; }
.sidebar-logo-text { font-size: var(--text-lg); font-weight: var(--font-semibold); color: var(--text-primary); }
.sidebar-nav { padding: var(--space-4); flex: 1; overflow-y: auto; }
.sidebar-nav-section { margin-bottom: var(--space-6); }
.sidebar-nav-section-title { font-size: var(--text-xs); font-weight: var(--font-semibold); text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-tertiary); padding: var(--space-2) var(--space-3); margin-bottom: var(--space-2); }
.sidebar-nav-item { display:flex; align-items:center; gap: var(--space-3); padding: var(--space-3) var(--space-3); margin-bottom: var(--space-1); border-radius: var(--radius-md); color: var(--text-secondary); text-decoration: none; font-size: var(--text-sm); font-weight: var(--font-medium); transition: all .2s ease; cursor: pointer; }
.sidebar-nav-item:hover { background: var(--color-gray-100); color: var(--text-primary); }
.sidebar-nav-item.active { background: var(--color-primary-50); color: var(--color-primary-600); font-weight: var(--font-semibold); }
.sidebar-nav-item-badge { background: var(--color-primary-500); color: var(--text-inverse); font-size: var(--text-xs); font-weight: var(--font-semibold); padding: 2px 8px; border-radius: var(--radius-full); }
.sidebar-footer { padding: var(--space-4); border-top: 1px solid var(--border-light); }
.sidebar-user { display:flex; align-items:center; gap: var(--space-3); padding: var(--space-3); border-radius: var(--radius-md); transition: background-color .2s ease; }
.sidebar-user:hover { background: var(--color-gray-100); }
.sidebar-user-avatar { width: 36px; height: 36px; border-radius: var(--radius-full); background: var(--color-primary-500); color: var(--text-inverse); display:flex; align-items:center; justify-content:center; font-weight: var(--font-semibold); font-size: var(--text-sm); }
.sidebar-user-name { font-size: var(--text-sm); font-weight: var(--font-medium); color: var(--text-primary); }
.sidebar-user-role { font-size: var(--text-xs); color: var(--text-tertiary); }
.topbar { position: sticky; top: 0; z-index: 50; display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: rgba(20,24,33,0.9); backdrop-filter: saturate(140%) blur(10px); color: #fff; border-bottom: 1px solid rgba(255,255,255,0.08); box-shadow: 0 6px 20px rgba(0,0,0,0.12); }
.topbar .brand a { color: #fff; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.brand-logo { height: 28px; width: auto; display: inline-block; }
.brand-text { color: #fff; font-weight: 600; letter-spacing: 0.2px; }
.topbar .navlinks a { margin-left: 12px; color: #fff; opacity: 0.9; padding: 6px 10px; border-radius: 10px; }
.topbar .navlinks a:hover { background: rgba(255,255,255,0.08); opacity: 1; }
.topbar .navlinks .user { margin-left: 12px; color: #cbd5e1; }
/* Mobile nav toggle hidden by default */
.nav-toggle { display: inline-block; }
.button { display: inline-inline; display: inline-block; padding: 10px 16px; border-radius: 12px; background: #eef2f7; color: #141821; border: 1px solid #e5e7eb; transition: all .2s ease; font-weight: 600; }
.button:hover { filter: brightness(0.98); }
.button.primary { background: #dc2626; color: #fff; border-color: #dc2626; box-shadow: 0 8px 18px rgba(220,38,38,0.25); }
.button.primary:hover { background: #c42020; transform: translateY(-1px); box-shadow: 0 10px 22px rgba(220,38,38,0.28); }
.button.ghost { background: transparent; color: #141821; border-color: #e5e7eb; }
.button.ghost:hover { background: #f3f4f6; }
.button:disabled { opacity: .6; cursor: not-allowed; }
.button.loading { position: relative; opacity: .9; pointer-events: none; }
.button.loading::after { content: ""; position: absolute; right: 12px; top: 50%; width: 16px; height: 16px; border-radius: 999px; border: 2px solid rgba(255,255,255,0.6); border-top-color: #fff; transform: translateY(-50%); animation: spin .8s linear infinite; }
.button.loading.button:not(.primary)::after { border-color: #6b7280; border-top-color: #111827; }

/* Calendar */
.calendar-toolbar { display:flex; align-items:center; justify-content: center; gap: 12px; margin: 10px 0 16px; }
.calendar-title { font-weight: 700; color:#111827; }
.calendar { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; box-shadow: 0 10px 24px rgba(0,0,0,0.06); overflow: hidden; }
.calendar-head, .calendar-row { display: grid; grid-template-columns: repeat(7, 1fr); }
.calendar-head > div { padding: 10px; font-weight:600; font-size: 13px; color:#6b7280; text-align:center; background: #f8fafc; border-bottom:1px solid #e5e7eb; }
.calendar-cell { min-height: 110px; border-right:1px solid #f1f5f9; border-bottom:1px solid #f1f5f9; padding: 8px; position: relative; }
.calendar-row .calendar-cell:last-child { border-right:none; }
.calendar-date { font-size: 12px; color:#64748b; margin-bottom: 6px; }
.calendar-events { display: flex; flex-direction: column; gap: 6px; }
.event-pill { display: inline-flex; align-items:center; gap:6px; padding: 6px 10px; border-radius: 999px; color:#0f172a; border:1px solid rgba(15,23,42,0.12); background:#e2e8f0; font-weight:600; cursor:pointer; text-align:left; }
.event-pill:hover { filter: brightness(0.98); transform: translateY(-1px); }

/* Modal tweaks (rely on base modal styles in header sections) */
.modal { display:none; position: fixed; inset:0; background: rgba(15,23,42,0.5); z-index: 2000; align-items:center; justify-content:center; padding: 20px; }
.modal.active { display:flex; }
.modal .modal-content { background:#fff; border-radius:12px; width:100%; max-width:520px; box-shadow: 0 20px 50px rgba(0,0,0,0.2); }
.modal .modal-header { padding:16px; display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid #eef2f7; }
.modal .modal-body { padding:16px; }
.modal .close-modal { background: transparent; border:none; font-size:22px; cursor:pointer; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.cards .card { display: flex; flex-direction: column; }
.card { background: #fff; border-radius: 16px; padding: 18px; box-shadow: 0 10px 30px rgba(2,6,23,0.06); border: 1px solid #edf2f7; }
.card .task-actions { margin-top: auto; display: flex; gap: 8px; }
.card:hover { box-shadow: 0 14px 36px rgba(2,6,23,0.08); }
.card-title { font-size: 14px; color: #6b7280; margin-bottom: 8px; }
.badge { display:inline-block; padding:4px 10px; border-radius:999px; font-size:12px; font-weight:600; border:1px solid #e5e7eb; background:#f3f4f6; color:#111827; }
.badge.amber { background:#fef3c7; color:#92400e; border-color:#fde68a; }
.badge.sky { background:#e0f2fe; color:#075985; border-color:#bae6fd; }
.badge.green { background:#dcfce7; color:#065f46; border-color:#bbf7d0; }
.cards .card:hover { transform: translateY(-2px); transition: transform .15s ease, box-shadow .15s ease; }
.metric { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; }
.posts { display: grid; gap: 12px; }
.post { background: #fff; border-radius: 16px; padding: 16px; box-shadow: 0 8px 24px rgba(15,23,42,0.06); border: 1px solid #edf2f7; }
.post-meta { display: flex; gap: 10px; align-items: center; font-size: 14px; color: #6b7280; margin-bottom: 8px; }
.tag { display: inline-block; background: #fee2e2; color: #991b1b; padding: 4px 10px; border-radius: 999px; font-size: 12px; }
.caption { margin: 8px 0 12px; }
.stats { display: flex; gap: 16px; font-size: 14px; color: #374151; }
.footer { padding: 16px; border-top: 1px solid #e5e7eb; color: #6b7280; }
.auth-card { max-width: 480px; margin: 48px auto; background: #fff; border-radius: 16px; padding: 28px; box-shadow: 0 20px 48px rgba(2,6,23,0.08); border: 1px solid #edf2f7; }
label { display: block; margin: 12px 0; font-size: 14px; color: #374151; }
input[type="email"], input[type="password"], input[type="text"], select, textarea { width: 100%; padding: 12px 14px; border: 1px solid #e5e7eb; border-radius: 12px; background: #fff; color: #111827; outline: none; transition: box-shadow .2s ease, border-color .2s ease; }
textarea { min-height: 120px; }
input:focus, select:focus, textarea:focus { border-color: #c7d2fe; box-shadow: 0 0 0 4px rgba(59,130,246,0.15); }
.select, select { appearance: none; background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none"><path d="M6 8l4 4 4-4" stroke="%236b7280" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>'); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; padding-right: 40px; }
.alert { padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; border: 1px solid transparent; }
.alert.error { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.alert.success { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.alert.info { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.muted { color: #6b7280; }
.tasks { display: grid; gap: 12px; }
.task { background: #fff; border-radius: 16px; padding: 18px; box-shadow: 0 8px 24px rgba(15,23,42,0.06); border: 1px solid #edf2f7; }
.task-header { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.task .uploads { margin-top: 10px; display: grid; gap: 6px; }
.teleprompter .controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.prompt { background: #000; color: #0ff; padding: 20px; border-radius: 12px; height: 60vh; overflow-y: auto; font-size: 28px; line-height: 40px; letter-spacing: 0.5px; }
.prompt.mirror { transform: scaleX(-1); }
.media a { font-size: 14px; }

/* Touch-friendly controls (mobile quick win) */
button, input[type="range"], select {
  min-height: 44px;
  min-width: 44px;
  padding: 12px;
}
input[type="range"] { height: 44px; -webkit-appearance: none; background: transparent; }
input[type="range"] { appearance: none; }
input[type="range"]::-webkit-slider-thumb { width: 28px; height: 28px; -webkit-appearance: none; background: #fff; border-radius: 50%; box-shadow: 0 2px 8px rgba(0,0,0,0.2); }

/* Reading guide line in teleprompter */
.prompt { position: relative; }
.prompt::before {
  content: '';
  position: sticky;
  top: 50%;
  display: block;
  height: 2px;
  background: rgba(255,255,255,0.25);
  margin-top: -1px;
}

/* Teleprompter slide-up panel */
.tp-panel { 
  position: fixed; left: 0; right: 0; bottom: -100%; 
  background: #f8fafc; color: #111827; 
  border-radius: 16px 16px 0 0; 
  padding: 12px; 
  z-index: 1000; 
  box-shadow: 0 -10px 30px rgba(0,0,0,0.2);
  transition: bottom .25s ease-out; 
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
.tp-panel.active { bottom: 0; }
.tp-panel label { color: #111827; }
/* Light theme controls */
.tp-panel input[type="range"] { height: 44px; -webkit-appearance: none; appearance: none; background: transparent; }
.tp-panel input[type="range"]::-webkit-slider-track { height: 6px; background: #9ca3af; border-radius: 999px; }
.tp-panel input[type="range"]::-moz-range-track { height: 6px; background: #9ca3af; border-radius: 999px; }
.tp-panel input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 24px; height: 24px; background: #dc2626; border: 2px solid #ffffff; border-radius: 50%; box-shadow: 0 2px 8px rgba(0,0,0,.2); margin-top: -10px; }
.tp-panel input[type="range"]::-moz-range-thumb { width: 24px; height: 24px; background: #dc2626; border: 2px solid #ffffff; border-radius: 50%; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.tp-panel input[type="range"]:focus { outline: none; }
.tp-panel input[type="range"]:focus::-webkit-slider-track { background: #6b7280; }
.tp-panel input[type="range"]:focus::-moz-range-track { background: #6b7280; }
.tp-panel select { background: #ffffff; color: #111827; border: 1px solid #e5e7eb; border-radius: 10px; padding: 10px 36px 10px 12px; }
.tp-panel .button { background: #eef2f7; color: #111827; border-color: #e5e7eb; }

/* Buttons (design system) */
.btn { display:inline-flex; align-items:center; justify-content:center; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); font-size: var(--text-sm); font-weight: var(--font-medium); line-height: 1; text-decoration:none; border: 1px solid transparent; cursor: pointer; transition: all .2s ease; white-space: nowrap; }
.btn:disabled { opacity:.5; cursor:not-allowed; }
.btn-primary { background: var(--color-primary-500); color: var(--text-inverse); }
.btn-primary:hover:not(:disabled) { background: var(--color-primary-600); box-shadow: var(--shadow-md); }
.btn-primary:active:not(:disabled) { background: var(--color-primary-700); }
.btn-secondary { background: var(--bg-primary); color: var(--text-primary); border-color: var(--border-medium); }
.btn-secondary:hover:not(:disabled) { background: var(--color-gray-50); border-color: var(--border-dark); }
.btn-success { background: var(--color-success); color: var(--text-inverse); }
.btn-success:hover:not(:disabled) { box-shadow: var(--shadow-md); }
.btn-danger { background: var(--color-error); color: var(--text-inverse); }
.btn-danger:hover:not(:disabled) { box-shadow: var(--shadow-md); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover:not(:disabled) { background: var(--color-gray-100); color: var(--text-primary); }
.btn-sm { padding: var(--space-2) var(--space-3); font-size: var(--text-xs); }
.btn-lg { padding: var(--space-4) var(--space-6); font-size: var(--text-base); }
.btn-icon { padding: var(--space-3); aspect-ratio: 1; }
.btn-icon svg { width: 20px; height: 20px; }

/* Forms (design system) */
.form-group { margin-bottom: var(--space-5); }
.form-label { display:block; font-size: var(--text-sm); font-weight: var(--font-medium); color: var(--text-primary); margin-bottom: var(--space-2); }
.form-input { width: 100%; padding: var(--space-3) var(--space-4); font-size: var(--text-sm); line-height: 1.5; color: var(--text-primary); background: var(--bg-primary); border: 1px solid var(--border-medium); border-radius: var(--radius-md); transition: all .2s ease; }
.form-input:focus { outline: none; border-color: var(--color-primary-500); box-shadow: 0 0 0 3px rgba(14,165,233,0.1); }
.form-input::placeholder { color: var(--text-tertiary); }
.form-input:disabled { background: var(--color-gray-100); cursor: not-allowed; opacity: .6; }
.form-input.error { border-color: var(--color-error); }
.form-input.error:focus { box-shadow: 0 0 0 3px rgba(239,68,68,0.1); }
.form-input.success { border-color: var(--color-success); }
.form-input.success:focus { box-shadow: 0 0 0 3px rgba(16,185,129,0.1); }
textarea.form-input { min-height: 120px; resize: vertical; }
select.form-input { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E"); background-position: right var(--space-3) center; background-repeat: no-repeat; background-size: 1.25em 1.25em; padding-right: var(--space-10); }

/* Tables (admin) */
table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden; }
thead th { text-align: left; font-size: 14px; padding: 10px 12px; color: #6b7280; background: #fafafa; border-bottom: 1px solid #e5e7eb; }
tbody td { font-size: 14px; padding: 10px 12px; border-bottom: 1px solid #f1f5f9; }
tbody tr:hover { background: #f9fafb; }

/* Badges & status chips */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; line-height: 1.6; border: 1px solid transparent; }
.badge.tiktok { background: #000; color: #fff; }
.badge.instagram { background: linear-gradient(90deg,#a855f7,#ec4899,#f97316); color: #fff; }

.status { padding: 2px 10px; border-radius: 999px; font-size: 12px; }
.status.pending { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.status.in_progress { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.status.completed { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }

/* Layout refinements */
.post .stats span { display: inline-flex; align-items: center; gap: 6px; }
.post .stats span::before { content: '•'; color: #d1d5db; }
.task .task-header h3 { margin: 0; }
.task .task-actions { display: flex; gap: 10px; margin-top: 8px; }

/* Headings */
h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; margin: 6px 0 16px; }
h2 { font-size: 20px; font-weight: 700; margin: 6px 0 12px; }
h3 { font-size: 16px; font-weight: 700; margin: 4px 0 8px; }

/* Admin quick pillbar */
.card .button { margin-right: 8px; }
.pillbar { display: flex; gap: 10px; padding: 8px; background: #fff; border: 1px solid #edf2f7; border-radius: 999px; }
.pillbar .pill { padding: 8px 14px; border-radius: 999px; background: #f3f4f6; color: #111827; }
.pillbar .pill.active { background: #dc2626; color: #fff; }

/* Micro animations */
.fade-in { animation: fade-in .25s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(2px);} to { opacity: 1; transform: none;} }

/* Loading spinner keyframes */
@keyframes spin { to { transform: translateY(-50%) rotate(360deg); } }

/* Dark mode overrides */
body.theme-dark { background: linear-gradient(180deg, #0b1220 0%, #0b1220 100%); color: #e5e7eb; }
.theme-dark .container { color: #e5e7eb; }
.theme-dark .card, .theme-dark .post, .theme-dark .task { background: #111827; border-color: #1f2937; box-shadow: 0 10px 30px rgba(0,0,0,0.4); }
.theme-dark .card-title, .theme-dark .muted { color: #9ca3af; }
.theme-dark .footer { color: #9ca3af; border-top-color: #1f2937; }
.theme-dark .button { background: #1f2937; color: #e5e7eb; border-color: #374151; }
.theme-dark .button.ghost { background: transparent; border-color: #374151; color: #e5e7eb; }
.theme-dark input[type="email"], .theme-dark input[type="password"], .theme-dark input[type="text"], .theme-dark select, .theme-dark textarea { background: #0f172a; color: #e5e7eb; border-color: #1f2937; }
.theme-dark input:focus, .theme-dark select:focus, .theme-dark textarea:focus { border-color: #334155; box-shadow: 0 0 0 4px rgba(59,130,246,0.18); }
.theme-dark table { background: #0f172a; border-color: #1f2937; }
.theme-dark thead th { background: #111827; color: #9ca3af; border-bottom-color: #1f2937; }
.theme-dark tbody td { border-bottom-color: #1f2937; }

/* Toasts */
#toastContainer { position: fixed; right: 16px; bottom: 16px; z-index: 1000; display: flex; flex-direction: column; gap: 10px; }
.toast { min-width: 260px; max-width: 360px; padding: 12px 14px; border-radius: 12px; border: 1px solid #e5e7eb; background: #fff; color: #111827; box-shadow: 0 10px 30px rgba(2,6,23,0.15); animation: toast-in .2s ease; }
.toast.success { border-color: #bbf7d0; background: #dcfce7; color: #166534; }
.toast.error { border-color: #fecaca; background: #fee2e2; color: #991b1b; }
.toast .title { font-weight: 700; margin-bottom: 4px; }
.toast .close { float: right; cursor: pointer; opacity: .7; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px);} to { opacity: 1; transform: none;} }

/* Responsive adjustments */
@media (max-width: 900px) {
  .container { padding: 16px; }
  .cards { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
}

@media (max-width: 768px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 56px; height: calc(100vh - 56px); width: 260px; transform: translateX(-100%); transition: transform .25s ease; background: #fff; box-shadow: 0 20px 50px rgba(0,0,0,0.12); z-index: 60; }
  .sidebar.open { transform: translateX(0); }
  .brand-logo { height: 24px; }
  .brand-text { font-size: 14px; }
  .nav-toggle { display: inline-block; margin-left: 8px; }
  .topbar { padding: 10px 12px; }
  .topbar .navlinks { display: none; }
  .pillbar { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .task-actions { flex-wrap: wrap; }
}

@media (max-width: 640px) {
  .container { padding: 12px; }
  h1 { font-size: 24px; }
  h2 { font-size: 18px; }
  .metric { font-size: 28px; }
  /* Make tables scroll on mobile */
  table { display: block; overflow-x: auto; white-space: nowrap; }
  thead, tbody, tr, td, th { border-color: #e5e7eb; }
}
