
/* =========================================================
   AMOORE STUDIO 2.0
   Premium visual system
   ========================================================= */

:root {
  color-scheme: light;

  --bg: #f5f4f7;
  --surface: #ffffff;
  --surface-soft: #faf9fb;
  --surface-hover: #f0eef3;

  --text: #17151d;
  --text-secondary: #494451;
  --text-muted: #716b79;

  --border: #e5e1e9;
  --border-strong: #d6cfdf;

  --purple: #35204f;
  --purple-soft: #eee9f3;
  --purple-line: #c9bbd8;

  --gold: #a88a4d;
  --gold-soft: #eee5d3;

  --success: #276348;
  --success-bg: #e8f2ec;
  --warning: #79551e;
  --warning-bg: #f5eedf;
  --danger: #923e49;
  --danger-bg: #f7e9eb;

  --sidebar-width: 258px;
  --topbar-height: 76px;

  --radius-xs: 7px;
  --radius-sm: 11px;
  --radius-md: 15px;
  --radius-lg: 21px;
  --radius-xl: 27px;

  --shadow-sm: 0 2px 8px rgba(27, 20, 38, .035);
  --shadow-md: 0 12px 34px rgba(27, 20, 38, .065);
  --shadow-lg: 0 22px 65px rgba(27, 20, 38, .13);

  --transition: 180ms ease;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", "Manrope", -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(92, 65, 119, .28);
  outline-offset: 3px;
}

::selection {
  background: #dcd0e8;
  color: #20142e;
}

/* =========================================================
   APP LAYOUT
   ========================================================= */

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 20;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  padding: 27px 18px 18px;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.main,
.main-content {
  min-width: 0;
  margin-left: var(--sidebar-width);
}

.main {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  z-index: 15;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--topbar-height);
  padding: 0 42px;
  background: rgba(245, 244, 247, .92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
}

body.dark .topbar {
  background: rgba(8, 8, 23, .9);
}

.topbar-left,
.topbar-right,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 13px;
}

#breadcrumb-current {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.content,
.main-content {
  padding: 38px 42px 58px;
}

.view {
  display: none;
  width: 100%;
  animation: view-enter .24s ease both;
}

.view.active {
  display: block;
}

@keyframes view-enter {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================================================
   BRAND
   ========================================================= */

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 9px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  color: #fff;
  background: #111020;
  border: 1px solid #4b3a60;
  border-radius: 12px;
  font-family: "Manrope", sans-serif;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -1.5px;
}

.brand-name {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-name strong,
.brand-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.65px;
}

.brand-name span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* =========================================================
   WORKSPACE
   ========================================================= */

.workspace-switcher {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 31px 0 25px;
  padding: 12px 11px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.workspace-avatar {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #fff;
  background: var(--purple);
  border-radius: 9px;
  font-size: 12px;
  font-weight: 800;
}

.workspace-info {
  min-width: 0;
  flex: 1;
}

.workspace-info span,
.workspace-info small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-info span {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.workspace-info small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 10px;
}

/* =========================================================
   SIDEBAR NAVIGATION
   ========================================================= */

.sidebar-label {
  margin: 0 10px 10px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.35px;
  text-transform: uppercase;
}

.sidebar-nav,
.nav-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 43px;
  padding: 0 12px;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  transition: background var(--transition), color var(--transition),
    border-color var(--transition);
}

.nav-item:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.nav-item.active {
  color: var(--purple);
  background: var(--purple-soft);
  border-color: var(--purple-line);
}

.nav-item.active::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: -1px;
  width: 2px;
  background: var(--purple);
  border-radius: 3px;
  content: "";
}

.nav-icon {
  display: grid;
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  place-items: center;
  font-size: 15px;
}

.nav-count,
#project-count {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  margin-left: auto;
  padding: 0 6px;
  place-items: center;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 10px;
  font-weight: 700;
}

.sidebar-spacer {
  flex: 1;
  min-height: 30px;
}

/* =========================================================
   PROFILE
   ========================================================= */

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 9px 3px;
  border-top: 1px solid var(--border);
}

.profile-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  color: #fff;
  background: #282032;
  border: 1px solid #59476a;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
}

.profile-info {
  min-width: 0;
  flex: 1;
}

.profile-info strong,
.profile-info span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-info strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.profile-info span {
  color: var(--text-muted);
  font-size: 10px;
}

