:root {
    /* Brand Colors */
    --sheep-green: #2c7744;
    --sheep-green-dark: #1e5a32;
    --sheep-green-light: #3a9c5a;
    --sheep-orange: #f28c38;
    --sheep-orange-dark: #d16f1e;
    /* Text / neutral */
    --sheep-light-bg: #f8f9fa;
    --sheep-dark: #1e293b;
    --sheep-gray: #6c757d;
    /* Surface tokens */
    --surface-bg: #ffffff;
    --surface-bg-soft: #f8fafc;
    --surface-bg-accent: #eef8f0;
    --surface-bg-glass: rgba(255, 255, 255, 0.82);
    --surface-border: rgba(30, 41, 59, 0.08);
    --surface-border-strong: rgba(30, 41, 59, 0.14);
    --surface-shadow: 0 8px 24px rgba(0,0,0,0.12);
    --surface-shadow-hover: 0 12px 32px rgba(0,0,0,0.16);
    --text-muted-color: #6c757d;
    /* Design tokens */
    --radius: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.12);
    --transition: all 0.25s ease;
    /* Layout */
    --navbar-height: 56px;
    --sidebar-collapsed: 58px;
    --sidebar-expanded: 240px;
    --sidebar-push-collapsed: calc(var(--sidebar-collapsed) + 8px);
    --sidebar-push-expanded: calc(var(--sidebar-expanded) + 8px);
}

/* Dark mode */
[data-theme="dark"] {
    --sheep-light-bg: #0f172a;
    --sheep-dark: #e2e8f0;
    --sheep-gray: #94a3b8;
    --surface-bg: #172033;
    --surface-bg-soft: #1e293b;
    --surface-bg-accent: #1d3a2a;
    --surface-bg-glass: rgba(23, 32, 51, 0.82);
    --surface-border: rgba(148, 163, 184, 0.16);
    --surface-border-strong: rgba(148, 163, 184, 0.28);
    --surface-shadow: 0 10px 28px rgba(0,0,0,0.38);
    --surface-shadow-hover: 0 16px 36px rgba(0,0,0,0.48);
    --text-muted-color: #94a3b8;
    background-color: #0f172a;
    color: #e2e8f0;
}

/* Base page colors */
html,
body {
    background-color: var(--sheep-light-bg);
    color: var(--sheep-dark);
}

/* Global utilities */
.text-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-sheep-green {
    color: var(--sheep-green) !important;
}

.text-sheep-orange {
    color: var(--sheep-orange) !important;
}

.text-muted {
    color: var(--text-muted-color) !important;
}

    .text-muted.small {
        font-size: 0.875rem;
        line-height: 1.3;
        color: var(--text-muted-color) !important;
    }

.bg-surface {
    background: var(--surface-bg) !important;
}

.bg-surface-soft {
    background: var(--surface-bg-soft) !important;
}

.bg-surface-accent {
    background: var(--surface-bg-accent) !important;
}

.border-surface {
    border-color: var(--surface-border) !important;
}

/* Prevent horizontal overflow */
body,
html,
.d-flex.flex-column.min-vh-100 {
    overflow-x: hidden;
}

/* Top Navbar */
.sheep-topbar {
    background: var(--sheep-green);
    border-bottom: 1px solid var(--sheep-green-dark);
    box-shadow: var(--shadow-sm);
    z-index: 1030;
}

    .sheep-topbar .navbar-brand img {
        height: 42px;
        transition: var(--transition);
    }

/* Sidebar */
.sheep-sidebar {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-collapsed);
    background: var(--sheep-green-dark);
    color: white;
    transition: width 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1020;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
}

@media (min-width: 992px) {
    .sheep-sidebar {
        display: flex !important;
    }
}

.sheep-sidebar:hover,
.sheep-sidebar.expanded {
    width: var(--sidebar-expanded);
    overflow-x: visible;
    box-shadow: 4px 0 16px rgba(0,0,0,0.25);
}

/* Sidebar logo */
.sheep-sidebar-logo {
    width: 200px;
    height: 200px;
    object-fit: contain;
    border-radius: 50%;
    border: 4px solid rgba(120, 220, 180, 0.18);
    background: linear-gradient(145deg, rgba(200, 240, 220, 0.25), rgba(255, 245, 230, 0.20));
    box-shadow: 0 8px 24px rgba(120, 220, 180, 0.08), inset 0 3px 10px rgba(255, 255, 255, 0.40);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    image-rendering: -webkit-optimize-contrast;
    margin: 1.5rem auto;
    opacity: 0;
    pointer-events: none;
    display: block;
}

