/* ===================================================================
   Responsible Business Certification — Admin Theme
   A brand-colored polish layer on top of Bootstrap 5. No Bootstrap
   classes are removed from the markup; this file only restyles them.
   =================================================================== */

:root {
    --rb-base: #FFFFFF;
    --rb-primary: #f9d973;
    --rb-primary-dark: #e8c65a;
    --rb-primary-tint: #fdf3d9;
    --rb-secondary: #000000;
    --rb-ink: #1a1a1a;
    --rb-muted: #767676;
    --rb-border: #e9e9e9;
    --rb-surface: #ffffff;
    --rb-bg: #f7f7f5;
    --rb-success: #1e8a4c;
    --rb-success-tint: #e5f6ec;
    --rb-danger: #c0392b;
    --rb-danger-tint: #fbe9e7;
    --rb-warning: #a9790a;
    --rb-warning-tint: #fdf1dc;
    --rb-radius: 10px;
    --rb-radius-sm: 6px;
    --rb-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.05);
}

* {
    -webkit-font-smoothing: antialiased;
}

body {
    background: var(--rb-bg);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--rb-ink);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--rb-secondary);
}

a {
    color: var(--rb-secondary);
}

/* -------------------------------------------------------------
   Sidebar
   ------------------------------------------------------------- */
.sidebar {
    min-height: 100vh;
    background-color: var(--rb-secondary);
    padding-left: 0;
    padding-right: 0;
}

.sidebar-brand {
    padding: 0 1.25rem;
}

.sidebar-logo {
    max-width: 100%;
    height: auto;
    max-height: 42px;
    filter: brightness(0) invert(1);
    /* renders the logo in white on the black sidebar */
    margin-bottom: 6px;
}

.sidebar-brand-tag {
    display: block;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.65);
    padding: 0.7rem 1.25rem;
    border-radius: 0;
    border-left: 3px solid transparent;
    font-size: 0.925rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.sidebar .nav-link i {
    width: 18px;
    text-align: center;
    opacity: 0.85;
}

.sidebar .nav-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.06);
    border-left-color: rgba(249, 217, 115, 0.5);
}

.sidebar .nav-link.active {
    color: #fff;
    background-color: rgba(249, 217, 115, 0.12);
    border-left-color: var(--rb-primary);
    font-weight: 600;
}

.sidebar hr {
    border-color: rgba(255, 255, 255, 0.1);
    margin-left: 1.25rem;
    margin-right: 1.25rem;
}

.sidebar .dropdown {
    padding: 0 1.25rem;
}

.sidebar .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
}

.sidebar .btn-outline-light:hover {
    background-color: var(--rb-primary);
    border-color: var(--rb-primary);
    color: var(--rb-secondary);
}

.sidebar .dropdown-menu {
    border-radius: var(--rb-radius-sm);
    border: 1px solid var(--rb-border);
    box-shadow: var(--rb-shadow);
}

/* -------------------------------------------------------------
   Mobile navigation (top bar + off-canvas sidebar)
   ------------------------------------------------------------- */
.mobile-topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    background-color: var(--rb-secondary);
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 1040;
    justify-content: space-between;
}

.mobile-topbar-logo {
    height: 26px;
    width: auto;
    filter: brightness(0) invert(1);
}

.mobile-menu-toggle {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.15rem;
    padding: 6px 10px;
    border-radius: var(--rb-radius-sm);
    line-height: 1;
}

.mobile-menu-toggle:hover,
.mobile-menu-toggle:focus-visible {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1045;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.sidebar-backdrop.show {
    display: block;
    opacity: 1;
}

body.sidebar-locked {
    overflow: hidden;
}

@media (max-width: 767.98px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: min(82%, 300px);
        max-width: 300px;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 1050;
        overflow-y: auto;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
    }

    .sidebar.sidebar-open {
        transform: translateX(0);
    }
}

/* -------------------------------------------------------------
   Main content area
   ------------------------------------------------------------- */
.main-content {
    padding: 2.25rem;
}

@media (max-width: 768px) {
    .main-content {
        padding: 1.25rem;
    }
}

/* -------------------------------------------------------------
   Cards
   ------------------------------------------------------------- */
.card {
    border: 1px solid var(--rb-border);
    border-radius: var(--rb-radius);
    box-shadow: var(--rb-shadow);
}

.card-header {
    background-color: var(--rb-surface);
    border-bottom: 1px solid var(--rb-border);
    font-weight: 600;
    color: var(--rb-secondary);
}

/* -------------------------------------------------------------
   Buttons
   ------------------------------------------------------------- */
.btn {
    border-radius: var(--rb-radius-sm);
    font-weight: 500;
    transition: transform 0.05s ease, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--rb-primary);
    border-color: var(--rb-primary);
    color: var(--rb-secondary);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--rb-primary-dark);
    border-color: var(--rb-primary-dark);
    color: var(--rb-secondary);
}

.btn-outline-primary {
    color: var(--rb-secondary);
    border-color: var(--rb-secondary);
}

.btn-outline-primary:hover {
    background-color: var(--rb-secondary);
    border-color: var(--rb-secondary);
    color: #fff;
}

.btn-outline-secondary {
    color: var(--rb-muted);
    border-color: var(--rb-border);
}

.btn-outline-secondary:hover {
    background-color: var(--rb-secondary);
    border-color: var(--rb-secondary);
    color: #fff;
}

/* -------------------------------------------------------------
   Tables
   ------------------------------------------------------------- */
.table thead th {
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    color: var(--rb-muted);
    font-weight: 600;
    border-bottom: 2px solid var(--rb-border);
    background-color: var(--rb-surface);
}

.table td {
    vertical-align: middle;
    border-color: var(--rb-border);
}

.table-hover tbody tr:hover {
    background-color: var(--rb-primary-tint);
}

code {
    background-color: var(--rb-bg);
    color: var(--rb-secondary);
    padding: 0.15rem 0.45rem;
    border-radius: var(--rb-radius-sm);
    font-size: 0.875em;
}

/* -------------------------------------------------------------
   Badges (survey status, etc.)
   ------------------------------------------------------------- */
.badge.bg-success {
    background-color: var(--rb-success-tint) !important;
    color: var(--rb-success) !important;
}

.badge.bg-danger {
    background-color: var(--rb-danger-tint) !important;
    color: var(--rb-danger) !important;
}

.badge.bg-warning {
    background-color: var(--rb-warning-tint) !important;
    color: var(--rb-warning) !important;
}

/* -------------------------------------------------------------
   Alerts
   ------------------------------------------------------------- */
.alert {
    border: none;
    border-radius: var(--rb-radius);
}

.alert-success {
    background-color: var(--rb-success-tint);
    color: var(--rb-success);
}

.alert-danger {
    background-color: var(--rb-danger-tint);
    color: var(--rb-danger);
}

/* -------------------------------------------------------------
   Forms
   ------------------------------------------------------------- */
.form-control,
.form-select {
    border-radius: var(--rb-radius-sm);
    border-color: var(--rb-border);
    padding: 0.55rem 0.8rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--rb-primary);
    box-shadow: 0 0 0 0.2rem rgba(249, 217, 115, 0.35);
}

.form-label {
    font-weight: 500;
    color: var(--rb-secondary);
    font-size: 0.9rem;
}

/* -------------------------------------------------------------
   Accessibility
   ------------------------------------------------------------- */
a:focus-visible,
button:focus-visible,
.nav-link:focus-visible {
    outline: 3px solid var(--rb-primary);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}