* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html,
body {
    height: 100%;
    margin: 0;
}

body {
    background-color: #f0f2f5;
    color: #333;
    min-height: 100vh;
}

/* navbar */
.navbar {
    background-color: #1b4332;
    color: white;
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
}

.logo span {
    color: #74c69d;
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;

}

.nav-links li {
    margin-left: 20px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.25s ease, background-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    padding: 8px 12px;
    border-radius: 999px;
}

.nav-links a:hover,
.nav-links a.active {
    color: #74c69d;
}

.nav-links a:hover {
    background: rgba(116, 198, 157, 0.12);
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.18);
}

.nav-links a::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 4px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, #74c69d, #95d5b2);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.25s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    transform: scaleX(1);
}

.nav-links a.active {
    background: rgba(116, 198, 157, 0.18);
    box-shadow: inset 0 0 0 1px rgba(149, 213, 178, 0.35);
}

/* container */
.container {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 20px;
    flex: 1 0 auto;
}

.header-main {
    margin-bottom: 2rem;
}

/* grid de cards */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 2rem;
}

.card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    border: 1px solid transparent;
}

.card::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #1b4332, #2d6a4f, #74c69d);
    transform: scaleX(0.3);
    transform-origin: left;
    transition: transform 0.25s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 24px rgba(27, 67, 50, 0.2);
}

.card:hover::after {
    transform: scaleX(1);
}

.dashboard-cards .dashboard-card {
    cursor: pointer;
    background: linear-gradient(180deg, #ffffff 0%, #fbfefc 100%);
    text-align: left;
    padding: 1rem 1.2rem;
}

.dashboard-cards .dashboard-card::after {
    display: none;
}

.dashboard-cards .dashboard-card::before {
    content: "";
    position: absolute;
    inset: -20% -30% auto auto;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(116, 198, 157, 0.2), transparent 70%);
    opacity: 0.65;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.dashboard-cards .dashboard-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: #2d6a4f;
    box-shadow: 0 18px 30px rgba(27, 67, 50, 0.26), 0 0 0 3px rgba(116, 198, 157, 0.4);
}

.dashboard-cards .dashboard-card:hover::before {
    opacity: 1;
}

.dashboard-cards .dashboard-card:hover h3 {
    color: #1b4332;
}

.sensor-card {
    --accent: #2d6a4f;
    --accent-soft: rgba(45, 106, 79, 0.16);
}

.sensor-card h3 {
    margin: 0;
    text-transform: none;
    font-size: 1.75rem;
    font-weight: 700;
    color: #2f3640;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sensor-card .card-icon {
    font-size: 1.2rem;
    line-height: 1;
    font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
}

.sensor-card .card-icon.thermo-icon {
    width: 18px;
    height: 22px;
    flex-shrink: 0;
    display: inline-block;
    background-repeat: no-repeat;
    background-size: 90% 90%;
    background-position: center;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-2 -2 28 28' fill='none' stroke='%23e74c3c' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 14.8V5a4 4 0 0 0-8 0v9.8a6 6 0 1 0 8 0Z'/%3E%3Cline x1='10' y1='9' x2='10' y2='17'/%3E%3C/svg%3E");
}

.sensor-card .card-main-value {
    margin-top: 8px;
    font-size: 2.05rem;
    color: #1f3d31;
    line-height: 1.1;
}

.sensor-card small {
    display: block;
    margin-top: 4px;
    color: #6c757d;
    font-size: 0.88rem;
    font-weight: 500;
}

.meter {
    margin-top: 10px;
    height: 8px;
    border-radius: 999px;
    background: #d9dee3;
    overflow: hidden;
}

.meter-fill {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), rgba(255, 255, 255, 0.65));
    transition: width 0.35s ease;
}

.soil-card {
    --accent: #2f9e44;
}

.air-card {
    --accent: #2b8bd8;
}

.temp-card {
    --accent: #ee6f13;
}

.temp-card .card-main-value {
    color: #1f3d31;
}

.card h3 {
    font-size: 1rem;
    color: #666;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.value-container {
    display: inline-block;
    width: 45%;
}

.value {
    display: block;
    font-size: 2rem;
    font-weight: bold;
}

.value.green {
    color: #2d6a4f;
}

.value.blue {
    color: #4895ef;
}

small {
    color: #888;
    font-size: 0.8rem;
}

.status-bomba {
    margin-bottom: 1rem;
}