/* =========================================================
   PAGE HEADINGS
   ========================================================= */

.page-heading,
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 27px;
}

.page-heading h1,
.section-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(25px, 3vw, 34px);
  font-weight: 800;
  letter-spacing: -1.4px;
  line-height: 1.15;
}

.page-heading p,
.section-heading p {
  max-width: 590px;
  margin: 9px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.65;
}

.eyebrow,
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 11px;
  color: var(--purple);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}

.eyebrow::before,
.section-eyebrow::before {
  width: 21px;
  height: 1px;
  background: var(--gold);
  content: "";
}

/* =========================================================
   WELCOME PANEL
   ========================================================= */

.welcome-banner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  min-height: 190px;
  margin-bottom: 32px;
  padding: 31px 35px;
  overflow: hidden;
  color: #fff;
  background: #0a0919;
  border: 1px solid #453454;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.welcome-banner::before {
  position: absolute;
  top: -100px;
  right: 8%;
  width: 330px;
  height: 330px;
  border: 1px solid rgba(180, 155, 204, .2);
  border-radius: 50%;
  content: "";
}

.welcome-banner::after {
  position: absolute;
  top: -50px;
  right: 13%;
  width: 230px;
  height: 230px;
  border: 1px solid rgba(180, 155, 204, .13);
  border-radius: 50%;
  content: "";
}

.welcome-content {
  position: relative;
  z-index: 1;
  max-width: 560px;
}

.welcome-banner .eyebrow {
  color: #d8c9e7;
}

.welcome-banner h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 800;
  letter-spacing: -1.1px;
}

.welcome-banner p {
  max-width: 460px;
  margin: 10px 0 0;
  color: #d1cbd9;
  font-size: 13px;
  line-height: 1.7;
}

.welcome-decoration {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100px;
  height: 100px;
  flex: 0 0 100px;
  place-items: center;
  color: #e8d9b5;
  border: 1px solid rgba(185, 154, 88, .55);
  border-radius: 50%;
  font-family: "Manrope", sans-serif;
  font-size: 37px;
  font-weight: 300;
}

/* =========================================================
   BUTTONS
   ========================================================= */

.btn,
.primary-button,
.secondary-button,
.ghost-button,
button.primary-button,
button.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: transform var(--transition), background var(--transition),
    border-color var(--transition), box-shadow var(--transition);
}

.btn:hover,
.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.primary-button {
  color: #fff;
  background: #21172e;
  border-color: #49365d;
  box-shadow: 0 4px 12px rgba(35, 22, 49, .12);
}

.primary-button:hover {
  background: #35204f;
  box-shadow: 0 7px 18px rgba(35, 22, 49, .17);
}

.secondary-button {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border-strong);
}

.secondary-button:hover {
  background: var(--surface-soft);
  border-color: var(--purple-line);
}

.ghost-button {
  color: var(--text-secondary);
  background: transparent;
  border-color: transparent;
}

.ghost-button:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.icon-button,
#theme-toggle {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  transition: all var(--transition);
}

.icon-button:hover,
#theme-toggle:hover {
  color: var(--purple);
  border-color: var(--purple-line);
}

/* =========================================================
   TOOLBAR / SEARCH / FILTER
   ========================================================= */

.projects-toolbar,
.toolbar,
.media-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 13px;
  margin-bottom: 20px;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-box {
  position: relative;
  min-width: 230px;
}

.search-box input,
input[type="search"],
#project-search {
  width: 100%;
  min-height: 42px;
  padding: 0 14px 0 38px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  font-size: 12px;
}

.search-box::before {
  position: absolute;
  top: 10px;
  left: 13px;
  color: var(--text-muted);
  font-size: 14px;
  content: "⌕";
  pointer-events: none;
}

#project-filter,
select {
  min-height: 42px;
  padding: 0 34px 0 12px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 12px;
  cursor: pointer;
}

input::placeholder,
textarea::placeholder {
  color: #77717e;
  opacity: 1;
}

/* =========================================================
   PROJECT GRID / CARDS
   ========================================================= */

.projects-grid,
#projects-grid,
.template-grid,
#template-grid,
.media-grid,
#media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 19px;
}

.project-card,
.template-card {
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), border-color var(--transition),
    box-shadow var(--transition);
}

.project-card:hover,
.template-card:hover {
  transform: translateY(-3px);
  border-color: var(--purple-line);
  box-shadow: var(--shadow-md);
}