.sheep-sidebar:hover .sheep-sidebar-logo,
.sheep-sidebar.expanded .sheep-sidebar-logo {
    opacity: 1;
    pointer-events: auto;
}

    .sheep-sidebar:hover .sheep-sidebar-logo:hover,
    .sheep-sidebar.expanded .sheep-sidebar-logo:hover {
        transform: scale(1.08) rotate(8deg);
        border-color: rgba(242, 140, 56, 0.35);
        box-shadow: 0 14px 40px rgba(242, 140, 56, 0.18), inset 0 5px 14px rgba(255, 255, 255, 0.50);
        filter: brightness(1.05) contrast(1.02);
    }

.sheep-sidebar:hover .sheep-sidebar-logo,
.sheep-sidebar.expanded .sheep-sidebar-logo {
    animation: gentlePulse 6s ease-in-out infinite;
    animation-delay: 1.5s;
}

@keyframes gentlePulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.015);
    }
}

@media (prefers-reduced-motion: reduce) {
    .sheep-sidebar-logo,
    .sheep-sidebar-logo:hover {
        transition: none;
        transform: none !important;
        animation: none;
    }
}

/* Sidebar nav links */
.sheep-sidebar .nav-link {
    color: rgba(255,255,255,0.9);
    border-radius: var(--radius);
    margin: 3px 4px;
    padding: 10px 8px;
    white-space: nowrap;
    transition: var(--transition);
    display: flex;
    align-items: center;
}

    .sheep-sidebar .nav-link i {
        font-size: 1.45rem;
        width: 28px;
        text-align: center;
        flex-shrink: 0;
    }

    .sheep-sidebar .nav-link span {
        margin-left: 12px;
        opacity: 0;
        transition: opacity 0.25s ease;
    }

.sheep-sidebar:hover .nav-link span,
.sheep-sidebar.expanded .nav-link span {
    opacity: 1;
}

.sheep-sidebar .nav-link:hover {
    color: var(--sheep-orange) !important;
    background: rgba(242, 140, 56, 0.12);
}

.sheep-sidebar .nav-link.active,
.sheep-sidebar .nav-link[aria-current="page"] {
    color: var(--sheep-orange) !important;
    background: rgba(242, 140, 56, 0.20);
    font-weight: 600;
}

    .sheep-sidebar .nav-link:hover i,
    .sheep-sidebar .nav-link.active i {
        color: var(--sheep-orange);
    }

/* Collapsed mode */
.sheep-sidebar:not(:hover):not(.expanded) .nav-link span {
    width: 0;
    overflow: hidden;
    margin-left: 0 !important;
    opacity: 0;
}

.sheep-sidebar:not(:hover):not(.expanded) .nav-link {
    justify-content: center;
    padding: 10px 0;
}

    .sheep-sidebar:not(:hover):not(.expanded) .nav-link i {
        margin: 0 auto;
    }

/* Content push */
@media (min-width: 992px) {
    .main-content {
        padding-left: var(--sidebar-push-collapsed);
        transition: padding-left 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .sheep-sidebar:hover ~ .main-content,
    .sheep-sidebar.expanded ~ .main-content {
        padding-left: var(--sidebar-push-expanded);
    }
}

/* Bottom nav */
.sheep-bottom-nav {
    background: var(--sheep-green);
    border-top: 1px solid var(--sheep-green-dark);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.15);
    padding-bottom: env(safe-area-inset-bottom);
}

    .sheep-bottom-nav .nav-link {
        padding: .4rem .25rem;
        line-height: 1.1;
    }

    .sheep-bottom-nav small {
        font-size: .70rem;
    }

    .sheep-bottom-nav .nav-link.active {
        font-weight: 600;
        text-decoration: none;
        opacity: 1;
    }

/* Offcanvas mobile */
.offcanvas-start {
    width: 85% !important;
    max-width: 320px;
}

/* Mobile content padding */
@media (max-width: 991.98px) {
    .main-content {
        padding-bottom: 80px;
    }
}

/* intl-tel-input helpers */
.iti {
    width: 100%;
}

.iti__tel-input {
    width: 100%;
}
