/* =========================================================
   FARMFLOW LITE
   SHARED APPLICATION STYLES
   ========================================================= */


/* ---------------------------------------------------------
   RESET
   --------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: #f4f7f3;
  color: #1f2937;
  min-height: 100vh;
}

button,
input,
select,
textarea {
  font-family: inherit;
}


/* ---------------------------------------------------------
   APP LAYOUT
   --------------------------------------------------------- */

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


/* ---------------------------------------------------------
   SIDEBAR
   --------------------------------------------------------- */

.sidebar {
  width: 250px;
  background: #173f2a;
  color: white;

  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;

  padding: 24px 18px;

  overflow-y: auto;

  z-index: 2000;
}

.brand {
  padding: 5px 10px 20px;
  margin-bottom: 25px;

  border-bottom: 1px solid rgba(255,255,255,.15);
}

.brand h1 {
  font-size: 25px;
  line-height: 1.2;
}

.brand p {
  margin-top: 5px;

  font-size: 12px;

  opacity: .7;
}

.nav-title {
  margin: 20px 10px 8px;

  font-size: 11px;

  text-transform: uppercase;

  letter-spacing: 1px;

  opacity: .55;
}

.nav-links {
  display: block;
}

.nav-link {
  display: block;

  width: 100%;

  padding: 12px 13px;
  margin-bottom: 5px;

  border: none;
  border-radius: 8px;

  background: transparent;

  color: #edf7f0;

  text-align: left;
  text-decoration: none;

  font-size: 14px;

  cursor: pointer;
}

.nav-link:hover,
.nav-link.active {
  background: #245d3d;
}

.logout-button {
  color: #ffd8d8;
}


/* ---------------------------------------------------------
   MAIN CONTENT
   --------------------------------------------------------- */

.main {
  margin-left: 250px;

  width: calc(100% - 250px);

  min-height: 100vh;
}


/* ---------------------------------------------------------
   TOPBAR
   --------------------------------------------------------- */

.topbar {
  min-height: 68px;

  padding: 16px 28px;

  background: white;

  border-bottom: 1px solid #e5e7eb;

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

  gap: 15px;
}

.topbar-left {
  display: flex;
  align-items: center;

  gap: 12px;
}

.topbar h2 {
  font-size: 21px;
}

.user-info {
  text-align: right;
}

.user-name {
  font-size: 14px;
  font-weight: 700;
}

.user-role {
  margin-top: 3px;

  font-size: 12px;

  color: #6b7280;
}


/* ---------------------------------------------------------
   PAGE CONTENT
   --------------------------------------------------------- */

.content {
  padding: 28px;
}

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

.page-heading h1,
.page-heading h2 {
  font-size: 27px;
  line-height: 1.2;
}

.page-heading p {
  margin-top: 6px;

  color: #6b7280;

  font-size: 14px;
  line-height: 1.5;
}


/* ---------------------------------------------------------
   SUMMARY CARDS
   --------------------------------------------------------- */

.summary-grid {
  display: grid;

  grid-template-columns: repeat(4, minmax(0,1fr));

  gap: 16px;

  margin-bottom: 24px;
}

.summary-card {
  padding: 19px;

  background: white;

  border: 1px solid #e5e7eb;
  border-radius: 12px;

  box-shadow: 0 3px 12px rgba(0,0,0,.03);
}

.summary-label {
  margin-bottom: 9px;

  color: #6b7280;

  font-size: 13px;
}

.summary-value {
  color: #173f2a;

  font-size: 27px;
  font-weight: 700;
}

.summary-note {
  margin-top: 7px;

  color: #9ca3af;

  font-size: 11px;
}


/* ---------------------------------------------------------
   PANELS
   --------------------------------------------------------- */

.panel {
  margin-bottom: 22px;

  background: white;

  border: 1px solid #e5e7eb;
  border-radius: 12px;

  overflow: hidden;
}

.panel-header {
  padding: 17px 20px;

  border-bottom: 1px solid #e5e7eb;

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

  gap: 15px;
}

.panel-header h3 {
  font-size: 17px;
}

.panel-body {
  padding: 20px;
}


/* ---------------------------------------------------------
   INFO BOX
   --------------------------------------------------------- */

.info-box {
  margin-bottom: 18px;

  padding: 13px 15px;

  background: #f3f7f4;

  border: 1px solid #dce8df;
  border-radius: 8px;

  color: #4b5563;

  font-size: 12px;
  line-height: 1.5;
}


/* ---------------------------------------------------------
   FORMS
   --------------------------------------------------------- */

