/* ============================================
   AGRO MANAGER — Custom CSS
   Παλέτα: #2d6a4f (σκούρο πράσινο), #52b788 (ανοιχτό πράσινο)
   ============================================ */

/* --- Variables --- */
:root {
    --agro-dark:      #2d6a4f;
    --agro-main:      #40916c;
    --agro-light:     #52b788;
    --agro-pale:      #d8f3dc;
    --agro-accent:    #1b4332;
    --sidebar-width:  260px;
    --sidebar-bg:     #1b4332;
    --sidebar-text:   #d8f3dc;
    --sidebar-hover:  #2d6a4f;
    --sidebar-active: #52b788;
    --topbar-height:  56px;
    --font-base:      'Noto Sans', 'Segoe UI', sans-serif;
}

/* --- Base --- */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--font-base);
    font-size: 0.9375rem;
    background-color: #f4f7f5;
    color: #212529;
    min-height: 100vh;
}

/* --- Layout Wrapper --- */
.wrapper {
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    transition: transform 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Brand */
.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.25rem;
    background-color: var(--agro-accent);
    flex-shrink: 0;
}

.sidebar-brand-icon {
    font-size: 1.6rem;
    line-height: 1;
}

.sidebar-brand-text {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.02em;
}

.sidebar-close {
    color: var(--sidebar-text);
    padding: 0;
    font-size: 1.1rem;
}

.sidebar-close:hover { color: #fff; }

/* Divider */
.sidebar-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 0;
}

/* Section Labels */
.sidebar-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(216,243,220,0.5);
    padding: 1rem 1.25rem 0.3rem;
}

/* Nav */
.sidebar-nav {
    padding: 0.5rem 0;
    flex: 1;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 1.25rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
    border-radius: 0;
    transition: background 0.15s, color 0.15s;
    position: relative;
}

.sidebar-nav-link:hover {
    background-color: var(--sidebar-hover);
    color: #fff;
}

.sidebar-nav-link.active {
    background-color: var(--agro-main);
    color: #fff;
    font-weight: 600;
}

.sidebar-nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: var(--agro-light);
    border-radius: 0 2px 2px 0;
}

.sidebar-nav-icon {
    font-size: 1rem;
    width: 1.25rem;
    text-align: center;
    flex-shrink: 0;
}

/* Footer */
.sidebar-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.75rem;
    color: rgba(216,243,220,0.4);
    flex-shrink: 0;
}

/* ============================================
   CONTENT WRAPPER
   ============================================ */
.content-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

/* ============================================
   TOPBAR
   ============================================ */
.topbar {
    height: var(--topbar-height);
    background-color: #fff;
    border-bottom: 1px solid #e2e8e4;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.topbar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--agro-dark);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
}

.topbar-toggle:hover { background-color: var(--agro-pale); }

.topbar-title {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--agro-accent);
    flex: 1;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    padding: 1.75rem;
    flex: 1;
}

/* ============================================
   DASHBOARD CARDS
   ============================================ */
.stat-card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    transition: transform 0.15s, box-shadow 0.15s;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.1);
}

.stat-card .card-body {
    padding: 1.35rem 1.5rem;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-card .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--agro-accent);
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Χρωματιστά stat card icons */
.stat-icon-green  { background-color: #d1fae5; color: #065f46; }
.stat-icon-blue   { background-color: #dbeafe; color: #1e40af; }
.stat-icon-yellow { background-color: #fef9c3; color: #854d0e; }
.stat-icon-red    { background-color: #fee2e2; color: #991b1b; }

/* ============================================
   WELCOME BANNER
   ============================================ */
.welcome-banner {
    background: linear-gradient(135deg, var(--agro-dark) 0%, var(--agro-main) 100%);
    color: #fff;
    border-radius: 0.875rem;
    padding: 2rem 2.25rem;
    margin-bottom: 1.75rem;
    position: relative;
    overflow: hidden;
}

.welcome-banner::after {
    content: '🌿';
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 4.5rem;
    opacity: 0.2;
    pointer-events: none;
}

.welcome-banner h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.welcome-banner p {
    margin-bottom: 0;
    opacity: 0.85;
    font-size: 0.95rem;
}

/* ============================================
   GENERAL UTILITIES
   ============================================ */
.page-header {
    margin-bottom: 1.5rem;
}

.page-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--agro-accent);
}

.btn-agro {
    background-color: var(--agro-main);
    border-color: var(--agro-main);
    color: #fff;
}

.btn-agro:hover {
    background-color: var(--agro-dark);
    border-color: var(--agro-dark);
    color: #fff;
}

.badge-agro {
    background-color: var(--agro-light);
    color: var(--agro-accent);
}

/* ============================================
   MOBILE OVERLAY & RESPONSIVE
   ============================================ */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1039;
    transition: opacity 0.3s;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-overlay.show {
        display: block;
    }

    .content-wrapper {
        margin-left: 0;
    }

    .topbar-toggle {
        display: block;
    }

    .main-content {
        padding: 1.25rem;
    }
}

@media (max-width: 575.98px) {
    .welcome-banner {
        padding: 1.5rem 1.25rem;
    }

    .welcome-banner h1 {
        font-size: 1.2rem;
    }
}

/* ============================================
   SCROLLBAR (WebKit)
   ============================================ */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }
