:root {
  color-scheme: dark;
  --bg: #0b121a;
  --sidebar: #101a25;
  --panel: #14212e;
  --panel-2: #192938;
  --border: #273949;
  --text: #edf4f7;
  --muted: #8da0ae;
  --green: #39d49a;
  --green-dark: #173e35;
  --blue: #58a9ed;
  --amber: #f0b65e;
  --violet: #aa91f4;
  --radius: 16px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); }
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 32px 18px; position: relative; overflow: hidden; background: radial-gradient(ellipse at 50% 42%, #1a3440 0%, #101c28 40%, #0b121a 76%); }
.login-decoration { position: absolute; width: 650px; height: 650px; border: 1px solid #29483f55; border-radius: 50%; box-shadow: 0 0 0 70px #29483f12, 0 0 0 140px #29483f0a; }
.login-card { width: min(100%, 440px); padding: 42px; border: 1px solid #344b5b; border-radius: 22px; background: #111e2aee; box-shadow: 0 30px 100px #0008; position: relative; z-index: 1; backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(145deg, #44dfa5, #168d70); color: #09241c; font: 800 17px Manrope, sans-serif; letter-spacing: -2px; box-shadow: 0 5px 20px #2bc18b33; }
.brand-mark span { color: #eafff5; }
.brand-name { font: 800 14px Manrope, sans-serif; letter-spacing: 1.1px; }
.brand-subtitle { color: var(--muted); font-size: 9px; letter-spacing: 2.2px; margin-top: 4px; }
.login-heading { margin: 45px 0 30px; }
.eyebrow { color: var(--green); font-size: 10px; font-weight: 700; letter-spacing: 1.8px; }
.login-heading h1 { font: 700 28px Manrope, sans-serif; letter-spacing: -.8px; margin: 13px 0 9px; }
.login-heading p, .page-heading p { color: var(--muted); font-size: 13px; line-height: 1.7; margin: 0; }
#login-form { display: flex; flex-direction: column; }
#login-form label { color: #c6d2da; font-size: 12px; font-weight: 600; margin: 0 0 8px; }
#login-form input { height: 48px; padding: 0 14px; color: var(--text); background: #0d1822; border: 1px solid #304454; border-radius: 9px; outline: none; margin-bottom: 20px; transition: border .2s, box-shadow .2s; }
#login-form input:focus { border-color: var(--green); box-shadow: 0 0 0 3px #39d49a20; }
#login-form input::placeholder { color: #617482; }
.primary-button { display: flex; justify-content: space-between; align-items: center; border: 0; border-radius: 9px; background: linear-gradient(110deg, #39d49a, #26b982); color: #06251b; font-weight: 800; padding: 0 17px; height: 49px; transition: filter .2s, transform .2s; }
.primary-button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.primary-button:disabled { opacity: .65; cursor: wait; }
.login-error { color: #ff8e8e; font-size: 12px; min-height: 18px; margin: -8px 0 9px; }
.login-foot { color: var(--muted); font-size: 11px; display: flex; gap: 9px; align-items: center; justify-content: center; margin-top: 28px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: var(--green); box-shadow: 0 0 10px #39d49a77; flex: 0 0 auto; }
.login-caption { position: absolute; bottom: 22px; color: #70818d; font-size: 9px; letter-spacing: 2px; z-index: 1; }
.login-caption span { color: var(--green); padding: 0 6px; }

.app-shell { min-height: 100vh; }
.sidebar { width: 258px; position: fixed; inset: 0 auto 0 0; z-index: 20; display: flex; flex-direction: column; padding: 25px 17px 16px; background: var(--sidebar); border-right: 1px solid #263746; }
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 0 7px 28px; }
.workspace-label, .nav-caption { color: #687e8d; font-size: 9px; font-weight: 700; letter-spacing: 1.5px; padding: 0 9px; }
.workspace-switch { display: flex; align-items: center; gap: 10px; background: #192938; border: 1px solid #2b3e4e; border-radius: 11px; padding: 10px; margin: 12px 0 26px; }
.workspace-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: #b5ffe0; background: #205441; font-weight: 800; }
.workspace-info { min-width: 0; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.workspace-info strong { font-size: 11px; }
.workspace-info span { font-size: 9px; color: var(--muted); }
.chevron { color: var(--muted); }
.main-nav { display: flex; flex-direction: column; gap: 5px; }
.nav-caption-spaced { margin-top: 23px; margin-bottom: 5px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 42px; padding: 0 11px; border: 1px solid transparent; border-radius: 9px; color: #9eafbb; background: transparent; text-align: left; font-size: 11px; transition: .2s; }
.nav-item:hover { color: var(--text); background: #1b2b39; }
.nav-item.active { color: #c8ffe9; background: linear-gradient(90deg, #1d483b, #1b352f); border-color: #2b624f; }
.nav-icon { width: 17px; text-align: center; font-size: 17px; color: #8299a7; }
.nav-item.active .nav-icon { color: var(--green); }
.nav-new { font-size: 8px; font-weight: 800; color: #10291f; background: var(--green); padding: 3px 5px; border-radius: 4px; margin-left: auto; }
.nav-count { font-size: 10px; margin-left: auto; background: #2b3e4d; color: #c1d1d9; border-radius: 20px; padding: 3px 7px; }
.sidebar-bottom { margin-top: auto; }
.cloud-status { display: flex; align-items: center; gap: 10px; border: 1px solid #284339; background: #152a27; padding: 12px 10px; border-radius: 10px; margin-bottom: 15px; }
.cloud-status > div, .user-info { display: flex; flex-direction: column; gap: 4px; }
.cloud-status strong, .user-info strong { font-size: 10px; }
.cloud-status small, .user-info span { color: var(--muted); font-size: 9px; }
.sidebar-user { border-top: 1px solid #293b49; padding: 16px 3px 0; display: flex; align-items: center; gap: 10px; }
.avatar, .top-avatar { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 50%; background: linear-gradient(145deg, #426c66, #23433e); color: #d7ffed; font-weight: 700; font-size: 12px; }
.user-info { flex: 1; min-width: 0; }
.logout-button { border: 0; background: transparent; color: #8498a5; font-size: 17px; }
.logout-button:hover { color: var(--green); }
.main-area { margin-left: 258px; min-height: 100vh; }
.topbar { height: 68px; display: flex; justify-content: space-between; align-items: center; padding: 0 34px; border-bottom: 1px solid #243542; background: #0e1821; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 18px; }
.breadcrumb { color: #718493; font-size: 10px; letter-spacing: .4px; }
.breadcrumb span { padding: 0 9px; color: #435968; }
.breadcrumb strong { color: #dce6eb; font-weight: 600; }
.topbar-right { gap: 20px; }
.connection-label { display: flex; align-items: center; gap: 8px; color: #9fb0bb; font-size: 10px; }
.top-avatar { width: 31px; height: 31px; }
.icon-button { width: 34px; height: 34px; display: grid; place-items: center; background: transparent; border: 1px solid transparent; color: #a7bac5; border-radius: 8px; font-size: 17px; }
.icon-button:hover { background: #1b2b38; border-color: #304454; }
.menu-toggle, .mobile-close, .sidebar-overlay { display: none; }
.notification-button { position: relative; }
.notification-button i { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--green); top: 6px; right: 6px; }
.page-content { max-width: 1600px; margin: 0 auto; padding: 34px 36px 20px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.page-heading h1 { font: 700 27px Manrope, sans-serif; letter-spacing: -.8px; margin: 8px 0 6px; }
.page-heading-actions { display: flex; align-items: center; gap: 10px; }
.date-chip, .secondary-button { border: 1px solid #304454; border-radius: 8px; background: #14222e; color: #b5c5ce; padding: 10px 12px; font-size: 10px; }
.secondary-button { display: inline-flex; align-items: center; gap: 8px; transition: .2s; }
.secondary-button:hover { border-color: var(--green); color: var(--green); }
.welcome-banner { min-height: 175px; padding: 30px 35px; border: 1px solid #315449; border-radius: var(--radius); background: radial-gradient(ellipse at 85% 40%, #285b4a 0%, transparent 43%), linear-gradient(110deg, #173c34, #152c30 70%, #172a32); display: flex; align-items: center; justify-content: space-between; overflow: hidden; position: relative; }
.welcome-kicker { color: #8fe9c2; font-size: 9px; font-weight: 700; letter-spacing: 2px; }
.welcome-banner h2 { font: 700 24px Manrope, sans-serif; margin: 11px 0 8px; letter-spacing: -.6px; }
.welcome-banner p { color: #b1c9c5; font-size: 11px; margin: 0; }
.welcome-orbit { width: 130px; height: 130px; margin-right: 50px; position: relative; display: grid; place-items: center; }
.orbit-ring { position: absolute; inset: 0; border: 1px solid #83e9c555; border-radius: 50%; box-shadow: 0 0 0 15px #83e9c511, 0 0 0 31px #83e9c50b; }
.orbit-core { width: 66px; height: 66px; display: grid; place-items: center; border-radius: 20px; color: #d7ffed; background: linear-gradient(145deg, #43d99f, #176f58); font: 800 22px Manrope; box-shadow: 0 10px 35px #39d49a55; transform: rotate(-8deg); }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin: 29px 0 15px; }
.section-heading h2 { font: 700 15px Manrope, sans-serif; margin: 0 0 5px; }
.section-heading p, .panel-heading p { color: var(--muted); font-size: 10px; margin: 0; }
.live-label { display: flex; align-items: center; gap: 7px; color: #8ca59e; font-size: 8px; letter-spacing: 1.2px; }
.live-label i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 9px var(--green); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.stat-card, .panel { border: 1px solid var(--border); background: linear-gradient(145deg, #172633, #13202b); border-radius: 13px; }
.stat-card { padding: 17px; min-height: 130px; }
.stat-top { display: flex; align-items: center; justify-content: space-between; color: #a5b5bf; font-size: 10px; gap: 8px; }
.stat-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; font-size: 15px; }
.stat-icon.green { color: var(--green); background: #1c4339; }
.stat-icon.blue { color: var(--blue); background: #1d3c53; }
.stat-icon.amber { color: var(--amber); background: #493923; }
.stat-icon.violet { color: var(--violet); background: #392f53; }
.stat-value { font: 700 26px Manrope, sans-serif; margin: 12px 0 4px; }
.stat-foot { color: #788d9a; font-size: 9px; line-height: 1.5; }
.content-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 14px; margin-top: 16px; }
.panel { padding: 19px; min-width: 0; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.panel-heading h3 { font: 700 13px Manrope, sans-serif; margin: 0 0 5px; }
.text-button { background: transparent; border: 0; color: var(--green); font-size: 10px; padding: 5px 0; }
.text-button:hover { color: #8affcf; }
.empty-state { min-height: 205px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 20px; }
.empty-illustration { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: #203d38; color: var(--green); font-size: 20px; margin-bottom: 13px; }
.empty-state strong { font-size: 11px; }
.empty-state p { max-width: 300px; color: var(--muted); font-size: 10px; line-height: 1.7; margin: 8px 0 13px; }
.empty-state .secondary-button { padding: 8px 11px; }
.weather-symbol { color: #f0c477; font-size: 25px; }
.weather-placeholder { min-height: 205px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 14px; }
.weather-large { color: #80bde9; font-size: 39px; margin-bottom: 9px; }
.weather-placeholder strong { font-size: 11px; }
.weather-placeholder p { color: var(--muted); max-width: 270px; font-size: 10px; line-height: 1.7; }
.lower-heading { margin-top: 27px; }
.activity-panel { padding: 15px 19px; }
.activity-empty { color: var(--muted); font-size: 10px; display: flex; align-items: center; gap: 10px; min-height: 30px; }
.activity-dot { width: 7px; height: 7px; background: #5b7180; border-radius: 50%; }
.app-footer { display: flex; justify-content: space-between; padding: 26px 2px 4px; color: #647986; font-size: 8px; letter-spacing: 1px; }
.app-footer i { display: inline-block; width: 5px; height: 5px; background: var(--green); border-radius: 50%; margin: 0 5px 1px; }

.weather-intro { min-height: 155px; display: flex; align-items: center; justify-content: space-between; padding: 27px 30px; background: radial-gradient(ellipse at 90% 20%, #285b64 0%, transparent 45%), linear-gradient(110deg, #172f3c, #162631); border-color: #31505a; }
.weather-intro h2 { font: 700 21px Manrope, sans-serif; margin: 10px 0 7px; }
.weather-intro p { max-width: 600px; color: #a9bbc4; font-size: 11px; line-height: 1.7; margin: 0; }
.weather-intro-icon { font-size: 65px; color: #f2c87a; padding: 0 28px; text-shadow: 0 0 35px #e5b95d66; }
.weather-stats { margin-top: 20px; }
.weather-content { margin-top: 15px; }
.empty-state.compact { min-height: 180px; }
.weather-map-panel { margin-top: 15px; }
.map-placeholder { min-height: 170px; margin-top: 15px; border: 1px dashed #344c5c; border-radius: 10px; background: radial-gradient(ellipse at 50% 50%, #1b3440, #14232e); display: grid; place-items: center; padding: 25px; text-align: center; color: #8196a3; font-size: 11px; line-height: 1.7; }
.generic-placeholder { min-height: 320px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.generic-placeholder h2 { font: 700 18px Manrope; margin: 5px 0; }
.generic-placeholder p { color: var(--muted); font-size: 11px; }
.module-tag { margin-top: 14px; padding: 6px 9px; border: 1px solid #315647; border-radius: 5px; color: var(--green); font-size: 8px; letter-spacing: 1px; }

@media (max-width: 1150px) {
  .page-content { padding: 28px 24px 18px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .welcome-orbit { margin-right: 20px; }
}
@media (max-width: 760px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; width: 280px; box-shadow: 20px 0 60px #0006; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { position: fixed; inset: 0; z-index: 19; background: #0009; }
  .sidebar-overlay.visible { display: block; }
  .mobile-close, .menu-toggle { display: grid; }
  .main-area { margin-left: 0; }
  .topbar { height: 59px; padding: 0 15px; }
  .topbar-left, .topbar-right { gap: 9px; }
  .connection-label { font-size: 0; gap: 0; }
  .connection-label .status-dot { width: 8px; height: 8px; }
  .breadcrumb { font-size: 9px; }
  .breadcrumb span { padding: 0 4px; }
  .page-content { padding: 24px 15px 16px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 13px; margin-bottom: 19px; }
  .page-heading h1 { font-size: 23px; }
  .page-heading-actions { width: 100%; }
  .welcome-banner { padding: 24px 20px; min-height: 155px; }
  .welcome-banner h2 { font-size: 19px; max-width: 270px; }
  .welcome-banner p { max-width: 270px; line-height: 1.6; }
  .welcome-orbit { width: 65px; height: 65px; margin: 0 5px 0 0; flex: 0 0 65px; }
  .orbit-core { width: 42px; height: 42px; border-radius: 13px; font-size: 15px; }
  .orbit-ring { box-shadow: 0 0 0 8px #83e9c511, 0 0 0 16px #83e9c50b; }
  .content-grid { grid-template-columns: 1fr; }
  .app-footer { gap: 12px; font-size: 7px; }
  .weather-intro { padding: 23px 19px; }
  .weather-intro h2 { font-size: 18px; }
  .weather-intro-icon { font-size: 43px; padding: 0 3px 0 10px; }
}
@media (max-width: 420px) {
  .login-card { padding: 30px 23px; }
  .login-heading h1 { font-size: 24px; }
  .stats-grid { gap: 9px; }
  .stat-card { padding: 12px; min-height: 125px; }
  .stat-top { font-size: 9px; }
  .stat-value { font-size: 23px; }
  .stat-foot { font-size: 8px; }
  .section-heading h2 { font-size: 14px; }
  .welcome-orbit { display: none; }
  .panel { padding: 15px; }
}

/* Grain monitoring */
.grain-toolbar {
  align-items: flex-end;
  gap: 18px;
  flex-wrap: wrap;
}

.grain-org-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 210px;
  color: var(--muted);
  font-size: 10px;
}

.grain-org-control select {
  width: 100%;
  min-height: 37px;
  padding: 8px 32px 8px 11px;
  color: #e4efef;
  background: #172a35;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 11px;
}

.grain-org-control select:focus {
  outline: 1px solid var(--green);
  border-color: var(--green);
}

.grain-org-control select:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.grain-stats {
  margin-top: 18px;
}

.grain-data-panel {
  margin-bottom: 15px;
  padding: 8px 18px;
}

.grain-data-list {
  display: flex;
  flex-direction: column;
}

.grain-data-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 14px 3px;
  border-bottom: 1px solid #293c48;
  min-width: 0;
}

.grain-data-row:last-child {
  border-bottom: 0;
}

.grain-data-row strong {
  color: #e1eceb;
  font-size: 11px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.grain-data-row span {
  color: #8fa3ad;
  font-size: 10px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.grain-child-row {
  padding-left: 18px;
  background: #ffffff03;
}

.grain-child-row strong {
  color: #b9d9ce;
}

@media (max-width: 760px) {
  .grain-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .grain-org-control {
    width: 100%;
    min-width: 0;
  }

  .grain-data-panel {
    padding: 7px 13px;
  }
}
