:root {
    --primary: #1b7a46;
    --primary-light: #3cb371;
    --primary-dark: #0f5132;
    --secondary: #8fd19e;
    --accent: #f0a202;
    --danger: #c62828;
    --info: #0288d1;
    --warning: #ef6c00;
    --success: #1b7a46;
    --bg-1: #e8f5e9;
    --bg-2: #c8e6c9;
    --card-bg: rgba(255, 255, 255, 0.92);
    --shadow: 0 10px 40px rgba(15, 81, 50, 0.12);
    --shadow-hover: 0 16px 48px rgba(15, 81, 50, 0.2);
    --radius: 20px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
    background: linear-gradient(160deg, var(--bg-1) 0%, #f4fff6 45%, var(--bg-2) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: #16321f;
}

.app-body { padding-bottom: 88px; }
.login-body { padding: 0; }

.fw-800 { font-weight: 800; }

.main-header {
    background: linear-gradient(135deg, #0f5132, #1b7a46 55%, #2e8b57);
    color: #fff;
    border-radius: 0 0 28px 28px;
    padding: 14px 20px 10px;
    margin-bottom: 22px;
    box-shadow: 0 10px 36px rgba(15, 81, 50, 0.35);
    position: sticky;
    top: 0;
    z-index: 1050;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.main-header .brand {
    font-size: clamp(1.15rem, 2.6vw, 1.7rem);
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}
.main-header .brand i { animation: float 3s ease-in-out infinite; }

.header-badge {
    background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.75rem;
}

.main-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 10px 0 6px;
    scrollbar-width: none;
}
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a {
    color: rgba(255,255,255,0.82);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.88rem;
    white-space: nowrap;
    transition: 0.2s ease;
}
.main-nav a i { margin-right: 6px; }
.main-nav a:hover, .main-nav a.active {
    background: #fff;
    color: var(--primary-dark);
}

.notification-bell, .user-avatar {
    border: 0;
    background: rgba(255,255,255,0.16);
    color: #fff;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    position: relative;
    font-weight: 800;
}
.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ff7043;
    color: #fff;
    border-radius: 999px;
    font-size: 0.65rem;
    padding: 1px 5px;
    animation: pulse 1.6s infinite;
}
.notification-dropdown { min-width: min(92vw, 340px); border-radius: 16px; overflow: hidden; }
.notif-list { max-height: 320px; overflow: auto; }
.notif-item { padding: 12px 14px; border-bottom: 1px solid #eef2ee; }
.notif-item.unread { background: #f1fbf3; }
.notif-title { font-weight: 700; font-size: 0.9rem; }
.notif-message, .notif-time, .field-details { font-size: 0.78rem; color: #667766; }

.mobile-nav {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 1040;
    background: rgba(255,255,255,0.94);
    backdrop-filter: blur(16px);
    border-radius: 22px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    padding: 8px 4px;
}
.mobile-nav a {
    text-align: center;
    text-decoration: none;
    color: #5d6d5d;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 6px 2px;
    border-radius: 14px;
}
.mobile-nav a i { display: block; font-size: 1.05rem; margin-bottom: 2px; }
.more-links {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 12px 12px;
    margin-top: -8px;
}
.more-links a {
    background: #fff;
    color: var(--primary-dark);
    text-decoration: none;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: var(--shadow);
}
.more-links a.active { background: var(--primary); color: #fff; }

.card {
    border: none;
    border-radius: var(--radius);
    background: var(--card-bg);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.card-header {
    background: transparent;
    border-bottom: 1px solid rgba(27, 122, 70, 0.12);
    font-weight: 700;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 18px 16px;
    box-shadow: var(--shadow);
    text-align: center;
    border-left: 5px solid var(--primary);
    animation: rise 0.6s ease both;
}
.stat-number { font-size: clamp(1.5rem, 3vw, 2.3rem); font-weight: 800; color: var(--primary-dark); }
.stat-label { color: #5f715f; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-icon { font-size: 1.4rem; margin-bottom: 6px; }

.page-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(27,122,70,0.1), rgba(240,162,2,0.12));
    border-radius: 22px;
    padding: 16px 18px;
}
.hero-pulse {
    background: #fff;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary-dark);
    animation: pulse 2s infinite;
}

.metric-tile {
    background: rgba(27, 122, 70, 0.08);
    border-radius: 16px;
    padding: 14px;
    text-align: center;
}
.metric-tile small { display: block; color: #678; }
.metric-tile strong { font-size: 1.45rem; }
.metric-tile.success { background: rgba(46, 139, 87, 0.12); color: var(--primary-dark); }

.field-item, .task-item {
    background: var(--card-bg);
    border-radius: 18px;
    padding: 16px;
    box-shadow: var(--shadow);
    border-left: 5px solid #43a047;
}
.field-item { cursor: grab; }
.field-status {
    width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: #43a047;
}
.field-status.passive { background: #f0a202; }
.field-status.maintenance { background: #0288d1; }
.field-name { font-weight: 800; }
.plant-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    margin: 2px;
}

.task-priority, .task-status {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 999px;
    text-transform: uppercase;
}
.task-priority.acil { background: #ffebee; color: var(--danger); }
.task-priority.yuksek { background: #fff3e0; color: var(--warning); }
.task-priority.normal { background: #e3f2fd; color: var(--info); }
.task-priority.dusuk { background: #f5f5f5; color: #666; }
.task-status { background: #eef6ee; margin-top: 4px; }
.task-status.tamamlandi { background: #e8f5e9; color: #1b7a46; }
.task-status.devam { background: #fff8e1; color: #ef6c00; }
.task-status.iptal { background: #eceff1; }

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at 20% 20%, #b9f6ca, transparent 40%),
                radial-gradient(circle at 80% 80%, #c8e6c9, transparent 42%),
                linear-gradient(160deg, #e8f5e9, #f1fff4);
}
.login-box {
    max-width: 440px;
    width: 100%;
    padding: 36px 28px;
    border-radius: 28px;
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(18px);
    box-shadow: 0 24px 70px rgba(15, 81, 50, 0.18);
    animation: fadeInUp 0.7s ease;
    position: relative;
    z-index: 2;
}
.login-icon { font-size: 3.2rem; color: var(--primary); animation: float 3s ease-in-out infinite; }
.demo-chip {
    border: 0;
    background: #e8f5e9;
    color: var(--primary-dark);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    margin: 3px 4px 0 0;
}
.login-leaves span {
    position: absolute;
    width: 18px;
    height: 18px;
    background: #43a047;
    border-radius: 0 70% 0 70%;
    opacity: 0.25;
    animation: fall 12s linear infinite;
}
.login-leaves span:nth-child(1) { left: 10%; animation-delay: 0s; }
.login-leaves span:nth-child(2) { left: 25%; animation-delay: 2s; background: #2e7d32; }
.login-leaves span:nth-child(3) { left: 45%; animation-delay: 4s; }
.login-leaves span:nth-child(4) { left: 62%; animation-delay: 1s; background: #66bb6a; }
.login-leaves span:nth-child(5) { left: 78%; animation-delay: 3s; }
.login-leaves span:nth-child(6) { left: 90%; animation-delay: 5s; }

.btn { border-radius: 999px; font-weight: 700; border: none; }
.btn-primary { background: linear-gradient(135deg, #1b7a46, #2e8b57); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.form-control, .form-select {
    border-radius: 14px;
    border: 2px solid #dce8dc;
    padding: 10px 14px;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(27, 122, 70, 0.15);
}

.toast-container { position: fixed; top: 86px; right: 16px; z-index: 9999; max-width: min(92vw, 420px); }
.toast-custom { border-radius: 16px; padding: 14px 16px; animation: fadeInUp 0.35s ease; box-shadow: var(--shadow-hover); }
.toast-custom.success { background: #e8f5e9; border-left: 5px solid var(--success); }
.toast-custom.error { background: #ffebee; border-left: 5px solid var(--danger); }
.toast-custom.info { background: #e3f2fd; border-left: 5px solid var(--info); white-space: pre-line; }

.page-enter { animation: fadeInUp 0.45s ease; }
.site-footer { text-align: center; color: #6b7b6b; font-size: 0.8rem; padding: 18px 8px 8px; }

@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes fall {
    0% { transform: translateY(-40px) rotate(0deg); }
    100% { transform: translateY(110vh) rotate(360deg); }
}

@media (max-width: 991.98px) {
    .main-header { border-radius: 0 0 18px 18px; padding: 12px 12px 8px; }
}
@media (max-width: 576px) {
    .stat-label { font-size: 0.62rem; }
    .mobile-nav a span { font-size: 0.58rem; }
    .page-hero { flex-direction: column; align-items: flex-start; }
}

.api-key-banner {
    background: linear-gradient(135deg, #0f5132, #1b7a46);
    color: #fff;
    border-radius: 20px;
    padding: 16px 18px;
}
.api-key-code {
    display: block;
    background: rgba(255,255,255,0.12);
    padding: 8px 10px;
    border-radius: 10px;
    word-break: break-all;
    color: #fff;
    margin-top: 6px;
}
.api-pre {
    background: #102418;
    color: #d7f5df;
    border-radius: 14px;
    padding: 14px;
    font-size: 0.78rem;
    overflow-x: auto;
    white-space: pre-wrap;
}
.device-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
    background: #bbb;
}
.device-dot.on { background: #43a047; box-shadow: 0 0 0 4px rgba(67,160,71,0.25); }
.wizard-steps {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.wizard-steps span {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef6ee;
    color: #5d6d5d;
}
.wizard-steps span.active {
    background: var(--primary);
    color: #fff;
}
.accordion-button {
    font-weight: 700;
    background: #f4faf5;
}
.accordion-button:not(.collapsed) {
    background: #e8f5e9;
    color: var(--primary-dark);
    box-shadow: none;
}
