/* =========================
   head.css — Lean Minimal Unified Theme
   ========================= */

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

body {
  background: #fff;
  color: #444;
  font-size: 11px;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
}

/* Header */
.header {
  height: 82px;
  background: #fff;
  border-bottom: 1px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 50;
}
.header-left img {
  height: 30px;
}
.header-right a {
  font-size: 11px;
  text-decoration: none;
  color: #444;
  background: #f2f2f2;
  padding: 5px 10px;
  border-radius: 5px;
}
.header-right a:hover {
  background: #e0e0e0;
}


/* Two-column Layout */
.main-container {
  display: grid;
  grid-template-columns: 17% 83%;
  height: calc(100vh - 52px);
  margin-top: 52px;
}

/* Sidebar */
.sidebar {
  background: #fff;
  border-right: 1px solid #e5e5e5;
  padding: 8px 6px;
  overflow: auto;
}
.sidebar-title {
  font-size: 10.5px;
  color: #666;
  text-align: center;
  margin-bottom: 6px;
  font-weight: 300;
}
.sidebar button {
  all: unset;
  display: flex;
  align-items: center;
  gap: 5px;
  width: 92%;
  margin: 2px auto;
  padding: 2px 4px;
  background: #fff;
  border: none;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 300;
  color: #444;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.sidebar button:hover {
  background: #f5f5f5;
}
.sidebar button.active,
.sidebar button:focus {
  background: #fff !important;
  color: #444 !important;
  font-weight: 300 !important;
  border: none !important;
  box-shadow: none !important;
}
.sidebar img {
  width: 13px;
  height: 13px;
  object-fit: contain;
}
.sidebar hr {
  border: none;
  border-top: 1px solid #eee;
  margin: 6px 4px;
}
.logout-btn {
  margin: 10px auto;
  width: 85%;
  background: #eee;
  color: #333;
  border: 1px solid #ccc;
  padding: 5px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 10.5px;
  font-weight: 300;
  transition: all 0.15s;
}
.logout-btn:hover {
  background: #ddd;
}

/* Right Column Content */
.right-column {
  background: #fff;
  padding: 12px;
  overflow-y: auto;
}

/* Section Titles */
.section-title {
  font-size: 12px;
  color: #666;
  font-weight: 400;
  margin-bottom: 8px;
}

/* Buttons */
button, .small-btn, .btn {
  background: #eee;
  color: #333;
  border: 1px solid #ddd;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 300;
  cursor: pointer;
  transition: background 0.15s, border 0.15s;
}
button:hover, .small-btn:hover, .btn:hover {
  background: #e0e0e0;
  border-color: #ccc;
}

/* Inputs / Form Fields */
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="datetime-local"], select, textarea {
  width: 100%;
  padding: 5px 7px;
  border-radius: 5px;
  border: 1px solid #ccc;
  background: #fafafa;
  font-size: 10.5px;
  color: #444;
  font-weight: 300;
  outline: none;
  margin-bottom: 8px;
  transition: border 0.15s, background 0.15s;
}
input:focus, select:focus, textarea:focus {
  border-color: #777;
  background: #fff;
}

/* List Boxes (Expense Entry) */
.list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 6px;
  margin: 6px 0 10px 0;
}
.list-box {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 5px 3px;
  cursor: pointer;
  text-align: center;
  font-size: 10.5px;
  font-weight: 300;
  color: #444;
  transition: background 0.15s, border 0.15s;
}
.list-box:hover {
  background: #f5f5f5;
  border-color: #ccc;
}
.list-box.selected {
  background: #f0f0f0;
  border: 1px solid #999;
  color: #222;
}
.search-input {
  width: 100%;
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid #ccc;
  font-size: 10.5px;
  color: #333;
  background: #fbfbfb;
  margin-bottom: 6px;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10.5px;
  margin: 6px 0;
}
thead {
  background: #fafafa;
  border-bottom: 1px solid #eee;
}
th, td {
  padding: 6px 8px;
  border-bottom: 1px solid #eee;
  color: #444;
  font-weight: 300;
  text-align: left;
}
tr:hover {
  background: #f9f9f9;
}

/* Misc */
.message, .success-msg {
  text-align: center;
  font-size: 10.5px;
  color: #555;
  padding: 6px;
  border-radius: 4px;
  margin: 6px auto;
}
.success-msg {
  background: #f3fff3;
  color: #2a7a2a;
  border: 1px solid #bfe6bf;
}
.footer {
  text-align: center;
  background: #fafafa;
  padding: 8px;
  font-size: 10px;
  color: #666;
  border-top: 1px solid #e5e5e5;
}

