/* Global Variables */
:root {
  --primary-color: #00897b; /* Teal Green */
  --secondary-color: #e0f2f1; /* Light Mint/White */
  --text-color: #333;
  --bg-color: #f4f6f8;
  --sidebar-width: 250px;
  --header-height: 60px;
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  margin: 0;
  padding: 0;
  color: var(--text-color);
  background-color: var(--bg-color);
  display: flex;
  height: 100vh;
  overflow: hidden; /* Prevent body scroll, handle in main-content */
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: #fff;
  border-right: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  padding: 20px;
  position: fixed;
  height: 100%;
  z-index: 100;
  overflow-y: auto;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 40px;
  display: flex;
  align-items: center;
}

.nav-item {
  padding: 10px 15px;
  margin-bottom: 5px;
  color: #555;
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-item:hover,
.nav-item.active {
  background-color: var(--secondary-color);
  color: var(--primary-color);
  font-weight: 500;
}

/* Sub-menu styling */
.nav-group {
    margin-bottom: 5px;
}

.nav-toggle {
    cursor: pointer;
    justify-content: space-between;
}

.sub-menu {
    display: none;
    padding-left: 20px;
    margin-top: 2px;
}

.sub-menu.open {
    display: block;
}

.sub-menu .nav-item {
    font-size: 0.9rem;
    padding: 8px 15px;
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: calc(100% - var(--sidebar-width));
  position: relative;
  z-index: 1;
}

/* Header */
.top-header {
  height: var(--header-height);
  background-color: #fff;
  border-bottom: 1px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-title {
  font-size: 1.2rem;
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 32px;
  height: 32px;
  background-color: var(--primary-color);
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

/* Page Content */
.page-content {
  padding: 30px;
  overflow-y: auto;
  flex: 1; /* Allow content to grow and scroll */
}

/* Components */
.card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
}

.btn {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  opacity: 0.9;
}

/* Search Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: flex-start;
    justify-content: center;
    padding-top: 100px;
}

.modal-overlay.open {
    display: flex;
}

.search-modal {
    background: white;
    width: 600px;
    max-width: 90%;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.search-input-container {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-input-container svg {
    color: #888;
}

#global-search-input {
    width: 100%;
    border: none;
    font-size: 1.1rem;
    outline: none;
    padding: 5px;
}

.search-results {
    padding: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.search-result-item {
    padding: 10px 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-color);
}

.search-result-item:hover, .search-result-item.selected {
    background-color: var(--secondary-color);
}

.search-footer {
    padding: 10px 15px;
    background: #f9f9f9;
    border-top: 1px solid #eee;
    font-size: 0.8rem;
    color: #888;
    display: flex;
    justify-content: space-between;
}

/* Utilities */
.text-teal {
  color: var(--primary-color);
}
.mt-4 {
  margin-top: 1rem;
}
.flex {
  display: flex;
}
.justify-between {
  justify-content: space-between;
}
.items-center {
  align-items: center;
}
.gap-4 {
  gap: 1rem;
}