.project-cover {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  height: 145px;
  padding: 17px;
  overflow: hidden;
  background: #21172e;
}

.project-cover::before,
.project-cover::after {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 50%;
  content: "";
}

.project-cover::before {
  top: -85px;
  right: -25px;
  width: 210px;
  height: 210px;
}

.project-cover::after {
  top: -55px;
  right: 10px;
  width: 150px;
  height: 150px;
}

.cover-1 {
  background: linear-gradient(135deg, #171326, #35204f);
}

.cover-2 {
  background: linear-gradient(135deg, #282032, #62513f);
}

.cover-3 {
  background: linear-gradient(135deg, #11101c, #40364b);
}

.cover-4 {
  background: linear-gradient(135deg, #282238, #4d3c54);
}

.cover-symbol {
  position: relative;
  z-index: 1;
  display: grid;
  width: 45px;
  height: 45px;
  place-items: center;
  color: #eee3ca;
  border: 1px solid rgba(201, 175, 119, .65);
  border-radius: 50%;
  font-size: 16px;
  font-weight: 700;
}

.project-card-body,
.template-card-body {
  padding: 18px;
}

.project-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.project-card h3,
.template-card h3 {
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -.25px;
  overflow-wrap: anywhere;
}

.project-card-body > p,
.template-card-body > p {
  min-height: 39px;
  margin: 9px 0 17px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.65;
}

.project-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 13px;
  border-top: 1px solid var(--border);
}

.project-card-footer > span {
  color: var(--text-muted);
  font-size: 10px;
}

.open-project,
.template-use {
  padding: 0;
  color: var(--purple);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.open-project:hover,
.template-use:hover {
  color: var(--gold);
}

/* =========================================================
   STATUS PILLS
   ========================================================= */

.draft-pill,
.active-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-height: 23px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.draft-pill {
  color: var(--warning);
  background: var(--warning-bg);
}

.active-pill {
  color: var(--success);
  background: var(--success-bg);
}

/* =========================================================
   EMPTY STATES
   ========================================================= */

.empty-state,
#projects-empty,
#media-empty {
  display: none;
  min-height: 240px;
  padding: 45px 20px;
  place-items: center;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}

.empty-state.show,
#projects-empty.show,
#media-empty.show {
  display: grid;
}

.empty-state h3,
#projects-empty h3,
#media-empty h3 {
  margin: 12px 0 5px;
  color: var(--text);
  font-size: 17px;
  font-weight: 800;
}

.empty-state p,
#projects-empty p,
#media-empty p {
  max-width: 380px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.7;
}

.empty-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  color: var(--purple);
  background: var(--purple-soft);
  border: 1px solid var(--purple-line);
  border-radius: 15px;
  font-size: 21px;
}

/* =========================================================
   TEMPLATES
   ========================================================= */

.template-preview {
  display: grid;
  min-height: 170px;
  padding: 22px;
  place-items: center;
  overflow: hidden;
}

.tone-lilac {
  background: #e8e0ed;
}

.tone-sand {
  background: #e9e1d4;
}

.tone-mint {
  background: #dce7df;
}

.tone-blue {
  background: #dedde7;
}

.tone-dark {
  background: #24202e;
}

.tone-peach {
  background: #eddfd8;
}

.preview-paper {
  width: 76%;
  min-height: 112px;
  padding: 13px;
  background: #fff;
  border: 1px solid rgba(36, 25, 46, .13);
  border-radius: 5px;
  box-shadow: 0 9px 25px rgba(28, 22, 34, .13);
}

.preview-line {
  width: 48%;
  height: 5px;
  margin-bottom: 7px;
  background: #b7a8c5;
  border-radius: 4px;
}

.preview-line.long {
  width: 75%;
  height: 8px;
  background: #2b2334;
}

.preview-blocks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 15px;
}

.preview-blocks i {
  display: block;
  height: 31px;
  background: #e8e3eb;
  border-radius: 3px;
}

.template-card-body .template-use {
  margin-top: 2px;
}

/* =========================================================
   MEDIA LIBRARY
   ========================================================= */

.media-grid,
#media-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.media-item {
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.media-item img {
  display: block;
  width: 100%;
  height: 155px;
  object-fit: cover;
  background: var(--surface-soft);
}

