/* Melloo UI foundation: tokens, layout, components, and responsive rules. */
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-variable-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --background-1: #0f0f0f;
  --background-2: #181818;
  --border-1: #242424;
  --white-1: #ffffff;
  --white-3: #aeaeae;
  --accent-1: #f772c5;
  --ink: #171813;
  --muted: #72746c;
  --line: #e8e7df;
  --paper: #f7f7f2;
  --white: #ffffff;
  --acid: #d8ff4f;
  --acid-dark: #b9e52a;
  --lilac: #ded6ff;
  --blue: #cae9ff;
  --coral: #ffd3bd;
  --sidebar: 260px;
  --shadow: 0 14px 40px rgba(31, 34, 20, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--background-1); font-family: "Inter", sans-serif; line-height: 1em; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: var(--sidebar); padding: 0 12px 12px; background: var(--background-1); border-right: 1px solid var(--border-1); color: #eee; display: flex; flex-direction: column; transition: transform .2s ease; }
.brand-row { height: 50px; margin: 0 -12px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; }
.logo { padding-left: 10px; color: var(--white-1); text-decoration: none; font-size: 16px; font-weight: 600; }
.sidebar nav { margin-top: 16px; }
.sidebar-close { display: none !important; color: #fff !important; }

.nav-label { margin: 0 11px 9px; color: var(--white-3); text-transform: none; font-size: 12px; font-weight: 500; }
.nav-label-spaced { margin-top: 25px; }
.nav-item { color: var(--white-3); height: 32px; margin-bottom: 2px; display: flex; align-items: center; gap: 12px; padding: 0 11px; border-radius: 9px; text-decoration: none; font-size: 14px; font-weight: 500; transition: .18s ease; }
.nav-item svg { width: 16px; height: 16px; }
.nav-item:hover { background: var(--background-2); }
.nav-item.active { color: #fff; background: var(--background-2); }
.nav-item.active svg { color: inherit; }
.sidebar-bottom { margin-top: auto; }
.usage-card { padding: 12px; margin-bottom: 0; border: 0; border-radius: 9px; background: var(--background-2); display: grid; gap: 2px; }
.usage-row { min-height: 22px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; }
.usage-row span { color: var(--white-3); }
.usage-row strong { color: var(--white-1); font-weight: 400; text-align: right; }
.plan-actions { display: flex; align-items: center; gap: 6px; }
.plan-divider { width: 3px; height: 3px; border-radius: 50%; background: var(--white-3); }
.plan-actions button { padding: 0; border: 0; background: transparent; color: var(--accent-1); font-size: 12px; font-weight: 400; cursor: pointer; }

.projects-page { width: 100%; max-width: 1050px; margin: 0 auto; color: var(--white-1); }
.projects-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.projects-heading h1 { margin: 0; font-family: "Inter", sans-serif; font-size: 22px; line-height: normal; font-weight: 500; font-style: normal; }
.projects-actions { display: flex; align-items: center; gap: 8px; }
.project-action { height: 36px; padding: 0 12px; border: 1px solid var(--border-1); border-radius: 9px; background: transparent; color: var(--white-1); display: flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; }
.project-action[hidden] { display: none; }
.project-action:hover { background: var(--background-2); }
.project-action svg { width: 16px; height: 16px; }
.project-action.primary { border-color: var(--accent-1); background: var(--accent-1); color: var(--background-1); }
.project-action.primary:hover { opacity: .9; }
.projects-tabs { position: relative; margin-top: 24px; padding-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.projects-tabs::after { content: ""; position: absolute; right: 0; bottom: 0; left: 0; height: 1px; background: var(--border-1); }
.projects-tabs button { position: relative; z-index: 2; height: 32px; padding: 0 10px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--white-3); font-size: 13px; cursor: pointer; }
.projects-tabs button.active { color: var(--white-1); }
.projects-tabs-active { position: absolute; z-index: 1; top: 0; height: 32px; border: 0; border-radius: 9px; background: var(--background-2); pointer-events: none; transition: left .18s ease, width .18s ease; }
.projects-tabs-indicator { position: absolute; z-index: 2; bottom: 0; height: 1px; background: var(--white-1); pointer-events: none; transition: left .18s ease, width .18s ease; }
.projects-toolbar { margin-top: 16px; display: flex; align-items: center; gap: 8px; }
.projects-search { min-width: 0; height: 40px; padding: 0 12px; display: flex; flex: 1; align-items: center; gap: 9px; border: 1px solid var(--border-1); border-radius: 9px; background: transparent; }
.projects-search:focus-within { border-color: #3a3a3b; }
.projects-search svg { width: 16px; height: 16px; flex: none; color: #858781; }
.projects-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--white-1); font-size: 13px; }
.projects-search input::placeholder { color: #73756f; }
.projects-view-toggle { position: relative; height: 40px; padding: 4px; display: flex; align-items: center; gap: 2px; border-radius: 9px; background: var(--background-2); }
.projects-view-toggle button { position: relative; z-index: 2; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 7px; display: grid; place-items: center; background: transparent; color: var(--white-3); cursor: pointer; }
.projects-view-toggle button.active { color: var(--white-1); }
.projects-view-active { position: absolute; z-index: 1; top: 4px; left: 4px; width: 32px; height: 32px; border-radius: 7px; background: var(--background-1); pointer-events: none; transition: left .18s ease; }
.projects-view-toggle svg { width: 16px; height: 16px; }
.projects-table { margin-top: 24px; }
.projects-table-head { min-height: 42px; display: grid; grid-template-columns: minmax(260px, 2fr) repeat(3, minmax(100px, .7fr)); align-items: center; gap: 20px; border-bottom: 1px solid var(--border-1); color: #aeb0a8; font-size: 12px; }
.projects-skeleton-row { min-height: 52px; display: grid; grid-template-columns: minmax(260px, 2fr) repeat(3, minmax(100px, .7fr)); align-items: center; gap: 20px; border-bottom: 1px solid var(--border-1); }
.projects-skeleton-row span { width: 58%; max-width: 130px; height: 10px; border-radius: 4px; background: var(--background-2); animation: skeleton-pulse 1.6s ease-in-out infinite; }
.projects-skeleton-row span:first-child { width: 42%; max-width: 180px; }
.projects-skeleton-grid { display: none; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; padding-top: 12px; }
.skeleton-card { min-width: 0; }
.skeleton-card span { display: block; border-radius: 5px; background: var(--background-2); animation: skeleton-pulse 1.6s ease-in-out infinite; }
.skeleton-preview { width: 100%; aspect-ratio: 16 / 10; border-radius: 9px !important; }
.skeleton-title { width: 62%; height: 10px; margin-top: 10px; }
.skeleton-meta { width: 38%; height: 8px; margin-top: 7px; opacity: .65; }
.projects-table[data-view="grid"] .projects-table-head,
.projects-table[data-view="grid"] .projects-skeleton-list { display: none; }
.projects-table[data-view="grid"] .projects-skeleton-grid { display: grid; }
@keyframes skeleton-pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.top-avatar { display: grid; place-items: center; font-weight: 700; }

.main { min-height: 100vh; margin-left: var(--sidebar); background: var(--background-1); transition: margin-left .2s ease; }
.sidebar-collapsed .sidebar { transform: translateX(-100%); }
.sidebar-collapsed .main { margin-left: 0; }
.topbar { position: sticky; top: 0; z-index: 20; height: 50px; padding: 0 12px; background: var(--background-1); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border-1); display: flex; align-items: center; justify-content: space-between; }
.search-wrap { width: min(440px, 48vw); height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.search-wrap svg { width: 18px; color: #a5a79f; }
.search-wrap input { min-width: 0; flex: 1; border: 0; outline: none; color: var(--ink); background: transparent; font-size: 13px; }
.search-wrap input::placeholder { color: #a4a69f; }
.shortcut { color: #a8aaa2; background: #f2f2ed; padding: 3px 6px; border-radius: 5px; font-size: 10px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.topbar-left { display: flex; align-items: center; }
.icon-btn { position: relative; width: 38px; height: 38px; border: 0; background: transparent; color: #65675f; display: grid; place-items: center; border-radius: 9px; cursor: pointer; }
.icon-btn:hover { background: #ecece6; }
.notification-dot { position: absolute; width: 6px; height: 6px; right: 8px; top: 8px; border: 1.5px solid var(--paper); border-radius: 50%; background: #ff705e; }
.topbar .icon-btn, .top-avatar { width: 32px; height: 32px; border: 1px solid var(--border-1); border-radius: 9px; background: transparent; color: var(--white-1); cursor: pointer; }
.topbar .sidebar-toggle { border: 0; }
.topbar .icon-btn:hover, .top-avatar:hover { background: var(--background-2); }
.topbar .icon-btn svg { width: 16px; height: 16px; stroke-width: 2; }
.feedback-button { height: 32px; padding: 0 10px; border: 1px solid var(--border-1); border-radius: 9px; background: transparent; color: var(--white-1); font-size: 13px; cursor: pointer; }
.feedback-button:hover { background: var(--background-2); }
.header-breadcrumb { padding: 0 10px; display: flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.header-breadcrumb svg { width: 12px; height: 12px; color: var(--white-3); }
.breadcrumb-parent { color: var(--white-3); }
.breadcrumb-current { color: var(--white-1); }
.top-avatar svg { width: 16px; height: 16px; stroke-width: 2; }

.content { width: 100%; margin: 0; padding: clamp(12px, 6vw, 90px) 12px; }
.welcome-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; }
.eyebrow { margin: 0 0 12px; color: #969890; font-size: 10px; font-weight: 700; }
h1 { margin: 0; font-size: clamp(38px, 5vw, 62px); line-height: .98; font-weight: 600; }
h1 em { font-family: "Inter", sans-serif; font-weight: 400; color: #777a70; }
.subhead { margin: 16px 0 0; color: var(--muted); font-size: 14px; }
.primary-action { height: 43px; padding: 0 19px; flex: none; border: 0; border-radius: 10px; background: var(--ink); color: #fff; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.primary-action:hover { background: #33352d; }
.primary-action svg { width: 17px; }

.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 44px 0 54px; }
.quick-card { min-height: 102px; display: flex; align-items: center; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); text-align: left; cursor: pointer; transition: .2s ease; }
.quick-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #d9d8cf; }
.quick-icon { width: 48px; height: 48px; display: grid; place-items: center; flex: none; background: var(--lilac); border-radius: 12px; }
.quick-icon svg { width: 22px; }
.icon-blue { background: var(--blue); }
.icon-coral { background: var(--coral); }
.quick-card > span:nth-child(2) { display: grid; gap: 4px; min-width: 0; }
.quick-card strong { font-size: 14px; }
.quick-card small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.quick-arrow { width: 17px; margin-left: auto; color: #a2a49d; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 18px; }
.section-heading h2 { margin: 0 0 5px; font-size: 20px; }
.section-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.section-heading a { display: flex; align-items: center; gap: 4px; color: #55574f; text-decoration: none; font-size: 12px; font-weight: 600; }
.section-heading a:hover { color: #111; }
.section-heading a svg { width: 15px; }
.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.project-card { min-width: 0; cursor: pointer; }
.project-preview { position: relative; aspect-ratio: 16/10; overflow: hidden; border-radius: 13px; transition: .25s ease; }
.project-card:hover .project-preview { transform: translateY(-3px); box-shadow: var(--shadow); }
.project-menu { position: absolute; z-index: 2; right: 10px; top: 10px; width: 30px; height: 28px; border: 0; border-radius: 7px; color: #fff; background: rgba(15,15,13,.45); display: grid; place-items: center; cursor: pointer; }
.project-menu svg { width: 16px; }
.duration { position: absolute; z-index: 2; bottom: 9px; right: 9px; padding: 4px 6px; border-radius: 5px; color: #fff; background: rgba(12,12,10,.72); font-size: 9px; }
.preview-one { background: #ef794f; }
.preview-one:before { content: ""; position: absolute; width: 48%; height: 140%; right: 4%; top: -8%; background: #f7b477; border-radius: 50% 45% 50% 40%; transform: rotate(22deg); box-shadow: -25px 10px 0 #c94c35; }
.poster-copy { position: absolute; left: 10%; top: 31%; display: grid; color: #fff; transform: rotate(-5deg); }
.poster-copy small { font-size: clamp(7px, .8vw, 11px); font-weight: 700; }
.poster-copy strong { font-family: "Inter", sans-serif; font-size: clamp(25px, 3.2vw, 48px); line-height: .8; font-style: italic; }
.preview-two { background: #131412; display: grid; place-items: center; }
.melloo-m { z-index: 1; color: var(--acid); font-family: "Inter", sans-serif; font-size: clamp(40px, 5vw, 75px); font-style: italic; }
.ring { position: absolute; border-radius: 50%; border: 1px solid #595c4f; }
.ring-one { width: 58%; aspect-ratio: 1; }
.ring-two { width: 88%; aspect-ratio: 1; border-color: #35372f; }
.preview-two:after { content: ""; position: absolute; width: 4px; height: 4px; background: var(--acid); border-radius: 50%; left: 21%; top: 35%; box-shadow: 155px 67px 0 #8670dd, 80px 92px 0 #fff; }
.preview-three { background: #d7edf0; }
.sun { position: absolute; width: 43%; aspect-ratio: 1; border-radius: 50%; background: #f6d263; right: 7%; top: 12%; }
.cup { position: absolute; z-index: 1; width: 28%; height: 45%; right: 17%; bottom: -4%; background: #b54f39; border-radius: 5px 5px 20px 20px; transform: rotate(-7deg); box-shadow: inset 0 6px 0 #613127; }
.cup:after { content: ""; position: absolute; width: 40%; height: 42%; right: -28%; top: 17%; border: 8px solid #b54f39; border-left: 0; border-radius: 0 50% 50% 0; }
.dark-copy { color: #243b3b; top: 25%; left: 8%; transform: rotate(0); }
.project-meta { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; padding: 13px 2px 0; }
.project-meta h3 { margin: 0 0 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.project-meta p { margin: 0; color: #90928b; font-size: 10px; }
.status { padding: 4px 7px; border-radius: 5px; font-size: 9px; font-weight: 600; }
.status-draft { color: #62645e; background: #e9e9e3; }
.status-ready { color: #47621d; background: #e1f3bd; }
.tip-banner { display: flex; align-items: center; gap: 14px; margin-top: 46px; padding: 17px 18px; border: 1px solid #dfe0d6; border-radius: 13px; background: #f0f1e9; }
.tip-icon { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--acid); }
.tip-icon svg { width: 18px; }
.tip-banner div { flex: 1; }
.tip-banner strong { font-size: 12px; }
.tip-banner p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.tip-banner button { border: 0; display: flex; align-items: center; gap: 3px; background: transparent; font-size: 11px; font-weight: 700; cursor: pointer; }
.tip-banner button svg { width: 14px; }

.empty-page { min-height: 70vh; display: grid; place-items: center; text-align: center; }
.empty-page-inner { max-width: 440px; }
.empty-icon { width: 62px; height: 62px; display: grid; place-items: center; margin: 0 auto 20px; border-radius: 17px; background: var(--lilac); }
.empty-icon svg { width: 28px; height: 28px; }
.empty-page h1 { font-size: 44px; }
.empty-page p { margin: 14px 0 25px; color: var(--muted); font-size: 14px; line-height: 1.6; }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; padding: 20px; background: rgba(20,21,18,.55); backdrop-filter: blur(6px); display: grid; place-items: center; opacity: 0; pointer-events: none; transition: .2s ease; }
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal { position: relative; width: min(460px, 100%); padding: 36px; border-radius: 20px; background: #fff; box-shadow: 0 30px 100px rgba(0,0,0,.2); transform: translateY(12px) scale(.98); transition: .2s ease; }
.modal-backdrop.open .modal { transform: translateY(0) scale(1); }
.modal-close { position: absolute; top: 13px; right: 13px; }
.modal-icon { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 20px; border-radius: 13px; background: var(--acid); }
.modal-icon svg { width: 22px; }
.modal h2 { margin: 0; font-size: 29px; }
.modal > p:not(.eyebrow) { margin: 9px 0 24px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.modal-options { display: grid; gap: 10px; }
.modal-options button { width: 100%; padding: 14px; display: flex; align-items: center; gap: 13px; border: 1px solid var(--line); border-radius: 11px; background: #fff; text-align: left; cursor: pointer; }
.modal-options button:hover { border-color: #c8c9bd; background: #f8f8f4; }
.modal-options button > svg { width: 21px; }
.modal-options button span { display: grid; gap: 3px; }
.modal-options strong { font-size: 12px; }
.modal-options small { color: var(--muted); font-size: 10px; }
.toast { position: fixed; z-index: 70; left: 50%; bottom: 24px; padding: 11px 17px; border-radius: 9px; color: #fff; background: #1d1e19; box-shadow: var(--shadow); font-size: 12px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: .25s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 980px) {
  .topbar { padding: 0 12px; }
  .quick-grid { grid-template-columns: 1fr; }
  .quick-card { min-height: 84px; }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .project-card:last-child { display: none; }
}

@media (max-width: 720px) {
  .sidebar { width: min(290px, 86vw); transform: translateX(-102%); transition: transform .25s ease; box-shadow: 20px 0 50px rgba(0,0,0,.18); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: grid !important; }
  .main { margin-left: 0; }
  .topbar { height: 50px; padding: 0 12px; gap: 10px; }
  .search-wrap { width: auto; flex: 1; }
  .shortcut, .top-avatar, .feedback-button { display: none; }
  .topbar-actions { gap: 8px; }
  .welcome-row { display: block; }
  h1 { font-size: 44px; }
  .primary-action { margin-top: 24px; }
  .quick-grid { margin: 34px 0 44px; }
  .projects-grid { grid-template-columns: 1fr; }
  .project-card:last-child { display: block; }
  .tip-banner { align-items: flex-start; }
  .tip-banner button { display: none; }
  .modal { padding: 30px 22px 22px; }
  .projects-heading { align-items: flex-start; }
  .project-action { width: 36px; padding: 0; justify-content: center; font-size: 0; }
  .projects-table-head { grid-template-columns: minmax(150px, 1fr) 80px; }
  .projects-table-head span:nth-child(3), .projects-table-head span:nth-child(4) { display: none; }
  .projects-skeleton-row { grid-template-columns: minmax(150px, 1fr) 80px; }
  .projects-skeleton-row span:nth-child(3), .projects-skeleton-row span:nth-child(4) { display: none; }
  .projects-skeleton-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skeleton-card:last-child { display: none; }
}

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