/* ==========================================
   CSS VARIABLES - DESIGN TOKENS
   ========================================== */

/* ==========================================
   GOOGLE FONTS
   ========================================== */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap'); 

:root {

/* Typography - Fonts */
  --font-primary:'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* --- Type Scale --- */
  --text-page-title:    600 24px/1.3  var(--font-primary);
  --text-section-title: 700 18px/1.35 var(--font-primary);
  --text-button:        600 14px/1.4  var(--font-primary);
  --text-button-sm:     600 12px/1.4  var(--font-primary);
  --text-label:         600 11px/1.4  var(--font-primary);
  --text-para:          600 12px/1.5  var(--font-primary);
  --text-para-sm:       600 10px/1.5  var(--font-primary);
  --text-link-sm:       500 12px/1.5  var(--font-primary);    

    /* Font Sizes */
    --font-size-base:    1rem;
    --font-size-sm:      0.875rem;
    --font-size-lg:      1.125rem;
    --font-size-xl:      1.5rem;
    --font-size-heading: 4.5rem;

    /* --- Brand --- */
    --color-brand:           #5b53d9;
    --color-brand-hover:     #3f35c0;
    --color-brand-mid:       #4f5086;
    --color-brand-dark:      #4e4b71;
    --color-brand-subtle:    #ebe9f4;
    --color-card-bg:         #deddf1;    

    /* Indigo Color Scale */
    --indigo-50:  #eef2ff;
    --indigo-100: #e0e7ff;
    --indigo-200: #c7d2fe;
    --indigo-500: #6366f1;
    --indigo-600: #4f46e5;
    --indigo-700: #4338ca;
    --indigo-800: #3730a3;

    /* Emerald Color Scale */
    --emerald-50:  #ecfdf5;
    --emerald-400: #34d399;
    --emerald-500: #10b981;
    --emerald-600: #059669;
    --emerald-700: #047857;
    --emerald-900: #064e3b;

    /* Red/Error */
    --red-50:  #fef2f2;
    --red-200: #fecaca;
    --red-500: #ef4444;
    --red-600: #dc2626;

    /* Reds */
    --red-100: #c95a5a;

    /* Greens */
    --green-100: #BBDEC0;
    --green-200: #57AA63;

    /* Zinc Color Scale */
    --zinc-0:   #FCFCFC;
    --zinc-10:  #F9F8F8;
    --zinc-20:  #F6F5F5;
    --zinc-30:  #F3F2F2;
    --zinc-40:  #F0EEEF;
    --zinc-50:  #EDEBEB;
    --zinc-60:  #EAE8E8;
    --zinc-70:  #E7E4E5;
    --zinc-80:  #E3E1E1;
    --zinc-90:  #E0DEDE;
    --zinc-100: #DDDBDB;
    --zinc-110: #DAD7D8;
    --zinc-120: #D7D4D4;
    --zinc-130: #D4D1D1;
    --zinc-140: #D1CDCE;
    --zinc-150: #CECACA;
    --zinc-160: #CBC7C7;
    --zinc-170: #C8C3C4;
    --zinc-180: #C5C0C1;
    --zinc-190: #C2BDBD;
    --zinc-200: #BFB9BA;
    --zinc-210: #BCB6B7;
    --zinc-220: #B9B3B3;
    --zinc-230: #B6AFB0;
    --zinc-240: #B2ACAD;
    --zinc-250: #AFA9AA;
    --zinc-260: #ACA6A6;
    --zinc-270: #A9A2A3;
    --zinc-280: #A69FA0;
    --zinc-290: #A39C9C;
    --zinc-300: #A09899;
    --zinc-310: #9D9596;
    --zinc-320: #9A9293;
    --zinc-330: #978E8F;
    --zinc-340: #948B8C;
    --zinc-350: #918889;
    --zinc-360: #8E8485;
    --zinc-370: #8B8182;
    --zinc-380: #887E7F;
    --zinc-390: #857A7C;
    --zinc-400: #817778;
    --zinc-410: #7E7475;
    --zinc-420: #7B7172;
    --zinc-430: #776E6F;
    --zinc-440: #746B6C;
    --zinc-450: #716869;
    --zinc-460: #6D6566;
    --zinc-470: #6A6263;
    --zinc-480: #675F60;
    --zinc-490: #635C5D;
    --zinc-500: #60595A;
    --zinc-510: #5D5656;
    --zinc-520: #595353;
    --zinc-530: #565050;
    --zinc-540: #534D4D;
    --zinc-550: #50494A;
    --zinc-560: #4C4647;
    --zinc-570: #494344;
    --zinc-580: #464041;
    --zinc-590: #423D3E;
    --zinc-600: #3F3A3B;
    --zinc-610: #3C3738;
    --zinc-620: #383435;
    --zinc-630: #353131;
    --zinc-640: #322E2E;
    --zinc-650: #2E2B2B;
    --zinc-660: #2B2828;
    --zinc-670: #282525;
    --zinc-680: #242222;
    --zinc-690: #211F1F;
    --zinc-700: #1E1C1C;
    --zinc-710: #1B1819;
    --zinc-720: #171516;
    --zinc-730: #141213;
    --zinc-740: #110F0F;
    --zinc-750: #0D0C0C;
    --zinc-760: #0A0909;
    --zinc-770: #070606;
    --zinc-780: #030303;

    /* --- Brand — Purple --- */
    --color-brand:           #5B53D9;
    --color-brand-mid:       #4f5086; 
    --color-brand-dark:      #4e4b71;   
    --color-brand-subtle:    #dfdbf1;     

    /* --- Accent — Blue --- */
    --color-accent:          #00a3e9;
    --color-accent-alt:      #03a0e9;
    --color-accent-dark:     #049fe8;
    --color-accent-deep:     #1976d2;

    /* --- Status --- */
    --color-success:         #4caf50;
    --color-success-alt:     #089347;
    --color-success-subtle:  rgba(131, 217, 77, 0.28);
    --color-error:           #d54545;
    --color-error-alt:       #ff3d00;
    --color-warning:         #ffc107;
    --color-black:           #000000;    

    /* Spacing Scale */
    --spacing-xs:  0.5rem;
    --spacing-sm:  0.75rem;
    --spacing-md:  1rem;
    --spacing-lg:  1.5rem;
    --spacing-xl:  2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;

    /* Border Radius */
    --radius-sm:   0.375rem;
    --radius-md:   0.5rem;
    --radius-lg:   0.75rem;
    --radius-xl:   1rem;
    --radius-full: 9999rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    /* Transitions */
    --t-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --t-base: 0.4s cubic-bezier(0, 0, 0.2, 1);
    --t-slow: 0.6s cubic-bezier(0, 0, 0.2, 1);

    /* --- Backgrounds --- */
    --color-bg-page:         #f5f5f7; 
    --color-bg-white:        #ffffff;   
    --color-bg-surface-1:    #f3f3f3;   
    --color-bg-surface-2:    #f2f2f2;   
    --color-bg-subtle:       #ebe9f4;   
    --color-bg-subtle-2:     #ededf5;   
    --color-bg-subtle-3:     #beb7da;   
    --color-bg-navy:         #0d093f;   
    --color-bg-dark-1:       #13121b;   
    --color-bg-dark-2:       #191127;   
    --color-bg-dark-3:       #252525;   
    --color-bg-overlay-10:   rgba(0, 0, 0, 0.10); 
    --color-bg-overlay-35:   rgba(0, 0, 0, 0.35); 

    /*---- button -----*/
    --button-nav-default: #E1E1F5;
    --button-nav-active: #5B53D9; 
    --button-default: #13121B;
    --button-active: #5B53D9;
    --button-color-default: #13121b;


    /* --- Border / Divider --- */
    --color-border-default:  #e3e2e9;
    --color-border-light:    #eaeaea;
    --color-border-lighter:  #e9e9e9;
    --color-border-mid:      #e3e1eb;
    --color-border-strong:   #b9b9d0;
    --color-border-purple:   #d9d9eb;
    --color-border-subtle:   #e6e5f1;

    /* --- Text --- */
    --color-text-primary:    #13121b;   /* Headings, main copy */
    --color-text-secondary:  #5e5e5e;   /* Sub-text, labels */
    --color-text-muted:      #7e7e7e;   /* Placeholder, hint */
    --color-text-muted-2:    #838383;
    --color-text-muted-3:    #7b7b7b;
    --color-text-muted-4:    #878787;
    --color-text-dark:       #4b4b4b;
    --color-text-darker:     #383838;
    --color-text-darkest:    #333333;
    --color-text-gray:       #6d6d6d;
    --color-text-gray-2:     #3a3a3a;
    --color-text-gray-3:     #565656;
    --color-text-gray-4:     #747474;
    --color-text-gray-5:     #71717d;
    --color-text-gray-6:     #828293;
    --color-text-gray-7:     #afafaf;
    --color-text-inverse:    #ffffff;   /* Text on dark backgrounds */
    --color-text-inverse-44: rgba(255, 255, 255, 0.44);
    --color-text-inverse-50: rgba(255, 255, 255, 0.50);
    --color-text-inverse-25: rgba(255, 255, 255, 0.25);

    --color-label-dark:#9d9caf;


/* --- Backgrounds --- */
  --color-bg-page:         #f5f5f7; 
  --color-bg-white:        #ffffff;   
  --color-bg-surface-1:    #f3f3f3;   
  --color-bg-surface-2:    #f2f2f2;   
  --color-bg-subtle:       #ebe9f4;   
  --color-bg-subtle-2:     #ededf5;   
  --color-bg-subtle-3:     #beb7da;   
  --color-bg-navy:         #0d093f;   
  --color-bg-dark-1:       #13121b;   
  --color-bg-dark-2:       #191127;   
  --color-bg-dark-3:       #252525;   
  --color-bg-overlay-10:   rgba(0, 0, 0, 0.10); 
  --color-bg-overlay-35:   rgba(0, 0, 0, 0.35); 

  /*---- button -----*/
  --button-nav-default: #E1E1F5;
  --button-nav-active: #5B53D9; 
  --button-default: #13121B;
  --button-active: #5B53D9;
  --button-color-default: #13121b;


  /* --- Border / Divider --- */
  --color-border-default:  #e3e2e9;
  --color-border-light:    #eaeaea;
  --color-border-lighter:  #e9e9e9;
  --color-border-mid:      #e3e1eb;
  --color-border-strong:   #b9b9d0;
  --color-border-purple:   #d9d9eb;
  --color-border-subtle:   #e6e5f1;

  /* --- Text --- */
  --color-text-primary:    #13121b;   /* Headings, main copy */
  --color-text-secondary:  #5e5e5e;   /* Sub-text, labels */
  --color-text-muted:      #7e7e7e;   /* Placeholder, hint */
  --color-text-muted-2:    #838383;
  --color-text-muted-3:    #7b7b7b;
  --color-text-muted-4:    #878787;
  --color-text-dark:       #4b4b4b;
  --color-text-darker:     #383838;
  --color-text-darkest:    #333333;
  --color-text-gray:       #6d6d6d;
  --color-text-gray-2:     #3a3a3a;
  --color-text-gray-3:     #565656;
  --color-text-gray-4:     #747474;
  --color-text-gray-5:     #71717d;
  --color-text-gray-6:     #828293;
  --color-text-gray-7:     #afafaf;
  --color-text-inverse:    #ffffff;   /* Text on dark backgrounds */
  --color-text-inverse-44: rgba(255, 255, 255, 0.44);
  --color-text-inverse-50: rgba(255, 255, 255, 0.50);
  --color-text-inverse-25: rgba(255, 255, 255, 0.25);

  --color-label-dark:#9d9caf;

  /* --- Brand — Purple --- */
  --color-brand:           #5B53D9;   /* Primary brand */
  --color-brand-mid:       #4f5086;   /* Brand mid / hover */
  --color-brand-dark:      #4e4b71;   /* Brand dark variant */
  --color-brand-subtle:    #dfdbf1;   /* Brand tint bg */

  /* --- Accent — Blue --- */
  --color-accent:          #00a3e9;   /* Primary accent */
  --color-accent-alt:      #03a0e9;   /* Accent alt */
  --color-accent-dark:     #049fe8;   /* Accent dark */
  --color-accent-deep:     #1976d2;   /* Deep blue */

  /* --- Status --- */
  --color-success:         #4caf50;
  --color-success-alt:     #089347;
  --color-success-subtle:  rgba(131, 217, 77, 0.28);
  --color-error:           #d54545;
  --color-error-alt:       #ff3d00;
  --color-warning:         #ffc107;
  --color-black:           #000000;    
    
}

