﻿:root {
    --farmos-primary: #2f6b45;
    --farmos-primary-hover: #255638;
    --farmos-bg: #f7f8f6;
    --farmos-surface: #ffffff;
    --farmos-text: #1f2933;
    --farmos-muted: #6b7280;
    --farmos-border: #e5e7eb;
    --farmos-danger: #c0392b;
    --farmos-sidebar-width: 240px;
    --farmos-header-height: 64px;
    --farmos-radius: 10px;
}

html {
    font-size: 14px;
}

body {
    margin: 0;
    color: var(--farmos-text);
    background: var(--farmos-bg);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* =========================
   AUTH
   ========================= */

.auth-page {
    min-height: 100vh;
    background: var(--farmos-bg);
}

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 32px;
    background: var(--farmos-surface);
    border: 1px solid var(--farmos-border);
    border-radius: var(--farmos-radius);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.auth-logo {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--farmos-primary);
    color: white;
    font-size: 20px;
    font-weight: 700;
}

.auth-brand h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 650;
}

.auth-brand p {
    margin: 2px 0 0;
    color: var(--farmos-muted);
    font-size: 12px;
}

.auth-header {
    margin-bottom: 24px;
}

    .auth-header h2 {
        margin-bottom: 6px;
        font-size: 24px;
        font-weight: 600;
    }

    .auth-header p {
        margin: 0;
        color: var(--farmos-muted);
        line-height: 1.5;
    }

.auth-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    font-size: 14px;
}

    .auth-links a {
        color: var(--farmos-primary);
        text-decoration: none;
    }

        .auth-links a:hover {
            text-decoration: underline;
        }

.result-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e9f4ec;
    color: var(--farmos-primary);
    font-size: 24px;
    font-weight: 600;
}

.result-icon-error {
    background: #fbeaea;
    color: var(--farmos-danger);
}

/* =========================
   APP SHELL
   ========================= */

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

.sidebar {
    width: var(--farmos-sidebar-width);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    overflow-y: auto;
    background: var(--farmos-surface);
    border-right: 1px solid var(--farmos-border);
}

.sidebar-brand {
    height: var(--farmos-header-height);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 18px;
    border-bottom: 1px solid var(--farmos-border);
}

.brand-mark {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--farmos-primary);
    color: white;
    font-weight: 700;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

    .brand-text strong {
        font-size: 15px;
    }

    .brand-text span {
        color: var(--farmos-muted);
        font-size: 11px;
    }

.sidebar-nav {
    padding: 16px 10px;
}

.nav-section {
    padding: 12px 10px 7px;
    color: var(--farmos-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 2px;
    color: #4b5563;
    border-radius: 7px;
    text-decoration: none;
    font-size: 14px;
}

    .nav-link i {
        width: 18px;
        font-size: 15px;
    }

    .nav-link:hover {
        background: #f1f5f2;
        color: var(--farmos-primary);
    }

    .nav-link.active {
        background: #eaf3ed;
        color: var(--farmos-primary);
    }

.main-area {
    width: 100%;
    margin-left: var(--farmos-sidebar-width);
    min-width: 0;
}

.topbar {
    height: var(--farmos-header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: var(--farmos-surface);
    border-bottom: 1px solid var(--farmos-border);
}

.topbar-title {
    font-size: 15px;
    font-weight: 600;
}

.topbar-user {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-summary {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
}

.user-role {
    color: var(--farmos-muted);
    font-size: 11px;
}

.user-menu {
    display: flex;
    gap: 8px;
}

    .user-menu a,
    .user-menu button {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 7px 10px;
        color: #4b5563;
        background: transparent;
        border: 1px solid var(--farmos-border);
        border-radius: 7px;
        font-size: 13px;
        text-decoration: none;
    }

        .user-menu a:hover,
        .user-menu button:hover {
            background: #f8faf9;
            color: var(--farmos-primary);
        }

    .user-menu form {
        margin: 0;
    }

    .user-menu button {
        cursor: pointer;
    }

/* =========================
   CONTENT
   ========================= */

.content {
    padding: 24px;
}

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

    .page-header h1 {
        margin: 0 0 6px;
        font-size: 24px;
        font-weight: 600;
    }

    .page-header p {
        margin: 0;
        color: var(--farmos-muted);
    }

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

.farmos-card {
    border: 1px solid var(--farmos-border);
    border-radius: var(--farmos-radius);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.025);
}

/* =========================
   DASHBOARD
   ========================= */

.stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    background: var(--farmos-surface);
    border: 1px solid var(--farmos-border);
    border-radius: var(--farmos-radius);
}

.stat-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: #edf5ef;
    color: var(--farmos-primary);
    font-size: 18px;
}

