/* ============================================================================
   KKS AI / DUBFLOW — NEW CREATIVE WORKSPACE UI
   A complete visual layer refresh. Existing React routes, controls and APIs
   remain untouched; this file changes presentation only.
   ============================================================================ */

:root {
  color-scheme: light;
  --ui-canvas: #f4f6f2;
  --ui-paper: #ffffff;
  --ui-paper-soft: #f8faf7;
  --ui-ink: #202b25;
  --ui-ink-soft: #46544b;
  --ui-muted: #78847b;
  --ui-line: #e3e9e2;
  --ui-line-strong: #d2ddd3;
  --ui-green: #2d634a;
  --ui-green-deep: #214c39;
  --ui-green-soft: #e8f1e9;
  --ui-green-pale: #f1f6f1;
  --ui-coral: #cf845f;
  --ui-coral-soft: #fbefe8;
  --ui-shadow: 0 8px 28px rgba(37, 62, 43, .055);
  --ui-shadow-card: 0 2px 8px rgba(37, 62, 43, .035), 0 14px 34px rgba(37, 62, 43, .035);
  --ui-radius-sm: 9px;
  --ui-radius: 15px;
  --ui-radius-lg: 21px;
  --ui-radius-xl: 26px;
  --font-ui: 'Plus Jakarta Sans', 'Pyidaungsu', 'Inter', 'Segoe UI', sans-serif;
}

html, body {
  min-height: 100%;
  background: var(--ui-canvas) !important;
  color: var(--ui-ink) !important;
  font-family: var(--font-ui) !important;
  -webkit-font-smoothing: antialiased !important;
  text-rendering: optimizeLegibility;
}

body {
  background-image:
    radial-gradient(ellipse at 12% 0%, rgba(212, 230, 214, .42), transparent 35%),
    radial-gradient(ellipse at 100% 18%, rgba(246, 226, 212, .25), transparent 27%) !important;
}

body::before { display: none !important; }
#root { min-height: 100vh; background: transparent !important; }
#root > div.min-h-screen {
  min-height: 100vh !important;
  background: transparent !important;
  color: var(--ui-ink) !important;
}