.badge {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.badge.off {
    background: #dee2e6;
    color: #6c757d;
}

.badge.on {
    background: #d8f3dc;
    color: #2d6a4f;
}

.btn-manual {
    background: #1b4332;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    transition: 0.3s;
}

.btn-manual:hover {
    background: #2d6a4f;
}

.chart-section {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.dashboard-main-chart {
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.dashboard-main-chart::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #1b4332, #2d6a4f, #74c69d);
    transform: scaleX(0.3);
    transform-origin: left;
    transition: transform 0.25s ease;
}

.dashboard-main-chart:hover {
    transform: translateY(-5px);
    border-color: #2d6a4f;
    box-shadow: 0 14px 24px rgba(27, 67, 50, 0.2);
}

.dashboard-main-chart:hover::after {
    transform: scaleX(1);
}

.history-chart-section {
    background: white;
    border: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 620px;
    height: 620px;
}

.history-effect-card {
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
    background: linear-gradient(180deg, #ffffff 0%, #fbfefc 100%);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.history-effect-card::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #1b4332, #2d6a4f, #74c69d);
    transform: scaleX(0.3);
    transform-origin: left;
    transition: transform 0.25s ease;
}

.history-effect-card:hover {
    transform: translateY(-5px);
    border-color: #2d6a4f;
    box-shadow: 0 14px 24px rgba(27, 67, 50, 0.2);
}

.history-toolbar {
    margin-bottom: 1rem;
    padding: 0.6rem 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    overflow: visible;
    z-index: 30;
}

.history-toolbar::after {
    display: none;
}

.history-period-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.period-tab {
    border: 1px solid #d7dce2;
    background: #f3f4f6;
    color: #374151;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.period-tab:hover {
    border-color: #74c69d;
    background: linear-gradient(180deg, #f8fffb 0%, #e9f9f0 100%);
    color: #1f513b;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(27, 67, 50, 0.18), 0 0 0 2px rgba(116, 198, 157, 0.38), 0 0 16px rgba(116, 198, 157, 0.28);
}

.period-tab.active {
    color: #111827;
    background: #e5e7eb;
    border-color: #c7ced8;
    box-shadow: inset 0 0 0 1px rgba(31, 41, 55, 0.08);
}

.history-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.export-select {
    position: relative;
    z-index: 40;
}

.export-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 999;
}

.export-menu.hidden {
    display: none;
}

.export-menu button {
    border: none;
    background: transparent;
    color: #374151;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 7px;
    padding: 8px 10px;
    cursor: pointer;
}

.export-menu button:hover {
    background: #f3f4f6;
}

.sensor-select {
    position: relative;
    z-index: 40;
}

.sensor-toggle-btn {
    border: 1px solid #cfd8e3;
    background: white;
    color: #4b5563;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.sensor-toggle-btn:hover {
    background: linear-gradient(180deg, #ffffff 0%, #e9f9f0 100%);
    color: #1f513b;
    border-color: #74c69d;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(27, 67, 50, 0.18), 0 0 0 2px rgba(116, 198, 157, 0.38), 0 0 16px rgba(116, 198, 157, 0.28);
}

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

.sensor-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 250px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
    padding: 10px 12px;
    z-index: 999;
}

.sensor-menu.hidden {
    display: none;
}

.sensor-menu label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #374151;
    font-size: 0.85rem;
    margin: 6px 0;
    cursor: pointer;
}

.sensor-menu-title {
    margin: 2px 0 8px;
    color: #4b5563;
    font-size: 0.78rem;
    font-weight: 700;
}

.history-table-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 0.6rem;
    flex-wrap: wrap;
}

.history-table-header h2 {
    margin: 0;
    font-size: 1.1rem;
    color: #1f2937;
    padding-top: 4px;
}

.history-table-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex: 1;
    flex-wrap: wrap;
}

.history-mini-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.period-tab-mini {
    border-radius: 7px;
    padding: 7px 12px;
    font-size: 0.82rem;
}

.history-export-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-export-small {
    padding: 5px 10px;
    font-size: 0.74rem;
}

