@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&family=Lexend+Deca:wght@100..900&display=swap');

:root {
  --bone-white:    #F9F6F0;
  --charcoal:      #2D2D2D;
  --pulse-blue:    #3A7BD5;
  --light-pink:    #FADEEB;
  --signal-red:    #C5301A;
  --pinned-note:   #FCFAED;

  --grid-line:     rgba(45, 45, 45, 0.07);
  --hairline:      rgba(45, 45, 45, 0.15);
  --text-muted:    #6b6b6b;
  --text-soft:     #888888;

  --bg:            var(--bone-white);
  --bg-alt:        var(--pinned-note);
  --fg:            var(--charcoal);
  --fg-muted:      var(--text-muted);
  --fg-soft:       var(--text-soft);
  --fg-on-dark:    var(--bone-white);

  --border-1:      1px solid var(--charcoal);
  --border-hairline: 1px solid var(--hairline);
  
  --accent:        var(--pulse-blue);
  --accent-soft:   var(--light-pink);
  --signal:        var(--signal-red);

  --font-headers: "Lexend Deca", system-ui, sans-serif;
  --font-details: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --font-body:    "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --fs-micro:    10px;
  --fs-nano:      9px;
  --tracking-widest: 0.18em;

  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-16: 64px;

  --radius-1: 2px;
  --radius-pill: 999px;

  --shadow-lg:  0 16px 32px rgba(45, 45, 45, 0.08);
  --shadow-pin: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-sm:  0 4px 12px rgba(45, 45, 45, 0.05);

  --dur-quick:   180ms;
  --dur-base:    300ms;
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --lace-step:   20px;
}

body { margin: 0; padding: 0; background: var(--bg); font-family: var(--font-body); color: var(--fg); overflow: hidden; height: 100vh; }
* { box-sizing: border-box; }
button { font-family: inherit; cursor: pointer; }

/* DA Base Styles */
h1, h2, h3, h4, h5, h6 { font-family: var(--font-headers); font-weight: 700; margin: 0 0 16px 0; color: var(--fg); letter-spacing: -0.01em; }
p { margin: 0 0 16px 0; line-height: 1.6; }
.hidden { display: none !important; }

/* Pulse Animation */
@keyframes da-brand-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(1.25); }
}
.da-pulse {
  display: inline-block;
  width: 12px; height: 12px;
  background: var(--accent);
  border: var(--border-1);
  border-radius: var(--radius-pill);
  animation: da-brand-pulse 3000ms ease-in-out infinite;
}

/* Application Shell Layout */
.custom-widget { position: absolute; inset: 0; display: flex; flex-direction: column; }
.ws-top {
  flex: 0 0 auto; height: 52px;
  display: flex; align-items: center; gap: var(--space-4);
  padding: 0 var(--space-4);
  background: var(--fg); color: var(--fg-on-dark);
  border-bottom: var(--border-1);
  z-index: 100;
}
.ws-top__brand { display: flex; align-items: center; gap: 9px; padding-right: var(--space-4); border-right: 1px solid rgba(255,255,255,.14); }
.ws-top__name { font-family: var(--font-headers); font-weight: 700; font-size: 14px; letter-spacing: .01em; white-space: nowrap; }
.ws-top__tag { font-size: var(--fs-micro); text-transform: uppercase; letter-spacing: var(--tracking-widest); color: rgba(255,255,255,.5); }

/* Client Switcher */
.ws-client { position: relative; }
.ws-client__btn {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.16);
  color: var(--fg-on-dark); padding: 6px 10px; border-radius: var(--radius-1);
  transition: background var(--dur-quick);
}
.ws-client__btn:hover { background: rgba(255,255,255,.12); }
.ws-avatar {
  width: 24px; height: 24px; border-radius: var(--radius-pill);
  display: grid; place-items: center; flex: 0 0 auto;
  font-family: var(--font-headers); font-weight: 700; font-size: 10px;
  color: #fff; border: 1px solid rgba(0,0,0,.2);
}
.ws-client__meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.ws-client__name { font-family: var(--font-headers); font-weight: 600; font-size: 12.5px; }
.ws-client__dom { font-size: 10px; color: rgba(255,255,255,.5); }

