/* GLOBAL RESET & TYPOGRAPHY */
:root {
  --primary: #0d6efd;
  --danger: #dc3545;
  --success: #198754;
  --dark: #212529;
  --light: #f8f9fa;
  --border: #dee2e6;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
}

/* Ensure page takes full height so footer sits at bottom */
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: #f3f4f6;
  color: #333;
  margin: 0;
  /* FLEXBOX FOR STICKY FOOTER */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* MAIN CONTAINER - UPDATED FIX */
.container {
  width: 100%;            /* FIX: Forces container to fill width */
  max-width: 1000px;      /* Slightly wider for better view */
  margin: 20px auto;      /* Centers it and adds vertical space */
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  
  /* Pushes footer down if content is short */
  flex: 1; 
}

/* HEADER SECTION */
.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 15px;
}

h1 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--dark);
}

#logout-btn {
  background-color: var(--danger);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

#logout-btn:hover {
  opacity: 0.9;
}

/* NOTICE BOARD CARD */
#notice-board {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 5px solid var(--primary) !important;
  padding: 20px;
  margin-bottom: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.notice-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

#post-notice-btn {
  background: #e9ecef;
  border: 1px solid #ced4da;
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 0.85em;
  font-weight: bold;
  cursor: pointer;
  color: #495057;
}

#post-notice-btn:hover {
  background: #dee2e6;
}

/* MENU GRID SYSTEM */
.menu-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); 
  gap: 15px;
}

.menu-list li {
  margin: 0;
}

/* MENU LINKS AS CARDS */
.menu-list a {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  background-color: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--dark);
  font-weight: 500;
  transition: all 0.2s ease;
  height: 100%;
}

.menu-list a:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border-color: var(--primary);
  background-color: #f8fbff;
}

/* SPECIAL LINK STYLES */
#history-link {
  border-left: 4px solid #6f42c1;
  background: #fdfaff;
}
#status-link {
  color: #d9534f;
}

/* RESPONSIVE MEDIA QUERIES */
@media (max-width: 768px) {
  .container {
    padding: 15px;
    width: 95%; /* Use almost full width on mobile */
  }

  .header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .menu-list {
    grid-template-columns: 1fr;
  }
}

/* MOBILE NAVIGATION STYLES */
.mobile-nav {
  display: none;
}

@media (max-width: 600px) {
  .mobile-nav {
    display: flex;
    justify-content: space-around;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    border-top: 1px solid #ddd;
    padding: 10px 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
  }

  .nav-item {
    text-align: center;
    text-decoration: none;
    font-size: 0.8rem;
    color: #555;
    font-weight: 600;
  }
  
  body { padding-bottom: 70px; }
}

/* --- PROFESSIONAL HEADER STYLES --- */
.erp-header-global {
  background: #003366; /* Corporate Navy Blue */
  color: white;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.erp-brand { display: flex; align-items: center; gap: 10px; }
.erp-logo { font-size: 1.5em; }
.erp-title { font-size: 1.1em; line-height: 1.2; }
.erp-badge { 
  display: block; 
  font-size: 0.6em; 
  background: #0056b3; 
  padding: 2px 5px; 
  border-radius: 3px; 
  width: fit-content; 
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.erp-controls { display: flex; align-items: center; gap: 15px; font-size: 0.9em; }
.erp-link { color: #cfdce6; text-decoration: none; transition: 0.2s; }
.erp-link:hover { color: white; text-decoration: underline; }
.erp-divider { opacity: 0.5; }
.erp-time { font-family: monospace; opacity: 0.9; }

@media (max-width: 768px) {
  .erp-header-global { flex-direction: column; gap: 10px; text-align: center; }
  .erp-controls { font-size: 0.8em; }
}

/* --- PROFESSIONAL FOOTER STYLES --- */
.erp-footer-global {
  background: #e9ecef;
  color: #495057;
  padding: 20px;
  border-top: 3px solid #003366;
  font-size: 0.85em;
  margin-top: auto; /* Pushes to bottom */
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-left { max-width: 600px; }
.legal-text { 
  font-size: 0.85em; 
  color: #6c757d; 
  margin-top: 5px; 
  font-style: italic;
}

.footer-right { text-align: right; }
.sys-version { color: #adb5bd; margin-top: 5px; font-family: monospace; }
.footer-right a { color: #003366; text-decoration: none; font-weight: bold; }

@media (max-width: 768px) {
  .footer-content { flex-direction: column; align-items: center; text-align: center; }
  .footer-right { text-align: center; }
}