/*
==========================
==========================
*/

/* page-title — 24px / SemiBold */
.text-page-title {
  font: var(--text-page-title);
  letter-spacing: 0;
}

/* Section-title — 18px / SemiBold */
.text-section-title {
  font: var(--text-section-title);
  letter-spacing: 0;
}

/* Button-text — 14px / SemiBold */
.text-button {
  font: var(--text-button);
  letter-spacing: 0;
}

/* Button-text-sm — 12px / SemiBold */
.text-button-sm {
  font: var(--text-button-sm);
  letter-spacing: 0;
}

/* Label-text — 11px / SemiBold */
.text-label {
  font: var(--text-label);
  letter-spacing: 0;
}

/* Para-text — 12px / SemiBold */
.text-para {
  font: var(--text-para);
  letter-spacing: 0;
}

/* Para-text-sm — 10px / SemiBold */
.text-para-sm {
  font: var(--text-para-sm);
  letter-spacing: 0;
}

/* Link-text-sm — 12px / Medium */
.text-link-sm {
  font: var(--text-link-sm);
  letter-spacing: 0;
}


/* ==========================================
   CSS RESET
   ========================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 100%;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    tab-size: 4;
}

body {
    font-family: var(--font-primary);
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--color-bg-dark-1);
    background-color: var(--zinc-50);
    min-height: 100vh;
    overflow-x: hidden;
}

a, a:hover { text-decoration: none; transition: color var(--t-fast); }
button { font-family: inherit; font-size: inherit; cursor: pointer; border: none; background: none; }
button:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 2px; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }

/* ==========================================
   ANIMATIONS
   ========================================== */