/* Dropdown */
.ws-client__menu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 60;
  width: 300px; background: var(--bg); color: var(--fg);
  border: var(--border-1); box-shadow: var(--shadow-lg);
}
.ws-client__head { padding: 10px 12px; border-bottom: var(--border-hairline); display:flex; justify-content:space-between; align-items:center; }
.ws-client__head span { font-size: var(--fs-micro); text-transform: uppercase; letter-spacing: var(--tracking-widest); color: var(--fg-soft); }
.ws-client__opt {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; background: none; border: 0; border-bottom: var(--border-hairline);
  text-align: left; transition: background var(--dur-quick);
}
.ws-client__opt:hover { background: var(--accent-soft); }
.ws-client__opt.is-on { background: var(--bg-alt); }
.ws-client__opt-meta { display: flex; flex-direction: column; line-height: 1.2; flex: 1; }
.ws-client__opt-name { font-family: var(--font-headers); font-weight: 600; font-size: 13px; color: var(--fg); }
.ws-client__opt-dom { font-size: 11px; color: var(--fg-muted); }
.ws-plan-tag { font-size: 9px; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; padding: 2px 6px; border: var(--border-1); border-radius: var(--radius-pill); }
.ws-plan-tag--starter { background: var(--bg); color: var(--fg); }
.ws-plan-tag--studio  { background: var(--accent-soft); color: var(--fg); }
.ws-plan-tag--agency  { background: var(--fg); color: var(--fg-on-dark); }

.ws-top__spacer { flex: 1; }
.ws-cmd {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.16);
  color: rgba(255,255,255,.7); padding: 6px 10px; border-radius: var(--radius-1);
  font-size: 12px; white-space: nowrap; transition: background var(--dur-quick);
}
.ws-cmd:hover { background: rgba(255,255,255,.12); }
.ws-sync { display: flex; align-items: center; gap: 7px; font-size: 11px; color: rgba(255,255,255,.6); }
.ws-sync--on { color: #fff; }

/* Sidebar */
.ws-body { flex: 1; display: flex; min-height: 0; }
.ws-nav {
  flex: 0 0 auto; background: var(--bg-alt); border-right: var(--border-1);
  display: flex; flex-direction: column; padding: var(--space-3) 0; width: 232px;
}
.ws-nav__group { font-size: var(--fs-nano); text-transform: uppercase; letter-spacing: var(--tracking-widest); color: var(--fg-soft); padding: var(--space-3) var(--space-5) var(--space-2); }
.ws-navitem {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px var(--space-5); background: none; border: 0; border-left: 2px solid transparent;
  color: var(--fg); text-align: left; font-size: 13px; position: relative;
  transition: background var(--dur-quick), border-color var(--dur-quick);
}
.ws-navitem:hover { background: var(--accent-soft); }
.ws-navitem.is-active { background: var(--bg); border-left-color: var(--signal); font-weight: 600; }
.ws-navitem__label { flex: 1; }
.ws-nav__foot { margin-top: auto; padding: var(--space-3) var(--space-5); }
.ws-nav__viewsite {
  display: flex; align-items: center; gap: 9px; width: 100%; justify-content: center;
  padding: 9px; background: var(--fg); color: var(--fg-on-dark);
  border: var(--border-1); font-size: 12px; font-weight: 600; white-space: nowrap;
  transition: background var(--dur-quick);
}
.ws-nav__viewsite:hover { background: var(--accent); color: var(--fg-on-dark); }

/* Main area */
.ws-main { 
  flex: 1; min-width: 0; overflow-y: auto; background: var(--bg);
  background-image: linear-gradient(var(--grid-line) .5px, transparent .5px), linear-gradient(90deg, var(--grid-line) .5px, transparent .5px);
  background-size: var(--lace-step) var(--lace-step); 
}
.ws-page { max-width: 1080px; margin: 0 auto; padding: var(--space-8) var(--space-10) var(--space-16); }

/* Sections */
.section { display: none; }
.section.active { display: block; }

.ws-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-6); margin-bottom: var(--space-8); padding-bottom: var(--space-4); border-bottom: var(--border-1); }
.ws-head__eyebrow { margin-bottom: 6px; }
.da-eyebrow { font-size: var(--fs-micro); font-weight: 700; letter-spacing: var(--tracking-widest); text-transform: uppercase; color: var(--signal); display: inline-block; }
.da-eyebrow--muted { color: var(--fg-soft); }
.ws-head h1, .ws-head h2 { font-family: var(--font-headers); font-size: 30px; font-weight: 700; margin: 0; color: var(--fg); letter-spacing: -0.005em; line-height: 1.1; }
.ws-head__sub { color: var(--fg-muted); font-size: 13px; margin-top: 4px; }