.btn-export-ghost {
    border: 1px solid #d1d5db;
    background: #f3f4f6;
    color: #4b5563;
    border-radius: 6px;
    padding: 7px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.btn-export-ghost:hover {
    background: linear-gradient(180deg, #f8fffb 0%, #e9f9f0 100%);
    border-color: #74c69d;
    color: #1f513b;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(27, 67, 50, 0.18), 0 0 0 2px rgba(116, 198, 157, 0.38), 0 0 16px rgba(116, 198, 157, 0.28);
}

.btn-export-ghost:disabled {
    opacity: 0.75;
    cursor: not-allowed;
}

.btn-export {
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
    border: 1px solid transparent;
}

.btn-export:hover {
    transform: translateY(-2px);
    border-color: #95d5b2;
    background: linear-gradient(90deg, #2d6a4f 0%, #40916c 100%);
    box-shadow: 0 12px 24px rgba(27, 67, 50, 0.28), 0 0 0 2px rgba(149, 213, 178, 0.42), 0 0 18px rgba(149, 213, 178, 0.32);
}

.btn-export:active,
.btn-export-ghost:active,
.period-tab:active {
    transform: translateY(0);
}

.history-table-wrap {
    max-height: 420px;
    overflow: auto;
}

.history-table-wrap .data-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: #f8f9fa;
}

.history-effect-card:hover::after {
    transform: scaleX(1);
}

.history-legend {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin-bottom: 10px;
    text-align: center;
    width: 100%;
}

#historyChart {
    display: block;
    width: 100% !important;
    max-width: none;
    height: 100% !important;
    margin: 0 auto;
}

.history-legend ul {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.history-legend li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: #555;
    white-space: nowrap;
    cursor: pointer;
}

.history-legend .legend-box {
    width: 34px;
    height: 12px;
    border: 2px solid;
    border-radius: 1px;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 60px;
    width: auto;

    margin-top: -8px;
    margin-right: 10px;
    margin-left: 5px;
    filter: drop-shadow(0 0 8px var(--neon-cyan));
    vertical-align: middle;
}

.logo {
    font-size: 1.8rem;
    letter-spacing: 2px;
}

.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.filter-group label {
    font-weight: bold;
    color: #1b4332;
    margin-right: 10px;
}

.filter-group select {
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #ddd;
    outline: none;
}

.btn-export {
    background-color: #2d6a4f;
    color: white;
    border: 1px solid transparent;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.btn-export:hover {
    background-color: #1b4332;
}

.table-section {
    margin-top: 2rem;
    background: white;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}

.history-table-scroll {
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    background-color: #f8f9fa;
    color: #1b4332;
    padding: 12px;
    border-bottom: 2px solid #dee2e6;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    color: #555;
    font-size: 0.9rem;
}

.data-table tr:hover {
    background-color: #f1f8f5;
}

.config-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.config-rules-card {
    padding: 1.25rem 1.3rem;
}

.rules-title {
    margin: 0 0 0.35rem;
    color: #374151;
    font-size: 1.05rem;
}

.rule-row {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(140px, 1fr) 78px;
    align-items: center;
    gap: 12px;
    padding: 0.45rem 0;
}

.rule-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1f2937;
    font-size: 0.98rem;
    font-weight: 500;
}

.rule-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.rule-cool .rule-icon {
    color: #1f9bea;
}

.rule-icon-temp {
    width: 16px;
    height: 18px;
    display: inline-block;
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M12 14.4V6.2a2.8 2.8 0 1 0-5.6 0v8.2a4.4 4.4 0 1 0 5.6 0Z' stroke='%23ee6f13' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='9.2' cy='18.1' r='1.7' fill='%23ee6f13'/%3E%3C/svg%3E");
}

.rule-range {
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: #d1d5db;
    outline: none;
}

.rule-range::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #10b981;
    cursor: pointer;
}

.rule-range::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #10b981;
    cursor: pointer;
}

