@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

/* =========================
   Brand Variables
   ========================= */
:root {
  --primary: #01A200;
  --primary-dark: #009000;
  --text: #222;
  --muted-text: #666;
  --background: #ffffff;
  --page-bg: #f8f8f8;
  --card-bg: #ffffff;
  --border: #e0e0e0;
  --danger: #b00020;
}

/* =========================
   Base Reset
   ========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--page-bg);
  color: var(--text);
  line-height: 1.6;
}

/* =========================
   Containers
   ========================= */
.container {
  max-width: 1200px;
  margin: auto;
  padding: 0 20px;
}

/* =========================
   Top Bar
   ========================= */
.topbar {
  background: var(--primary);
  color: white;
  padding: 16px 0;
}

.header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 1.4em;
  font-weight: 600;
}

.brand-sub {
  font-size: 0.85em;
  opacity: 0.9;
}

/* =========================
   Logout Button
   ========================= */
.logout-btn {
  background: white;
  color: var(--primary);
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  cursor: pointer;
}

.logout-btn:hover {
  opacity: 0.85;
}

/* =========================
   App Layout
   ========================= */
.app-layout {
  display: flex;
  min-height: calc(100vh - 140px);
}

/* =========================
   Sidebar
   ========================= */
.sidebar {
  width: 260px;
  background: #ffffff;
  border-right: 1px solid var(--border);
  padding: 20px;
}

.sidebar nav button {
  display: block;
  width: 100%;
  text-align: left;
  background: #f4f4f4;
  border: none;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.sidebar nav button:hover {
  background: var(--primary);
  color: white;
}

/* =========================
   Main Content
   ========================= */
.main-content {
  flex: 1;
  padding: 30px 40px;
}

.main-content h1 {
  font-size: 1.9em;
  margin-bottom: 24px;
}

/* =========================
   Grid & Cards
   ========================= */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.card h3 {
  font-size: 1.1em;
  margin-bottom: 12px;
  color: var(--primary);
}

.card p {
  font-size: 0.95em;
  margin-bottom: 8px;
}

/* =========================
   Forms (Profile Edit)
   ========================= */
label {
  font-size: 0.85em;
  font-weight: 600;
}

input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-family: 'Poppins', sans-serif;
  font-size: 0.95em;
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
}

/* =========================
   Buttons
   ========================= */
button {
  font-family: 'Poppins', sans-serif;
}

.card button {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
}

.card button:hover {
  background: var(--primary-dark);
}

/* =========================
   Status Messages
   ========================= */
#profileMsg {
  font-size: 0.85em;
}

/* =========================
   Footer
   ========================= */
.footer {
  background: #111;
  color: #eee;
  text-align: center;
  padding: 18px 10px;
  font-size: 0.8em;
}

/* =========================
   Responsive
   ========================= */
@media (max-width: 900px) {
  .app-layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .main-content {
    padding: 24px;
  }
}

/* =========================
   Tables (Leave)
   ========================= */
.table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.table th,
.table td {
  padding: 12px 14px;
  font-size: 0.9em;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table th {
  background: #f4f4f4;
  font-weight: 600;
}

.table tr:last-child td {
  border-bottom: none;
}

/* Status pills */
.status {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75em;
  font-weight: 600;
  display: inline-block;
}

.status.pending {
  background: #fff3cd;
  color: #856404;
}

.status.approved {
  background: #d4edda;
  color: #155724;
}

.status.rejected {
  background: #f8d7da;
  color: #721c24;
}

/* Action buttons */
.action-btn {
  padding: 6px 12px;
  font-size: 0.8em;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

.approve-btn {
  background: #01A200;
  color: white;
}

.reject-btn {
  background: #b00020;
  color: white;
}

.action-btn + .action-btn {
  margin-left: 6px;
}

/* =========================
   Forms (Leave Request)
   ========================= */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 0.85em;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-family: 'Poppins', sans-serif;
  font-size: 0.95em;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-actions {
  margin-top: 16px;
}

.form-actions button {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
}

.form-actions button:hover {
  background: var(--primary-dark);
}
