:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-hover: #334155;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --border: #334155;
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --accent: #f59e0b;
  --canvas-bg: #475569;
  --page-bg: #ffffff;
  --page-text: #1e293b;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-size: 12px;
}

/* Header */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand span {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-muted);
}

/* Ribbon Toolbar */
.ribbon {
  background: #182234;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.ribbon-tabs {
  display: flex;
  background: #0f172a;
  padding-left: 8px;
  border-bottom: 1px solid var(--border);
}

.ribbon-tab {
  padding: 6px 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  color: var(--text-muted);
  font-size: 11px;
}

.ribbon-tab.active {
  background: #182234;
  color: white;
  border-color: var(--border);
}

.ribbon-content {
  display: flex;
  padding: 6px 12px;
  gap: 16px;
  overflow-x: auto;
  align-items: center;
}

.ribbon-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid var(--border);
  padding-right: 12px;
}

.ribbon-group-title {
  font-size: 9px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
}

.ribbon-buttons {
  display: flex;
  gap: 4px;
  align-items: center;
}

.btn {
  padding: 5px 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn:hover {
  background: var(--surface-hover);
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* Workspace Layout */
.workspace {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* Page Thumbnails Sidebar */
.sidebar-thumbnails {
  width: 180px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.thumb-card {
  background: var(--page-bg);
  border: 2px solid transparent;
  border-radius: 4px;
  padding: 8px;
  height: 180px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--page-text);
  font-size: 9px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.thumb-card.active {
  border-color: var(--primary);
}

/* Canvas Area */
.canvas-area {
  flex: 1;
  background: var(--canvas-bg);
  padding: 24px;
  overflow-y: auto;
  display: flex;
  justify-content: center;
}

.ddf-page {
  width: 680px;
  min-height: 880px;
  background: var(--page-bg);
  color: var(--page-text);
  border-radius: 4px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  padding: 48px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}

.page-header {
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 8px;
  font-size: 10px;
  color: #64748b;
  display: flex;
  justify-content: space-between;
}

.page-footer {
  border-top: 1px solid #e2e8f0;
  padding-top: 8px;
  font-size: 10px;
  color: #64748b;
  margin-top: auto;
  display: flex;
  justify-content: space-between;
}

.watermark-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-30deg);
  font-size: 3rem;
  font-weight: 800;
  color: rgba(2, 132, 199, 0.12);
  pointer-events: none;
  white-space: nowrap;
}

/* Right Inspector Panel */
.sidebar-inspector {
  width: 240px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.inspector-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inspector-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.form-control {
  padding: 6px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 11px;
  width: 100%;
}