.media-item > div {
  padding: 10px 11px;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-upload-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 16px;
  color: #fff;
  background: #21172e;
  border: 1px solid #49365d;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.media-upload-label:hover {
  background: var(--purple);
}

input[type="file"] {
  max-width: 100%;
  color: var(--text-secondary);
  font-size: 11px;
}

/* =========================================================
   SETTINGS
   ========================================================= */

.settings-layout {
  display: grid;
  grid-template-columns: 205px minmax(0, 1fr);
  gap: 25px;
  align-items: start;
}

.settings-sidebar,
.settings-menu {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.settings-tab {
  min-height: 39px;
  padding: 0 12px;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-size: 12px;
  font-weight: 650;
}

.settings-tab:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.settings-tab.active {
  color: var(--purple);
  background: var(--purple-soft);
  border-color: var(--purple-line);
}

.settings-content {
  display: none;
  padding: 25px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.settings-content.active {
  display: block;
}

.settings-content h2 {
  margin: 0 0 7px;
  color: var(--text);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.5px;
}

.settings-content > p {
  margin: 0 0 24px;
  color: var(--text-secondary);
  font-size: 12px;
}

.settings-field {
  max-width: 500px;
  margin-bottom: 21px;
}

.settings-field label,
.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.settings-field input,
.form-group input,
.form-group textarea,
.form-group select,
#workspace-name-input {
  width: 100%;
  min-height: 43px;
  padding: 10px 12px;
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  outline: none;
  font-size: 12px;
}

.settings-field input:focus,
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(53, 32, 79, .08);
}

.theme-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 140px;
  padding: 12px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.theme-option.active {
  border-color: var(--purple);
  box-shadow: 0 0 0 2px rgba(53, 32, 79, .09);
}

.theme-swatch {
  width: 27px;
  height: 27px;
  border: 1px solid var(--border);
  border-radius: 7px;
}

.theme-swatch.light {
  background: #fff;
}

.theme-swatch.dark {
  background: #080817;
  border-color: #49365d;
}

/* =========================================================
   PROJECT DETAIL
   ========================================================= */

.project-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 25px;
}

.detail-card,
.project-detail-card {
  padding: 25px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.detail-card h2,
.project-detail-card h2 {
  margin: 0 0 9px;
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
}

.detail-card p,
.project-detail-card p {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.7;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px;
  margin-top: 20px;
}

.detail-placeholder {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 130px;
  padding: 19px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.detail-placeholder strong {
  color: var(--text);
  font-size: 13px;
}

.detail-placeholder span {
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.6;
}

/* =========================================================
   MODALS
   ========================================================= */

.modal-backdrop,
#project-modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 8, 18, .56);
  backdrop-filter: blur(7px);
}

.modal-backdrop.open,
#project-modal.open {
  display: flex;
}

.modal,
.modal-card {
  width: min(100%, 490px);
  max-height: min(90vh, 720px);
  padding: 27px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--purple-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: modal-enter .2s ease both;
}

