/*
Theme Name: Livestock Manager Theme
Theme URI: https://example.com/livestock-manager-theme
Author: Your Name
Author URI: https://example.com
Description: A responsive theme optimized for Livestock Management System with animal tracking, vaccination schedules, feeding management, employee management, and financial reporting.
Version: 1.0.0
License: GPL v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: livestock-manager-theme
Tags: responsive, livestock, farm-management, dashboard, two-columns, right-sidebar, custom-header, custom-background, custom-menu, featured-images
*/

:root {
  --lm-primary: #2c6e2c;
  --lm-secondary: #f4a261;
  --lm-accent: #264653;
  --lm-success: #2a9d8f;
  --lm-warning: #e9c46a;
  --lm-danger: #e76f51;
  --lm-background: #f8f9fa;
  --lm-card: #ffffff;
  --lm-text: #212529;
  --lm-body-font: 'ZCOOL XiaoWei', sans-serif;
  --lm-border-radius: 18px;
  --lm-box-shadow: 0 18px 45px rgba(0, 0, 0, 0.08);
  --lm-gap: 1.5rem;
  --lm-line-height: 1.6;
  --lm-max-width: 1240px;
}

* {
  box-sizing: border-box;
}

html {
  font-family: var(--lm-body-font);
  font-size: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--lm-background);
  color: var(--lm-text);
  line-height: var(--lm-line-height);
  min-height: 100vh;
}

img,
video,
iframe,
embed,
object {
  max-width: 100%;
  display: block;
}

a {
  color: var(--lm-primary);
  text-decoration: none;
}

