/* =========================================================
   SMART FARMING - DESIGN SYSTEM
   Referensi: Landing Page Smart Farming (PDF 4 halaman)
   Dipasangkan dengan base.html versi terbaru.
========================================================= */

/* =========================
   1. GLOBAL RESET & COLORS
========================= */

:root {
    --green-deep: #174b25;
    --green-sidebar: #176329;
    --green-border: #294b34;
    --green-accent: #16e94b;
    --green-soft: #9be99e;
    --text-main: #07130a;
    --text-muted: #334b37;

    --glass-panel: rgba(190, 211, 174, 0.76);
    --glass-card: rgba(154, 187, 139, 0.48);
    --glass-inner: rgba(218, 229, 207, 0.38);

    --panel-border: rgba(35, 73, 45, 0.92);
    --panel-shadow: 0 12px 28px rgba(0, 0, 0, 0.20);
    --glass-blur: 9px;

    --sidebar-width: 212px;
    --sidebar-left: 2.15vw;
    --content-offset: 250px;
}

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

html {
    width: 100%;
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;

    font-family: Arial, Helvetica, sans-serif;
    color: var(--text-main);

    background-image:
        linear-gradient(
            rgba(8, 38, 14, 0.28),
            rgba(8, 38, 14, 0.28)
        ),
        url("../images/background.png");

    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

button,
input,
select {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

img {
    max-width: 100%;
}

/* Wrapper yang ditambahkan pada base.html */
.app-shell {
    width: 100%;
    min-height: 100vh;
}

/* =========================
   2. SIDEBAR & NAVIGATION
========================= */

.sidebar {
    width: var(--sidebar-width);
    height: 86vh;
    min-height: 500px;

    position: fixed;
    top: 9.5vh;
    left: var(--sidebar-left);

    display: flex;
    flex-direction: column;
    align-items: stretch;

    overflow: hidden;
    z-index: 100;

    background:
        linear-gradient(
            155deg,
            rgba(20, 101, 39, 0.96),
            rgba(25, 79, 34, 0.96)
        );

    border: 1.5px solid #173d24;
    border-radius: 34px;

    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* LOGO */

.logo {
    width: 100%;
    height: 245px;
    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 12px 10px 0;
}

.logo img {
    display: block;

    width: 92px;
    height: 92px;

    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #101b12;

    background: rgba(255, 255, 255, 0.12);
}

/* MENU */

.menu {
    width: 100%;

    display: flex;
    flex-direction: column;
    align-items: stretch;

    gap: 4px;
    padding: 26px 0 20px 44px;
}

.menu a {
    display: block;
    width: 100%;

    padding: 5px 8px;

    color: #06150a;
    text-decoration: none;
    white-space: nowrap;

    font-size: 17px;
    line-height: 1.35;
    font-weight: 700;
    font-style: italic;

    border: 1px solid transparent;
    border-radius: 0;

    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        padding-left 0.2s ease;
}

.menu a:hover {
    background: rgba(158, 235, 158, 0.55);
    padding-left: 12px;
}

.menu a.active {
    color: #06150a;
    background: #9be99e;
    border-color: rgba(28, 77, 38, 0.45);
}

.menu a:focus-visible {
    outline: 2px solid #e5ffe6;
    outline-offset: 2px;
}

/* =========================
   3. MAIN CONTENT
========================= */

.main {
    width: calc(100% - var(--content-offset));
    min-height: 100vh;

    margin-left: var(--content-offset);
    padding: 5vh 3vw;

    position: relative;
    z-index: 1;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 24px;
}

/* DASHBOARD PAGE WRAPPER */
.dashboard-page {
    width: min(650px, 100%);

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

/* =========================
   4. DASHBOARD - LIVE CAMERA
========================= */

.camera-panel {
    width: min(590px, 100%);
    flex-shrink: 0;

    padding: 48px 55px 44px;

    background: var(--glass-panel);
    border: 1.5px solid var(--panel-border);
    border-radius: 35px;

    box-shadow: var(--panel-shadow);

    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
}

.camera-panel h1 {
    margin-bottom: 18px;

    color: var(--text-main);
    font-size: 26px;
    line-height: 1.2;
    font-weight: 700;
    font-style: italic;
}

.camera-box {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;

    overflow: hidden;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(25, 48, 30, 0.28);
    border: 2px solid #365a40;
    border-radius: 0;
}

.camera-box img,
.camera-stream {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* =========================
   5. DASHBOARD - STATUS PANEL
========================= */

.status-panel {
    width: min(540px, 100%);

    padding: 14px;

    display: grid;
    grid-template-columns: 1fr 2.2fr 1fr;
    align-items: stretch;
    gap: 18px;

    background: var(--glass-panel);
    border: 1.5px solid var(--panel-border);
    border-radius: 30px;

    box-shadow: var(--panel-shadow);

    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
}

.status-card {
    min-width: 0;
    min-height: 90px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--glass-card);
    border: 1px solid rgba(53, 94, 59, 0.78);
    border-radius: 9px;

    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease;
}

.status-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.15);
}

.card-title {
    color: var(--text-main);
    font-size: 12px;
    font-weight: 600;
}

/* BATTERY BAR */

.battery-card {
    padding: 12px 10px;

    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.battery-card .card-title {
    margin-bottom: 10px;
    align-self: flex-start;
}

.battery-bar {
    width: 100%;
    max-width: 100px;
    height: 34px;

    position: relative;
    overflow: hidden;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(225, 232, 216, 0.78);
    border: 1px solid #657565;
    border-radius: 20px;
}

.battery-fill {
    width: 0%;
    height: 100%;

    position: absolute;
    top: 0;
    left: 0;

    background: #00ed39;
    transition: width 0.4s ease;
}

.battery-bar span {
    position: relative;
    z-index: 2;

    color: #07130a;
    font-size: 15px;
    font-weight: 700;
}

/* RASPBERRY PI TEMPERATURE */

.temperature-card {
    padding: 12px 13px;

    justify-content: space-between;
    gap: 10px;
}

.temperature-title {
    color: var(--text-main);
    font-size: 15px;
    line-height: 1.25;
    font-weight: 500;
}

.temperature-box {
    min-width: 105px;
    padding: 9px 12px;

    text-align: center;

    background: #08c96b;
    border-radius: 16px;
}

.temperature-box strong {
    display: block;

    color: #03170b;
    font-size: 26px;
    line-height: 1.1;
    font-weight: 700;
    font-style: italic;
}

.temperature-box span {
    display: block;
    margin-top: 4px;

    color: #082d17;
    font-size: 10px;
}

/* MANUAL BUTTON */

.manual-card {
    padding: 10px 6px;

    flex-direction: column;
    gap: 10px;
}

.manual-button {
    width: 36px;
    height: 36px;
    padding: 0;

    background: #a8dc24;
    border: 3px solid #ffffff;
    border-radius: 50%;

    box-shadow:
        0 0 0 2px #6c7d67,
        0 3px 6px rgba(0, 0, 0, 0.20);

    cursor: pointer;

    transition:
        transform 0.2s ease,
        background-color 0.2s ease,
        box-shadow 0.2s ease;
}

.manual-button:hover {
    background: #83c600;
    transform: scale(1.07);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.22);
}

.manual-button:active {
    transform: scale(0.94);
}

.manual-button:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 4px;
}

.manual-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* =========================
   6. GENERAL CONTENT PANEL
========================= */

.page-content {
    width: min(900px, 100%);
    padding: 35px;

    background: var(--glass-panel);
    border: 1.5px solid var(--panel-border);
    border-radius: 30px;

    box-shadow: var(--panel-shadow);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
}

.page-content h1 {
    margin-bottom: 15px;
    font-size: 28px;
    font-style: italic;
}

.page-content p {
    font-size: 16px;
    line-height: 1.5;
}

/* =========================
   7. SYSTEM MONITORING
========================= */

.power-layout {
    width: min(730px, 100%);

    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 24px;

    margin: 0 auto;
}

.power-column {
    min-width: 0;
    min-height: 535px;

    padding: 24px 12px;

    display: flex;
    flex-direction: column;

    background: var(--glass-panel);
    border: 1.5px solid var(--panel-border);
    border-radius: 35px;

    box-shadow: var(--panel-shadow);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
}

/* PANEL HEADER */

.power-header,
.device-header {
    min-height: 46px;

    display: flex;
    align-items: center;
    gap: 13px;

    padding: 0 10px;
}

.power-header h2,
.device-header h2 {
    color: var(--text-main);
    font-size: 17px;
    line-height: 1.25;
    font-weight: 700;
    font-style: italic;
}

.power-header-icon {
    font-size: 29px;
}

.solar-icon {
    font-size: 36px;
    line-height: 1;
}

.device-header-icon {
    font-size: 30px;
}

/* HEADER LINE */

.power-line {
    width: 100%;
    height: 2px;
    flex-shrink: 0;

    margin: 8px 0 25px;
    background: #356443;
}

/* BATTERY STATUS BOX */

.battery-status-box {
    min-height: 195px;
    padding: 14px;

    display: grid;
    grid-template-columns: minmax(105px, 1fr) minmax(0, 1.55fr);
    align-items: center;
    gap: 12px;

    background: var(--glass-inner);
    border: 1.3px solid var(--panel-border);
    border-radius: 17px;
}

/* BATTERY GAUGE */

.battery-gauge {
    width: 125px;
    height: 125px;
    max-width: 100%;

    margin: auto;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid #356443;
    border-radius: 50%;

    background:
        conic-gradient(
            #16ef21 0deg 145deg,
            rgba(220, 228, 211, 0.7) 145deg 360deg
        );
}

.battery-gauge-inner {
    width: 88px;
    height: 88px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #ffffff;
    background: #215c31;
    border-radius: 50%;

    font-size: 27px;
    font-weight: 700;
    font-style: italic;
    text-align: center;
}

/* BATTERY METRICS */

.battery-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.info-box {
    min-width: 0;
    min-height: 78px;
    padding: 10px 7px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-align: center;

    background: var(--glass-card);
    border: 1px solid #356443;
    border-radius: 9px;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.info-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.12);
}