@keyframes modal-enter {
  from {
    opacity: 0;
    transform: translateY(9px) scale(.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal h2,
.modal-card h2 {
  margin: 0 0 7px;
  color: var(--text);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.6px;
}

.modal-description {
  margin: 0 0 22px;
  color: var(--text-secondary);
  font-size: 12px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group textarea {
  min-height: 95px;
  resize: vertical;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 23px;
}

/* =========================================================
   TOASTS
   ========================================================= */

#toast,
.toast {
  position: fixed;
  z-index: 150;
  right: 25px;
  bottom: 25px;
  max-width: min(380px, calc(100vw - 40px));
  padding: 13px 17px;
  color: #fff;
  background: #21172e;
  border: 1px solid #69537d;
  border-radius: 11px;
  box-shadow: var(--shadow-lg);
  font-size: 12px;
  font-weight: 650;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity var(--transition), transform var(--transition);
}

#toast.show,
.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================================
   GOLD MICRO-DETAILS
   ========================================================= */

.gold-divider {
  width: 46px;
  height: 1px;
  margin: 17px 0;
  background: var(--gold);
}

.gold-line {
  width: 100%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(168, 138, 77, .65),
    transparent
  );
}

/* =========================================================
   UTILITIES
   ========================================================= */

.muted {
  color: var(--text-secondary);
}

.text-small {
  font-size: 11px;
}

.hidden {
  display: none !important;
}

hr {
  height: 1px;
  margin: 20px 0;
  background: var(--border);
  border: 0;
}

/* =========================================================
   DARK THEME
   ========================================================= */

body.dark {
  color-scheme: dark;

  --bg: #080817;
  --surface: #0e0d1d;
  --surface-soft: #131225;
  --surface-hover: #1a172b;

  --text: #f4f1f8;
  --text-secondary: #c4bdce;
  --text-muted: #a39aad;

  --border: #292239;
  --border-strong: #3b2c50;

  --purple: #c4a9df;
  --purple-soft: #20172e;
  --purple-line: #4b3762;

  --gold: #c2a46a;
  --gold-soft: #302817;

  --success: #9ac9ac;
  --success-bg: #14291f;
  --warning: #d9bd7f;
  --warning-bg: #302817;
  --danger: #e0a2aa;
  --danger-bg: #321b23;

  --shadow-sm: 0 2px 10px rgba(0, 0, 0, .16);
  --shadow-md: 0 12px 34px rgba(0, 0, 0, .22);
  --shadow-lg: 0 22px 65px rgba(0, 0, 0, .42);
}

body.dark .sidebar {
  background: #0b0a19;
  border-right-color: #30243e;
}

body.dark .workspace-switcher,
body.dark .settings-sidebar,
body.dark .settings-menu {
  background: #111021;
  border-color: var(--border);
}

body.dark .brand-mark {
  color: #f2e9fa;
  background: #171225;
  border-color: #59446d;
}

body.dark .nav-item.active {
  color: #e4d4f4;
  background: #21172f;
  border-color: #49365e;
}

body.dark .nav-item.active::before {
  background: #b99bce;
}

body.dark .welcome-banner {
  background: #080817;
  border-color: #49365e;
}

body.dark .welcome-banner p {
  color: #d1c9dc;
}

body.dark .primary-button,
body.dark .media-upload-label {
  color: #fff;
  background: #35204f;
  border-color: #765b91;
}

body.dark .primary-button:hover,
body.dark .media-upload-label:hover {
  background: #493260;
}

body.dark .secondary-button,
body.dark .icon-button,
body.dark #theme-toggle {
  color: var(--text);
  background: #151326;
  border-color: var(--border-strong);
}

body.dark .project-cover {
  border-bottom: 1px solid #49365e;
}

body.dark .cover-1 {
  background: linear-gradient(135deg, #080817, #241632);
}

body.dark .cover-2 {
  background: linear-gradient(135deg, #11101d, #30243c);
}

body.dark .cover-3 {
  background: linear-gradient(135deg, #090917, #211b32);
}

body.dark .cover-4 {
  background: linear-gradient(135deg, #151023, #352342);
}

body.dark .tone-lilac,
body.dark .tone-sand,
body.dark .tone-mint,
body.dark .tone-blue,
body.dark .tone-peach {
  filter: brightness(.72) saturate(.55);
}

body.dark .tone-dark {
  background: #181425;
}

body.dark .preview-paper {
  background: #f6f3f8;
}

body.dark .preview-line.long {
  background: #282032;
}

body.dark .preview-blocks i {
  background: #e5dfea;
}

body.dark .settings-tab.active {
  color: #e4d4f4;
  background: #21172f;
  border-color: #49365e;
}

body.dark .theme-option {
  background: #111021;
  border-color: var(--border);
}

body.dark .theme-option.active {
  border-color: #9473b0;
}

body.dark input,
body.dark select,
body.dark textarea,
body.dark #project-search,
body.dark #project-filter,
body.dark #workspace-name-input {
  color: var(--text);
  background: #131225;
  border-color: var(--border-strong);
}

body.dark input::placeholder,
body.dark textarea::placeholder {
  color: #a39aad;
}

body.dark .empty-state,
body.dark #projects-empty,
body.dark #media-empty {
  background: #0e0d1d;
  border-color: #49365e;
}

body.dark .draft-pill {
  color: #e0c58e;
  background: #302817;
}

body.dark .active-pill {
  color: #a8d5b7;
  background: #14291f;
}

body.dark .toast,
body.dark #toast {
  background: #21172e;
  border-color: #765b91;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1200px) {
  .projects-grid,
  #projects-grid,
  .template-grid,
  #template-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .media-grid,
  #media-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .content,
  .main-content {
    padding-right: 30px;
    padding-left: 30px;
  }

  .topbar {
    padding-right: 30px;
    padding-left: 30px;
  }
}

@media (max-width: 900px) {
  :root {
    --sidebar-width: 218px;
  }

  .sidebar {
    padding-right: 13px;
    padding-left: 13px;
  }

  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-sidebar,
  .settings-menu {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .settings-tab {
    flex: 1 1 auto;
  }
}

@media (max-width: 650px) {
  :root {
    --sidebar-width: 0px;
    --topbar-height: 62px;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    width: 100%;
    height: auto;
    padding: 11px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .brand {
    padding: 0;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .workspace-switcher,
  .sidebar-label,
  .sidebar-spacer,
  .sidebar-profile {
    display: none;
  }

  .sidebar-nav,
  .nav-list {
    flex-direction: row;
    gap: 5px;
    margin-top: 11px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .sidebar-nav::-webkit-scrollbar,
  .nav-list::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    width: auto;
    min-width: 43px;
    min-height: 39px;
    justify-content: center;
    padding: 0 10px;
    white-space: nowrap;
  }

  .nav-item.active::before {
    top: auto;
    right: 9px;
    bottom: -1px;
    left: 9px;
    width: auto;
    height: 2px;
  }

  .main,
  .main-content {
    margin-left: 0;
  }

  .topbar {
    min-height: var(--topbar-height);
    padding: 0 17px;
  }

  .content,
  .main-content {
    padding: 25px 17px 40px;
  }

  .page-heading,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 15px;
  }

  .welcome-banner {
    min-height: 170px;
    padding: 24px 21px;
  }

  .welcome-decoration {
    width: 65px;
    height: 65px;
    flex-basis: 65px;
    font-size: 25px;
  }

  .projects-grid,
  #projects-grid,
  .template-grid,
  #template-grid,
  .media-grid,
  #media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .projects-toolbar,
  .toolbar,
  .media-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-left,
  .toolbar-right {
    width: 100%;
  }

  .search-box {
    flex: 1;
    min-width: 0;
  }

  #project-filter {
    max-width: 150px;
  }

  .project-cover {
    height: 115px;
  }

  .project-card-body,
  .template-card-body {
    padding: 13px;
  }

  .project-card-top {
    flex-direction: column;
  }

  .project-card-body > p,
  .template-card-body > p {
    min-height: 0;
  }

  .media-item img {
    height: 115px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .settings-content {
    padding: 18px;
  }
}

@media (max-width: 390px) {
  .projects-grid,
  #projects-grid,
  .template-grid,
  #template-grid,
  .media-grid,
  #media-grid {
    grid-template-columns: 1fr;
  }

  .welcome-decoration {
    display: none;
  }

  .modal,
  .modal-card {
    padding: 21px;
  }
}

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

/* AMOORE STUDIO 2.0 — NEW CONTROLS */

.project-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.project-card-actions button {
  padding: 6px 9px;
  color: var(--text-secondary);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 7px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  transition: all var(--transition);
}

.project-card-actions button:hover {
  color: var(--purple);
  border-color: var(--purple-line);
}

.project-card-actions button:last-child:hover {
  color: var(--danger);
  border-color: var(--danger);
}

.media-toolbar input {
  width: min(280px, 100%);
  min-height: 40px;
  padding: 0 12px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
}

.media-preview-button {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  background: transparent;
  border: 0;
  cursor: zoom-in;
}

.media-item-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
}

.media-item-info span {
  min-width: 0;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-item-info button {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  place-items: center;
  color: var(--text-secondary);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 7px;
  cursor: pointer;
  font-size: 16px;
}

.media-item-info button:hover {
  color: var(--danger);
  border-color: var(--danger);
}

.media-lightbox {
  position: relative;
  width: min(900px, 95vw);
  max-height: 90vh;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--purple-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.media-lightbox img {
  display: block;
  max-width: 100%;
  max-height: 75vh;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 8px;
}

.media-lightbox p {
  margin: 12px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
  text-align: center;
  overflow-wrap: anywhere;
}

.media-lightbox-close {
  position: absolute;
  z-index: 2;
  top: 9px;
  right: 9px;
  width: 34px;
  height: 34px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
}

.project-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 17px;
}

.template-category {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--gold);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

@media (max-width: 650px) {
  .project-card-actions {
    gap: 5px;
  }

  .project-card-actions button {
    padding: 6px 7px;
    font-size: 9px;
  }

  .media-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .media-toolbar input {
    width: 100%;
  }
}