@keyframes spin    { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes pulse   { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ==========================================
   ICON UTILITIES
   ========================================== */
.icon-xs  { width: 0.75rem; height: 0.75rem; flex-shrink: 0; }
.icon-sm  { width: 1rem;    height: 1rem;    flex-shrink: 0; }
.icon-md  { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }
.icon-lg  { width: 1.5rem;  height: 1.5rem;  flex-shrink: 0; }
.icon-xl  { width: 3rem;    height: 3rem;    flex-shrink: 0; }
.icon-mr  { margin-right: 0.5rem; }
.icon-mr-xs { margin-right: 0.25rem; }

/* ==========================================
   FLEX COLUMN STACK UTILITIES
   ========================================== */
.stack-xs { display: flex; flex-direction: column; gap: 0.5rem; }
.stack-sm { display: flex; flex-direction: column; gap: 0.75rem; }
.stack-md { display: flex; flex-direction: column; gap: 1rem; }
.stack-lg { display: flex; flex-direction: column; gap: 1.5rem; }
.stack-xl { display: flex; flex-direction: column; gap: 3rem; }

/* ==========================================
   APP SHELL
   ========================================== */
.app-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background-color: var(--color-bg-subtle);
    color: var(--color-bg-dark-1);
    font-family: var(--font-primary);
}

.app-main {
    flex: 1 1 0%;
    overflow: auto;
}

/* ==========================================
   TOP NAVIGATION
   ========================================== */
.topnav {
    width: 100%;
    background-color: var(--color-bg-navy);
    color: var(--zinc-300);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--color-bg-navy-dark);
    height: 4rem;
    flex-shrink: 0;
}

.topnav-left {
    display: flex;
    align-items: center;
    gap: 2rem;
    width: 100%;
}
.brand{
    min-width: 15%;
    width: fit-content;
}

.topnav-brand-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.025em;
    line-height: 1.25;
}

.topnav-brand-sub {
    font-size: 10px;
    color: var(--zinc-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.25;
}

.topnav-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.topnav-section-label {
    font: var(--text-para-sm);
    color: var(--color-text-muted);
    text-transform: uppercase;
    margin-right: 0.5rem;
    margin-left: 1rem;
}

.topnav-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    font: var(--text-button);
    border-radius: var(--radius-sm);
    color: var(--button-color-default);
    text-decoration: none;
    background-color: var(--button-nav-default);
    transition: all var(--t-fast);
}
.topnav-link:hover{ 
    background-color: var(--button-nav-active); 
    color: #ffffff;
    transition: all var(--t-fast);
}
.topnav-link--active{ 
    background-color: var(--button-nav-active); 
    color: #ffffff; }

.topnav-divider {
    width: 1px;
    height: 1.5rem;
    background-color: var(--zinc-700);
    margin: 0 1rem;
    flex-shrink: 0;
}

.topnav-play-icon {
    width: 0.75rem;
    height: 0.75rem;
    margin-right: 0.5rem;
    color: var(--emerald-500);
    flex-shrink: 0;
}

/* ==========================================
   PAGE CONTAINERS
   ========================================== */
.page-container {
    padding: 2rem 1.25rem;
    max-width: 80rem;
    margin-left: auto;
    margin-right: auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border-mid);
}

.page-title {
    font: var(--text-page-title);
    color: var(--color-text-primary);
}

.page-subtitle { 
    font: var(--text-para);
    color: var(--color-text-secondary); 
    margin-top: 0.5rem; 
}
.page-not-found { padding: 2rem; color: var(--zinc-500); }

/* ==========================================
   BUTTONS
   ========================================== */
.btn-dark {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: var(--color-bg-dark-1);
    color: #ffffff;
    border-radius: 0.5rem;
    transition: background-color var(--t-fast);
    cursor: pointer;
    font: var(--text-button);
}
.btn-dark:hover { 
    background-color:var(--button-active);
    color: #ffffff;
}

.btn-save-emerald {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: var(--color-brand);
    color: #ffffff;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: background-color var(--t-fast);
    cursor: pointer;
}
.btn-save-emerald:hover { background-color: var(--color-brand-hover); }

.btn-save-indigo {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: var(--color-brand);
    color: #ffffff;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: background-color var(--t-fast);
    cursor: pointer;
}
.btn-save-indigo:hover { background-color: var(--color-brand-hover); }

/* Text icon-link buttons */
.icon-link-btn {
    font-size: 14px;
    color: var(--color-brand-subtle);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    padding: 0;
    transition: color var(--t-fast);
}
.icon-link-btn:hover { color: var(--indigo-800); }
.sidebar-api-section .icon-link-btn:hover,
.sidebar-right .icon-link-btn:hover {
    color: #fff; 
}

/* ==========================================
   CARDS GRID
   ========================================== */
.cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
@media (min-width: 768px)  { .cards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .cards-grid { grid-template-columns: repeat(3, 1fr); } }

/* List card (LayoutsList / PagesList) */
.list-card {
    background-color: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--zinc-200);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: box-shadow var(--t-fast);
    position: relative;
}
.list-card:hover { box-shadow: var(--shadow-md); }

.list-card-body { padding: 1.5rem; }

.list-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.list-card-icon-indigo {
    padding: 0.75rem;
    background-color: var(--indigo-50);
    color: var(--indigo-600);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.list-card-icon-emerald {
    padding: 0.75rem;
    background-color: var(--emerald-50);
    color: var(--emerald-600);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.list-card-actions { display: flex; gap: 0.5rem; }

.list-card-delete-btn {
    display: flex;
    padding: 0.5rem;
    color: var(--zinc-400);
    border-radius: var(--radius-sm);
    transition: color var(--t-fast), background-color var(--t-fast);
    opacity: 0;
}
.list-card:hover .list-card-delete-btn { opacity: 1; }
.list-card-delete-btn:hover { color: var(--red-500); background-color: var(--red-50); }

.list-card-view-btn {
    display: flex;
    padding: 0.5rem;
    color: var(--zinc-400);
    border-radius: var(--radius-sm);
    transition: color var(--t-fast), background-color var(--t-fast);
    opacity: 0;
}
.list-card:hover .list-card-view-btn { opacity: 1; }
.list-card-view-btn:hover { color: var(--emerald-600); background-color: var(--emerald-50); }

.list-card-title {
    font: var(--text-section-title);
    color: var(--color-bg-dark-1); 
}
.list-card-meta  { font-size: 0.875rem; color: var(--zinc-500); margin-top: 0.25rem; }
.list-card-meta-mono {
    font-size: 0.875rem;
    color: var(--zinc-500);
    margin-top: 0.25rem;
    font-family: var(--font-mono);
}

.list-card-tags { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }

.tag {
    display: inline-flex;
    padding: 0.25rem 0.5rem;
    background-color: var(--zinc-100);
    color: var(--zinc-600);
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

/* ==========================================
   BUILDER LAYOUT (PageBuilder + LayoutBuilder)
   ========================================== */
.builder {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: var(--zinc-50);
}

.builder-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background-color: #ffffff;
    border-bottom: none;
    flex-shrink: 0;
}

.builder-header-left { display: flex; align-items: center; }

.builder-back-btn {
    display: flex;
    align-items: center;
    margin-right: 1rem;
    color: var(--zinc-500);
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: color var(--t-fast);
}
.builder-back-btn:hover { color: var(--color-bg-dark-1); }

.builder-title-input {
    font: var(--text-page-title);
    color: var(--color-bg-dark-1);
    background: transparent;
    /* border: none; */
    outline: none;
    padding: 2px 8px;
    box-shadow: none;
    border: 1px dashed var(--color-bg-subtle);
    border-radius: 6px;
    transition: all var(--t-slow);
}
.builder-title-input:focus,
.builder-title-input:hover{
    border: 1px dashed var(--color-bg-subtle-3);
    transition: all var(--t-slow);
}

.builder-body {
    display: flex;
    flex: 1 1 0%;
    overflow: hidden;
}

.builder-canvas {
    flex: 1 1 0%;
    padding: 2rem;
    overflow-y: auto;
    background-color: var(--color-bg-subtle);
}

.builder-canvas-inner      { max-width: 48rem; margin-left: auto; margin-right: auto; }
.builder-canvas-inner-wide { max-width: 64rem; margin-left: auto; margin-right: auto; }

/* ==========================================
   SIDEBARS
   ========================================== */
.sidebar-left {
    width: 16rem;
    background-color: var(--color-bg-navy);
    border-right: 1px solid var(--zinc-200);
    padding: 1rem;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-left-wide {
    width: 18rem;
    background-color: var(--color-bg-navy);
    border-right: 1px solid var(--zinc-200);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-right {
    width: 400px;
    background-color: var(--color-bg-navy);
    border-left: 1px solid var(--zinc-200);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-right-empty {
    width: 400px;
    background-color: var(--color-bg-navy);
    border-left: 1px solid var(--zinc-200);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-section-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-label-dark);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    display: block;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid rgb(255 255 255 / 24%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* background-color: var(--zinc-50); */
    flex-shrink: 0;
}

.sidebar-title {
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.sidebar-close-btn {
    color: var(--color-label-dark);
    font-size: 1.5rem;
    line-height: 1;
    transition: color var(--t-fast);
    padding: 0px 8px;
}
.sidebar-close-btn:hover { color: #fff; }

.sidebar-content {
    padding: 1rem;
    overflow-y: auto;
    flex: 1 1 0%;
}

.sidebar-api-section { margin-bottom: 2rem; }

/* ==========================================
   TABS
   ========================================== */
.tab-bar {
    display: flex;
    border-bottom: 1px solid rgb(255 255 255 / 15%);
    flex-shrink: 0;
}

.tab-btn {
    flex: 1 1 0%;
    padding: 0.75rem 0;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.375rem;
    border-bottom: 2px solid transparent;
    color: var(--color-card-bg);
    transition: color var(--t-fast), border-color var(--t-fast);
}
.tab-btn:hover { color: #ffffff; }
.tab-btn--active {
    border-bottom-color: var(--button-active);
    background:var(--button-active);
    color: #fff;    
}

/* ==========================================
   FORM ELEMENTS
   ========================================== */
.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--zinc-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.form-label-sm {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--zinc-700);
    margin-bottom: 0.25rem;
}

.sidebar-api-section .form-label-sm,
.sidebar-right .form-label {
    color: var(--color-brand-subtle);
}

.form-hint {
    font-size: 0.75rem;
    color: var(--color-label-dark);
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 600;
}
.form-hint-xs { 
    font-size: 0.75rem; 
    color: var(--color-label-dark); 
    margin-top: 0.25rem; 
    display: block;
    
}
.form-italic-empty { 
    font-size: 0.75rem; 
    color: var(--color-label-dark); 
    font-style: italic; 
}

.form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.form-pair-row { display: flex; gap: 0.5rem; }

.form-section-divider { 
    padding-top: 1rem; 
    border-top: 1px solid rgb(228 228 231 / 12%);
}

/* Inputs */
.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgb(255 255 255 / 12%);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    background-color: #ffffff;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
    line-height: 1.25rem;
}
.form-input:focus {
    outline: none;
    border-color: var(--color-brand);
    box-shadow: 0 0 0 2px rgb(99 102 241 / 0.2);
}

.sidebar-api-section .form-input,
.sidebar-right .form-input,
.sidebar-right .form-input-number,
.sidebar-right .form-select-full,
.sidebar-right .form-input-mono,
.sidebar-right .form-input-half{
    background-color: rgb(255 255 255 / 24%);
    border: 1px solid rgb(255 255 255 / 12%);
    color: #fff;
}
.sidebar-api-section .form-input::placeholder,
.sidebar-right .form-input::placeholder,
.sidebar-right .form-input-number::placeholder,
.sidebar-right .form-select-full::placeholder,
.sidebar-right .form-input-mono::placeholder,
.sidebar-right .form-input-half::placeholder{
    color: #fff;
}

.form-input-emerald {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--zinc-300);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-family: var(--font-mono);
    background-color: #ffffff;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
    line-height: 1.25rem;
}
.form-input-emerald:focus {
    outline: none;
    border-color: var(--emerald-500);
    box-shadow: 0 0 0 2px rgb(16 185 129 / 0.2);
}

.form-input-mono {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--zinc-300);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-family: var(--font-mono);
    background-color: #ffffff;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.form-input-mono:focus {
    outline: none;
    border-color: var(--color-brand);
    box-shadow: 0 0 0 2px rgb(99 102 241 / 0.2);
}

.form-input-sm {
    width: 100%;
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--zinc-300);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    background-color: #ffffff;
    transition: border-color var(--t-fast);
}
.form-input-sm:focus { outline: none; border-color: var(--zinc-500); }

.form-input-sm-mono {
    width: 100%;
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--zinc-300);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-family: var(--font-mono);
    background-color: #ffffff;
    transition: border-color var(--t-fast);
}
.form-input-sm-mono:focus { outline: none; border-color: var(--zinc-500); }

.form-input-half {
    width: 50%;
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--zinc-300);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-family: var(--font-mono);
    background-color: #ffffff;
    transition: border-color var(--t-fast);
}
.form-input-half:focus { outline: none; border-color: var(--zinc-500); }

.form-input-number {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--zinc-300);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    background-color: #ffffff;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.form-input-number:focus {
    outline: none;
    border-color: var(--color-brand);
    box-shadow: 0 0 0 2px rgb(99 102 241 / 0.2);
}