.rule-soil .rule-range {
    background: linear-gradient(90deg, #16a34a, #4ade80);
}

.rule-cool .rule-range {
    background: linear-gradient(90deg, #0ea5e9, #38bdf8);
}

.rule-heat .rule-range {
    background: linear-gradient(90deg, #ee6f13, #f59b55);
}

.rule-cool .rule-range::-webkit-slider-thumb {
    border-color: #0284c7;
}

.rule-cool .rule-range::-moz-range-thumb {
    border-color: #0284c7;
}

.rule-heat .rule-range::-webkit-slider-thumb {
    border-color: #ee6f13;
}

.rule-heat .rule-range::-moz-range-thumb {
    border-color: #ee6f13;
}

.rule-value {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    padding: 0.35rem 0.5rem;
    background: #f9fafb;
}

.rule-value input {
    width: 40px;
    border: none;
    background: transparent;
    text-align: right;
    font-size: 1.05rem;
    color: #111827;
    outline: none;
}

.rule-value span {
    color: #4b5563;
    font-weight: 600;
    font-size: 0.9rem;
}

@media (max-width: 900px) {
    .rule-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

.config-cards .config-actuator-card {
    cursor: pointer;
    --card-accent: #2f855a;
    --card-accent-soft: rgba(116, 198, 157, 0.2);
    --card-accent-glow: rgba(116, 198, 157, 0.4);
    --card-title-color: #1f2937;
    text-align: left;
    padding: 1rem 0.95rem 1.05rem;
    border: 1px solid transparent;
    background: linear-gradient(180deg, #ffffff 0%, #fbfefc 100%);
}

.config-cards .config-actuator-card::after {
    display: none;
}

.config-cards .config-actuator-card::before {
    content: "";
    position: absolute;
    inset: -20% -30% auto auto;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--card-accent-soft), transparent 70%);
    opacity: 0.65;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.config-cards .config-actuator-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--card-accent);
    box-shadow: 0 18px 30px rgba(15, 23, 42, 0.2), 0 0 0 3px var(--card-accent-glow);
}

.config-cards .config-actuator-card:hover::before {
    opacity: 1;
}

.config-cards .config-actuator-card:hover h3 {
    color: var(--card-title-color);
}

.config-irrigacao {
    --card-accent: #2f855a;
    --card-accent-soft: rgba(116, 198, 157, 0.2);
    --card-accent-glow: rgba(116, 198, 157, 0.4);
    --card-title-color: #2f855a;
}

.config-resfriamento {
    --card-accent: #2f855a;
    --card-accent-soft: rgba(116, 198, 157, 0.2);
    --card-accent-glow: rgba(116, 198, 157, 0.4);
    --card-title-color: #1f6fb3;
}

.config-aquecimento {
    --card-accent: #2f855a;
    --card-accent-soft: rgba(116, 198, 157, 0.2);
    --card-accent-glow: rgba(116, 198, 157, 0.4);
    --card-title-color: #ee6f13;
}

.config-cards .config-actuator-card h3 {
    margin: 0;
    text-transform: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--card-title-color);
}

.cfg-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.cfg-icon-irrigacao,
.cfg-icon-resfriamento {
    width: 22px;
    height: 22px;
    display: inline-block;
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    flex-shrink: 0;
}

.cfg-icon-irrigacao {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2338a169' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20V10'/%3E%3Cpath d='M12 13c-3.7 0-6.5-2.8-6.5-6.5C9.2 6.5 12 9.3 12 13Z' fill='%2368d391' stroke='%2338a169'/%3E%3Cpath d='M12 13c3.7 0 6.5-2.8 6.5-6.5C14.8 6.5 12 9.3 12 13Z' fill='%2348bb78' stroke='%2338a169'/%3E%3Cellipse cx='12' cy='20.3' rx='4.8' ry='1.5' fill='%2338a169' stroke='none'/%3E%3C/svg%3E");
}

.cfg-icon-resfriamento {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%231f9bea'%3E%3Ccircle cx='12' cy='12' r='2.1'/%3E%3Cpath d='M12 3.2a3.7 3.7 0 0 1 3.2 5.6l-1.7 2.9-3.3-5.8A3.7 3.7 0 0 1 12 3.2Z'/%3E%3Cpath d='M20.8 12a3.7 3.7 0 0 1-5.6 3.2l-2.9-1.7 5.8-3.3A3.7 3.7 0 0 1 20.8 12Z'/%3E%3Cpath d='M12 20.8a3.7 3.7 0 0 1-3.2-5.6l1.7-2.9 3.3 5.8A3.7 3.7 0 0 1 12 20.8Z'/%3E%3Cpath d='M3.2 12a3.7 3.7 0 0 1 5.6-3.2l2.9 1.7-5.8 3.3A3.7 3.7 0 0 1 3.2 12Z'/%3E%3C/svg%3E");
}

.cfg-subtitle {
    margin: 0.35rem 0 0.6rem;
    color: #4b5563;
    font-size: 0.92rem;
}

.cfg-status-row {
    border-top: 1px solid #e5e7eb;
    padding-top: 0.55rem;
    margin-bottom: 0.75rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1.05rem;
    font-weight: 700;
}

.status-pill::before {
    content: "";
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.5);
}

.status-pill.on {
    color: #2f855a;
}

.status-pill.off {
    color: #6b7280;
}

