/* ═══════════════════════════════════════════════════════
   CropWings Network — Custom Styles
   Tailwind-backed palette only
   ═══════════════════════════════════════════════════════ */

/* ─── Base ─── */
html, body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* ─── Utility Classes ─── */
.fw-bold { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-medium { font-weight: 500 !important; }
.cursor-pointer { cursor: pointer; }

/* ─── App Bar ─── */
.app-bar {
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.app-bar .mud-appbar {
    box-shadow: none !important;
}

/* ─── Login Page ─── */
.login-container {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-primary-900) 0%, var(--color-primary-600) 54%, var(--color-primary-400) 100%);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgb(from var(--color-neutral-50) r g b / 5%) 0%, rgb(from var(--color-neutral-50) r g b / 0%) 50%),
                radial-gradient(circle at 70% 80%, rgb(from var(--color-neutral-50) r g b / 3%) 0%, rgb(from var(--color-neutral-50) r g b / 0%) 40%);
    pointer-events: none;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 2rem;
    z-index: 1;
}

/* ─── Stats Card ─── */
.stats-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.stats-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgb(16 109 32 / 15%) !important;
}

/* ─── Navigation ─── */
.mud-nav-link {
    border-radius: var(--m3-shape-field) !important;
    margin: 2px 0;
    transition: all 0.15s ease;
}

.mud-nav-link:hover {
    background-color: var(--m3-state-hover) !important;
}

.mud-nav-link.active {
    background-color: var(--m3-state-selected) !important;
    color: var(--mud-palette-primary) !important;
    font-weight: 600;
}

.mud-nav-link.active .mud-nav-link-icon {
    color: var(--color-primary-600) !important;
}

/* ─── Data Tables ─── */
.clickable-row {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.clickable-row:hover {
    background-color: rgb(16 109 32 / 6%) !important;
}

/* Clean table header */
.mud-table-head .mud-table-cell {
    font-weight: 600 !important;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--mud-palette-text-secondary);
}

/* ─── Cards ─── */
.mud-card {
    transition: box-shadow 0.2s ease;
}

.border {
    border: 1px solid var(--mud-palette-lines-default) !important;
}

/* ─── Drawer ─── */
.mud-drawer {
    border-right: 1px solid var(--mud-palette-lines-default) !important;
    box-shadow: none !important;
}

/* ─── Chips / Badges ─── */
.mud-chip {
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* ─── Buttons ─── */
.mud-button-root {
    text-transform: none !important;
    font-weight: 600;
    letter-spacing: 0;
}

/* ─── Page Header Pattern ─── */
.page-header {
    margin-bottom: 1.5rem;
}

/* ─── Scrollbar Styling ─── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: none;
}

::-webkit-scrollbar-thumb {
    background: rgb(from var(--color-neutral-950) r g b / 15%);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgb(from var(--color-neutral-950) r g b / 25%);
}

/* ─── Timeline ─── */
.order-timeline .mud-timeline-item-dot {
    border: 2px solid var(--color-primary-600);
}

/* ─── Responsive ─── */
@media (max-width: 600px) {
    .login-card {
        padding: 1rem;
        margin: 1rem;
    }

    .page-header {
        margin-bottom: 1rem;
    }

    .mud-main-content {
        padding: 12px !important;
    }
}

@media (max-width: 960px) {
    .hide-on-mobile {
        display: none !important;
    }
}

/* ─── Animations ─── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

/* ─── Error UI ─── */
#blazor-error-ui {
    background: var(--color-warning-100);
    bottom: 0;
    box-shadow: 0 -1px 2px rgb(from var(--color-neutral-950) r g b / 20%);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ─── Print Styles ─── */
@media print {
    .mud-drawer,
    .mud-appbar,
    #blazor-error-ui {
        display: none !important;
    }

    .mud-main-content {
        padding: 0 !important;
        margin: 0 !important;
    }
}