/* Buttons & Inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 16px; font-size: 13px; font-weight: 600; font-family: var(--font-body);
  border: var(--border-1); border-radius: var(--radius-1);
  background: var(--bg); color: var(--fg); transition: all var(--dur-quick);
  text-decoration: none; min-width: 100px;
}
.btn--primary { background: var(--accent); color: white; border-color: var(--accent); }
.btn--primary:hover { background: #2f65b0; border-color: #2f65b0; }
.btn--secondary { background: var(--bg-alt); border-color: var(--charcoal); color: var(--charcoal); }
.btn--secondary:hover { background: var(--accent-soft); }
.btn--outline { background: transparent; border-color: var(--charcoal); }
.btn--outline:hover { background: var(--accent-soft); }

.form-control {
  display: block; width: 100%; padding: 10px 12px; font-size: 13px; font-family: var(--font-body);
  background: var(--bg); border: var(--border-1); border-radius: var(--radius-1);
  color: var(--fg); transition: border-color var(--dur-quick);
}
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.form-group { margin-bottom: 20px; }
.form-label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 600; }

/* Specific Application Components */

/* Dashboard Grid */
.dashboard-grid { display: flex; flex-direction: column; gap: 32px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-card {
  text-align: left; background: var(--bg); border: var(--border-1); padding: 20px;
  display: flex; flex-direction: column; gap: 4px; transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base);
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.ws-stat__top { display: flex; justify-content: space-between; align-items: center; color: var(--fg-muted); margin-bottom: 12px; }
.stat-card__number { font-family: var(--font-headers); font-weight: 700; font-size: 34px; line-height: 1; color: var(--fg); margin: 0; }
.ws-stat__label { font-size: 12px; font-weight: 600; }

.widget-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.widget { background: var(--bg); border: var(--border-1); padding: 24px; }
.activity-feed { display: flex; flex-direction: column; gap: 16px; }
.activity-item { display: flex; gap: 16px; font-size: 13px; padding-bottom: 16px; border-bottom: var(--border-hairline); }
.activity-item:last-child { border-bottom: none; padding-bottom: 0; }

.deadline-list { display: flex; flex-direction: column; gap: 12px; }
.deadline-item { display: flex; gap: 16px; font-size: 13px; border-left: 4px solid var(--accent); padding-left: 12px; }
.deadline-item.priority-high { border-left-color: var(--signal); }

.quick-actions { display: flex; gap: 16px; }

/* Tabs */
.content-tabs, .dev-tabs { display: flex; gap: 8px; margin-bottom: 32px; border-bottom: var(--border-1); }
.tab-btn {
  background: transparent; border: none; border-bottom: 2px solid transparent; padding: 12px 16px;
  font-size: 13px; font-weight: 600; color: var(--fg-muted); transition: color 0.2s;
}
.tab-btn:hover { color: var(--fg); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Content Library */
.content-filters, .dev-filters { display: flex; gap: 16px; margin-bottom: 24px; }
.content-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.content-item { background: var(--bg); border: var(--border-1); padding: 20px; transition: transform 0.2s, box-shadow 0.2s; }
.content-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-sm); }
.content-item__header { display: flex; justify-content: space-between; margin-bottom: 12px; }
.content-item__title { font-size: 16px; font-family: var(--font-headers); font-weight: 700; margin: 0; }
.content-item__meta { font-size: 11px; margin-bottom: 12px; color: var(--fg-soft); }
.content-item__type { display: inline-block; padding: 2px 6px; border: var(--border-1); border-radius: 2px; margin-right: 8px; }
.content-item__excerpt { font-size: 13px; color: var(--fg-muted); }
.content-item__actions { display: flex; gap: 8px; margin-top: 16px; }

/* Forms */
.content-form, #devForm, #noteForm { background: var(--bg); border: var(--border-1); padding: 32px; max-width: 800px; margin: 0 auto; }
.form-actions { display: flex; gap: 16px; margin-top: 32px; }