.form-select {
    width: 100%;
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--zinc-300);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    background-color: #ffffff;
    cursor: pointer;
    transition: border-color var(--t-fast);
}
.form-select:focus { outline: none; border-color: var(--color-brand); }

.form-select-full {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--zinc-300);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    background-color: #ffffff;
    cursor: pointer;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.form-select-full:focus {
    outline: none;
    border-color: var(--color-brand);
    box-shadow: 0 0 0 2px rgb(99 102 241 / 0.2);
}

.form-inline-delete-btn {
    display: flex;
    align-items: center;
    padding: 0.375rem;
    color: var(--zinc-400);
    border-radius: 0.25rem;
    flex-shrink: 0;
    transition: color var(--t-fast);
}
.form-inline-delete-btn:hover { color: var(--red-500); }

/* ==========================================
   SETTINGS PANEL (PageBuilder)
   ========================================== */
.settings-panel {
    background-color: #ffffff;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--zinc-200);
    margin-bottom: 2rem;
}
.settings-panel-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-bg-dark-1);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.section-heading {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-bg-dark-1);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    display: block;
}

/* ==========================================
   EMPTY STATE
   ========================================== */
.empty-state {
    text-align: center;
    padding: 5rem 1rem;
    border: 2px dashed var(--zinc-300);
    border-radius: var(--radius-lg);
    background-color: #ffffff;
}
.empty-state-icon  { width: 3rem; height: 3rem; color: var(--zinc-300); margin: 0 auto 1rem; }
.empty-state-title { font-size: 1.125rem; font-weight: 500; color: var(--color-bg-dark-1); }
.empty-state-text  { color: var(--zinc-500); margin-top: 0.25rem; }

.empty-state-sm {
    text-align: center;
    padding: 2rem 1rem;
    border: 1px dashed var(--zinc-300);
    border-radius: 0.5rem;
}
.empty-state-sm-text { font-size: 0.75rem; color: var(--zinc-500); }

/* ==========================================
   ASSIGNED ITEMS (PageBuilder canvas)
   ========================================== */
.assigned-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #ffffff;
    padding: 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--zinc-200);
    box-shadow: var(--shadow-sm);
    position: relative;
}
.assigned-item-left   { display: flex; align-items: center; }
.assigned-item-index  {
    width: 2rem; height: 2rem;
    border-radius: 9999px;
    background-color: var(--zinc-100);
    color: var(--zinc-500);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.875rem; font-weight: 700;
    margin-right: 1rem; flex-shrink: 0;
}
.assigned-item-name   { font-weight: 600; color: var(--color-bg-dark-1); }
.assigned-item-meta   { font-size: 0.75rem; color: var(--zinc-500); }
.assigned-item-delete {
    display: flex; padding: 0.5rem;
    color: var(--zinc-400);
    border-radius: var(--radius-sm);
    transition: color var(--t-fast), background-color var(--t-fast);
    opacity: 0;
}
.assigned-item:hover .assigned-item-delete { opacity: 1; }
.assigned-item-delete:hover { color: var(--red-600); background-color: var(--red-50); }

/* ==========================================
   AVAILABLE LAYOUT BUTTONS (PageBuilder sidebar)
   ========================================== */
.layout-btn {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 0.75rem;
    text-align: left;
    border: 1px solid var(--zinc-200);
    border-radius: 0.5rem;
    background-color: #ffffff;
    cursor: pointer;
    transition: border-color var(--t-fast), background-color var(--t-fast);
    position: relative;
}
.layout-btn:hover               { border-color: var(--emerald-500); background-color: var(--emerald-50); }
.layout-btn--disabled           { background-color: var(--zinc-50); opacity: 0.5; cursor: not-allowed; }
.layout-btn--disabled:hover     { border-color: var(--zinc-200); background-color: var(--zinc-50); }