/* Responsive */
@media (max-width: 768px) {
  body { font-size: 10px; }
  .sidebar { width: 150px; }
  .header { padding: 0 10px; }
  .main-container { grid-template-columns: 160px auto; }
}
@media (max-width: 480px) {
  /* Hide sidebar only until opened */
  .sidebar {
    position: fixed;
    top: 60px;
    left: -250px;
    width: 220px;
    height: calc(100vh - 60px);
    background: #fff;
    border-right: 1px solid #ccc;
    overflow-y: auto;
    z-index: 999;
    transition: left 0.3s ease-in-out;
  }

  /* When menu is open, slide it in */
  .sidebar.open {
    display: block !important;
    left: 0;
  }

  /* Show toggle button */
  .sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 12px;
    left: 10px;
    background: #0096FF;
    color: white;
    font-size: 20px;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    z-index: 1000;
    cursor: pointer;
  }

  /* Dim background when sidebar is open */
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 998;
  }

  .sidebar-overlay.show {
    display: block;
  }

  .left-column {
    width: 100%;
  }
}


/* =========================
   Persistent Sidebar (Home.php)
   ========================= */

/* Layout */
.main-container {
  display: grid;
  grid-template-columns: 18% 82%;
  height: calc(100vh - 60px);
  margin-top: 60px;
}

/* Header */
.header {
  height: 60px;
  background: #fff;
  border-bottom: 1px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 20;
}
.header-left img {
  height: 38px;
}
.header-right a {
  font-size: 13px;
  text-decoration: none;
  color: #444;
  background: #f2f2f2;
  padding: 6px 12px;
  border-radius: 6px;
}
.header-right a:hover {
  background: #ddd;
}

/* Sidebar Wrapper 
.left-column {
  background: #fff;
  border-right: 1px solid #ddd;
  padding: 10px 0;
  overflow: hidden; 
} */

.left-column {
  background: #fff;
  border-right: 1px solid #ddd;
  padding: 4px 0;         /* ↓ reduced padding */
  height: auto;           /* expands fully */
  overflow: visible;      /* no scrollbar */
}


/* Sidebar content */
.sidebar {
  padding: 8px 6px;
}
.sidebar-title {
  font-size: 12px;
  color: #555;
  text-align: center;
  margin-bottom: 8px;
  font-weight: 400 !important;
}

/* Sidebar buttons */
body .sidebar button,
body .sidebar button.active,
body .sidebar button:focus {
  all: unset;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 92%;
  margin: 3px auto;
  padding: 6px 8px;
  background: #fff;
  border: none;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 400 !important;
  color: #333;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
body .sidebar button:hover {
  background: #f5f5f5;
}
body .sidebar button.active {
  background: #fff !important;
  border: none !important;
  color: #333 !important;
  font-weight: 400 !important;
}

/* Sidebar images */
.sidebar img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

/* Sidebar hr line */
.sidebar hr {
  border: none;
  border-top: 1px solid #eee;
  margin: 8px 5px;
}

/* Logout Button */
.logout-btn {
  display: block;
  margin: 10px auto;
  width: 85%;
  background: gray;
  color: #fff;
  border: none;
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 400;
  text-align: center;
}
.logout-btn:hover {
  background: #333;
}

/* Right column */
.right-column {
  background: #fff;
  padding: 20px;
  overflow-y: auto;
}
.section-title {
  font-size: 14px;
  color: gray;
  font-weight: 400;
  margin-bottom: 10px;
}

/* ===== Header Container ===== */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 25px;
  background-color: #fff;
  border-bottom: 1px solid #e3e3e3;
  font-family: 'Poppins', sans-serif;
}


/* Header container */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 25px;
  background: #fff;
  border-bottom: 1px solid #e6e6e6;
  font-family: 'Poppins', sans-serif;
  flex-wrap: wrap; /* Prevent breaking on small screens */
}

/* Logo (left) */
.logo img {
  width: 45px;
  height: 45px;
  object-fit: contain;
  display: block;
}

/* Navigation (right) */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.nav-menu a {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #333;
  text-decoration: none;
  font-size: 15px;
  font-weight: 400;
  transition: color 0.2s ease;
}

.nav-menu a:hover {
  color: #0078ff;
}

.nav-menu img {
  width: 18px;
  height: 18px;
  vertical-align: middle;
}

/* Responsive: stack vertically on small screens */
@media (max-width: 700px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-menu {
    margin-top: 10px;
    gap: 15px;
  }
}

/* ===========================
   ✅ Responsive Sidebar for Mobile
   =========================== */
@media (max-width: 900px) {
  .main-container {
    display: block;
    margin-top: 60px; /* leave space for header */
  }

  .sidebar {
    position: fixed;
    top: 60px; /* adjust based on header height */
    left: -260px;
    width: 240px;
    height: calc(100vh - 60px);
    background: #fff;
    border-right: 1px solid #ccc;
    overflow-y: auto;
    z-index: 999;
    transition: left 0.3s ease-in-out;
  }

  .sidebar.open {
    left: 0;
  }

  .sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 12px;
    left: 10px;
    background: #0096FF;
    color: white;
    font-size: 18px;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    z-index: 1000;
    cursor: pointer;
  }

  /* Dark overlay when sidebar open */
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 998;
  }
  .sidebar-overlay.show {
    display: block;
  }

  /* Hide sidebar by default on mobile */
  .left-column {
    width: 100%;
  }
}