/* Status Badges */
.status { font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 2px 6px; border: var(--border-1); border-radius: var(--radius-1); }
.status--published, .status--done { background: var(--bg-alt); }
.status--draft, .status--open { background: var(--bg); }
.status--review, .status--testing { background: var(--accent-soft); }
.status--error { background: var(--light-pink); color: var(--signal); border-color: var(--signal); }
.status--warning { background: var(--bg-alt); border-color: #d97706; }

/* Tags */
.tag { font-size: 10px; padding: 2px 6px; background: rgba(45,45,45,0.05); border-radius: 2px; }

/* Project Organization (Kanban) */
.project-selector { margin-bottom: 32px; max-width: 400px; }
.kanban-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; align-items: start; }
.kanban-column { background: rgba(249, 246, 240, 0.8); border: var(--border-1); padding: 16px; min-height: 400px; }
.kanban-column__header { display: flex; justify-content: space-between; border-bottom: var(--border-1); padding-bottom: 12px; margin-bottom: 16px; }
.kanban-column__title { font-family: var(--font-headers); font-size: 14px; margin: 0; }
.kanban-column__count { font-size: 11px; font-weight: 700; }
.kanban-column__tasks { display: flex; flex-direction: column; gap: 12px; min-height: 300px; }
.task-card { background: var(--bg); border: var(--border-1); padding: 16px; cursor: grab; }
.task-card:active { cursor: grabbing; }
.task-card.dragging { opacity: 0.5; }
.task-card__title { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.task-card__due { font-size: 11px; color: var(--fg-soft); }

/* Research & Notes */
.research-layout { display: grid; grid-template-columns: 240px 1fr; gap: 32px; align-items: start; }
.notebooks-sidebar { border: var(--border-1); padding: 16px; }
.notebook-item { padding: 8px 12px; font-size: 13px; cursor: pointer; border-left: 2px solid transparent; }
.notebook-item:hover { background: rgba(45,45,45,0.05); }
.notebook-item.active { border-left-color: var(--accent); font-weight: 600; }
.notes-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-top: 24px; }
.note-item { background: var(--bg); border: var(--border-1); padding: 20px; cursor: pointer; }
.note-item__title { font-family: var(--font-headers); font-size: 16px; margin-bottom: 8px; }
.note-item__preview { font-size: 13px; color: var(--fg-muted); margin: 12px 0; }
.note-editor { margin-top: 24px; }

/* Development */
.dev-tasks-grid { display: flex; flex-direction: column; gap: 16px; }
.dev-task-item { background: var(--bg); border: var(--border-1); padding: 20px; display: flex; justify-content: space-between; }
.dev-task-item__title { font-family: var(--font-headers); font-size: 16px; margin-bottom: 8px; }
.dev-task-item__description { font-size: 13px; color: var(--fg-muted); max-width: 600px; }

/* Calendar */
.calendar-view { margin-top: 24px; }
.calendar-controls { margin-bottom: 24px; }
.calendar-filters { display: flex; gap: 16px; margin-top: 12px; }
.calendar-grid { display: grid; grid-template-columns: repeat(1, 1fr); gap: 16px; }
.calendar-item {
  background: var(--bg); border: var(--border-1); padding: 20px;
  border-left: 4px solid var(--accent); transition: transform 0.2s, box-shadow 0.2s;
}
.calendar-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.calendar-item__day { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--signal); margin-bottom: 8px; }
.calendar-item__header { display: flex; justify-content: space-between; align-items: start; margin-bottom: 8px; }
.calendar-item__topic { font-family: var(--font-headers); font-weight: 700; font-size: 16px; }
.calendar-item__category { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--fg-soft); }
.calendar-item__hook { font-size: 13px; font-weight: 600; margin: 8px 0; }
.calendar-item__caption { font-size: 13px; color: var(--fg-muted); line-height: 1.6; margin: 8px 0; }
.calendar-item__cta { font-size: 12px; font-weight: 600; color: var(--accent); margin: 8px 0; }
.calendar-item__prompt { font-size: 11px; color: var(--fg-soft); font-style: italic; margin-top: 12px; padding-top: 12px; border-top: var(--border-hairline); }
.calendar-item__status { display: inline-block; font-size: 10px; padding: 2px 6px; background: var(--accent-soft); border: var(--border-1); border-radius: 2px; margin-top: 8px; }

.notification-badge { position: absolute; top: -5px; right: -5px; background: var(--signal); color: white; border-radius: var(--radius-pill); font-size: 10px; padding: 2px 6px; font-weight: 700; }