.layout-btn-icon                { width: 1.25rem; height: 1.25rem; margin-right: 0.75rem; flex-shrink: 0; color: var(--zinc-500); }
.layout-btn:hover .layout-btn-icon { color: var(--emerald-600); }
.layout-btn--disabled .layout-btn-icon { color: var(--zinc-400); }

.layout-btn-body                { flex: 1 1 0%; min-width: 0; }
.layout-btn-name                { display: block; font-size: 0.875rem; font-weight: 500; color: var(--zinc-700); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layout-btn:hover .layout-btn-name   { color: var(--emerald-900); }
.layout-btn--disabled .layout-btn-name { color: var(--zinc-500); }
.layout-btn-count               { display: block; font-size: 0.75rem; color: var(--zinc-400); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.layout-btn-plus                { width: 1rem; height: 1rem; margin-left: 0.5rem; color: var(--zinc-400); opacity: 0; flex-shrink: 0; }
.layout-btn:hover .layout-btn-plus { color: var(--emerald-600); opacity: 1; }

/* ==========================================
   CARD-TYPE BUTTONS (LayoutBuilder left panel)
   ========================================== */
.card-type-btn {
    cursor: pointer;
    background-color: var(--color-card-bg);
    border: 1px solid var(--zinc-200);
    border-radius: var(--radius-lg);
    padding: 1rem;
    transition: all var(--t-slow);
    position: relative;
    overflow: hidden;
    width: 100%;
    text-align: left;
}
.card-type-btn:hover { 
    border-color: var(--color-brand); 
    box-shadow: var(--shadow-md);
    background-color: #ffffff;
    transition: all var(--t-slow);
}

.card-type-accent {
    position: absolute; top: 0; left: 0;
    width: 0.25rem; height: 100%;
    background-color: var(--color-brand);
    opacity: 0; transition: opacity var(--t-fast);
}
.card-type-btn:hover .card-type-accent { opacity: 1; }

.card-type-top { display: flex; align-items: center; margin-bottom: 0.5rem; }

.card-type-icon-wrap {
    padding: 0.5rem; 
    background-color: #fff; 
    border-radius: 0.5rem;
    display: flex; 
    align-items: center; 
    justify-content: center;
    transition: background-color var(--t-fast);
}
.card-type-btn:hover .card-type-icon-wrap { background-color: var(--indigo-50); }
.card-type-icon                             { width: 1.25rem; height: 1.25rem; color: var(--zinc-600); }
.card-type-btn:hover .card-type-icon        { color: var(--indigo-600); }

.card-type-label { margin-left: 0.75rem; font-weight: 600; color: var(--color-bg-dark-1); font-size: 0.875rem; }
.card-type-plus  {
    width: 1rem; height: 1rem; margin-left: auto;
    color: var(--zinc-400); opacity: 0;
}
.card-type-btn:hover .card-type-plus { color: var(--indigo-600); opacity: 1; }
.card-type-desc { font-size: 0.75rem; color: var(--zinc-500); line-height: 1.625; }

/* ==========================================
   CANVAS CARD (LayoutBuilder center panel)
   ========================================== */
.canvas-card {
    position: relative;
    border-radius: var(--radius-lg);
    /* border: 2px solid transparent; */
    cursor: pointer;
    transition: border-color var(--t-fast);
}
.canvas-card:hover     {
    border-color: var(--color-card-bg); 
}
.canvas-card--active { 
    /* border-color: var(--color-brand);  */
    box-shadow: 0 12px 30px rgb(91 83 217 / 30%);
}

.canvas-card-toolbar {
    position: absolute; top: 0.5rem; right: 0.5rem;
    opacity: 0; transition: opacity var(--t-fast);
    z-index: 10; display: flex; gap: 0.25rem;
    background-color: #ffffff; box-shadow: var(--shadow-sm);
    border-radius: var(--radius-sm); 
    border: 1px solid var(--zinc-200);
    padding: 0.25rem;
}
.canvas-card:hover .canvas-card-toolbar { opacity: 1; }

.canvas-card-tool-btn {
    padding: 0.375rem; display: flex; align-items: center;
    color: var(--zinc-500); border-radius: 0.25rem;
    transition: color var(--t-fast), background-color var(--t-fast);
}
.canvas-card-tool-btn:hover        { color: var(--indigo-600); background-color: var(--indigo-50); }
.canvas-card-delete-btn            { padding: 0.375rem; display: flex; align-items: center; color: var(--zinc-500); border-radius: 0.25rem; transition: color var(--t-fast), background-color var(--t-fast); }
.canvas-card-delete-btn:hover      { color: var(--red-600); background-color: var(--red-50); }
.canvas-card-preview               { pointer-events: none; height: 100%; }

/* ==========================================
   LAYOUT GRID (LayoutBuilder + DynamicPage)
   12-column responsive grid with col-span helpers
   ========================================== */
.layout-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
@media (min-width: 768px) {
    .layout-grid           { grid-template-columns: repeat(12, 1fr); }
    .col-span-1            { grid-column: span 1  / span 1;  }
    .col-span-2            { grid-column: span 2  / span 2;  }
    .col-span-3            { grid-column: span 3  / span 3;  }
    .col-span-4            { grid-column: span 4  / span 4;  }
    .col-span-5            { grid-column: span 5  / span 5;  }
    .col-span-6            { grid-column: span 6  / span 6;  }
    .col-span-7            { grid-column: span 7  / span 7;  }
    .col-span-8            { grid-column: span 8  / span 8;  }
    .col-span-9            { grid-column: span 9  / span 9;  }
    .col-span-10           { grid-column: span 10 / span 10; }
    .col-span-11           { grid-column: span 11 / span 11; }
    .col-span-12           { grid-column: span 12 / span 12; }
}

/* ==========================================
   API ERROR BOX
   ========================================== */
.api-error-box    { margin-top: 0.5rem; padding: 0.5rem; background-color: var(--red-50); border: 1px solid var(--red-200); border-radius: var(--radius-sm); }
.api-error-msg    { font-size: 0.75rem; color: var(--red-600); font-weight: 500; display: flex; align-items: center; gap: 0.25rem; }
.api-error-detail { font-size: 0.75rem; color: var(--red-500); margin-top: 0.25rem; word-break: break-all; }

/* ==========================================
   JSON PREVIEW BOXES
   ========================================== */
.json-details-toggle {
    font-size: 0.75rem; color: var(--indigo-600); font-weight: 500;
    cursor: pointer; display: flex; align-items: center; gap: 0.25rem;
    list-style: none; transition: color var(--t-fast); margin-top: 0.5rem;
}
.json-details-toggle:hover   { color: var(--indigo-800); }

.json-preview-box {
    margin-top: 0.5rem; padding: 0.5rem;
    background-color: var(--color-bg-dark-1); border-radius: var(--radius-sm);
    overflow-x: auto; max-height: 12rem; overflow-y: auto;
}
.json-preview-code { font-size: 10px; color: var(--zinc-300); font-family: var(--font-mono); white-space: pre; }

/* Full-height preview panels */
.json-panel-wrapper { display: flex; flex-direction: column; height: 100%; gap: 1rem; }
.json-panel-header  { display: flex; justify-content: space-between; align-items: center; }
.json-panel-body    { flex: 1 1 0%; background-color: var(--color-bg-dark-1); border-radius: 0.5rem; padding: 1rem; overflow: auto; }
.json-panel-code-green { font-size: 0.75rem; color: var(--emerald-400); font-family: var(--font-mono); white-space: pre-wrap; }
.json-panel-code-blue  { font-size: 0.75rem; color: #93c5fd;            font-family: var(--font-mono); white-space: pre-wrap; }
.json-panel-loading    { color: var(--zinc-500); font-size: 0.875rem; animation: pulse 2s ease-in-out infinite; }
.json-panel-empty      { color: var(--zinc-500); font-size: 0.875rem; }

/* ==========================================
   PARAM TAGS
   ========================================== */
.param-tags-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.param-tag {
    display: inline-flex; align-items: center;
    padding: 0.25rem 0.5rem;
    background-color: var(--zinc-100); 
    color: var(--zinc-600);
    font-size: 0.75rem; font-family: var(--font-mono);
    border-radius: var(--radius-sm); 
    border: 1px solid var(--zinc-200);

    background-color: rgb(255 255 255 / 24%);
    border-color: rgb(255 255 255 / 12%);
    color: #fff;
}
.param-tag-remove {
    margin-left: 0.5rem; color: var(--zinc-400);
    cursor: pointer; font-size: 0.875rem; line-height: 1;
    transition: color var(--t-fast);
}
.param-tag-remove:hover { color: var(--red-500); }

/* ==========================================
   FILTER ITEM / ACTION ITEM EDITORS
   ========================================== */
.filter-item {
    padding: 0.75rem; border: 1px solid var(--zinc-200);
    border-radius: var(--radius-sm); background-color: var(--zinc-50); position: relative;
}
.filter-item-delete {
    position: absolute; top: 0.5rem; right: 0.5rem;
    color: var(--zinc-400); display: flex; align-items: center;
    transition: color var(--t-fast);
}
.filter-item-delete:hover { color: var(--red-500); }
.filter-item-fields       { padding-right: 1.5rem; }

.action-item {
    padding: 1rem; border: 1px solid var(--zinc-200);
    border-radius: 0.5rem; background-color: var(--zinc-50); position: relative;
}
.action-item-delete {
    position: absolute; top: 0.5rem; right: 0.5rem;
    color: var(--zinc-400); display: flex; align-items: center;
    transition: color var(--t-fast);
}
.action-item-delete:hover { color: var(--red-500); }

/* ==========================================
   DATA CARD (CardRenderer wrapper)
   ========================================== */
.data-card {
    background-color: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--zinc-50);
    padding: 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}
.canvas-card--active .data-card{
    border-color: var(--color-brand);
}
.data-card-header{
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-bg-subtle);    
}
.data-card-title-wrap  { display: flex; align-items: center; gap: 0.5rem; }
.data-card-title { 
    font-size: 0.875rem;
    font-weight: 600;
    font: var(--text-section-title);
    color: var(--color-bg-dark-1);
    text-transform: none;
    letter-spacing: 0;
    font-weight: 600; 
}
.data-card-content     { flex: 1 1 0%; }

/* Tooltip */
.tooltip-trigger { position: relative; display: flex; align-items: center; }
.tooltip-icon    { width: 1rem; height: 1rem; color: var(--zinc-400); cursor: help; transition: color var(--t-fast); }
.tooltip-icon:hover { color: var(--zinc-600); }
.tooltip-popup {
    position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
    margin-bottom: 0.5rem; display: none;
    width: 12rem; padding: 0.5rem;
    background-color: var(--zinc-800); color: #ffffff;
    font-size: 0.75rem; font-weight: 400; text-transform: none; letter-spacing: 0;
    border-radius: 0.25rem; box-shadow: var(--shadow-lg); z-index: 50; white-space: normal;
}
.tooltip-trigger:hover .tooltip-popup { display: block; }
.tooltip-arrow {
    position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
    border: 4px solid transparent; border-top-color: var(--zinc-800);
}

/* Filter buttons on card */
.filter-bar     { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.filter-btn     { padding: 0.25rem 0.5rem; font-size: 0.75rem; font-weight: 500; border-radius: var(--radius-sm); background-color: var(--zinc-100); color: var(--zinc-600); border: 1px solid var(--zinc-200); cursor: pointer; transition: background-color var(--t-fast); }
.filter-btn:hover       { background-color: var(--zinc-200); }
.filter-btn--active     { background-color: var(--indigo-100); color: var(--indigo-700); border-color: var(--indigo-200); }

/* Endpoint label in builder canvas preview */
.endpoint-label  { position: absolute; top: 0.5rem; left: 0.5rem; opacity: 0; transition: opacity var(--t-fast); z-index: 10; }
.data-card:hover .endpoint-label { opacity: 1; }
.endpoint-badge  {
    background-color: var(--zinc-800); color: #ffffff;
    font-size: 10px; padding: 0.25rem 0.5rem;
    border-radius: 0.25rem; font-family: var(--font-mono);
    display: block; max-width: 12.5rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Card state views */
.card-loading       { display: flex; align-items: center; justify-content: center; height: 12rem; }
.spinner            { width: 2rem; height: 2rem; color: var(--color-brand); animation: spin 1s linear infinite; }
.card-error-state   { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 12rem; color: var(--red-500); }
.card-error-icon    { width: 2rem; height: 2rem; margin-bottom: 0.5rem; }
.card-error-msg     { font-size: 0.875rem; font-weight: 500; }
.card-no-data       { display: flex; align-items: center; justify-content: center; height: 12rem; color: var(--zinc-400); font-size: 0.875rem; }
.chart-error-inline { padding: 1rem; color: var(--red-500); font-size: 0.875rem; }

/* ==========================================
   METRIC CARD
   ========================================== */
.metric-display { display: flex; flex-direction: column; justify-content: center; height: 8rem; }
.metric-value   { font-size: 2.25rem; font-weight: 500; letter-spacing: -0.025em; color: var(--color-bg-dark-1); }

/* ==========================================
   CHART WRAPPER
   ========================================== */
.chart-container { height: 16rem; margin-top: 1rem; }

/* ==========================================
   DATA TABLE
   ========================================== */
.table-wrapper     { margin-top: 1rem; display: flex; flex-direction: column; height: 100%; }
.table-toolbar     { display: flex; justify-content: flex-end; margin-bottom: 0.5rem; }
.export-csv-btn    { font-size: 0.75rem; display: flex; align-items: center; gap: 0.25rem; color: var(--indigo-600); font-weight: 500; cursor: pointer; transition: color var(--t-fast); }
.export-csv-btn:hover { color: var(--indigo-800); }
.data-table-scroll { overflow-x: auto; flex: 1 1 0%; }
.data-table        { width: 100%; min-width: 100%; border-collapse: collapse; }
.data-table thead tr { border-bottom: 1px solid var(--zinc-200); }
.data-table-th     { padding: 0.5rem 0.75rem; text-align: left; font-size: 0.75rem; font-weight: 600; color: var(--zinc-500); text-transform: uppercase; letter-spacing: 0.05em; }
.data-table tbody tr { border-bottom: 1px solid var(--zinc-200); }
.data-table tbody tr:hover { background-color: var(--zinc-50); }
.data-table-td     { padding: 0.5rem 0.75rem; white-space: nowrap; font-size: 0.875rem; color: var(--zinc-700); }
.table-more-rows   { font-size: 0.75rem; text-align: center; color: var(--zinc-400); margin-top: 0.5rem; padding: 0.5rem 0; border-top: 1px solid var(--zinc-100); }

/* ==========================================
   DYNAMIC PAGE
   ========================================== */
.dynamic-page { min-height: 100%; background-color: var(--color-bg-subtle); padding: 2rem; }
.dynamic-page-inner  { max-width: 80rem; margin-left: auto; margin-right: auto; }
.dynamic-page-header { margin-bottom: 2rem; border-bottom: 1px solid var(--zinc-200); padding-bottom: 1.5rem; }
.dynamic-page-title  { font-size: 1.875rem; font-weight: 700; letter-spacing: -0.025em; color: var(--color-bg-dark-1); }
.dynamic-page-path   { color: var(--zinc-500); margin-top: 0.5rem; font-family: var(--font-mono); font-size: 0.875rem; }
.layout-section-header { 
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* border-bottom: 1px solid var(--zinc-200); 
    padding-bottom: 0.5rem; */
}
.layout-section-title  { 
    font: var(--text-button);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 700;
    color: var(--color-brand-dark);
 }
.layout-api-error      { display: flex; align-items: center; color: var(--red-500); font-size: 0.875rem; gap: 0.25rem; }

/* ==========================================
   SIDEBAR EMPTY (no card selected)
   ========================================== */
.sidebar-no-card-icon  { width: 3rem; height: 3rem; color: var(--zinc-200); margin: 0 auto 1rem; }
.sidebar-no-card-title { 
    font-size: 1.125rem; 
    font-weight: 500; 
    color: var(--button-nav-default);
}
.sidebar-no-card-text  { 
    font-size: 0.875rem;
    color: var(--color-label-dark);
    margin-top: 0.25rem;
    font-weight: 500;
    letter-spacing: 0.4px;
}

/* ==========================================
   Login
   ========================================== */

   .loginWrapper {
      min-height: 100dvh;
      display: flex;
      align-items: center;
      justify-content: center;
      background-color: var(--color-bg-page);
      font: var(--text-para);
      font-family: var(--font-primary);
      color: var(--color-text-primary);
    }

   /* ── Login card ── */
    .login-card {
      width: 100%;
      max-width: 400px;
      background: var(--color-bg-white);
      border: 1px solid var(--color-border-default);
      border-radius: var(--radius-xl);
      box-shadow: var(--shadow-lg);
      padding: var(--spacing-2xl) var(--spacing-xl);
      display: flex;
      flex-direction: column;
      gap: var(--spacing-lg);
    }

    /* ── Card header ── */
    .login-header {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: var(--spacing-sm);
    }

    .login-header img {
      height: 36px;
      width: auto;
    }

    .login-header h1 {
      font: var(--text-page-title);
      color: var(--color-text-primary);
      letter-spacing: -0.3px;
    }

    .login-header p {
      font: var(--text-para);
      color: var(--color-text-muted);
    }

    /* ── Divider ── */
    .login-divider {
      height: 1px;
      background: var(--color-border-light);
    }

    /* ── Form ── */
    .login-form {
      display: flex;
      flex-direction: column;
      gap: var(--spacing-md);
    }

    .form-field {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .form-field label {
      font: var(--text-label);
      color: var(--color-text-secondary);
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .form-field input {
      width: 100%;
      height: 42px;
      padding: 0 var(--spacing-sm);
      background: var(--color-bg-surface-1);
      border: 1px solid var(--color-border-default);
      border-radius: var(--radius-md);
      font: var(--text-para);
      font-family: var(--font-primary);
      color: var(--color-text-primary);
      outline: none;
      transition: border-color var(--t-fast), box-shadow var(--t-fast);
    }

    .form-field input::placeholder {
      color: var(--color-text-muted);
    }

    .form-field input:focus {
      border-color: var(--color-brand);
      box-shadow: 0 0 0 3px var(--color-brand-subtle);
      background: var(--color-bg-white);
    }

    /* ── Submit button ── */
    .btn-login {
      margin-top: var(--spacing-xs);
      width: 100%;
      height: 42px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      background: var(--color-brand);
      color: var(--color-text-inverse);
      font: var(--text-button);
      font-family: var(--font-primary);
      border: none;
      border-radius: var(--radius-md);
      cursor: pointer;
      transition: background var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
    }

    .btn-login:hover {
      background: var(--color-brand-hover);
      box-shadow: var(--shadow-md);
    }

    .btn-login:active {
      transform: scale(0.98);
    }