@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --ez-green: #3d9e47;
  --ez-green-light: #e8f6ea;
  --ez-green-dark: #2f7f38;
  --ez-orange: #e8913a;
  --ez-bg: #eef1f4;
  --ez-sidebar-bg: #ffffff;
  --ez-panel: #ffffff;
  --ez-text: #1f2937;
  --ez-muted: #6b7280;
  --ez-border: #e5e7eb;
  --ez-danger: #e05252;
  --ez-ok: #2f7f38;
  --ez-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  --ez-radius: 14px;
  --ez-sidebar-width: 248px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  color: var(--ez-text);
  background: var(--ez-bg);
}

a { color: var(--ez-green-dark); text-decoration: none; }
a:hover { color: var(--ez-green); }

button, input, select, textarea { font: inherit; }

button, .btn {
  cursor: pointer;
  background: var(--ez-green);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 0.55rem 0.95rem;
  display: inline-block;
  font-weight: 600;
}
button:hover, .btn:hover { background: var(--ez-green-dark); }
button.secondary, .btn.secondary {
  background: #fff;
  color: var(--ez-green-dark);
  border: 1px solid var(--ez-border);
}
button.linkish {
  background: transparent;
  color: var(--ez-muted);
  padding: 0.45rem 0.75rem;
  text-align: left;
  font-weight: 500;
  width: 100%;
}
button.linkish:hover {
  background: #f3f4f6;
  color: var(--ez-text);
}

input, select, textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--ez-border);
  border-radius: 10px;
  background: #fff;
}
input[type="checkbox"],
input[type="radio"] {
  width: auto;
  min-width: 1rem;
  height: auto;
  padding: 0;
  border-radius: 3px;
  flex-shrink: 0;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--ez-green-light);
  border-color: var(--ez-green);
}
input[type="checkbox"]:focus,
input[type="radio"]:focus {
  outline-offset: 2px;
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--ez-muted);
  margin-bottom: 0.75rem;
}
.check-inline {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  margin: 0.15rem 0 0.35rem;
}
.check-inline label {
  display: inline;
  margin: 0;
  color: var(--ez-text);
  font-weight: 500;
  cursor: pointer;
}
.check-inline input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0;
}
form.stack { display: grid; gap: 0.5rem; max-width: 720px; }

.shell {
  display: grid;
  grid-template-columns: var(--ez-sidebar-width) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--ez-sidebar-bg);
  color: var(--ez-text);
  padding: 1.25rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-radius: 0 24px 24px 0;
  box-shadow: var(--ez-shadow);
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: block;
  padding: 0.25rem 0.75rem 0.85rem;
  text-decoration: none !important;
}
.sidebar-brand img {
  display: block;
  width: 200px;
  max-width: 100%;
  height: auto;
}
.sidebar-tagline {
  margin: 0;
  padding: 0 0.75rem 0.5rem;
  font-size: 0.75rem;
  color: var(--ez-muted);
  font-weight: 500;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 0.35rem;
}

.sidebar nav a {
  color: var(--ez-muted);
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  flex: 0 0 auto;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}
.sidebar nav a:hover {
  background: #f3f4f6;
  color: var(--ez-text);
}
.sidebar nav a.active {
  background: var(--ez-green-light);
  color: var(--ez-green-dark);
  font-weight: 600;
}

.sidebar-footer {
  margin-top: auto;
  padding: 0.85rem 0.5rem 0.35rem;
  border-top: 1px solid var(--ez-border);
}
.sidebar .user {
  font-size: 0.75rem;
  color: var(--ez-muted);
  word-break: break-all;
  padding: 0.35rem 0.75rem 0.5rem;
}

.content { padding: 1.5rem 1.75rem; }

.panel {
  background: var(--ez-panel);
  border: 1px solid var(--ez-border);
  border-radius: var(--ez-radius);
  box-shadow: var(--ez-shadow);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

h1 { margin: 0 0 1rem; font-size: 1.45rem; font-weight: 700; }
h2 { margin: 0 0 0.85rem; font-size: 1.1rem; font-weight: 600; }
.muted { color: var(--ez-muted); font-size: 0.9rem; }

.error, .text-danger, .validation-summary-errors { color: var(--ez-danger); }
.flash { padding: 0.7rem 0.9rem; border-radius: 10px; margin-bottom: 1rem; }
.flash.ok { background: var(--ez-green-light); color: var(--ez-ok); }
.flash.error { background: #fdecec; color: var(--ez-danger); }

.grid-2 {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td {
  text-align: left;
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--ez-border);
  vertical-align: top;
}
th { color: var(--ez-muted); font-weight: 600; font-size: 0.8rem; }

.actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.stat-row {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.stat {
  background: var(--ez-green-light);
  border-radius: 12px;
  padding: 0.85rem;
}
.stat strong { display: block; font-size: 1.25rem; color: var(--ez-green-dark); }

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f4f7f9 0%, #e8f0ea 100%);
}
.auth-card {
  width: min(440px, 100%);
  background: var(--ez-panel);
  border: 1px solid var(--ez-border);
  border-radius: 16px;
  box-shadow: var(--ez-shadow);
  padding: 1.75rem;
}
.auth-card .auth-brand {
  display: block;
  margin: 0 auto 1rem;
  width: 220px;
  max-width: 100%;
  height: auto;
}
.auth-card h1 { text-align: center; }
.auth-card > .muted { text-align: center; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    border-radius: 0;
  }
  .grid-2, .stat-row { grid-template-columns: 1fr; }
}