a:hover,
a:focus {
  color: var(--lm-accent);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

body,
button,
input,
textarea,
select {
  min-height: 0;
}

.container {
  width: min(100%, calc(100vw - 2rem));
  max-width: var(--lm-max-width);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 999;
  background: #fff;
  border-bottom: 1px solid rgba(36, 72, 46, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-branding .site-title,
.site-branding .site-description {
  margin: 0;
}

.site-branding .site-title {
  font-size: clamp(1.3rem, 2vw, 1.8rem);
  font-weight: 800;
  color: var(--lm-accent);
}

.site-branding .site-description {
  font-size: 0.95rem;
  color: #5c6b5c;
}

.lm-plugin-logo-link img,
.site-branding img {
  max-width: 220px;
  height: auto;
}

.main-navigation {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
}

.main-navigation ul {
  display: flex;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.main-navigation li {
  position: relative;
}

.main-navigation a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  background: transparent;
  color: var(--lm-dark);
  transition: background 0.2s ease, color 0.2s ease;
}

.main-navigation a:hover,
.main-navigation a:focus {
  background: rgba(44, 110, 44, 0.08);
  color: var(--lm-primary);
}

.menu-toggle {
  display: none;
  border: 1px solid rgba(36, 72, 46, 0.2);
  background: #fff;
  padding: 0.75rem 1rem 0.75rem 0.95rem;
  border-radius: 12px;
  min-height: 44px;
  min-width: 44px;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  display: inline-flex;
  font-weight: 700;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  touch-action: manipulation;
}

.menu-toggle::before {
  content: '≡';
  font-size: 1.1rem;
  line-height: 1;
  display: inline-block;
  margin-right: 0.5rem;
}

.menu-toggle.open {
  background: var(--lm-primary);
  color: #fff;
  border-color: var(--lm-primary);
}

.menu-toggle.open::before {
  content: '✕';
}

.site-main {
  padding: 2rem 0;
}

.page-header {
  margin-bottom: 2rem;
}

.page-title {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
}

.grid {
  display: grid;
  gap: var(--lm-gap);
}

.layout-sidebar {
  grid-template-columns: 1fr;
}

.card,
.widget,
.archive-card,
.dashboard-card {
  background: var(--lm-card);
  border-radius: var(--lm-border-radius);
  box-shadow: var(--lm-box-shadow);
  padding: 1.5rem;
}

.card h2,
.widget h2,
.archive-card h2,
.dashboard-card h2 {
  margin-top: 0;
}

.button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.85rem 1.4rem;
  border-radius: 999px;
  border: none;
  background: var(--lm-primary);
  color: #fff;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.button:hover,
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(44, 110, 44, 0.12);
}

.button-secondary {
  background: var(--lm-secondary);
  color: #212529;
}

.button-success {
  background: var(--lm-success);
}

.button-danger {
  background: var(--lm-danger);
}

.button-warning {
  background: var(--lm-warning);
  color: var(--lm-dark);
}

.form-group {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

label {
  font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="date"],
select,
textarea {
  width: 100%;
  background: #fff;
  border: 1px solid rgba(36, 72, 46, 0.12);
  border-radius: 14px;
  padding: 0.95rem 1rem;
  font: inherit;
  color: #212529;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--lm-primary);
  box-shadow: 0 0 0 4px rgba(44, 110, 44, 0.12);
}

.table-responsive {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

thead {
  background: rgba(44, 110, 44, 0.05);
}

th,
td {
  padding: 1rem 0.75rem;
  border-bottom: 1px solid rgba(36, 72, 46, 0.08);
  text-align: left;
}

th {
  font-weight: 700;
}

tr:nth-child(even) {
  background: rgba(44, 110, 44, 0.03);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: rgba(36, 72, 46, 0.1);
  color: var(--lm-dark);
  font-size: 0.85rem;
  font-weight: 700;
}

.alert {
  padding: 1rem 1rem;
  border-radius: 18px;
  margin-bottom: 1.5rem;
}

.alert-info {
  background: #e3f2fd;
  color: #0f4c81;
}

.alert-success {
  background: #e6fffa;
  color: #116b5c;
}

.alert-warning {
  background: #fff4d6;
  color: #7c5c12;
}

.alert-danger {
  background: #ffe8e3;
  color: #9f2a0b;
}

.tabs {
  display: grid;
  gap: 1rem;
}

.tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tab-list button {
  background: rgba(36, 72, 46, 0.08);
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1rem;
}

.tab-list button.active {
  background: var(--lm-primary);
  color: #fff;
}

.accordion {
  border-radius: 18px;
  overflow: hidden;
}

.accordion-item + .accordion-item {
  margin-top: 1rem;
}

.accordion-summary {
  width: 100%;
  background: rgba(36, 72, 46, 0.05);
  border: none;
  padding: 1rem 1.25rem;
  text-align: left;
  font-weight: 700;
  display: inline-flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 18px;
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: #fff;
  padding: 0 1.25rem;
}

.accordion-item.open .accordion-content {
  max-height: 1000px;
  padding: 1rem 1.25rem 1.5rem;
}

.progress {
  background: rgba(36, 72, 46, 0.1);
  border-radius: 999px;
  overflow: hidden;
  height: 1rem;
}

.progress-bar {
  display: block;
  height: 100%;
  background: var(--lm-primary);
  width: 0;
}

.footer-widgets {
  display: grid;
  gap: 1.5rem;
  padding: 2rem 0;
}

.footer-navigation {
  padding: 0 0 1.5rem;
  margin-top: 1rem;
  border-top: 1px solid rgba(36, 72, 46, 0.08);
}

.footer-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 1rem 0 0;
}

.footer-menu li {
  margin: 0;
}

.footer-menu a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  background: rgba(44, 110, 44, 0.05);
  color: var(--lm-text);
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.footer-menu a:hover,
.footer-menu a:focus {
  background: rgba(44, 110, 44, 0.14);
  color: var(--lm-primary);
  transform: translateY(-1px);
}

.site-footer {
  background: #fff;
  border-top: 1px solid rgba(36, 72, 46, 0.08);
  padding: 2rem 0;
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  color: #5c6b5c;
}

.skip-link {
  position: absolute;
  left: -999rem;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  position: static;
  width: auto;
  height: auto;
  padding: 0.75rem 1rem;
  background: var(--lm-primary);
  color: #fff;
  z-index: 1000;
}

@media screen and (max-width: 1024px) {
  .layout-sidebar {
    grid-template-columns: 1fr;
  }
}

@media screen and (max-width: 1024px) {
  .header-inner {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .main-navigation {
    width: 100%;
    display: none;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
    background: rgba(248, 249, 250, 0.98);
    padding: 1rem;
    border-radius: 18px;
    border: 1px solid rgba(36, 72, 46, 0.1);
  }

  .main-navigation.open {
    display: flex;
  }

  .main-navigation ul {
    flex-direction: column;
    gap: 0.75rem;
  }

  .main-navigation a {
    width: 100%;
  }

  .menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }
}

@media screen and (max-width: 600px) {
  .site-branding {
    flex-direction: column;
    align-items: flex-start;
  }

  .container {
    width: min(100%, calc(100vw - 1rem));
  }

  .page-title {
    font-size: clamp(1.8rem, 8vw, 2.4rem);
  }

  .main-navigation {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .main-navigation a {
    padding: 0.85rem 1rem;
  }
}

@media screen and (max-width: 600px) {
  .site-branding {
    flex-direction: column;
    align-items: flex-start;
  }

  .container {
    width: min(100%, calc(100vw - 1rem));
  }

  .page-title {
    font-size: clamp(1.8rem, 8vw, 2.4rem);
  }
}

@media print {
  body,
  .site-header,
  .site-footer,
  .main-navigation,
  .menu-toggle,
  .widget,
  .footer-widgets {
    box-shadow: none !important;
    background: #fff !important;
    color: #000 !important;
  }

  a {
    color: #000 !important;
    text-decoration: underline;
  }

  .no-print,
  .menu-toggle,
  .main-navigation,
  .site-footer {
    display: none !important;
  }

  .page-title {
    font-size: 2rem;
  }
}
