/* ============================================================
   PWA Builder - UI Styles
   Ramaker Platform — Redesigned
   ============================================================ */

:root {
  --brand:         #0f85a9;
  --brand-dark:    #093653;
  --brand-light:   #e8f6fb;
  --brand-accent:  #00c9f5;
  --sidebar-bg:    #06243a;
  --sidebar-text:  rgba(255,255,255,0.72);
  --sidebar-active: #0f85a9;
  --bg:            #f0f5f9;
  --card:          #ffffff;
  --border:        #dde8f0;
  --text:          #0d1f2d;
  --text-muted:    #5a7080;
  --success:       #0d9466;
  --success-bg:    #ecfdf5;
  --danger:        #dc2626;
  --danger-bg:     #fef2f2;
  --radius:        12px;
  --radius-sm:     8px;
  --shadow:        0 1px 4px rgba(9,54,83,0.07), 0 4px 16px rgba(9,54,83,0.06);
  --shadow-md:     0 6px 24px rgba(9,54,83,0.12);
  --sidebar-width: 230px;
  --header-height: 64px;
}

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

html, body {
  height: 100%;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(15,133,169,0.25); border-radius: 3px; }

.hidden { display: none !important; }
.text-muted { color: var(--text-muted); font-size: 0.85rem; }

/* ============================================================
   LOGIN
   ============================================================ */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(145deg, #06243a 0%, #093653 45%, #0f85a9 100%);
  position: relative;
  overflow: hidden;
}

/* Background blobs */
.login-page::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: rgba(0,201,245,0.1);
  border-radius: 50%;
  filter: blur(80px);
  top: -250px; right: -200px;
  animation: builderBlob1 12s ease-in-out infinite;
}

.login-page::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: rgba(15,133,169,0.15);
  border-radius: 50%;
  filter: blur(60px);
  bottom: -150px; left: -100px;
  animation: builderBlob2 10s ease-in-out infinite;
}

@keyframes builderBlob1 {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(-20px,30px) scale(1.08); }
}
@keyframes builderBlob2 {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(15px,-20px) scale(1.06); }
}

/* Grid overlay */
.login-page .login-grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

#login-screen {
  width: 100%;
  max-width: 400px;
  padding: 16px;
  position: relative;
  z-index: 1;
}

.login-card {
  background: var(--card);
  border-radius: 20px;
  padding: 44px 36px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.35);
  animation: loginCardIn 0.5s ease both;
}

@keyframes loginCardIn {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-brand {
  text-align: center;
  margin-bottom: 36px;
}

.login-brand-icon {
  width: 68px;
  height: 68px;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  box-shadow: 0 8px 24px rgba(15,133,169,0.35);
  animation: iconBounce 0.6s cubic-bezier(0.175,0.885,0.32,1.275) 0.1s both;
}

@keyframes iconBounce {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; transform: scale(1); }
}

.login-brand-icon .material-icons-round {
  font-size: 32px;
  color: #fff;
}

.login-brand h1 {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.login-brand p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 5px;
}

/* ============================================================
   LAYOUT
   ============================================================ */
#builder-app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  position: relative;
}

/* Sidebar pattern */
.sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 18px;
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  position: relative;
  z-index: 1;
  letter-spacing: -0.01em;
}

.sidebar-brand .material-icons-round {
  color: var(--brand-accent);
  font-size: 26px;
  filter: drop-shadow(0 0 8px rgba(0,201,245,0.5));
}

.sidebar-nav {
  flex: 1;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
  z-index: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
  text-decoration: none;
  position: relative;
}

.nav-item:hover {
  background: rgba(255,255,255,0.07);
  color: #fff;
  transform: translateX(2px);
}

.nav-item.active {
  background: rgba(15,133,169,0.22);
  color: var(--brand-accent);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: linear-gradient(180deg, var(--brand), var(--brand-accent));
  border-radius: 0 3px 3px 0;
}

.nav-item .material-icons-round { font-size: 20px; }

.sidebar-footer {
  padding: 14px 10px;
  border-top: 1px solid rgba(255,255,255,0.07);
  position: relative;
  z-index: 1;
}

/* ---- Main Content ---- */
.main-content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   VIEWS
   ============================================================ */
.view {
  padding: 28px;
  flex: 1;
  animation: viewSlideIn 0.25s ease;
}

@keyframes viewSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.page-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-actions {
  display: flex;
  gap: 10px;
}

/* ============================================================
   APP GRID (Dashboard)
   ============================================================ */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
}

.app-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
  border: 1.5px solid transparent;
}

.app-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(15,133,169,0.2);
}

.app-card-hero {
  height: 130px;
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%);
  position: relative;
  overflow: hidden;
}