/* Typography — replace the previous condensed/uppercase-heavy treatment. */
h1, h2, h3, h4, h5, h6 {
  color: var(--ui-ink) !important;
  font-family: var(--font-ui) !important;
  font-style: normal !important;
  letter-spacing: -.035em !important;
  line-height: 1.18 !important;
}
p, label, li, small { font-family: var(--font-ui) !important; }
[class~="text-white"]:not(button):not(svg),
[class~="text-gray-100"]:not(button),
[class~="text-gray-200"]:not(button),
[class~="text-slate-100"]:not(button),
[class~="text-slate-200"]:not(button),
[class~="text-zinc-100"]:not(button),
[class~="text-zinc-200"]:not(button) { color: var(--ui-ink) !important; }
[class~="text-gray-300"]:not(button), [class~="text-slate-300"]:not(button), [class~="text-zinc-300"]:not(button) { color: #536158 !important; }
[class~="text-gray-400"]:not(button), [class~="text-slate-400"]:not(button), [class~="text-zinc-400"]:not(button) { color: #718076 !important; }
[class~="text-gray-500"]:not(button), [class~="text-slate-500"]:not(button), [class~="text-zinc-500"]:not(button) { color: #849087 !important; }
[class~="text-gray-600"]:not(button), [class~="text-slate-600"]:not(button), [class~="text-zinc-600"]:not(button) { color: #707c72 !important; }
[class~="text-blue-300"], [class~="text-blue-400"], [class~="text-blue-500"], [class~="text-indigo-400"] { color: var(--ui-green) !important; }
[class~="text-amber-300"], [class~="text-amber-400"], [class~="text-yellow-400"] { color: #b9783d !important; }
[class~="uppercase"] { text-transform: none !important; }
[class~="tracking-widest"], [class~="tracking-wider"] { letter-spacing: .025em !important; }
[class~="font-black"] { font-weight: 750 !important; }

/* Main application canvas and left navigation. */
#root > div.min-h-screen[class*="md:flex-row"] {
  background: transparent !important;
  color: var(--ui-ink) !important;
}
#root div[class*="w-64"][class*="flex-col"][class*="border-r"] {
  width: 264px !important;
  min-width: 264px !important;
  background: rgba(255,255,255,.94) !important;
  border-right: 1px solid var(--ui-line) !important;
  box-shadow: 8px 0 30px rgba(35, 56, 39, .025) !important;
  color: var(--ui-ink) !important;
  z-index: 50 !important;
}
#root div[class*="w-64"][class*="flex-col"] > div:first-child {
  min-height: 88px !important;
  padding: 22px 20px !important;
  border-bottom: 1px solid var(--ui-line) !important;
  background: #fff !important;
}
#root div[class*="w-64"][class*="flex-col"] nav {
  padding: 22px 14px !important;
  gap: 6px !important;
}
#root div[class*="w-64"][class*="flex-col"] nav button {
  min-height: 47px !important;
  padding: 10px 13px !important;
  border: 1px solid transparent !important;
  border-radius: 12px !important;
  background: transparent !important;
  color: #657269 !important;
  box-shadow: none !important;
  text-align: left !important;
  transition: background .18s ease, color .18s ease, border-color .18s ease !important;
}
#root div[class*="w-64"][class*="flex-col"] nav button:hover {
  background: #f2f6f1 !important;
  border-color: #e8eee7 !important;
  color: var(--ui-ink) !important;
}
#root div[class*="w-64"][class*="flex-col"] nav button[class*="bg-blue-600/10"],
#root div[class*="w-64"][class*="flex-col"] nav button[class*="border-blue-500"] {
  background: var(--ui-green-soft) !important;
  border-color: #d5e5d6 !important;
  color: var(--ui-green-deep) !important;
  box-shadow: inset 3px 0 0 var(--ui-green) !important;
}
#root div[class*="w-64"][class*="flex-col"] nav button p,
#root div[class*="w-64"][class*="flex-col"] nav button span {
  color: inherit !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  letter-spacing: -.01em !important;
}
#root div[class*="w-64"][class*="flex-col"] nav button svg { color: inherit !important; }
#root div[class*="w-64"][class*="flex-col"] nav button[class*="bg-blue-600/10"] svg { color: var(--ui-green) !important; }
#root div[class*="w-64"][class*="flex-col"] > div:last-child {
  margin: 8px 14px 16px !important;
  padding: 13px !important;
  border: 1px solid var(--ui-line) !important;
  border-radius: 15px !important;
  background: #f8faf7 !important;
}
#root div[class*="w-64"][class*="flex-col"] .bg-amber-500,
#root div[class*="w-64"][class*="flex-col"] div[class*="bg-amber-500"] {
  background: var(--ui-green) !important;
  color: #fff !important;
}
#root div[class*="w-64"][class*="flex-col"] button[class*="border-rose"] {
  border: 1px solid #f1d8d1 !important;
  border-radius: 10px !important;
  color: #a44d3e !important;
  background: #fff8f5 !important;
}

/* Mobile navigation masthead. */
#root div[class*="md:hidden"][class*="border-b"][class*="px-4"] {
  background: rgba(255,255,255,.97) !important;
  border-bottom: 1px solid var(--ui-line) !important;
  color: var(--ui-ink) !important;
  padding: 13px 17px !important;
}
#root div[class*="md:hidden"][class*="border-b"] button {
  border: 1px solid var(--ui-line) !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: var(--ui-ink) !important;
}

/* Page area — wider breathing space and lighter canvas. */
#root div[class*="flex-1"][class*="flex-col"][class*="overflow-x-hidden"] {
  min-width: 0 !important;
  background: transparent !important;
}
#root div[class*="max-w-7xl"] {
  width: min(100% - 48px, 1480px) !important;
  max-width: 1480px !important;
  padding-top: 32px !important;
  padding-bottom: 42px !important;
}
#root div[class*="max-w-7xl"] > div:first-child[class*="bg-"] {
  border: 1px solid #dbe7dc !important;
  border-radius: var(--ui-radius-xl) !important;
  background: linear-gradient(118deg, #e7f1e7 0%, #f2f6ed 56%, #f8f2ec 100%) !important;
  box-shadow: none !important;
  padding: 27px 30px !important;
  overflow: hidden !important;
}
#root div[class*="max-w-7xl"] > div:first-child h1,
#root div[class*="max-w-7xl"] > div:first-child h2 {
  color: #23372b !important;
  font-size: clamp(22px, 2vw, 29px) !important;
  font-weight: 750 !important;
}
#root div[class*="max-w-7xl"] > div:first-child p { color: #617066 !important; }
#root div[class*="max-w-7xl"] > div:first-child [class*="text-blue"],
#root div[class*="max-w-7xl"] > div:first-child [class*="text-amber"] { color: var(--ui-green) !important; }
#root div[class*="max-w-7xl"] > div:first-child [class*="bg-blue-950"],
#root div[class*="max-w-7xl"] > div:first-child [class*="bg-emerald-950"] {
  background: rgba(255,255,255,.72) !important;
  border-color: #d5e3d5 !important;
  border-radius: 999px !important;
  color: var(--ui-green-deep) !important;
}

