/* ==========================================================================
   Truva HR Automation Master Suite - Unified Luxury Stylesheet
   ========================================================================== */

:root {
  --primary-orange: #ff6020;
  --primary-orange-hover: #e04f13;
  --primary-orange-light: #fff2eb;
  --primary-orange-border: #ffccb3;
  --secondary-brand: #ff6f38;
  
  --bg-dark: #0f1117;
  --bg-sidebar: #161822;
  --bg-card: #1e2230;
  --bg-card-hover: #262b3d;
  --bg-input: #12141c;
  --bg-input-focus: #181b26;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --border-color: #2a2f42;
  --border-active: #ff6020;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(255, 96, 32, 0.3);

  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Poppins', sans-serif;
  --font-montserrat: 'Montserrat', sans-serif;
  --font-handwriting: 'Kalam', cursive;
}

/* Base resets */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-dark);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Master Header */
.master-header {
  height: 64px;
  background-color: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 50;
  flex-shrink: 0;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary-orange), #ff8a50);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  box-shadow: var(--shadow-glow);
}

.brand-titles h1 {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(255, 96, 32, 0.18);
  color: var(--primary-orange);
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid rgba(255, 96, 32, 0.4);
}

.brand-tagline {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

/* Navigation Tabs */
.view-tabs {
  display: flex;
  align-items: center;
  background: var(--bg-dark);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  gap: 4px;
}

.view-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.view-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.view-tab-btn.active {
  background: var(--primary-orange);
  color: #fff;
  box-shadow: 0 2px 10px rgba(255, 96, 32, 0.4);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-orange), #ff7b42);
  color: #fff;
  box-shadow: 0 4px 14px rgba(255, 96, 32, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-orange-hover), #ff6020);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 96, 32, 0.5);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.btn-accent {
  background: #2563eb;
  color: #fff;
}

.btn-accent:hover {
  background: #1d4ed8;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* Master App Body Layout */
.app-layout {
  display: flex;
  flex: 1;
  height: calc(100vh - 64px);
  overflow: hidden;
}

/* Sidebar */
.master-sidebar {
  width: 380px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 20;
}

.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
}

.sidebar-tab-btn {
  flex: 1;
  padding: 12px 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.sidebar-tab-btn:hover {
  color: #fff;
}

.sidebar-tab-btn.active {
  color: var(--primary-orange);
  border-bottom-color: var(--primary-orange);
  background: rgba(255, 96, 32, 0.05);
}

.sidebar-content-area {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.sidebar-content-area::-webkit-scrollbar {
  width: 5px;
}

.sidebar-content-area::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 10px;
}

/* Sidebar Form Sections */
.form-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease;
}

.form-section:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title i {
  color: var(--primary-orange);
  font-size: 14px;
}

.section-tag {
  font-size: 10px;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-muted);
}

/* Form Inputs */
.input-group {
  margin-bottom: 14px;
}

.input-group:last-child {
  margin-bottom: 0;
}

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

.input-group input[type="text"],
.input-group input[type="email"],
.input-group select,
.input-group textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: #fff;
  font-family: var(--font-body);
  font-size: 13px;
  padding: 10px 12px;
  transition: all 0.2s ease;
  outline: none;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
  border-color: var(--primary-orange);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px rgba(255, 96, 32, 0.15);
}

.input-group textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.4;
}

.input-hint {
  display: block;
  font-size: 10.5px;
  color: var(--text-dim);
  margin-top: 4px;
}

.input-row {
  display: flex;
  gap: 10px;
}

.input-row .input-group {
  flex: 1;
}

/* Upload Drop Zone */
.upload-dropzone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 14px;
  text-align: center;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
  border-color: var(--primary-orange);
  background: rgba(255, 96, 32, 0.05);
}

.upload-dropzone i {
  font-size: 28px;
  color: var(--primary-orange);
  margin-bottom: 8px;
  display: block;
}

.upload-dropzone .upload-title {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 2px;
}

.upload-dropzone .upload-sub {
  font-size: 11px;
  color: var(--text-dim);
}