.app-card-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 24px 24px;
}

.app-card-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.6;
  transition: opacity 0.3s, transform 0.3s;
}

.app-card:hover .app-card-hero img {
  opacity: 0.75;
  transform: scale(1.04);
}

.app-card-hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-card-hero-overlay .material-icons-round {
  font-size: 48px;
  color: rgba(255,255,255,0.4);
}

.app-card-body { padding: 18px; }

.app-card-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 3px;
  letter-spacing: -0.01em;
}

.app-card-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.app-card-meta {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: 0.03em;
}

.badge-green { background: var(--success-bg); color: var(--success); }
.badge-blue  { background: #eff6ff; color: #2563eb; }
.badge-gray  { background: #f1f5f9; color: #64748b; }

.app-card-actions {
  display: flex;
  gap: 6px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

/* ============================================================
   VENDOR GRID
   ============================================================ */
.vendor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.vendor-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.vendor-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(15,133,169,0.2);
}

.vendor-card-hero {
  height: 110px;
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.vendor-card-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 24px 24px;
}

.vendor-card-hero .material-icons-round {
  font-size: 52px;
  color: rgba(255,255,255,0.35);
  position: relative;
  z-index: 1;
}

.vendor-card-body { padding: 18px; }

.vendor-card-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 3px;
  letter-spacing: -0.01em;
}

.vendor-card-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.vendor-card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ============================================================
   EDITOR
   ============================================================ */
.editor-tabs {
  display: flex;
  gap: 4px;
  background: var(--card);
  padding: 6px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.editor-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.editor-tab:hover { background: var(--bg); color: var(--text); }

.editor-tab.active {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  color: #fff;
  box-shadow: 0 4px 12px rgba(15,133,169,0.3);
}

.editor-tab .material-icons-round { font-size: 16px; }

/* ---- Panels ---- */
.panel-section {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  border: 1px solid var(--border);
}

.panel-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* ============================================================
   FORMS
   ============================================================ */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.form-grid.col-3 {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.field input[type="text"],
.field input[type="password"],
.field input[type="email"],
.field textarea,
.field select {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15,133,169,0.1);
}

.field textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.65;
}

.field .hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.field .hint a { color: var(--brand); text-decoration: none; }
.field .hint a:hover { text-decoration: underline; }

/* Color field */
.color-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-field input[type="color"] {
  width: 42px;
  height: 40px;
  padding: 2px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: #fff;
  flex-shrink: 0;
}

.color-field input[type="text"] {
  flex: 1;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
}

/* Toggle */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.toggle-label input[type="checkbox"] { display: none; }

.toggle {
  width: 46px;
  height: 26px;
  background: var(--border);
  border-radius: 13px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: left 0.2s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.toggle-label input:checked + .toggle {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
}
.toggle-label input:checked + .toggle::after { left: 23px; }

/* ============================================================
   USERS LIST
   ============================================================ */
.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.user-row:last-child { border-bottom: none; }

.user-row input {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s;
}

.user-row input:focus { border-color: var(--brand); }

.user-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--brand-light);
  color: var(--brand-dark);
  white-space: nowrap;
}

/* ============================================================
   TABS LIST
   ============================================================ */
.tabs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.tabs-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tab-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.tab-row:hover {
  border-color: var(--brand);
  background: var(--brand-light);
  transform: translateX(2px);
}

.tab-row.selected {
  border-color: var(--brand);
  background: var(--brand-light);
  box-shadow: 0 2px 8px rgba(15,133,169,0.15);
}

.tab-row .drag-handle {
  cursor: grab;
  color: var(--text-muted);
}

.tab-row .material-icons-round.tab-icon { color: var(--brand); font-size: 20px; }

.tab-row-label {
  flex: 1;
  font-weight: 600;
  font-size: 0.875rem;
}

.tab-row-actions { display: flex; gap: 4px; }

/* ============================================================
   TAB CONTENT EDITOR
   ============================================================ */
.tab-editor {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  margin-top: 18px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--brand);
  animation: editorIn 0.2s ease;
}

@keyframes editorIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tab-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.tab-editor-header h3 {
  font-size: 1rem;
  font-weight: 700;
}

.sections-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 22px 0 10px;
}

.te-sections {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.section-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.2s;
}

.section-card:hover { border-color: rgba(15,133,169,0.3); }

.section-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  background: var(--bg);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.section-card-header:hover { background: var(--brand-light); }

.section-card-header .material-icons-round { color: var(--brand); font-size: 18px; }
.section-card-label { flex: 1; font-weight: 600; font-size: 0.875rem; }

.section-card-body {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.add-section-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1.5px dashed var(--border);
  transition: border-color 0.2s;
}