.form-grid {
  display: grid;

  grid-template-columns: repeat(4, minmax(0,1fr));

  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-group.half {
  grid-column: span 2;
}

label {
  margin-bottom: 7px;

  color: #374151;

  font-size: 12px;
  font-weight: 600;
}

.required {
  color: #b42318;
}

input,
select,
textarea {
  width: 100%;

  padding: 11px 12px;

  background: white;

  border: 1px solid #d1d5db;
  border-radius: 7px;

  outline: none;

  font-size: 14px;
}

textarea {
  min-height: 90px;

  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #1f6f43;
}

input:disabled,
select:disabled,
textarea:disabled {
  background: #f3f4f6;

  color: #6b7280;
}

.field-note {
  margin-top: 5px;

  color: #9ca3af;

  font-size: 10px;
  line-height: 1.35;
}

.form-actions {
  margin-top: 18px;

  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}


/* ---------------------------------------------------------
   BUTTONS
   --------------------------------------------------------- */

.btn {
  padding: 10px 16px;

  border: none;
  border-radius: 7px;

  cursor: pointer;

  font-size: 13px;
  font-weight: 700;
}

.btn-primary {
  background: #1f6f43;
  color: white;
}

.btn-primary:hover {
  background: #185a36;
}

.btn-secondary {
  background: #f3f4f6;

  border: 1px solid #d1d5db;

  color: #374151;
}

.btn-danger {
  background: #fff1f1;

  border: 1px solid #fecaca;

  color: #b42318;
}

.btn-warning {
  background: #fff4d6;

  border: 1px solid #fde68a;

  color: #996800;
}


/* ---------------------------------------------------------
   TABS
   --------------------------------------------------------- */

.tabs {
  margin-bottom: 20px;

  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tab-button {
  padding: 10px 16px;

  background: white;

  border: 1px solid #d1d5db;
  border-radius: 8px;

  cursor: pointer;

  font-size: 13px;
  font-weight: 700;
}

.tab-button.active {
  background: #173f2a;

  border-color: #173f2a;

  color: white;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}


/* ---------------------------------------------------------
   TABLES
   --------------------------------------------------------- */

.table-wrapper {
  width: 100%;

  overflow-x: auto;
}

table {
  width: 100%;

  border-collapse: collapse;
}

th {
  padding: 12px 14px;

  background: #f8faf8;

  border-bottom: 1px solid #e5e7eb;

  color: #4b5563;

  text-align: left;

  font-size: 12px;
}

td {
  padding: 13px 14px;

  border-bottom: 1px solid #f0f0f0;

  vertical-align: middle;

  font-size: 13px;
}

.table-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.small-button {
  padding: 6px 9px;

  background: white;

  border: 1px solid #d1d5db;
  border-radius: 6px;

  cursor: pointer;

  font-size: 11px;
}

.edit-button {
  color: #176b3a;
}

.delete-button {
  color: #b42318;
}


/* ---------------------------------------------------------
   SEARCH
   --------------------------------------------------------- */

.search-box {
  width: 280px;
  max-width: 100%;
}


/* ---------------------------------------------------------
   STATUS BADGES
   --------------------------------------------------------- */

.badge,
.status {
  display: inline-block;

  padding: 5px 9px;

  border-radius: 20px;

  font-size: 11px;
  font-weight: 700;

  white-space: nowrap;
}

.status-active,
.badge-success {
  background: #e6f4ea;
  color: #176b3a;
}

.status-warning,
.badge-warning {
  background: #fff4d6;
  color: #996800;
}

.status-danger,
.badge-danger {
  background: #fff1f1;
  color: #b42318;
}

.status-info,
.badge-info {
  background: #eaf0ff;
  color: #3454a1;
}

.status-muted,
.badge-muted {
  background: #f3f4f6;
  color: #6b7280;
}


/* ---------------------------------------------------------
   EMPTY STATE
   --------------------------------------------------------- */

.empty-state {
  padding: 35px;

  color: #6b7280;

  text-align: center;

  font-size: 14px;
}


/* ---------------------------------------------------------
   MESSAGES
   --------------------------------------------------------- */

.message {
  display: none;

  margin-bottom: 18px;

  padding: 12px 14px;

  border-radius: 8px;

  font-size: 13px;
}

.message.success {
  display: block;

  background: #eaf6ed;

  border: 1px solid #c8e6d0;

  color: #176b3a;
}

.message.error {
  display: block;

  background: #fff1f1;

  border: 1px solid #fecaca;

  color: #b42318;
}

.message.warning {
  display: block;

  background: #fff4d6;

  border: 1px solid #fde68a;

  color: #996800;
}


/* ---------------------------------------------------------
   MOBILE MENU
   --------------------------------------------------------- */

.mobile-menu-button {
  display: none;

  padding: 8px 11px;

  background: #173f2a;

  border: none;
  border-radius: 7px;

  color: white;

  cursor: pointer;

  font-size: 20px;
}

.mobile-overlay {
  display: none;
}


/* ---------------------------------------------------------
   LOADING
   --------------------------------------------------------- */

.loading-screen {
  position: fixed;
  inset: 0;

  background: white;

  z-index: 9999;

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

  color: #173f2a;

  font-size: 17px;
}


/* ---------------------------------------------------------
   LOGIN PAGE
   --------------------------------------------------------- */

.login-page {
  min-height: 100vh;

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

  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 430px;

  padding: 30px;

  background: white;

  border: 1px solid #e5e7eb;
  border-radius: 14px;

  box-shadow: 0 10px 30px rgba(0,0,0,.06);
}

.login-brand {
  margin-bottom: 25px;

  text-align: center;
}

.login-brand h1 {
  color: #173f2a;

  font-size: 30px;
}

.login-brand p {
  margin-top: 7px;

  color: #6b7280;

  font-size: 13px;
}


/* ---------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------- */

@media(max-width: 1100px) {

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

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

}


@media(max-width: 750px) {

  .app {
    display: block;
  }

  .sidebar {
    width: 250px;
    height: 100vh;

    left: -270px;

    bottom: auto;

    transition: left .25s ease;

    box-shadow: 4px 0 15px rgba(0,0,0,.2);
  }

  .sidebar.mobile-open {
    left: 0;
  }

  .mobile-overlay {
    position: fixed;
    inset: 0;

    z-index: 1500;

    background: rgba(0,0,0,.35);
  }

  .mobile-overlay.active {
    display: block;
  }

  .main {
    width: 100%;

    margin-left: 0;
  }

  .mobile-menu-button {
    display: block;
  }

  .topbar {
    padding: 14px 16px;
  }

  .topbar h2 {
    font-size: 18px;
  }

  .user-name {
    font-size: 12px;
  }

  .user-role {
    font-size: 10px;
  }

  .content {
    padding: 18px;
  }

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

  .form-group.half {
    grid-column: auto;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-box {
    width: 100%;
  }

}


/* =========================================================
   END FARMFLOW LITE SHARED STYLES
   ========================================================= */