.info-box span {
    margin-bottom: 7px;

    color: #f7fff4;
    font-size: 11px;
    line-height: 1.25;
    font-weight: 700;
    font-style: italic;
}

.info-box strong {
    color: #ffffff;
    font-size: 18px;
    line-height: 1.2;
    font-style: italic;
    overflow-wrap: anywhere;
}

/* BATTERY USAGE CHART */

.battery-usage-box {
    min-height: 175px;
    margin-top: 28px;
    padding: 15px 17px 12px;

    background: var(--glass-inner);
    border: 1.3px solid var(--panel-border);
    border-radius: 17px;
}

.battery-usage-box h3 {
    margin-bottom: 10px;
    color: var(--text-main);
    font-size: 13px;
    font-style: italic;
}

.battery-chart {
    width: 100%;
    height: 145px;
}

.battery-chart svg,
.battery-chart canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.battery-chart line {
    stroke: #486645;
    stroke-width: 1.2;
}

.battery-chart polyline {
    fill: none;
    stroke: #315b31;
    stroke-width: 3;
}

.battery-chart text {
    fill: #283d2a;
    font-size: 10px;
}

/* =========================
   8. COMMUNICATION QUALITY
   Kelas ini disiapkan untuk
   markup power.html yang baru.
========================= */

.communication-status-box {
    min-height: 145px;
    padding: 14px;

    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: 12px;

    background: var(--glass-inner);
    border: 1.3px solid var(--panel-border);
    border-radius: 17px;
}

.communication-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.communication-info-box {
    min-width: 0;
    min-height: 88px;
    padding: 10px 7px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-align: center;

    background: var(--glass-card);
    border: 1px solid #356443;
    border-radius: 9px;
}

.communication-info-box span {
    margin-bottom: 8px;
    color: #f7fff4;
    font-size: 11px;
    font-weight: 700;
    font-style: italic;
}

.communication-info-box strong {
    color: #ffffff;
    font-size: 19px;
    font-style: italic;
    overflow-wrap: anywhere;
}

.communication-chart-box,
.activity-chart-panel {
    width: 100%;
    min-height: 190px;

    margin-top: 28px;
    padding: 15px 16px;

    background: var(--glass-inner);
    border: 1.3px solid var(--panel-border);
    border-radius: 17px;
}

.communication-chart-box h3,
.activity-chart-panel h2 {
    margin-bottom: 12px;
    color: var(--text-main);
    font-size: 13px;
    font-style: italic;
}

.communication-chart,
.communication-chart canvas,
.communication-chart svg {
    display: block;
    width: 100%;
    height: 150px;
}

/* =========================
   9. LEGACY SOLAR & DEVICE
   Dipertahankan sementara agar
   halaman lama tetap terbaca
   selama proses migrasi.
========================= */

.solar-status-box {
    min-height: 220px;
    padding: 15px;

    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.5fr);
    align-items: center;
    gap: 13px;

    background: var(--glass-inner);
    border: 1.3px solid var(--panel-border);
    border-radius: 17px;
}