.status-pill.off::before {
    background: transparent;
    box-shadow: inset 0 0 0 2px currentColor;
}

.status-pill.bomba.on {
    color: #2f855a;
}

.status-pill.ventoinha.on {
    color: #1f6fb3;
}

.status-pill.lampada.on {
    color: #ee6f13;
}

.btn-irrigacao {
    background: linear-gradient(90deg, #1f7a4d, #276749);
}

.btn-resfriamento {
    background: linear-gradient(90deg, #1f6fb3, #1e5e99);
}

.btn-aquecimento {
    background: linear-gradient(90deg, #ee6f13, #d35f0d);
}

.config-actuator-card .btn-manual {
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 8px 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
}

.config-actuator-card .btn-manual:hover {
    background: inherit;
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.16);
}

.btn-irrigacao:hover {
    background: linear-gradient(90deg, #1f7a4d, #276749) !important;
}

.btn-resfriamento:hover {
    background: linear-gradient(90deg, #1f6fb3, #1e5e99) !important;
}

.btn-aquecimento:hover {
    background: linear-gradient(90deg, #ee6f13, #d35f0d) !important;
}


.input-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.input-group label {
    font-weight: 500;
    color: #444;
}

.input-group input {
    padding: 8px;
    width: 80px;
    border-radius: 6px;
    border: 1px solid #ddd;
    text-align: center;
}

.input-group input:focus {
    border-color: #74c69d;
    outline: none;
}

.footer {
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at 18% 12%, rgba(116, 198, 157, 0.16), transparent 35%), linear-gradient(180deg, #1b4332 0%, #173a2b 100%);
    padding: 2rem 5%;
    margin-top: 4rem;
    border-top: 1px solid rgba(149, 213, 178, 0.5);
    width: 100%;
    flex-shrink: 0;
    /* Garante que o rodapé não seja "esmagado" */
}

.footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #52b788, #95d5b2, #52b788);
}

.footer-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-cards {
    max-width: 1150px;
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 12px;
}

.footer-card {
    position: relative;
    padding: 0.45rem 0.6rem;
    background: transparent;
    border: none;
    box-shadow: none;
    transition: none;
}

.footer-card::after {
    display: none;
}

.footer-card::before {
    display: none;
}

.footer-card .footer-shine {
    display: none;
}

.footer-card .footer-shine::before {
    content: "";
    position: absolute;
    top: -140%;
    left: -40%;
    width: 45%;
    height: 280%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
    transform: rotate(18deg) translateX(-180%);
    transition: transform 0.55s ease;
}

.footer-card:hover {
    transform: none;
    box-shadow: none;
}

.footer-card h4 {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    color: #d8f3dc;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.25s ease, text-shadow 0.25s ease, transform 0.25s ease;
}

.footer-card h4:hover {
    color: #95d5b2;
    text-shadow: 0 0 10px rgba(149, 213, 178, 0.45);
    transform: translateX(3px);
}

.footer-brand-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-brand-title>span {
    color: #e2f8eb;
    font-weight: 700;
}

.footer-brand-title>span span {
    color: #74c69d;
}

.footer-brand-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.footer-icon-monitor {
    width: 22px;
    height: 18px;
    display: inline-block;
    flex-shrink: 0;
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2368d391' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='4' width='19' height='13' rx='2'/%3E%3Cpath d='M8 20h8'/%3E%3Cpath d='M12 17v3'/%3E%3Cpath d='m6.5 12 3-3 2.5 2 3.5-3.5'/%3E%3C/svg%3E");
}

.footer-card p {
    margin: 0.22rem 0;
    font-size: 0.96rem;
    color: #e2f8eb;
}

.footer-section p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #cbd5e0;
}

.footer-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    margin-bottom: 5px;
}

.footer-title span {
    color: #74c69d;
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-cards {
        grid-template-columns: 1fr;
    }
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 5px;
}

.footer-logo-img {
    height: 40px;
    width: auto;
    opacity: 0.8;
    margin-top: -10px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.footer-brand:hover .footer-logo-img {
    opacity: 1;
    transform: rotate(-6deg) scale(1.06);
}

.footer-subtitle {
    color: #74c69d;
    margin-bottom: 5px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-link {
    color: #cbd5e0;
    text-decoration: none;
    transition: 0.3s;
    font-size: 0.85rem;
}

.footer-link:hover {
    color: #74c69d;
    text-decoration: underline;
}

.footer-section {
    min-width: 200px;
    padding: 0.35rem 0.55rem;
    border-radius: 10px;
    transition: background-color 0.25s ease, transform 0.25s ease;
}

.footer-section:hover {
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-2px);
}

.logo-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.logo-link:hover {
    opacity: 0.9;
    transition: 0.3s;
}

.logo-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: all 0.4s ease;
}

.logo-link:hover {
    transform: translateY(-3px);
    cursor: pointer;
}

.logo-link:hover .logo {
    color: #74c69d;
    transition: color 0.4s ease;
}

.logo-link:hover .logo span {
    color: white;
    transition: color 0.4s ease;
}

.footer-copy {
    color: #74c69d;
}

/* =========================================
   Estilos para Login e Cadastro
   ========================================= */

.login-page {
    background: linear-gradient(135deg, #1b4332, #2d6a4f);
    display: flex;
    flex-direction: column;
    min-height: 100vh;

}

.auth-wrapper {
    /* display: flex;
    justify-content: center;
    align-items: flex-start; /* empurra pra baixo 
    padding-top: 6rem; */

    /* display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    padding: 1rem; */

    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    padding-bottom: 3rem;
    padding-top: -1rem;


}

.auth-card {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem 2rem;
    transition: none !important;
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.92);
}

.auth-card:hover {
    transform: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.auth-card h2 {
    color: #1b4332;
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
    text-align: center;
}

.auth-card p {
    color: #666;
    text-align: center;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.auth-card::after {
    display: none;
}

.auth-form-group {
    margin-bottom: 1.2rem;
    text-align: left;
}

.auth-form-group label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.auth-form-group input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #ddd;
    outline: none;
    font-size: 1rem;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.auth-form-group input:focus {
    border-color: #74c69d;
    box-shadow: 0 0 0 3px rgba(116, 198, 157, 0.2);
}

.auth-btn {
    width: 100%;
    background-color: #2d6a4f;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
    transition: transform 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

.auth-btn:hover {
    background-color: #1b4332;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(27, 67, 50, 0.2);
}

.auth-links {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: #555;
}

.auth-links a {
    color: #2d6a4f;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s ease;
}

.auth-links a:hover {
    color: #74c69d;
    text-decoration: underline;
}

.login-header {
    /* text-align: center;
    margin-bottom: 3rem;
    margin-top: 2.5rem;
    text-align: center;
    margin: -0.3rem 0.5;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; */
    text-align: center;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* linha de cima */
.login-brand-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* EcoComp */
.login-brand-top h1 {
    margin: 0;
    font-size: 2.2rem;
    font-weight: 700;
    color: white;
    letter-spacing: 1px;
}

.login-brand-top h1 span {
    color: #74c69d;
}

.login-slogan {
    margin-top: 10px;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
    max-width: 500px;

    font-weight: 500;
    letter-spacing: 0.4px;
    line-height: 1.6;

    opacity: 0.9;
}

.login-logo {
    width: 110px;
    height: auto;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.25));
    transition: transform 0.3s ease;
}

.login-logo:hover {
    transform: scale(1.05);
}

.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;

    background: linear-gradient(270deg, #1b4332, #2d6a4f, #40916c, #1b4332);
    background-size: 400% 400%;

    animation: gradientMove 12s ease infinite;
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes floatLight {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@media (max-height: 750px) {
    .auth-card {
        padding: 1.5rem 1.2rem;
    }

    .auth-card h2 {
        font-size: 1.4rem;
    }

    .auth-card p {
        font-size: 0.85rem;
        margin-bottom: 1rem;
    }
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    width: 100%;
    padding-right: 42px;
}

.toggle-password {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: #2d6a4f;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    transition: all 0.25s ease;
}

.toggle-password:hover {
    color: #74c69d;
    transform: scale(1.1);
}

.toggle-password svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: all 0.25s ease;
}

.toggle-password svg.open {
    color: #74c69d;
    filter: drop-shadow(0 0 6px rgba(116, 198, 157, 0.6));
}

.toggle-password.active {
    color: #74c69d;
    filter: drop-shadow(0 0 6px rgba(116, 198, 157, 0.6));
}

.toggle-password.active svg {
    transform: scale(1.05);
}

.logout-btn {
    background: #a30303;
    border: none;
    color: white;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    white-space: nowrap;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
    will-change: transform;
}

.logout-btn:hover {
    background: #c21010;
    transform: scale(1.06);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}