.add-section-bar:hover { border-color: rgba(15,133,169,0.4); }

.add-section-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* File links editor */
.file-link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.file-link-row:last-child { border-bottom: none; }
.file-link-row input { flex: 1; }

/* ============================================================
   THEME PREVIEW
   ============================================================ */
.theme-preview {
  margin-top: 22px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  max-width: 320px;
  border: 1px solid var(--border);
}

.tp-header {
  background: var(--brand);
  color: #fff;
  padding: 13px 18px;
  font-weight: 700;
  font-size: 0.875rem;
}

.tp-body { background: var(--brand); }

.tp-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  color: rgba(255,255,255,0.88);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-size: 0.85rem;
  transition: background 0.15s;
}

.tp-tab:hover { background: rgba(255,255,255,0.08); }
.tp-tab .material-icons-round { font-size: 20px; opacity: 0.8; }
.tp-tab span:nth-child(2) { flex: 1; }
.tp-arrow { font-size: 16px !important; opacity: 0.4 !important; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  transform: translateX(-100%);
  transition: transform 0.25s ease;
}

.btn:hover::after { transform: translateX(0); }

.btn .material-icons-round { font-size: 16px; }

.btn-sm { padding: 6px 13px; font-size: 0.8rem; }
.btn-sm .material-icons-round { font-size: 14px; }

.btn-primary {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  color: #fff;
  box-shadow: 0 4px 12px rgba(15,133,169,0.25);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(15,133,169,0.35);
}

.btn-success {
  background: linear-gradient(135deg, #0a7a52, var(--success));
  color: #fff;
  box-shadow: 0 4px 12px rgba(13,148,102,0.25);
}
.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(13,148,102,0.35);
}

.btn-danger {
  background: linear-gradient(135deg, #b91c1c, var(--danger));
  color: #fff;
}
.btn-danger:hover { transform: translateY(-1px); }

.btn-outline {
  background: none;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-outline:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-light);
}

.btn-ghost {
  background: none;
  border: none;
  color: var(--sidebar-text);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  width: 100%;
  transition: all 0.15s;
}

.btn-ghost:hover {
  background: rgba(255,255,255,0.07);
  color: #fff;
}

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
}
.btn-icon:hover { background: var(--bg); color: var(--text); }
.btn-icon .material-icons-round { font-size: 18px; }

.btn-full { width: 100%; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #fecaca;
}
.alert-error::before { content: '⚠'; font-size: 14px; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6,36,58,0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  animation: overlayIn 0.2s ease;
}

@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0,0,0,0.3);
  width: 100%;
  max-width: 500px;
  overflow: hidden;
  animation: modalSlideIn 0.25s cubic-bezier(0.175,0.885,0.32,1.275);
  border: 1px solid var(--border);
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: scale(0.92) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-sm { max-width: 380px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(15,133,169,0.04), transparent);
}

.modal-header h3 {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.modal-header .material-icons-round { color: var(--brand); }

.modal-body {
  padding: 22px;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.publish-url {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font-family: 'Courier New', monospace;
  font-size: 0.82rem;
  margin: 12px 0;
  word-break: break-all;
  color: var(--brand-dark);
  border-left: 3px solid var(--brand);
}

.publish-status,
.publish-success {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.publish-status { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.publish-success { background: var(--success-bg); color: var(--success); border: 1px solid #a7f3d0; }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: linear-gradient(135deg, var(--brand-dark), #0d3a5c);
  color: #fff;
  padding: 13px 22px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 8px 28px rgba(9,54,83,0.4);
  z-index: 9999;
  animation: toastSlideUp 0.3s cubic-bezier(0.175,0.885,0.32,1.275);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast::before {
  content: '✓';
  width: 22px;
  height: 22px;
  background: rgba(0,201,245,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--brand-accent);
  flex-shrink: 0;
}

@keyframes toastSlideUp {
  from { opacity: 0; transform: translateY(16px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.spin {
  animation: spin 1s linear infinite;
  display: inline-block;
}

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

/* ============================================================
   RICHTEXT EDITOR TOOLBAR
   ============================================================ */
.rich-toolbar {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  padding: 6px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.rich-btn {
  padding: 5px 9px;
  background: none;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  font-family: inherit;
  font-weight: 600;
  color: var(--text);
  transition: background 0.1s;
}

.rich-btn:hover { background: var(--border); }
.rich-btn .material-icons-round { font-size: 16px; vertical-align: middle; }

.rich-editor {
  width: 100%;
  min-height: 120px;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.7;
  outline: none;
  background: #fff;
  transition: border-color 0.2s;
}

.rich-editor:focus { border-color: var(--brand); }
