:root {
  --accent:#16a34a;            /* primary green */
  --accent-light:#22c55e;
  --muted:#6b7280;
  --primary: #068A4F;
  --bg-gradient:linear-gradient(135deg, #065f46, #16a34a, #4ade80);
}

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

/* Base responsive body */
body {
  font-family:'Poppins', system-ui, sans-serif;
  color:#111827;
  min-height: 100vh;
}

/* Login Container - Mobile First */
.login-container {
  width:90%;
  max-width:420px;
  background:white;
  border-radius:16px;
  box-shadow:0 12px 40px rgba(0,0,0,0.15);
  overflow:hidden;
  animation:fadeIn 1.2s ease;
  margin: 20px auto;
}

.header {
  background:#f9fafb;
  padding:20px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  border-bottom:1px solid #e5e7eb;
  flex-direction: column;
  text-align: center;
}

.header img {
  height:42px;
  max-width: 100%;
}

.header h1 {
  font-size:1.3rem;
  font-weight:700;
  color:var(--accent);
  line-height: 1.3;
}

.form {
  padding:25px 20px 35px;
}

h2 {
  text-align:center;
  margin-bottom:20px;
  color:#065f46;
  font-weight:600;
  font-size: 1.25rem;
}

.input {
  width:100%;
  padding:14px 16px;
  border:1px solid #d1d5db;
  border-radius:10px;
  margin-bottom:16px;
  font-size:1rem;
  transition:all 0.3s;
}

.input:focus {
  border-color:var(--accent);
  box-shadow:0 0 0 3px rgba(22,163,74,0.15);
  outline:none;
}

.btn {
  width:100%;
  padding:14px;
  background:var(--accent);
  color:white;
  border:none;
  border-radius:10px;
  font-weight:600;
  font-size:1rem;
  cursor:pointer;
  transition:background 0.3s ease;
  margin-top: 10px;
}

.btn:hover {
  background:var(--accent-light);
}

.error-box {
  color:#dc2626;
  background:#fee2e2;
  padding:12px;
  border-radius:8px;
  font-size:0.9rem;
  text-align:center;
  margin-bottom:16px;
  line-height: 1.4;
}

.footer {
  text-align:center;
  padding-top:14px;
  font-size:0.9rem;
  color:var(--muted);
  line-height: 1.5;
}

.footer a {
  color:var(--accent);
  text-decoration:none;
  font-weight:500;
}

@keyframes fadeIn {
  from {opacity:0; transform:translateY(20px);}
  to {opacity:1; transform:translateY(0);}
}

/* Navigation Links */
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
  justify-content: center;
}

.nav-links a {
  padding: 12px 16px;
  background: #A4CE3A;
  color: white;
  border-radius: 8px;
  text-decoration: none;
  transition: 0.3s;
  text-align: center;
  flex: 1;
  min-width: 120px;
}

.nav-links a:hover {
  background: #0c47a1;
}

/* Sidebar - Mobile First */
.sidebar {
  width: 100%;
  background: var(--primary);
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  height: auto;
  padding: 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-family: "Poppins", sans-serif;
  z-index: 1000;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
  max-height: 100vh;
  overflow-y: auto;
}

.sidebar.active {
  transform: translateY(0);
}

.sidebar .logo {
  font-size: 1.2em;
  font-weight: 600;
  text-align: center;
  margin-bottom: 15px;
  padding: 10px 0;
}

.sidebar .user-info {
  text-align: center;
  margin-bottom: 15px;
  padding: 10px 0;
}

.sidebar .user-name {
  font-weight: 600;
  font-size: 1rem;
}

.sidebar .user-role {
  font-size: 0.85em;
  color: #c7c7c7;
}

.sidebar .nav-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0;
}

.sidebar .nav-links a {
  color: #fff;
  text-decoration: none;
  padding: 12px 15px;
  border-radius: 6px;
  transition: background 0.3s;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar .nav-links a:hover {
  background: #1b3a7a;
}

.sidebar .permissions {
  background: rgba(255, 255, 255, 0.1);
  padding: 12px;
  border-radius: 8px;
  font-size: 0.85em;
  margin: 15px 0;
}

.sidebar .permissions h4 {
  font-size: 0.9em;
  margin-bottom: 10px;
  text-align: center;
}

.sidebar .permissions ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar .permissions li {
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  line-height: 1.4;
}

.sidebar .footer {
  text-align: center;
  font-size: 0.8em;
  opacity: 0.7;
  margin-top: 15px;
  padding: 10px 0;
}

/* Hamburger Menu */
.hamburger-menu {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 24px;
  cursor: pointer;
  position: fixed;
  top: 15px;
  left: 15px;
  z-index: 1100;
}

.hamburger-menu span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: white;
  border-radius: 3px;
  transition: all 0.3s ease;
}

.hamburger-menu.active span:nth-child(1) {
  transform: translateY(10px) rotate(45deg);
}

.hamburger-menu.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
  transform: translateY(-10px) rotate(-45deg);
}

/* Overlay for mobile sidebar */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

.overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Main content area */
.main-content {
  width: 100%;
  padding: 20px;
  margin-top: 0;
  transition: transform 0.3s ease;
}

/* Tablet Styles */
@media (min-width: 768px) {
  .login-container {
    width: 80%;
    margin: 40px auto;
  }
  
  .header {
    flex-direction: row;
    padding: 25px;
  }
  
  .form {
    padding: 30px 25px 40px;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  .nav-links a {
    flex: none;
    min-width: auto;
  }
  
  /* Sidebar for tablet and desktop */
  .sidebar {
    width: 250px;
    height: 100vh;
    transform: translateX(0);
    position: fixed;
    padding: 20px;
  }
  
  .hamburger-menu {
    display: none;
  }
  
  .main-content {
    width: calc(100% - 250px);
    margin-left: 250px;
    padding: 30px;
  }
}

/* Desktop Styles */
@media (min-width: 1024px) {
  .login-container {
    width: 100%;
    max-width: 420px;
  }
  
  .sidebar {
    width: 280px;
  }
  
  .main-content {
    width: calc(100% - 280px);
    margin-left: 280px;
    padding: 40px;
  }
  
  .sidebar .logo {
    font-size: 1.3em;
  }
  
  .sidebar .nav-links {
    gap: 12px;
  }
}

/* Small mobile devices */
@media (max-width: 360px) {
  .login-container {
    width: 95%;
    margin: 10px auto;
  }
  
  .header {
    padding: 15px;
  }
  
  .form {
    padding: 20px 15px 25px;
  }
  
  .input {
    padding: 12px 14px;
  }
  
  .btn {
    padding: 12px;
  }
  
  .nav-links {
    flex-direction: column;
  }
  
  .nav-links a {
    min-width: 100%;
  }
}

/* Landscape orientation for mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .login-container {
    max-height: 90vh;
    overflow-y: auto;
  }
  
  .header {
    padding: 15px;
  }
  
  .form {
    padding: 15px 20px 20px;
  }
  
  .input {
    padding: 10px 12px;
    margin-bottom: 10px;
  }
  
  .sidebar {
    max-height: 100vh;
    overflow-y: auto;
  }
}