/* Cards, work panels, project tiles. */
#root div[class*="bg-[#0F"],
#root div[class*="bg-[#0E"],
#root div[class*="bg-[#11"],
#root div[class*="bg-[#12"],
#root div[class*="bg-[#14"],
#root div[class*="bg-[#18"],
#root div[class*="bg-slate-900"],
#root div[class*="bg-slate-800"] {
  background-color: var(--ui-paper) !important;
  background-image: none !important;
  color: var(--ui-ink) !important;
}
#root div[class*="rounded-2xl"][class*="border"],
#root div[class*="rounded-xl"][class*="border"],
#root div[class*="rounded-lg"][class*="border"] {
  border-color: var(--ui-line) !important;
  border-radius: var(--ui-radius) !important;
  box-shadow: var(--ui-shadow-card) !important;
}
#root div[class*="rounded-none"][class*="border"]:not([class*="fixed"]):not([class*="sticky"]) {
  border-radius: var(--ui-radius) !important;
}
#root div[class*="border-white/10"],
#root div[class*="border-white/15"],
#root div[class*="border-white/5"] {
  border-color: var(--ui-line) !important;
}
#root div[class*="shadow-2xl"], #root div[class*="shadow-xl"], #root div[class*="shadow-lg"] {
  box-shadow: var(--ui-shadow-card) !important;
}
#root div[class*="hover:bg-[#18181f"]:hover,
#root div[class*="hover:bg-slate-800"]:hover {
  background: #f8faf7 !important;
}
#root div[class*="border-dashed"] {
  border: 1.5px dashed #cbd9cc !important;
  border-radius: 17px !important;
  background: #f8fbf7 !important;
}
#root div[class*="border-dashed"]:hover {
  border-color: #7eaa88 !important;
  background: #f1f7f1 !important;
}

/* Buttons — soft, deliberate controls with forest-green primary action. */
#root button {
  min-height: 34px;
  border-radius: 10px !important;
  font-family: var(--font-ui) !important;
  font-weight: 650 !important;
  letter-spacing: -.01em !important;
  text-transform: none !important;
  transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease !important;
  transform: none !important;
}
#root button[class*="bg-blue-600"],
#root button[class*="bg-blue-500"],
#root button[class*="bg-indigo-600"],
#root button[class*="from-blue-600"],
#root button[class*="bg-blue-700"] {
  background: var(--ui-green) !important;
  background-image: none !important;
  border: 1px solid var(--ui-green) !important;
  color: #fff !important;
  box-shadow: 0 5px 12px rgba(45, 99, 74, .14) !important;
}
#root button[class*="bg-blue-600"]:hover,
#root button[class*="bg-blue-500"]:hover,
#root button[class*="from-blue-600"]:hover {
  background: var(--ui-green-deep) !important;
  border-color: var(--ui-green-deep) !important;
  box-shadow: 0 7px 16px rgba(45, 99, 74, .18) !important;
}
#root button[class*="bg-amber-500"], #root button[class*="bg-amber-400"], #root button[class*="bg-orange-500"] {
  background: #e6ad82 !important;
  border: 1px solid #e6ad82 !important;
  color: #3f2b20 !important;
  box-shadow: none !important;
}
#root button[class*="bg-emerald"], #root button[class*="bg-green-5"], #root button[class*="bg-green-6"] {
  background: var(--ui-green) !important;
  border-color: var(--ui-green) !important;
  color: #fff !important;
}
#root button[class*="bg-rose"], #root button[class*="bg-red-5"], #root button[class*="bg-red-6"] {
  background: #bd5c50 !important;
  border-color: #bd5c50 !important;
  color: #fff !important;
}
#root button[class*="border-white/10"],
#root button[class*="bg-white/5"],
#root button[class*="bg-slate-800"],
#root button[class*="bg-[#141416]"] {
  background: #fff !important;
  border: 1px solid var(--ui-line-strong) !important;
  color: var(--ui-ink-soft) !important;
  box-shadow: none !important;
}
#root button:hover { filter: brightness(.98); }
#root button:disabled { opacity: .48 !important; cursor: not-allowed !important; }