.solar-image-box {
    min-width: 0;
    min-height: 150px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid #356443;
    border-radius: 10px;
}

.solar-image-box img {
    width: 90%;
    max-height: 150px;
    object-fit: contain;
}

.solar-information {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.solar-voltage {
    min-height: 75px;
    padding: 10px;

    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;

    background: var(--glass-card);
    border: 1px solid #356443;
    border-radius: 9px;
}

.solar-voltage span {
    margin-bottom: 7px;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    font-style: italic;
}

.solar-voltage strong {
    color: #ffffff;
    font-size: 18px;
    font-style: italic;
}

.solar-small-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.device-header {
    margin-top: 25px;
}

.device-information-box {
    min-height: 130px;
    padding: 14px 10px;

    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;

    background: var(--glass-inner);
    border: 1.3px solid var(--panel-border);
    border-radius: 17px;
}

.device-item {
    min-width: 0;
    padding: 10px 6px;

    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;

    background: var(--glass-card);
    border: 1px solid #356443;
    border-radius: 9px;
}

.device-item span {
    margin-bottom: 10px;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    font-style: italic;
}

.device-item strong {
    color: #00ef66;
    font-size: 14px;
    font-style: italic;
    overflow-wrap: anywhere;
}

.signal-speed {
    white-space: pre-line;
}

/* =========================
   10. DATA ANALYST
   Layout disesuaikan dengan desain referensi Page 3.
========================= */

.analyst-page {
    width: min(860px, 100%);
    padding: 38px 44px 48px;

    display: flex;
    flex-direction: column;
    gap: 50px;

    background: var(--glass-panel);
    border: 1.5px solid var(--panel-border);
    border-radius: 24px;

    box-shadow: var(--panel-shadow);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
}

/* FOUR KPI CARDS */

.analyst-summary {
    width: 100%;

    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 95px;
    row-gap: 38px;
}

.summary-card {
    min-width: 0;
    min-height: 123px;
    padding: 10px 0;

    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    align-items: center;
    gap: 0;

    background: var(--glass-card);
    border: 1.3px solid var(--panel-border);
    border-radius: 12px;

    box-shadow: 0 7px 16px rgba(0, 0, 0, 0.13);

    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));

    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease;
}

.summary-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18);
}

.summary-icon {
    min-width: 0;
    height: 84px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-right: 3px solid #356443;
}

.summary-icon img {
    width: 76px;
    height: 76px;
    object-fit: contain;
}

.summary-content {
    min-width: 0;
    padding: 0 10px;
    text-align: center;
}

.summary-content h2 {
    margin-bottom: 7px;

    color: #f7fff4;
    font-size: 16px;
    line-height: 1.2;
    font-weight: 700;
    font-style: italic;
}

.summary-content span {
    display: block;
    margin-bottom: 5px;

    color: var(--text-muted);
    font-size: 10px;
}

.summary-content strong {
    display: block;
    margin-bottom: 2px;

    color: #00ef28;
    font-size: 34px;
    line-height: 1.1;
    font-weight: 700;
}

.summary-content p {
    color: var(--text-main);
    font-size: 10px;
}

/* ACTIVITY CHART */

.activity-chart-panel {
    width: 100%;
    min-height: 297px;
    margin-top: 0;
    padding: 23px 28px 24px;

    background: var(--glass-card);
    border: 1.3px solid var(--panel-border);
    border-radius: 12px;

    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.13);

    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
}

