/* ============================================================
   Bootstrap primary colour override — #00ace6
   ============================================================ */
:root {
    --bs-primary:           #00ace6;
    --bs-primary-rgb:       0, 172, 230;
    --bs-link-color:            #00ace6;
    --bs-link-color-rgb:        0, 172, 230;
    --bs-link-hover-color:      #0099cc;
    --bs-link-hover-color-rgb:  0, 153, 204;
}

.btn:disabled { opacity: 0.5; }

.btn-primary {
    --bs-btn-bg:               #00ace6;
    --bs-btn-border-color:     #00ace6;
    --bs-btn-hover-bg:         #0099cc;
    --bs-btn-hover-border-color: #0099cc;
    --bs-btn-active-bg:        #0088b3;
    --bs-btn-active-border-color: #0088b3;
    --bs-btn-focus-shadow-rgb: 0, 172, 230;
    --bs-btn-disabled-bg:      #00ace6;
    --bs-btn-disabled-border-color: #00ace6;
}

.btn-outline-primary {
    --bs-btn-color:            #00ace6;
    --bs-btn-border-color:     #00ace6;
    --bs-btn-hover-bg:         #00ace6;
    --bs-btn-hover-border-color: #00ace6;
    --bs-btn-active-bg:        #00ace6;
    --bs-btn-active-border-color: #00ace6;
    --bs-btn-focus-shadow-rgb: 0, 172, 230;
}

.text-primary   { color: #00ace6 !important; }
.bg-primary     { background-color: #00ace6 !important; }
.border-primary { border-color: #00ace6 !important; }
.form-control:focus { border-color: #00ace6; box-shadow: 0 0 0 0.25rem rgba(0, 172, 230, 0.25); }
.form-check-input:checked { background-color: #00ace6; border-color: #00ace6; }
.form-check-input:focus { box-shadow: 0 0 0 0.25rem rgba(0, 172, 230, 0.25); }

/* ============================================================
   Layout variables
   ============================================================ */
:root {
    --sidebar-w:          260px;
    --sidebar-bg:         #3d4f63;
    --sidebar-hover:      #4a5f76;
    --sidebar-active-bg:  #d52b1e;
    --sidebar-border:     #4a5f76;
    --ca-red:             #d52b1e;
    --ca-red-dark:        #b52318;
}

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    min-height: 100vh;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 1040;
    transition: transform 0.25s ease;
}

.sidebar-logo {
    padding: 20px;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid var(--sidebar-border);
    display: block;
}

.sidebar-logo span { color: #f87171; }

.sidebar-nav { flex: 1; padding: 12px 0; }

.nav-section-label {
    padding: 14px 20px 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #8fa3b8;
}

.sidebar .nav-link {
    padding: 9px 20px;
    color: #c8d8e8;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 0;
    transition: background 0.15s, color 0.15s;
}

.sidebar .nav-link:hover  { background: var(--sidebar-hover); color: #fff; }
.sidebar .nav-link.active { background: var(--sidebar-active-bg); color: #fff; }
.sidebar .nav-link .icon  { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.8; }

/* ============================================================
   Main layout
   ============================================================ */
.main-wrapper {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    background: #f1f5f9;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 28px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-title { font-size: 16px; font-weight: 600; color: #1e293b; }

.page-content { padding: 28px; }

/* ============================================================
   Profile avatar
   ============================================================ */
.profile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ca-red);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.5px;
    transition: background 0.15s;
    flex-shrink: 0;
}

.profile-avatar:hover { background: var(--ca-red-dark); }

/* ============================================================
   Publish bar
   ============================================================ */
.publish-bar {
    background: #fefce8;
    border: 1px solid #fde047;
    border-radius: 8px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.publish-bar p { font-size: 14px; color: #713f12; margin: 0; }

/* ============================================================
   Sections list
   ============================================================ */
.section-row {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}

.section-row.disabled  { opacity: 0.5; }
.section-row.dragging  { opacity: 0.4; background: #f1f5f9; }
.section-row-label     { font-size: 14px; font-weight: 500; }
.section-row-meta      { font-size: 13px; color: #64748b; margin-top: 2px; }
.drag-handle           { display: flex; align-items: center; cursor: grab; padding: 0 4px; }

/* ============================================================
   Repeatable items
   ============================================================ */
.repeat-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.repeat-item-label {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

/* ============================================================
   Site URL block
   ============================================================ */
.site-url-block {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
}

/* ============================================================
   Mobile sidebar
   ============================================================ */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #1e293b;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1039;
}

/* ============================================================
   Auth pages
   ============================================================ */
.auth-logo { font-size: 24px; font-weight: 700; color: #1e293b; }
.auth-logo span { color: var(--ca-red); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,0.2); }
    .sidebar-overlay.open { display: block; }
    .main-wrapper { margin-left: 0; }
    .topbar { padding: 0 16px; }
    .sidebar-toggle { display: flex; }
    .page-content { padding: 16px; }
    .publish-bar { flex-direction: column; align-items: flex-start; }
}