/* Forms and selection controls. */
#root input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
#root textarea,
#root select {
  min-height: 42px;
  background: #fff !important;
  border: 1px solid #dce5dc !important;
  border-radius: 11px !important;
  color: var(--ui-ink) !important;
  box-shadow: 0 1px 2px rgba(34, 57, 40, .025) !important;
  font-family: var(--font-ui) !important;
}
#root textarea { min-height: 100px; }
#root input:focus, #root textarea:focus, #root select:focus {
  border-color: #7da88a !important;
  outline: 0 !important;
  box-shadow: 0 0 0 3px rgba(83, 139, 94, .12) !important;
}
#root input::placeholder, #root textarea::placeholder { color: #a0aaa1 !important; }
#root input[type="checkbox"], #root input[type="radio"], #root input[type="range"] { accent-color: var(--ui-green) !important; }

/* Status states retain their meaning, but use softer backgrounds. */
#root [class*="bg-emerald-950"], #root [class*="bg-green-950"] {
  background: #edf6ed !important; border-color: #d2e8d3 !important; color: #347347 !important;
}
#root [class*="bg-rose-950"], #root [class*="bg-red-950"] {
  background: #fff1ee !important; border-color: #f1d4cd !important; color: #a94f42 !important;
}
#root [class*="bg-amber-950"] {
  background: #fff7e9 !important; border-color: #f0dfbf !important; color: #96652d !important;
}
#root [class*="bg-blue-950"]:not(button) {
  background: #edf4ee !important; border-color: #d9e7da !important; color: var(--ui-green) !important;
}
#root [class*="border-blue-500"], #root [class*="border-blue-400"] { border-color: #c9ddcb !important; }
#root [class*="border-amber-500"] { border-color: #ead3b3 !important; }

/* Modal, drawer and toast surfaces. */
#root div[class*="fixed"][class*="inset-0"][class*="bg-black"] {
  background: rgba(24, 38, 29, .42) !important;
  backdrop-filter: blur(3px) !important;
}
#root div[class*="fixed"][class*="inset-0"][class*="z-50"] > div[class*="bg-"],
#root div[class*="max-h-[85vh]"][class*="bg-[#"] {
  background: #fff !important;
  border: 1px solid var(--ui-line) !important;
  border-radius: 20px !important;
  box-shadow: 0 24px 70px rgba(31, 48, 35, .18) !important;
}
#root div[class*="top-5 right-5"] > div {
  border-radius: 12px !important;
  box-shadow: var(--ui-shadow) !important;
  text-transform: none !important;
}

/* Video preview surfaces remain dark to preserve video contrast. */
#root div[class*="aspect-video"][class*="bg-black"],
#root div[class*="aspect-[16/9]"][class*="bg-black"] {
  background: #111 !important;
  border: 1px solid #dce4dc !important;
  border-radius: 15px !important;
  overflow: hidden !important;
}
#root video, #root canvas { border-radius: 12px; }

/* Tables, lists, output panes and code areas. */
#root table { border-collapse: separate !important; border-spacing: 0 !important; overflow: hidden; border-radius: 13px; }
#root thead th {
  background: #f3f7f2 !important;
  color: #65736a !important;
  border-bottom: 1px solid var(--ui-line) !important;
  padding: 12px 14px !important;
  font-size: 10px !important;
  font-weight: 750 !important;
  letter-spacing: .055em !important;
  text-transform: uppercase !important;
}
#root tbody td { color: #46554b !important; border-bottom: 1px solid #edf1ec !important; padding: 12px 14px !important; }
#root tbody tr:hover td { background: #f8faf7 !important; }
#root pre, #root code, #root [class*="font-mono"] { font-family: 'JetBrains Mono', 'Consolas', monospace !important; }
#root pre, #root textarea[class*="font-mono"] { background: #f7faf6 !important; border: 1px solid var(--ui-line) !important; border-radius: 12px !important; color: #34443a !important; }