.activity-chart-heading {
    width: min(560px, 100%);
    margin: 0 auto;
}

.activity-chart-panel h2 {
    margin-bottom: 3px;
    color: #f7fff4;
    font-size: 20px;
    line-height: 1.2;
    font-weight: 700;
}

.activity-chart-panel p {
    margin-bottom: 10px;
    color: #f7fff4;
    font-size: 14px;
}

.bird-activity-chart {
    width: min(560px, 100%);
    height: 210px;
    margin: 0 auto;
}

.bird-activity-chart canvas,
.bird-activity-chart svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* LEGACY DETECTION HISTORY TABLE */



.history-panel {
    width: 100%;
    margin: 0 auto;
    padding: 25px;

    background: var(--glass-panel);
    border: 1.5px solid var(--panel-border);
    border-radius: 22px;

    box-shadow: var(--panel-shadow);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
}

.history-panel h2 {
    margin-bottom: 18px;
    color: var(--text-main);
    font-size: 20px;
    font-style: italic;
}

.history-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(141, 182, 127, 0.28);
}

.history-table th {
    padding: 12px 10px;

    border-bottom: 2px solid #294734;
    text-align: center;

    color: var(--text-main);
    font-size: 12px;
    font-style: italic;
}

.history-table td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(41, 71, 52, 0.25);

    color: var(--text-main);
    text-align: center;
    font-size: 12px;
}

.history-table tbody tr:hover {
    background: rgba(115, 207, 121, 0.18);
}

.servo-active {
    color: #00a83a;
    font-weight: 700;
}

/* =========================
   11. SETTINGS
========================= */

.settings-page {
    width: min(585px, 100%);

    display: flex;
    flex-direction: column;
    gap: 28px;

    padding: 10px 0 35px;
}

.settings-card {
    width: 100%;
    min-height: 150px;
    padding: 20px 22px;

    display: grid;
    grid-template-columns: 100px minmax(0, 1fr) 180px;
    align-items: center;
    gap: 18px;

    background: var(--glass-panel);
    border: 1.5px solid var(--panel-border);
    border-radius: 22px;

    box-shadow: var(--panel-shadow);

    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));

    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease;
}

.settings-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 22px rgba(0, 0, 0, 0.18);
}

/* SETTINGS ICON */

.settings-icon {
    width: 100%;
    height: 78px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-right: 2px solid #356443;
    overflow: hidden;

    font-size: 48px;
}

.settings-icon img {
    display: block;
    width: 65px;
    height: 65px;
    object-fit: contain;
}

/* SETTINGS DESCRIPTION */

.settings-info {
    min-width: 0;

    display: flex;
    flex-direction: column;
    justify-content: center;
}

.settings-info h2 {
    margin-bottom: 7px;

    color: var(--text-main);
    font-size: 19px;
    font-weight: 700;
    font-style: italic;
}

.settings-info p {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.4;
}

/* LANGUAGE SELECT */

.settings-control {
    width: 100%;
}

.settings-control select {
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;

    color: var(--text-main);
    background: rgba(218, 226, 204, 0.78);

    border: 1px solid #3f6749;
    border-radius: 9px;

    font-size: 13px;
    cursor: pointer;
}

/* APPEARANCE */

.theme-control {
    width: 100%;

    display: flex;
    flex-direction: column;
    gap: 8px;
}

.theme-control label {
    min-height: 42px;
    padding: 8px 10px;

    display: flex;
    align-items: center;
    gap: 8px;

    color: var(--text-main);
    background: rgba(218, 226, 204, 0.78);

    border: 1px solid #3f6749;
    border-radius: 8px;

    font-size: 12px;
    cursor: pointer;

    transition: background-color 0.2s ease;
}

.theme-control label:hover {
    background: rgba(174, 218, 160, 0.88);
}

.theme-control input {
    width: 15px;
    height: 15px;
    accent-color: #1d9d45;
}

.theme-icon {
    font-size: 17px;
}

/* ABOUT */

.about-card {
    min-height: 150px;
}

