/* TERRA AI Food Stylist — First-Use + Security Hardened theme */
:root{--terra-brown:#6a351f;--terra-brown-2:#7d4936;--terra-taupe:#b09991;--terra-blush:#f4e7df;--terra-cream:#fbf7f4;--terra-line:#e4d5ce;--terra-charcoal:#242424;--terra-ink:#372c28;--terra-muted:#776b66;--terra-gold:#b38758}
body.terra-ai-food-stylist{background:var(--terra-blush);color:var(--terra-ink)}
.terra-ai-food-stylist .app-wrapper,.terra-ai-food-stylist .app-main{background:var(--terra-blush)}
.terra-ai-food-stylist .app-header{background:var(--terra-taupe)!important;border-bottom:0;box-shadow:0 2px 10px rgba(68,45,36,.08)}
.terra-ai-food-stylist .app-header .nav-link,.terra-ai-food-stylist .app-header .btn,.terra-ai-food-stylist .app-header .text-body-secondary{color:#fff!important}
.terra-ai-food-stylist .app-header .adminlte-search-trigger{border-color:rgba(255,255,255,.35)!important;background:rgba(255,255,255,.08)}
.terra-ai-food-stylist .app-header kbd{color:#fff;background:rgba(82,47,34,.25);border-color:rgba(255,255,255,.3)!important}
.terra-ai-food-stylist .app-sidebar{background:var(--terra-charcoal)!important;border-right:0}
.terra-ai-food-stylist .sidebar-brand{min-height:82px;background:var(--terra-taupe);border-bottom:1px solid rgba(255,255,255,.12)}
.terra-ai-food-stylist .sidebar-brand .brand-link{min-height:82px;padding:9px 14px 8px;display:flex;align-items:center;gap:10px}
.terra-ai-food-stylist .terra-brand-logo{width:128px;max-height:54px;object-fit:contain;margin:0;opacity:1!important;box-shadow:none!important}
.terra-ai-food-stylist .terra-brand-text{min-width:0;color:#fff!important}
.terra-ai-food-stylist .terra-brand-subtitle{display:block;font-size:.72rem;line-height:1.1;letter-spacing:.04em;text-transform:uppercase;color:rgba(255,255,255,.92)}
.terra-ai-food-stylist .sidebar-menu .nav-link{color:#e8dfdb;border-radius:6px;margin:2px 10px}
.terra-ai-food-stylist .sidebar-menu .nav-link:hover{background:rgba(176,153,145,.16);color:#fff}
.terra-ai-food-stylist .sidebar-menu .nav-link.active{background:var(--terra-brown)!important;color:#fff!important;box-shadow:inset 3px 0 0 #d7b9aa}
.terra-ai-food-stylist .sidebar-menu .nav-header{color:#bfaea7;letter-spacing:.08em;font-size:.68rem;text-transform:uppercase;margin-top:12px}
.terra-ai-food-stylist .app-content-header{padding-top:1.25rem;padding-bottom:.75rem}
.terra-ai-food-stylist .app-content-header h3{color:var(--terra-brown);font-weight:700;letter-spacing:.01em}
.terra-ai-food-stylist .app-content-header .text-muted,.terra-ai-food-stylist .breadcrumb,.terra-ai-food-stylist .breadcrumb a{color:var(--terra-muted)!important}
.terra-ai-food-stylist .card,.terra-ai-food-stylist .info-box{border-color:var(--terra-line);background:var(--terra-cream);box-shadow:0 2px 9px rgba(89,60,48,.06)!important}
.terra-ai-food-stylist .card-header{background:rgba(244,231,223,.68);border-bottom-color:var(--terra-line)}
.terra-ai-food-stylist .card-title{color:var(--terra-ink);font-weight:650}
.terra-ai-food-stylist .table>:not(caption)>*>*{border-bottom-color:#eaded8}
.terra-ai-food-stylist .table thead th{color:var(--terra-brown);background:#f8efea}
.terra-ai-food-stylist .info-box-icon{background:var(--terra-brown)!important;color:#fff!important}
.terra-ai-food-stylist .info-box-number{color:var(--terra-brown)}
.terra-ai-food-stylist .text-muted{color:var(--terra-muted)!important}
.terra-ai-food-stylist .btn-primary{--bs-btn-bg:var(--terra-brown);--bs-btn-border-color:var(--terra-brown);--bs-btn-hover-bg:#542817;--bs-btn-hover-border-color:#542817;--bs-btn-active-bg:#4a2214;--bs-btn-active-border-color:#4a2214}
.terra-ai-food-stylist .btn-outline-primary{--bs-btn-color:var(--terra-brown);--bs-btn-border-color:var(--terra-brown);--bs-btn-hover-bg:var(--terra-brown);--bs-btn-hover-border-color:var(--terra-brown)}
.terra-ai-food-stylist .form-control:focus,.terra-ai-food-stylist .form-select:focus,.terra-ai-food-stylist .form-check-input:focus{border-color:#aa7a65;box-shadow:0 0 0 .2rem rgba(106,53,31,.12)}
.terra-ai-food-stylist .form-check-input:checked{background-color:var(--terra-brown);border-color:var(--terra-brown)}
.terra-ai-food-stylist .badge.text-bg-primary{background:var(--terra-brown)!important}
.terra-ai-food-stylist .alert-info{color:#5d4439;background:#f5e8e1;border-color:#ddc6bb}
.terra-ai-food-stylist .bg-body-tertiary{background:#f6ede8!important}
.terra-ai-food-stylist .app-footer{background:var(--terra-charcoal)!important;border-top:0;color:#d9ceca}
.terra-ai-food-stylist .app-footer b{color:#fff}
.terra-ai-food-stylist .terra-page-kicker{color:var(--terra-brown);font-size:.72rem;text-transform:uppercase;letter-spacing:.11em;font-weight:700}
.terra-ai-food-stylist .style-option{border:1px solid var(--terra-line);transition:transform .12s ease,box-shadow .12s ease,border-color .12s ease}
.terra-ai-food-stylist .style-option:hover{transform:translateY(-1px);border-color:#c9a99a;box-shadow:0 4px 14px rgba(80,50,38,.08)}
.terra-ai-food-stylist .terra-user-initials{width:30px;height:30px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;background:rgba(255,255,255,.92);color:var(--terra-brown);font-size:.72rem;font-weight:800;letter-spacing:.03em}
.empty-state{max-width:560px;margin:auto}
.secure-upload-zone{border:1.5px dashed #cdb7ad;border-radius:10px;text-align:center;padding:2.5rem 1.25rem;background:#faf3ef}
.starter-card{border:1px solid var(--terra-line);border-radius:9px;padding:1rem;height:100%;background:#fff}
.starter-card span{width:28px;height:28px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;background:var(--terra-brown);color:#fff;font-size:.8rem;font-weight:700;margin-bottom:.65rem}
.starter-card strong,.starter-card small{display:block}.starter-card small{color:var(--terra-muted);margin-top:.35rem}
.system-template-card{border:1px solid var(--terra-line);border-radius:9px;overflow:hidden;background:#fff}
.system-template-preview{height:125px;background:linear-gradient(135deg,#1e1815,#6a351f 62%,#b38758);display:flex;align-items:center;justify-content:center;color:#fff;font-size:2rem}
.security-rule{border:1px solid var(--terra-line);border-radius:9px;padding:1rem;height:100%;background:#fff}.security-rule i{display:block;font-size:1.4rem;color:var(--terra-brown);margin-bottom:.5rem}.security-rule strong,.security-rule small{display:block}.security-rule small{color:var(--terra-muted);margin-top:.35rem}
.security-checklist{padding-left:1.2rem}.security-checklist li{padding:.35rem 0}
.terra-auth-logo{object-fit:contain;max-width:100%;height:auto!important}

/* First-time setup intentionally uses a focused layout without application navigation. */
body.terra-first-use-page{min-height:100vh;background:linear-gradient(145deg,#f6ece6 0%,#fff 45%,#eee0d8 100%);color:var(--terra-ink)}
.terra-setup-shell{max-width:940px}.terra-setup-logo{width:170px;max-height:70px;object-fit:contain}.terra-setup-step{background:#fff;border:1px solid var(--terra-line);border-radius:9px;padding:.85rem}.terra-setup-step span{width:27px;height:27px;display:flex;align-items:center;justify-content:center;border-radius:50%;background:var(--terra-brown);color:#fff;font-weight:700;margin-bottom:.55rem}.terra-setup-step strong,.terra-setup-step small{display:block}.terra-setup-step small{font-size:.72rem;color:var(--terra-muted);margin-top:.2rem}

@media(max-width:991.98px){.terra-ai-food-stylist .sidebar-brand{min-height:64px}.terra-ai-food-stylist .sidebar-brand .brand-link{min-height:64px}.terra-ai-food-stylist .terra-brand-logo{width:106px}.terra-ai-food-stylist .terra-brand-subtitle{display:none}}


/* Baseline 4 brand-header correction */
.terra-ai-food-stylist .sidebar-brand .brand-link{
    justify-content:center;
    gap:0;
}
.terra-ai-food-stylist .sidebar-brand .brand-text{
    display:none!important;
}
.terra-ai-food-stylist .terra-brand-logo{
    width:138px;
    max-height:58px;
}

/* Terra horizontal logo - final sidebar sizing */
.terra-ai-food-stylist .sidebar-brand {
    height: 82px;
    min-height: 82px;
    padding: 8px 12px;
}

.terra-ai-food-stylist .sidebar-brand .brand-link {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.terra-ai-food-stylist .sidebar-brand .brand-link .brand-image.terra-brand-logo {
    float: none !important;
    width: 170px !important;
    max-width: 90% !important;
    height: auto !important;
    max-height: 64px !important;
    margin: 0 !important;
    opacity: 1 !important;
    object-fit: contain !important;
}

/* Keep logo sensible while sidebar is collapsed */
.terra-ai-food-stylist.sidebar-collapse .sidebar-brand .brand-link .brand-image.terra-brand-logo {
    width: 52px !important;
    max-width: 52px !important;
    max-height: 46px !important;
}

/* =========================================================
   Terra header alignment
   Sidebar brand + application navbar = 64px
   ========================================================= */

.terra-ai-food-stylist .app-header {
    height: 64px !important;
    min-height: 64px !important;
    max-height: 64px !important;
    display: flex;
    align-items: center;
}

.terra-ai-food-stylist .app-header .navbar-nav {
    min-height: 64px;
    align-items: center;
}

.terra-ai-food-stylist .sidebar-brand {
    height: 64px !important;
    min-height: 64px !important;
    max-height: 64px !important;
    padding: 0 !important;
}

.terra-ai-food-stylist .sidebar-brand .brand-link {
    width: 100%;
    height: 64px !important;
    min-height: 64px !important;
    max-height: 64px !important;
    padding: 5px 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.terra-ai-food-stylist .sidebar-brand .brand-link .brand-image.terra-brand-logo {
    float: none !important;
    width: auto !important;
    height: 50px !important;
    max-height: 50px !important;
    max-width: 160px !important;
    margin: 0 !important;
    object-fit: contain !important;
    opacity: 1 !important;
}

/* Compact logo while sidebar is collapsed */
.terra-ai-food-stylist.sidebar-collapse
.sidebar-brand .brand-link .brand-image.terra-brand-logo {
    width: auto !important;
    height: 42px !important;
    max-height: 42px !important;
    max-width: 48px !important;
}

