/* ============================================================
   AGRONET RTK - ADMIN FELULET - VILAGOSKEK TEMA
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #6caf2e;
    --primary-dark: #4d8020;
    --primary-light: #8dcf52;
    --primary-bg: #f0f8e8;

    --bg: #eef6df;
    --bg-sidebar: #6caf2e;
    --bg-sidebar-hover: #7cc23a;
    --bg-sidebar-section: #4d8020;

    --text: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --text-sidebar: rgba(255,255,255,0.85);
    --text-sidebar-active: #ffffff;

    --border: #cfe6a8;
    --border-light: #e9f4d8;

    --card-shadow: 0 1px 3px rgba(108, 175, 46, 0.08), 0 1px 2px rgba(108, 175, 46, 0.04);
    --card-shadow-hover: 0 4px 16px rgba(108, 175, 46, 0.14);

    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #0d9488;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ============================================================
   LOGIN OLDAL
   ============================================================ */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4d8020 0%, #7cc23a 50%, #4d8020 100%);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(141, 207, 82, 0.2) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    animation: float 8s ease-in-out infinite;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(174, 221, 117, 0.15) 0%, transparent 70%);
    bottom: -150px;
    left: -150px;
    animation: float 10s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, -30px); }
}

.login-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo img { max-width: 200px; height: auto; }

.login-title {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.login-subtitle {
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.form-group { margin-bottom: 20px; }

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
    transition: all 0.2s;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 175, 46, 0.15);
}

.form-error {
    background: #fef2f2;
    color: #dc2626;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
    border-left: 3px solid #dc2626;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    width: 100%;
    padding: 14px 24px;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 175, 46, 0.3);
}

.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    background: #ffffff;
    color: var(--text);
    border: 1.5px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg);
    border-color: var(--text-muted);
}

/* ============================================================
   LAYOUT - SIDEBAR + MAIN
   ============================================================ */

.app-layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px;
    background: linear-gradient(180deg, #6caf2e 0%, #4d8020 100%);
    color: var(--text-sidebar);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 10;
    box-shadow: 3px 0 20px rgba(108, 175, 46, 0.25);
}

.sidebar-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.1);
}

.sidebar-logo img { max-width: 160px; height: auto; display: block; }

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-sidebar);
    margin-bottom: 2px;
    transition: all 0.15s;
    cursor: pointer;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-sidebar-active);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.nav-item-icon { width: 20px; height: 20px; flex-shrink: 0; }

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.1);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.main-content {
    margin-left: 240px;
    flex: 1;
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 5;
}

.topbar-title { font-size: 20px; font-weight: 700; color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 16px; }

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 14px;
    border-radius: 8px;
    background: var(--primary-bg);
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    transition: background 0.15s;
}

.user-menu:hover { background: var(--border-light); }

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
}

.content-area { flex: 1; min-width: 0; padding: 32px; }

/* ============================================================
   CARDS / STATS
   ============================================================ */

.page-header { margin-bottom: 32px; }

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.page-subtitle { font-size: 14px; color: var(--text-muted); }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    transition: all 0.2s;
    border: 1px solid var(--border);
}

.stat-card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

.stat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.primary { background: #e4f2cf; color: var(--primary); }
.stat-icon.info    { background: #e4f2cf; color: var(--info); }
.stat-icon.warning { background: #fef3c7; color: var(--warning); }
.stat-icon.danger  { background: #fee2e2; color: var(--danger); }

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.1;
    margin-bottom: 4px;
}

.stat-change { font-size: 12px; color: var(--text-muted); }
.stat-change.positive { color: var(--success); }
.stat-change.negative { color: var(--danger); }

/* ============================================================
   CARDS / TABLES
   ============================================================ */

.card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border);
    overflow: visible;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title { font-size: 16px; font-weight: 600; color: var(--text); }
.card-body { padding: 24px; }

.table { width: 100%; border-collapse: collapse; }

.table th {
    text-align: left;
    padding: 12px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--primary-bg);
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 16px 12px;
    font-size: 14px;
    color: var(--text);
    border-bottom: 1px solid var(--border-light);
}

.table tbody tr:hover { background: var(--primary-bg); }
.table tbody tr:last-child td { border-bottom: none; }

/* ============================================================
   BADGES
   ============================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-danger  { background: #fee2e2; color: #b91c1c; }
.badge-info    { background: #e4f2cf; color: #3d7012; }
.badge-neutral { background: #f1f5f9; color: #475569; }

/* ============================================================
   RESPONSIVE 2-OSZLOPOS LAYOUT
   ============================================================ */

.two-col-layout {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 20px;
    max-width: 1200px;
}
.two-col-layout > * { min-width: 0; }

@media (max-width: 1100px) {
    .two-col-layout {
        grid-template-columns: 1fr;
        max-width: 100%;
    }
}

/* ============================================================
   UTILS
   ============================================================ */

.empty-state {
    padding: 48px 24px;
    text-align: center;
    color: var(--text-muted);
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .content-area { padding: 20px 16px; }
    .topbar { padding: 12px 16px; }
    .topbar-title { font-size: 16px; }
}

@media (max-width: 640px) {
    .content-area { padding: 16px 12px; }
    .stats-grid { grid-template-columns: 1fr; gap: 12px; }
    .stat-card { padding: 16px; }
    .stat-value { font-size: 24px; }
    .topbar { padding: 10px 12px; gap: 8px; }
    .user-menu { padding: 4px 8px; }
    .user-menu > div:nth-child(2) { display: none; }
    .page-title { font-size: 22px; }
}
/* ============================================================
   MOBIL: HAMBURGER MENU-GOMB + SOTETITO HATTER
   (asztali nezeten rejtve; csak <=1024px-en jelenik meg)
   ============================================================ */
.sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-right: 4px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #ffffff;
    color: var(--text);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
}
.sidebar-toggle:hover { background: var(--primary-bg); }
.sidebar-toggle svg { width: 22px; height: 22px; }

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9;            /* a sidebar z-index:10 alatt, a tartalom felett */
}
.sidebar-backdrop.open { display: block; }

@media (max-width: 1024px) {
    /* A menu-nyito gomb megjelenik */
    .sidebar-toggle { display: inline-flex; }
    /* A nyitott menu a sotetito fole kerul */
    .sidebar { z-index: 30; }
    .sidebar-backdrop { z-index: 20; }
}

/* Asztali nezeten SOHA ne maradjon ott a mobil-allapot (pl. atmeretezeskor) */
@media (min-width: 1025px) {
    .sidebar-backdrop { display: none !important; }
    .sidebar { transform: none !important; }
}

/* ============================================================
   MOBIL OLVASHATOSAG (finom igazitasok kis kepernyore)
   ============================================================ */
@media (max-width: 640px) {
    /* Tablazatok ne nyomodjanak ossze: inkabb vizszintesen gorduljenek */
    .content-area .table { min-width: 560px; }
    .table th { font-size: 12px; padding: 12px 10px; }
    .table td { font-size: 14px; padding: 14px 10px; }
    /* A globalis kereso ne foglaljon tul sok helyet a topbarban */
    .topbar > div[style*="max-width:420px"],
    .topbar > div[style*="max-width: 420px"] { margin: 0 8px !important; }
    /* Kartyak belso tavolsaga keszuljon kenyelmesebbre */
    .card-body { padding: 16px !important; }
}

/* ============================================================
   TABLAZAT SOR-ELVALASZTOK (zebracsik) - jobb olvashatosag
   A paratlan/paros sorok valtott hattere. A hover (JS) ezt felulirja.
   ============================================================ */
.table tbody tr:nth-child(even) { background: #f7faf1; }