.about-info {
    min-width: 0;
    text-align: center;
}

.about-info h2 {
    margin-bottom: 7px;

    color: var(--text-main);
    font-size: 19px;
    font-weight: 700;
    font-style: italic;
}

.about-info p {
    margin-bottom: 9px;

    color: var(--text-muted);
    font-size: 11px;
}

.about-info span {
    display: inline-block;
    padding: 5px 12px;

    color: #536a16;
    background: rgba(205, 220, 87, 0.48);

    border: 1px solid #70854b;
    border-radius: 12px;

    font-size: 10px;
}

/* =========================
   12. SHARED HOVER & FOCUS
========================= */

.info-box,
.device-information-box {
    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease;
}

.device-information-box:hover {
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.13);
}

select:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline-color: #0b8735;
    outline-offset: 2px;
}

/* =========================
   13. DARK MODE
========================= */

body.dark-mode {
    color: #f4f8f2;

    background-image:
        linear-gradient(
            rgba(0, 15, 5, 0.68),
            rgba(0, 15, 5, 0.68)
        ),
        url("../images/background.png");
}

body.dark-mode .sidebar {
    background:
        linear-gradient(
            155deg,
            rgba(13, 49, 23, 0.98),
            rgba(10, 38, 18, 0.98)
        );

    border-color: #42654a;
}

body.dark-mode .menu a {
    color: #f2f8ef;
}

body.dark-mode .menu a.active {
    color: #07130a;
    background: #83d98a;
}

body.dark-mode .menu a:hover {
    background: rgba(115, 207, 121, 0.28);
}

body.dark-mode .camera-panel,
body.dark-mode .status-panel,
body.dark-mode .power-column,
body.dark-mode .history-panel,
body.dark-mode .analyst-page,
body.dark-mode .summary-card,
body.dark-mode .settings-card,
body.dark-mode .page-content,
body.dark-mode .activity-chart-panel {
    color: #f4f8f2;
    background: rgba(31, 57, 36, 0.91);
    border-color: rgba(125, 164, 126, 0.78);
}

body.dark-mode .status-card,
body.dark-mode .info-box,
body.dark-mode .device-item,
body.dark-mode .communication-info-box {
    background: rgba(47, 83, 51, 0.78);
    border-color: rgba(132, 173, 128, 0.65);
}

body.dark-mode .battery-status-box,
body.dark-mode .battery-usage-box,
body.dark-mode .solar-status-box,
body.dark-mode .device-information-box,
body.dark-mode .communication-status-box,
body.dark-mode .communication-chart-box {
    background: rgba(21, 43, 27, 0.60);
    border-color: rgba(132, 173, 128, 0.65);
}

body.dark-mode .camera-panel h1,
body.dark-mode .card-title,
body.dark-mode .temperature-title,
body.dark-mode .power-header h2,
body.dark-mode .device-header h2,
body.dark-mode .battery-usage-box h3,
body.dark-mode .history-panel h2,
body.dark-mode .summary-content h2,
body.dark-mode .summary-content p,
body.dark-mode .settings-info h2,
body.dark-mode .settings-info p,
body.dark-mode .about-info h2,
body.dark-mode .about-info p,
body.dark-mode .activity-chart-panel h2,
body.dark-mode .activity-chart-panel p {
    color: #f4f8f2;
}

body.dark-mode .settings-control select,
body.dark-mode .theme-control label {
    color: #f4f8f2;
    background: rgba(37, 69, 43, 0.95);
    border-color: #64856a;
}

body.dark-mode .settings-control select option {
    color: #f4f8f2;
    background: #25452b;
}

body.dark-mode .history-table {
    background: rgba(34, 64, 39, 0.72);
}

body.dark-mode .history-table th,
body.dark-mode .history-table td {
    color: #f4f8f2;
    border-color: rgba(180, 211, 177, 0.35);
}

body.dark-mode .battery-gauge-inner {
    background: #143b20;
}

body.dark-mode .battery-chart text {
    fill: #e0eddf;
}

body.dark-mode .battery-chart line {
    stroke: #8aa78b;
}

body.dark-mode .battery-chart polyline {
    stroke: #a5e7a1;
}