.photo-preview-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  margin-top: 10px;
}

.photo-thumb-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.photo-thumb-img {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.photo-filename {
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-icon-danger {
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.btn-icon-danger:hover {
  background: rgba(239, 68, 68, 0.15);
}

/* Sliders */
.slider-group {
  margin-bottom: 12px;
}

.slider-group:last-child {
  margin-bottom: 0;
}

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

.slider-header label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.slider-val-badge {
  font-family: monospace;
  font-size: 11px;
  background: var(--bg-input);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--primary-orange);
  border: 1px solid var(--border-color);
}

input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 4px;
  background: var(--bg-input);
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary-orange);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(255, 96, 32, 0.6);
  border: 2px solid #fff;
  transition: transform 0.1s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Toggles & Checkboxes */
.toggle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
}

.toggle-label-text {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-main);
}

.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-switch {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 22px;
}

.slider-switch:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-dim);
  transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 50%;
}

input:checked + .slider-switch {
  background-color: var(--primary-orange);
  border-color: var(--primary-orange);
}

input:checked + .slider-switch:before {
  transform: translateX(18px);
  background-color: #ffffff;
}

/* AI Status Badge */
.ai-status-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 96, 32, 0.08);
  border: 1px solid rgba(255, 96, 32, 0.25);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-top: 10px;
  font-size: 12px;
}

.ai-status-box.loading {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.3);
  color: #93c5fd;
}

.ai-status-box.success {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.3);
  color: #86efac;
}

.ai-status-box.error {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.ai-status-box.idle,
.ai-status-box.ready {
  background: rgba(148, 163, 184, 0.08);
  border-color: rgba(148, 163, 184, 0.25);
  color: var(--text-muted);
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--primary-orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Main Workspace Area */
.master-workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-dark);
  overflow: hidden;
  position: relative;
}

.workspace-topbar {
  height: 52px;
  background: rgba(22, 24, 34, 0.7);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
}

.workspace-title-group h2 {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.workspace-canvas-area {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  background: radial-gradient(circle at center, #1b1f2e 0%, #0d0f15 100%);
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

/* ==========================================================================
   View 1: All-in-One Dashboard (Live 3-in-1 Preview Grid)
   ========================================================================== */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
  width: 100%;
  max-width: 1300px;
  margin: auto;
  align-items: start;
}

.asset-preview-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.asset-preview-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 96, 32, 0.4);
  box-shadow: var(--shadow-lg), 0 0 25px rgba(255, 96, 32, 0.15);
}

.asset-card-header {
  padding: 14px 18px;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.asset-card-title {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.asset-card-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.asset-card-body {
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 380px;
  background: rgba(0, 0, 0, 0.15);
}

.asset-card-footer {
  padding: 14px 18px;
  background: rgba(0, 0, 0, 0.25);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* Specific Canvas Wrappers */
.id-card-wrapper {
  width: 230px;
  aspect-ratio: 687 / 1024;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  position: relative;
}

.id-card-wrapper-sm {
  width: 135px;
  border-radius: 12px;
}

.id-card-back-frame {
  cursor: default;
}

.id-card-back-frame:active {
  cursor: default;
}

.id-card-wrapper canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Visiting Card Previews */
.visiting-cards-row {
  display: flex;
  gap: 14px;
  justify-content: center;
}

.visiting-card-box {
  width: 135px;
  aspect-ratio: 2400 / 4200;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  position: relative;
  background: var(--secondary-brand);
}

.visiting-card-box img,
.visiting-card-box canvas {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* Welcome Note Poster Wrapper */
.welcome-poster-wrapper {
  width: 220px;
  aspect-ratio: 595 / 842;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  position: relative;
  background: #ffffff;
}

.welcome-poster-wrapper canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ==========================================================================
   View 2: Dedicated ID Card Studio
   ========================================================================== */
.studio-canvas-container {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.id-card-studio-frame {
  width: 360px;
  aspect-ratio: 687 / 1024;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 30px rgba(255, 96, 32, 0.2);
  position: relative;
  cursor: grab;
}

.id-card-studio-frame:active {
  cursor: grabbing;
}

.id-card-studio-frame canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.canvas-hint-tag {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  color: #fff;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   View 3: Dedicated Visiting Card Studio
   ========================================================================== */
.visiting-studio-grid {
  display: flex;
  gap: 36px;
  align-items: center;
  justify-content: center;
}

.visiting-studio-card-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.visiting-studio-card-label {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.visiting-card-large {
  width: 240px;
  aspect-ratio: 2400 / 4200;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  background: var(--secondary-brand);
}

.visiting-card-large canvas,
.visiting-card-large img {
  width: 100%;
  height: 100%;
  display: block;
}

/* ==========================================================================
   View 4: Dedicated Welcome Note Studio (Interactive Transform Poster)
   ========================================================================== */
.poster-studio-frame {
  width: 440px;
  aspect-ratio: 595 / 842;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  position: relative;
  background: #ffffff;
  container-type: inline-size;
  user-select: none;
}

.poster-base-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.transform-layer {
  position: absolute;
  cursor: move;
  transform-origin: center center;
  will-change: transform, left, top;
  touch-action: none;
  user-select: none;
}

#wn-layer-photo {
  min-width: 60px;
  min-height: 60px;
}

.photo-placeholder-box {
  min-width: 120px;
  min-height: 140px;
  border: 2px dashed rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.15);
}

.photo-placeholder-box::after {
  content: 'Photo Area';
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#wn-layer-bubble:not(.selected) {
  outline: 1px dashed rgba(37, 99, 235, 0.35);
  outline-offset: 0;
}

.wn-bubble-empty {
  position: absolute;
  top: 0;
  left: 0;
  color: #94a3b8;
  font-style: italic;
  font-size: 12px;
  pointer-events: none;
}

.wn-bubble-warn {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -26px;
  background: #b91c1c;
  color: #fff;
  font: 600 11px 'Poppins', sans-serif;
  padding: 4px 8px;
  border-radius: 6px;
  text-align: center;
  pointer-events: none;
}

#wn-layer-name {
  container-type: inline-size;
  min-width: 120px;
}

#wn-bubble-list {
  list-style: none;
  padding: 0;
  margin: 0;
  pointer-events: none;
}

#wn-bubble-list li {
  font-family: 'Kalam', cursive, sans-serif;
  font-size: 11.5px;
  line-height: 1.2;
  margin-bottom: 6px;
  word-break: break-word;
}

#wn-name-display {
  font-family: 'Outfit', sans-serif;
  font-weight: 800 !important;
  color: #ffffff !important;
  line-height: 1 !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

#wn-dept-display {
  font-family: 'Kalam', cursive, sans-serif;
  font-weight: 700 !important;
  color: #ffffff !important;
  line-height: 1 !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.transform-layer.selected {
  outline: 2px dashed #2563eb;
  outline-offset: 4px;
}

.transform-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #ffffff;
  border: 2px solid #2563eb;
  border-radius: 3px;
  z-index: 1000;
  touch-action: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.handle-nw { top: -11px; left: -11px; cursor: nwse-resize; }
.handle-ne { top: -11px; right: -11px; cursor: nesw-resize; }
.handle-se { bottom: -11px; right: -11px; cursor: nwse-resize; }
.handle-sw { bottom: -11px; left: -11px; cursor: nesw-resize; }

.handle-rotate-stem {
  position: absolute;
  top: -24px;
  left: 50%;
  width: 2px;
  height: 16px;
  background: #2563eb;
  transform: translateX(-50%);
  pointer-events: none;
}

.handle-rotate {
  position: absolute;
  top: -38px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  background: #ffffff;
  border: 2px solid #2563eb;
  border-radius: 50%;
  cursor: grab;
  z-index: 1001;
  touch-action: none;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary-orange);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.success { border-left-color: #22c55e; }
.toast.error { border-left-color: #ef4444; }

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .app-layout {
    flex-direction: column;
  }
  .master-sidebar {
    width: 100%;
    height: 45vh;
  }
  .master-workspace {
    height: 55vh;
  }
}