.stat-label {
    display: block;
    color: var(--farmos-muted);
    font-size: 12px;
}

.stat-value {
    display: block;
    margin-top: 2px;
    font-size: 22px;
}

.role-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.role-badge {
    display: inline-flex;
    padding: 5px 9px;
    background: #edf5ef;
    color: var(--farmos-primary);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 900px) {

    .sidebar {
        width: 210px;
    }

    .main-area {
        margin-left: 210px;
    }
}

@media (max-width: 700px) {

    .sidebar {
        position: static;
        width: 100%;
        height: auto;
    }

    .app-shell {
        display: block;
    }

    .main-area {
        margin-left: 0;
    }

    .topbar {
        padding: 0 16px;
    }

    .content {
        padding: 16px;
    }

    .user-summary {
        display: none;
    }

    .auth-card {
        padding: 24px;
    }
}
.confirmation-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

    .confirmation-icon.success {
        background: #e8f5e9;
        color: #2e7d32;
    }

    .confirmation-icon.error {
        background: #fdecea;
        color: #c0392b;
    }
.profile-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #e8f5e9;
    color: #2f6b45;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.profile-field {
    padding: 14px 0;
    border-bottom: 1px solid #e5e7eb;
}

.profile-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 4px;
}

.profile-value {
    color: #1f2933;
}
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.page-title {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: #1f2933;
}

.page-subtitle {
    margin-top: 6px;
    margin-bottom: 0;
    color: #6b7280;
}

.bg-success-subtle {
    background-color: #e8f5e9 !important;
}

.bg-secondary-subtle {
    background-color: #f3f4f6 !important;
}

/* =========================
   PLANT QR & MAINTENANCE
   ========================= */

.qr-preview-box {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 14px;
    background: #ffffff;
    border: 1px solid var(--farmos-border);
    border-radius: var(--farmos-radius);
}

.scan-hero-card {
    border-top: 4px solid var(--farmos-primary) !important;
}

.maintenance-timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.maintenance-item {
    padding: 14px 16px;
    background: #fafbfa;
    border: 1px solid var(--farmos-border);
    border-left: 3px solid var(--farmos-primary);
    border-radius: 8px;
}

.qr-sheet-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.qr-label-card {
    background: #ffffff;
    border: 1.5px dashed #9ca3af;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    break-inside: avoid;
    page-break-inside: avoid;
}

.qr-label-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--farmos-border);
}

.qr-brand {
    font-weight: 700;
    color: var(--farmos-primary);
    letter-spacing: 0.03em;
}

.qr-species {
    font-weight: 600;
    color: var(--farmos-text);
}

.qr-label-image-wrap {
    padding: 4px;
}

.qr-label-image {
    width: 148px;
    height: 148px;
    image-rendering: pixelated;
}

.qr-label-code {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #111827;
    margin-top: 4px;
}

.qr-label-notes {
    font-size: 12px;
    font-weight: 600;
    color: var(--farmos-primary);
    margin-top: 2px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qr-label-location {
    font-size: 10px;
    color: var(--farmos-muted);
    margin-top: 3px;
}

@media (max-width: 900px) {
    .qr-sheet-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 576px) {
    .qr-sheet-grid {
        grid-template-columns: 1fr;
    }
}

@media print {
    @page {
        size: A4 portrait;
        margin: 10mm;
    }

    body {
        background: #ffffff !important;
    }

    .no-print {
        display: none !important;
    }

    .app-shell {
        display: block !important;
    }

    .main-area {
        margin-left: 0 !important;
    }

    .content {
        padding: 0 !important;
    }

    .qr-sheet-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8mm !important;
    }

    .qr-label-card {
        border: 1px dashed #6b7280 !important;
        padding: 4mm !important;
        box-shadow: none !important;
    }

    .qr-label-image {
        width: 38mm !important;
        height: 38mm !important;
    }
}