body.dark-mode .about-info span {
    color: #efffc1;
    background: rgba(111, 132, 38, 0.45);
}

/* =========================
   14. TABLET RESPONSIVE
========================= */

@media (max-width: 1100px) {
    :root {
        --sidebar-width: 190px;
        --sidebar-left: 18px;
        --content-offset: 225px;
    }

    .logo {
        height: 215px;
    }

    .logo img {
        width: 84px;
        height: 84px;
    }

    .menu {
        padding-left: 28px;
    }

    .menu a {
        font-size: 15px;
    }

    .main {
        padding: 35px 20px;
    }

    .camera-panel {
        width: min(590px, 100%);
    }

    .power-layout {
        width: min(730px, 100%);
        gap: 18px;
    }

    .power-column {
        padding-left: 10px;
        padding-right: 10px;
    }

    .battery-status-box {
        grid-template-columns: minmax(95px, 1fr) minmax(0, 1.5fr);
        padding: 10px;
    }

    .battery-gauge {
        width: 112px;
        height: 112px;
    }

    .battery-gauge-inner {
        width: 80px;
        height: 80px;
        font-size: 24px;
    }

    .settings-card {
        grid-template-columns: 85px minmax(0, 1fr) 165px;
        gap: 14px;
    }

    .settings-icon img {
        width: 58px;
        height: 58px;
    }
}

/* =========================
   15. SMALL LAPTOP / TABLET
========================= */

@media (max-width: 900px) {
    .power-layout {
        grid-template-columns: 1fr;
        width: min(560px, 100%);
    }

    .power-column {
        min-height: auto;
        padding: 24px 18px;
    }

    .battery-status-box {
        grid-template-columns: 130px minmax(0, 1fr);
    }

    .battery-gauge {
        width: 120px;
        height: 120px;
    }

    .battery-gauge-inner {
        width: 86px;
        height: 86px;
    }

    .solar-status-box {
        grid-template-columns: 1fr 1.4fr;
    }

    .analyst-page {
        width: min(860px, 100%);
        padding: 30px 28px 34px;
        gap: 38px;
    }
}

/* =========================
   16. MOBILE RESPONSIVE
========================= */