.cw-network-map-host {
    position: relative;
    min-height: 560px;
    height: min(72vh, 760px);
    width: 100%;
    overflow: hidden;
    border: 1px solid var(--surface-border, #e5e7eb);
    border-radius: 8px;
    background: #eef2f7;
}

.cw-network-map-canvas {
    position: absolute;
    inset: 0;
    height: 100%;
    width: 100%;
}

.cw-network-map-attribution {
    position: absolute;
    right: 10px;
    bottom: 8px;
    z-index: 2;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    color: #334155;
    font-size: 11px;
    line-height: 1;
    padding: 5px 7px;
    pointer-events: none;
}

.cw-network-map-controls {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 4;
    width: 280px;
    max-height: calc(100% - 24px);
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid var(--surface-border, #e5e7eb);
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.06);
}

.cw-network-map-controls-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--surface-border, #e5e7eb);
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
}

.cw-network-map-controls-body {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cw-network-map-controls.collapsed {
    width: auto;
}

.cw-network-map-controls.collapsed .cw-network-map-controls-body {
    display: none;
}

.cw-network-map-controls.collapsed .cw-network-map-controls-header {
    border-bottom: 0;
    padding: 8px 10px;
}

.cw-network-map-popup {
    position: absolute;
    width: 280px;
    max-height: 60%;
    overflow-y: auto;
    z-index: 6;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid var(--surface-border, #e5e7eb);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18), 0 2px 6px rgba(15, 23, 42, 0.08);
    font-size: 13px;
    color: #111827;
}

.cw-network-map-popup.minimized {
    width: auto;
    max-width: 220px;
    max-height: none;
    overflow: hidden;
}

.cw-network-map-popup.minimized .cw-network-map-popup-body {
    display: none;
}

.cw-network-map-popup.minimized .cw-network-map-popup-header {
    border-bottom: 0;
}

.cw-network-map-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--surface-border, #e5e7eb);
}

.cw-network-map-popup-title {
    font-weight: 700;
    font-size: 13px;
    color: #111827;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cw-network-map-popup-actions {
    display: flex;
    gap: 4px;
}

.cw-network-map-popup-actions button {
    width: 22px;
    height: 22px;
    line-height: 1;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #6b7280;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
}

.cw-network-map-popup-actions button:hover {
    background: rgba(15, 23, 42, 0.06);
    color: #111827;
}

.cw-network-map-popup-body {
    padding: 8px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cw-network-map-popup-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 2px 0;
    border-bottom: 1px dashed rgba(15, 23, 42, 0.06);
}

.cw-network-map-popup-row:last-child {
    border-bottom: 0;
}

.cw-network-map-popup-row span {
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-size: 10px;
    flex-shrink: 0;
}

.cw-network-map-popup-row b {
    color: #111827;
    font-weight: 600;
    text-align: right;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.cw-network-map-popup-open {
    display: inline-flex;
    align-items: center;
    margin-top: 6px;
    padding: 5px 10px;
    border-radius: 6px;
    background: rgba(16, 109, 32, 0.1);
    color: #106d20;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    align-self: flex-start;
}

.cw-network-map-popup-open:hover {
    background: rgba(16, 109, 32, 0.18);
}

.cw-network-map-tooltip {
    padding: 2px 4px;
}

.cw-network-map-tooltip-title {
    font-weight: 700;
    margin-bottom: 3px;
}

.cw-network-map-tooltip-status {
    color: #d1d5db;
    margin-top: 3px;
}
;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ─── Print Styles ─── */
@media print {
    .mud-drawer,
    .mud-appbar,
    #blazor-error-ui {
        display: none !important;
    }

    .mud-main-content {
        padding: 0 !important;
        margin: 0 !important;
    }
}
.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ─── Print Styles ─── */
@media print {
    .mud-drawer,
    .mud-appbar,
    #blazor-error-ui {
        display: none !important;
    }

    .mud-main-content {
        padding: 0 !important;
        margin: 0 !important;
    }
}