/* Login / registration view. */
#root div[class*="min-h-screen"][class*="justify-center"][class*="bg-[#08090C]"] {
  background:
    radial-gradient(circle at 18% 18%, rgba(207, 228, 208, .72), transparent 34%),
    radial-gradient(circle at 84% 84%, rgba(245, 224, 209, .7), transparent 34%),
    #f3f6f1 !important;
  color: var(--ui-ink) !important;
}
#root div[class*="max-w-md"][class*="bg-[#12151F]"] {
  background: #fff !important;
  border: 1px solid #e1e9e0 !important;
  border-radius: 24px !important;
  box-shadow: 0 24px 70px rgba(43, 70, 49, .12) !important;
  padding: 34px !important;
}
#root div[class*="max-w-md"][class*="bg-[#12151F]"] h1,
#root div[class*="max-w-md"][class*="bg-[#12151F]"] h2 { color: var(--ui-ink) !important; }
#root div[class*="max-w-md"][class*="bg-[#12151F]"] label { color: #59675d !important; }

/* Admin suite injected by dubflow-admin.js. */
#dubflow-admin-modal {
  background: #f4f6f2 !important;
  color: var(--ui-ink) !important;
  font-family: var(--font-ui) !important;
}
#dubflow-admin-modal > div:first-child {
  background: #fff !important;
  border-bottom: 1px solid var(--ui-line) !important;
}
#dubflow-admin-modal [class*="bg-[#0"],
#dubflow-admin-modal [class*="bg-slate-900"],
#dubflow-admin-modal [class*="bg-slate-800"] {
  background: #fff !important;
  color: var(--ui-ink) !important;
}
#dubflow-admin-modal [class*="text-white"],
#dubflow-admin-modal [class*="text-gray-200"],
#dubflow-admin-modal [class*="text-slate-200"] { color: var(--ui-ink) !important; }
#dubflow-admin-modal button { border-radius: 10px !important; font-weight: 650 !important; text-transform: none !important; }
#dubflow-admin-modal input, #dubflow-admin-modal textarea, #dubflow-admin-modal select {
  background: #fff !important; color: var(--ui-ink) !important; border-color: var(--ui-line-strong) !important; border-radius: 10px !important;
}
#dubflow-admin-modal [class*="border-white/10"], #dubflow-admin-modal [class*="border-white/5"] { border-color: var(--ui-line) !important; }
#btn-admin-floating-pill {
  background: var(--ui-green) !important;
  border: 1px solid #1e4e37 !important;
  border-radius: 999px !important;
  color: #fff !important;
  box-shadow: 0 8px 20px rgba(35, 78, 55, .22) !important;
  letter-spacing: 0 !important;
}

/* Footer and small details. */
#root footer, #root [class*="border-t"][class*="text-gray-500"] {
  color: #8a958c !important;
  border-color: var(--ui-line) !important;
}
#root ::selection { background: #d4e7d5 !important; color: #214c39 !important; }
#root ::-webkit-scrollbar { width: 7px !important; height: 7px !important; }
#root ::-webkit-scrollbar-track { background: transparent !important; }
#root ::-webkit-scrollbar-thumb { background: #d6e0d6 !important; border-radius: 999px !important; }
#root ::-webkit-scrollbar-thumb:hover { background: #b7c9b8 !important; }

/* Keep the layout usable on tablets and small screens. */
@media (max-width: 1024px) {
  #root div[class*="max-w-7xl"] { width: calc(100% - 36px) !important; padding-top: 25px !important; }
  #root div[class*="w-64"][class*="flex-col"] { width: 250px !important; min-width: 250px !important; }
}
@media (max-width: 767px) {
  html, body { background: var(--ui-canvas) !important; }
  #root div[class*="w-64"][class*="flex-col"] {
    width: min(86vw, 300px) !important;
    min-width: min(86vw, 300px) !important;
    box-shadow: 18px 0 48px rgba(28, 47, 33, .14) !important;
  }
  #root div[class*="max-w-7xl"] { width: calc(100% - 28px) !important; padding-top: 18px !important; padding-bottom: 28px !important; }
  #root div[class*="max-w-7xl"] > div:first-child[class*="bg-"] { padding: 20px !important; border-radius: 18px !important; }
  #root div[class*="max-w-md"][class*="bg-[#12151F]"] { padding: 24px !important; border-radius: 20px !important; }
  #root div[class*="grid-cols-12"] { grid-template-columns: minmax(0, 1fr) !important; }
  #root button { min-height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  #root *, #root *::before, #root *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