@media (max-width: 700px) {
    body {
        background-attachment: scroll;
    }

    .sidebar {
        width: calc(100% - 28px);
        height: auto;
        min-height: 0;

        position: relative;
        top: auto;
        left: auto;

        margin: 14px auto 0;

        border-radius: 24px;
    }

    .logo {
        height: 105px;
        padding: 10px;
    }

    .logo img {
        width: 70px;
        height: 70px;
    }

    .menu {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;

        padding: 0 12px 14px;
    }

    .menu a {
        width: 100%;
        padding: 9px 5px;

        border-radius: 7px;
        text-align: center;
        white-space: normal;

        font-size: 13px;
    }

    .menu a:hover {
        padding-left: 5px;
    }

    .main {
        width: 100%;
        min-height: auto;

        margin-left: 0;
        padding: 25px 15px 40px;

        justify-content: flex-start;
        gap: 20px;
    }

    /* DASHBOARD */

    .camera-panel {
        width: 100%;
        padding: 25px 22px;
        border-radius: 25px;
    }

    .camera-panel h1 {
        margin-bottom: 15px;
        font-size: 23px;
    }

    .camera-box {
        aspect-ratio: 16 / 9;
    }

    .status-panel {
        width: 100%;
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 13px;
        border-radius: 23px;
    }

    .status-card {
        min-height: 85px;
    }

    .battery-card,
    .manual-card {
        flex-direction: row;
        justify-content: space-between;
        padding: 12px 18px;
    }

    .battery-card .card-title {
        margin: 0;
        align-self: center;
    }

    .temperature-card {
        justify-content: space-between;
        padding: 12px 18px;
    }

    /* SYSTEM MONITORING */

    .power-layout {
        width: 100%;
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .power-column {
        width: 100%;
        padding: 22px 14px;
        border-radius: 25px;
    }

    .battery-status-box {
        grid-template-columns: minmax(105px, 0.8fr) minmax(0, 1.4fr);
        gap: 10px;
    }

    .battery-info-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .communication-status-box {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .solar-status-box {
        grid-template-columns: 1fr 1.3fr;
    }

    .device-information-box {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    /* DATA ANALYST */

    .analyst-page {
        width: 100%;
        padding: 22px 16px 26px;
        gap: 24px;
        border-radius: 22px;
    }

    .analyst-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .activity-chart-panel {
        min-height: 250px;
        padding: 18px 12px;
    }

    .activity-chart-panel h2 {
        font-size: 16px;
    }

    .activity-chart-panel p {
        font-size: 11px;
    }

    .bird-activity-chart {
        height: 185px;
    }

    .summary-card {
        min-height: 100px;
        padding: 10px 8px;
        grid-template-columns: 52px minmax(0, 1fr);
        gap: 7px;
    }

    .summary-icon {
        height: 55px;
    }

    .summary-icon img {
        width: 42px;
        height: 42px;
    }

    .summary-content h2 {
        font-size: 11px;
    }

    .summary-content strong {
        font-size: 21px;
    }

    .history-panel {
        padding: 18px 14px;
    }

    /* SETTINGS */

    .settings-page {
        width: 100%;
        gap: 18px;
    }

    .settings-card {
        grid-template-columns: 70px minmax(0, 1fr);
        gap: 14px;
        padding: 18px;
    }

    .settings-icon {
        width: 70px;
        height: 70px;
        border-right: 2px solid #356443;
    }

    .settings-icon img {
        width: 50px;
        height: 50px;
    }

    .settings-info {
        align-items: flex-start;
    }

    .settings-control,
    .theme-control,
    .about-info {
        grid-column: 1 / -1;
        width: 100%;
    }

    .about-info {
        padding-top: 5px;
    }

    .settings-info h2 {
        font-size: 17px;
    }

    .settings-info p {
        font-size: 11px;
    }
}

/* =========================
   17. VERY SMALL MOBILE
========================= */

@media (max-width: 430px) {
    .main {
        padding-left: 12px;
        padding-right: 12px;
    }

    .camera-panel {
        padding: 21px 16px;
    }

    .temperature-card {
        flex-direction: column;
        text-align: center;
    }

    .temperature-title {
        font-size: 14px;
    }

    .battery-status-box {
        grid-template-columns: 1fr;
        padding: 14px;
    }

    .battery-gauge {
        width: 118px;
        height: 118px;
    }

    .battery-info-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .communication-status-box {
        grid-template-columns: 1fr;
    }

    .solar-status-box {
        grid-template-columns: 1fr;
    }

    .solar-image-box {
        min-height: 120px;
    }

    .device-information-box {
        grid-template-columns: 1fr;
    }

    .analyst-summary {
        grid-template-columns: 1fr;
    }

    .summary-card {
        min-height: 90px;
        grid-template-columns: 76px minmax(0, 1fr);
    }

    .summary-icon {
        height: 62px;
    }

    .summary-icon img {
        width: 54px;
        height: 54px;
    }

    .summary-content h2 {
        font-size: 13px;
    }

    .summary-content strong {
        font-size: 25px;
    }

    .settings-card {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 12px;
    }

    .settings-icon {
        width: 100%;
        height: 65px;

        margin: 0 auto;
        border-right: none;
        border-bottom: 2px solid #356443;
    }

    .settings-info {
        align-items: center;
    }

    .settings-control,
    .theme-control,
    .about-info {
        grid-column: auto;
    }
}

/* =========================
   18. REDUCED MOTION
========================= */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}


/* EMPTY STATE FOR HISTORICAL CHARTS */
.chart-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.chart-empty-state p {
    max-width: 270px;
    margin: 0 auto;
    padding: 12px;

    color: #405844;
    font-size: 12px;
    line-height: 1.5;
    font-style: italic;
}

body.dark-mode .chart-empty-state p {
    color: #dcebdd;
}


/* EMOJI ICONS FOR ANALYST KPI CARDS */
.summary-icon.summary-emoji-icon {
    color: #176329;
    font-size: 36px;
    line-height: 1;
}

body.dark-mode .summary-icon.summary-emoji-icon {
    color: #a8e8ad;
}
