/* === Global reset & font === */
* { box-sizing:border-box; margin:0; padding:0; }
html, body {
  min-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  font-family: "Segoe UI", sans-serif;
  position: relative;
}
.background {
  background: url('../img/bg.png') center/cover no-repeat;
  filter: brightness(.8);
  position: fixed;
  inset: 0;
  z-index: -1;
}
/* === Full-screen background === */
.dashboard-bg {
	
  background: url('../img/bg.png') no-repeat bottom center;
  background-size: cover;
  background-attachment: fixed;
  min-height: calc(100vh - 60px);
}

/* === Login card === */
.login-box{
  background:rgba(255,255,255,.95);
  width:90%; max-width:400px; padding:30px 40px;
  border-radius:12px; box-shadow:0 8px 20px rgba(0,0,0,.2);
  text-align:center;
  position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);
}
.logo{width:100px;height:auto;margin-bottom:20px;}
.login-box h2{margin-bottom:20px;color:#1a237e;}
.error{color:#e53935;margin-bottom:10px;font-weight:600;}
.login-box form{display:flex;flex-direction:column;gap:15px}
.login-box label{text-align:left;font-weight:600;color:#333}
.login-box input{padding:10px;border:1px solid #ccc;border-radius:6px}
.login-box button{
  padding:12px;border:none;border-radius:6px;
  background:#1a237e;color:#fff;font-weight:700;cursor:pointer;
  transition:background .3s;
}
.login-box button:hover{background:#0d155a}

/* --- Mobile tweaks (login) --- */
@media(max-width:600px){
  .login-box{padding:25px;}
  .logo{width:80px;}
  .login-box h2{font-size:20px;}
  .login-box input,.login-box button{font-size:16px;}
}

/* === Footer (login screen) === */
.footer{
  position:fixed;bottom:15px;width:100%;text-align:center;
  font-size:14px;color:#fff;z-index:1;text-shadow:1px 1px 2px #000;
}

/* === Top Header (dashboards) === */
.top-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: #cdeefd;
  color: #004d80;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
  z-index: 1001;
}
.header-left{display:flex;align-items:center;}
.logo-small{height:40px;margin-right:10px;}
.site-title {
  font-size: 20px;
  font-weight: bold;
  color: #004d80;
}
.logout-btn,.hamburger{
  background:#f44336;color:#fff;border:none;padding:8px 14px;
  border-radius:5px;font-weight:bold;cursor:pointer;margin-left:10px;
}
.logout-btn:hover{background:#d32f2f;}
.hamburger{background:#0d47a1;}
.hamburger:hover{background:#08306b;}
.logout-btn, .hamburger {
  background: #004d80;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
  margin-left: 10px;
}
.logout-btn:hover {
  background: #003355;
}
.hamburger:hover {
  background: #003355;
}

/* === Sidebar === */
#sidebar{
  width:220px;background:#eee;min-height:calc(100% - 60px);
  position:fixed;left:0;top:60px;padding:20px;
  transition:left .3s ease;overflow-y:auto;z-index:1000;
}
#sidebar {
  background: #cdeefd;
  color: #004d80;
}
#sidebar nav ul{list-style:none;padding:0;}
#sidebar nav ul li{margin-bottom:10px;}
#sidebar nav ul li a{text-decoration:none;color:#333;font-weight:bold;}
#sidebar nav ul li a {
  color: #004d80;
}
#sidebar nav ul li a:hover {
  text-decoration: underline;
}
#sidebar.active{left:-220px;}

/* === Sidebar Submenu === */
#sidebar nav ul ul {
  margin-left: 15px;
  padding-left: 10px;
  list-style: none;
}
#sidebar nav ul ul li {
  margin-bottom: 6px;
}
#sidebar nav ul ul li a {
  font-weight: normal;
  font-size: 14px;
  color: #004d80;
  text-decoration: none;
}
#sidebar nav ul ul li a:hover {
  text-decoration: underline;
}
#sidebar nav ul ul li::before {
  content: "• ";
  color: #0074a8;
  margin-right: 5px;
}
.submenu {
  display: none;
  margin-left: 15px;
  padding-left: 10px;
  list-style: none;
  transition: all 0.3s ease;
}
.submenu.open {
  display: block;
}
.submenu li {
  margin-bottom: 6px;
}
.submenu li a {
  font-weight: normal;
  font-size: 14px;
  color: #004d80;
  text-decoration: none;
}
.submenu li a:hover {
  text-decoration: underline;
}
.submenu-toggle {
  display: block;
  font-weight: bold;
  color: #004d80;
  cursor: pointer;
  margin-bottom: 5px;
}
.submenu-toggle::after {
  content: "▸";
  float: right;
  transition: transform 0.2s ease;
}
.submenu-toggle.active::after {
  transform: rotate(90deg);
}

/* === Main content wrapper === */
.main-content {
  margin-left: 220px;
  margin-top: 60px; /* height of the fixed header */
  padding: 20px;
  min-height: calc(100vh - 60px);
  overflow: auto;
}
.main-content.shifted{margin-left:0;}
@media(max-width:768px){
  #sidebar{left:-220px;}
  #sidebar.active{left:0;}
  .main-content{margin-left:0;}
  .main-content.shifted{margin-left:220px;}
}

/* === Cards === */
.card{
  background:#fff;border-radius:8px;padding:20px;
  box-shadow:0 0 10px rgba(0,0,0,.1);margin-top:20px;
}
.card h3{margin-top:0;color:#1a237e;}
.card a{text-decoration:none;color:#1a237e;font-weight:bold;}

/* === Main dashboard footer === */
.main-footer {
  background: #cdeefd;
  color: #004d80;
  text-align: center;
  padding: 10px;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 999;
}

/* === Modal (logout confirm) === */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  justify-content: center;
  align-items: center;
  z-index: 10000;
}
.modal-content, .modal-box {
  background: #fff;
  padding: 30px 25px;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  position: relative;
  text-align: center;
}
.modal-box h2 {
  font-size: 20px;
  color: #004d80;
  margin-bottom: 10px;
}
.modal-box p {
  margin-bottom: 25px;
  color: #444;
}
.modal-actions {
  display: flex;
  justify-content: space-around;
  gap: 10px;
}
.btn-cancel, .btn-confirm {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  font-size: 14px;
}
.btn-cancel { background: #ccc; color: #333; }
.btn-confirm {
  background: #004d80;
  color: #fff;
}
.btn-confirm:hover {
  background: #003355;
}
.close-btn {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  font-size: 22px;
  color: #999;
  cursor: pointer;
}

/* === Form Layouts === */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.form-row {
  display: flex;
  flex-direction: column;
}
.form-row label {
  margin-bottom: 5px;
  font-weight: 600;
  color: #333;
}
.form-row input, .form-row select, .form-row textarea {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  width: 100%;
}
.form-row.full {
  grid-column: 1 / 3;
}
.form-actions {
  grid-column: 1 / 3;
  text-align: right;
}
.form-actions button {
  padding: 12px 20px;
  background: #1a237e;
  color: #fff;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease;
}
.form-actions button:hover {
  background: #0d155a;
}

/* === Success Modal Animation === */
#successModal {
  display: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}
#successModal.show {
  display: flex;
  opacity: 1;
}
/* Floating menu toggle button (mobile only) */
.floating-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1001;
  width: 50px;
  height: 50px;
  background: #007bff;
  color: white;
  border-radius: 50%;
  font-size: 24px;
  text-align: center;
  line-height: 50px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  cursor: pointer;
}

/* Show only on mobile */
@media (max-width: 768px) {
  .floating-toggle {
    display: block;
  }

  #sidebar {
    position: fixed;
    top: 60px; /* shift below the fixed header */
    left: -250px;
    width: 250px;
    height: calc(100% - 60px); /* subtract header height */
    background: #fff;
    z-index: 1000;
    transition: left 0.3s ease;
    box-shadow: 2px 0 5px rgba(0,0,0,0.2);
    overflow-y: auto;
  }

  #sidebar.active {
    left: 0;
  }

  .main-content {
    margin-left: 0 !important;
  }
}

