
/* General Styles */


body, html {
    margin: 0;
    padding: 0;
    width: 100%;
/*    border: 1px solid hotpink;*/
    font-family: Arial, sans-serif;
}

body.light-mode {
    background-color: #fff;
    color: #000;
}


/* Dark Mode Styles */
/*body.dark-mode {
    background: #333;
    color: #ffffff;
}

body.dark-mode .app-header {
    background: #333;
    color: #fff;
}

body.dark-mode .nav-link {
    color: #fff;
}

body.dark-mode .nav-link:hover {
    color: #ddd;
}
*/

/* Layout */
.main-container {
    display: flex;
    flex-direction: row;
}






/* Footer Styles */
.app-footer {
    background: #eee;
    padding: 6px 0px;
    text-align: center;
    position: relative;
    bottom: 0;
    width: 98%;
    margin: 0 auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-footer {
        padding: 20px 5px;
    }
}



















/* Header Styles */




/* ──────────────────────────────────────────────────────────────────────────────
   Variables
   ────────────────────────────────────────────────────────────────────────────── */
:root {
  /* Light mode */
  --bg-light:       #fff;
  --text-light:     #333;
  --card-bg-light:  #f9f9f9;

  /* Dark mode */
  --bg-dark:        #2b2b2b;
  --text-dark:      #eee;
  --card-bg-dark:   #333;

  /* Notifications */
  --notif-badge-bg: #d9534f;
  --notif-dot-bg:   #0275d8;

  --primary-light:   #0275d8;
  --primary-dark:    #66b2ff;

  /* Shadows */
  --shadow-light:   0 4px 8px rgba(0,0,0,0.1);
  --shadow-dark:    0 4px 12px rgba(0,0,0,0.5);
}

/* ──────────────────────────────────────────────────────────────────────────────
   Header & Navigation
   ────────────────────────────────────────────────────────────────────────────── */
.app-header {
  background: #eee;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-title img {
  height: 40px;
}

.logo-title h3 {
  margin: 0;
  font-size: 1.5rem;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-light);
  text-decoration: none;
}

.nav-link:hover {
  color: #000;
}

/* Dark Mode Toggle */
body.dark-mode .nav-link,
body.dark-mode .logo-title h3 {
  color: var(--text-dark);
}

/* ─────────────── Mobile ≤768px ─────────────── */
@media (max-width: 768px) {
  .app-header {
    display: flex;
    flex-direction: column;
    padding: 10px;
  }

  /* Top bar: menu, logo & actions */
  .header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 8px;
  }
  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  /* group notifications + dark toggle into one block */
  .header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  /* Center the logo/title in the middle of top bar */
  .logo-title {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  /* Bottom nav: full‑width, evenly spaced */
  .main-nav {
    display: flex;
    justify-content: space-around;
    width: 100%;
    border-top: 1px solid #ddd;
    padding-top: 6px;
  }
  .main-nav .nav-link {
    flex: 1;
    justify-content: center;
    text-align: center;
    padding: 8px 0;
  }
  /* hide link text if you prefer just icons */
  .main-nav .nav-link i + span,
  .main-nav .nav-link small {
    display: none;
  }
}


/* ──────────────────────────────────────────────────────────────────────────────
   Notifications & Dropdown
   ────────────────────────────────────────────────────────────────────────────── */

/* Container around bell icon */
.notif-container {
  position: relative;
  display: inline-block;
}

/* Bell toggle button */
#notifToggle {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  color: inherit;
}

/* Unread badge on the bell */
.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--notif-badge-bg);
  color: #fff;
  font-size: 0.75rem;
  border-radius: 50%;
  line-height: 1;
}

/* Notification menu (dropdown) */
.notif-menu {
  position: absolute;
  top: calc(100% + 4px);     /* just below the bell */
  right: 0;                  /* align right edge to bell */
  width: 280px;              /* fixed width on desktop */
  max-width: 80vw;           /* up to 80% on small screens */
  background: var(--bg-light);
  border-radius: 6px;
  box-shadow: var(--shadow-light);
  overflow: hidden;
  z-index: 1000;

  /* Hidden by default */
  visibility: hidden;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

/* Show dropdown: add “show” class via JS */
.notif-menu.show {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

/* Triangle arrow above dropdown */
.notif-menu::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 14px;    /* align under bell icon */
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid var(--bg-light);
}

/* Dark mode overrides for dropdown */
body.dark-mode .notif-menu {
  background: var(--bg-dark);
  box-shadow: var(--shadow-dark);
}
body.dark-mode .notif-menu::before {
  border-bottom-color: var(--bg-dark);
}

/* Notification list container */
.notif-menu ul {
  list-style: none;
  margin: 4px 4px;
  padding: 0;
  
  max-height: 320px;          /* fixed max height */
  overflow-y: auto;           /* scroll if more items */
}

/* Each notification item in dropdown */
.notif-menu li {
  position: relative;
  display: flex;
  flex-direction: column;
  
  border-bottom: 1px solid #eee;
  /*border: 1px solid hotpink;*/
  padding: 2px 4px;
  padding-bottom: 0;           /* footer’s own padding covers this */
  padding-right: 0;           /* footer’s own padding covers this */
}

.notif-menu li:hover {
  background-color: var(--erp-hover-row);
}
body.dark-mode .notif-menu li {
  border-bottom: 1px solid #444;
}

/* If no notifications */
.notif-menu li.empty {
  padding: 12px;
  text-align: center;
  color: #777;
  font-size: 0.9rem;
}

/* Link wrapper for dropdown item */
.notif-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  width: calc(100% - 32px); /* leave space for ✔ button */
}

/* Hover effect on dropdown item */
.notif-link:hover .notif-content,
.notif-link:hover .notif-footer {
  background: rgba(0, 0, 0, 0.55);
}
body.dark-mode .notif-link:hover .notif-content,
body.dark-mode .notif-link:hover .notif-footer {
  background: rgba(255, 255, 255, 0.05);
}

/* Top row: notification text */
.notif-content {
  padding: 6px 10px 4px 10px; /* reduced padding */
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.3;
}
body.dark-mode .notif-content {
  color: var(--text-dark);
}

/* Bottom row: “new dot” + timestamp */
.notif-footer {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 10px 6px 10px;
  font-size: 0.75rem;
}

/* “New” dot on dropdown item */
.new-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  background: var(--notif-dot-bg);
  border-radius: 50%;
  margin-right: 8px;
}

/* Placeholder to keep alignment when item is read */
.new-dot.placeholder {
  visibility: hidden;
}

/* Timestamp next to dot */
.timestamp {
  flex-grow: 1;
  color: #777;
}
body.dark-mode .timestamp {
  color: #aaa;
}

/* ✔ button to mark a dropdown item as read */
.mark-read-single {
  position: absolute;
  right: 12px;
  bottom: 8px;
  background: none;
  border: none;
  font-size: 0.85rem;
  color: #0275d8;
  cursor: pointer;
  line-height: 1;
}
.mark-read-single:hover {
  text-decoration: underline;
}

/* Placeholder for the ✔ button when already read */
.mark-read-single.placeholder {
  visibility: hidden;
}

/* “View all” link at bottom of dropdown */
.view-all {
  text-align: center;
  padding: 6px;
  background: var(--card-bg-light);
}
.view-all a {
  color: #0275d8;
  text-decoration: none;
  font-size: 0.9rem;
}
body.dark-mode .view-all {
  background: var(--card-bg-dark);
}
body.dark-mode .view-all a {
  color: #5bc0de;
}

/* ────── Center notif‑menu under bell on ≤768px ────── */


@media (max-width: 768px) {
  /* ── 1) Positioning Context & Z‑Index ── */
  .notif-container {
    position: relative;
    z-index: 1000;

  }

  /* ── 2) Center Dropdown + Polish ── */
  .notif-menu {
    position: absolute;            /* ensure it stays relative to .notif-container */
    top: calc(100% + 4px);         /* just below the bell */
    left: 50%;                     /* start at 50% of container */
    transform: translateX(-50%);   /* pull back by half its own width */
    width: 90vw;                   /* almost full screen */
    max-width: 320px;              /* but not wider than this */
    padding: 0;                    /* padding lives inside the ul/li */
    background: rgba(255,255,255,0.8);
    backdrop-filter: saturate(180%) blur(10px);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    overflow: hidden;
    margin-left: -100px;


  }

  /* Center the little arrow under the bell */
  .notif-menu::before {
    content: "";
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid rgba(255,255,255,0.8);
    backdrop-filter: saturate(180%) blur(10px);
  }

  /* ── 3) Backdrop behind the menu ── */
  .notif-container::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.2);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 900;
  }
  .notif-menu.show + .notif-container::after,
  .notif-container .notif-menu.show ~ ::after {
    opacity: 1;
    pointer-events: auto;
  }

  /* ── 4) List Styling ── */
  .notif-menu ul {
    list-style: none;
    margin: 0;
    padding: 8px 0;
    max-height: 60vh;
    overflow-y: auto;
  }
  .notif-menu li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    margin: 2px 4px;
    border-radius: 8px;
    transition: background 0.2s;
  }
  .notif-menu li.unread {
    background: rgba(0,123,255,0.1);
  }
  .notif-menu li:hover {
    background: rgba(0,0,0,0.05);
  }

  /* ── 5) Content & Timestamp ── */
  .notif-content {
    flex: 1;
    margin-right: 8px;
    font-size: 1rem;
    line-height: 1.4;
  }
  .timestamp {
    font-size: 0.75rem;
    opacity: 0.6;
  }

  /* ── 6) Slim Scrollbar ── */
  .notif-menu ul::-webkit-scrollbar {
    width: 6px;
  }
  .notif-menu ul::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 3px;
  }

  /* ── 7) “View all” Footer ── */
  .view-all {
    padding: 10px;
    text-align: center;
    background: rgba(0,0,0,0.03);
    border-top: 1px solid rgba(0,0,0,0.05);
  }
  .view-all a {
    font-weight: 500;
  }
}







/* In your main CSS file (e.g. public/css/style.css) */

/* ──────────────────────────────────────────────────────────────────────────────
   Notifications Index Page
   ────────────────────────────────────────────────────────────────────────────── */
.notifications-container {
  /* (if you need container‐specific styles, add them here) */
}

.notifications-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 800px;
  margin: 20px auto;
}

.notification-item {
  position: relative;
  background: var(--bg-light);
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-bottom: 12px;
  padding: 12px 40px 12px 12px; /* leave space on right for button */
  display: flex;
  flex-direction: column;
}

body.dark-mode .notification-item {
  background: var(--bg-dark);
  border-color: #444;
}

/* Unread items get a left border + light background */
.notification-item.unread {
  border-left: 4px solid var(--notif-dot-bg);
  background: rgba(0, 123, 255, 0.05);
}

body.dark-mode .notification-item.unread {
  background: rgba(0, 123, 255, 0.15);
}

.notification-item.read {
  opacity: 0.7;
}

.notification-item .content {
  color: var(--text-light);
  font-size: 1rem;
  margin-bottom: 6px;
}

body.dark-mode .notification-item .content {
  color: var(--text-dark);
}

.notification-item .timestamp {
  font-size: 0.85rem;
  color: #777;
}

body.dark-mode .notification-item .timestamp {
  color: #aaa;
}

.notification-item .notif-link {
  text-decoration: none;
  color: inherit;
}

.notification-item .notif-link:hover .content {
  text-decoration: underline;
}

/* ✔ button for “mark single as read” */
.mark-read-single {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1rem;
  color: #0275d8;
  cursor: pointer;
  line-height: 1;
}

.mark-read-single:hover {
  text-decoration: underline;
}














/* ──────────────────────────────────────────────────────────────────────────────
   Admin Template Editor & Preferences Forms
   ────────────────────────────────────────────────────────────────────────────── */
.template-editor,
.prefs-form {
  /*width: 700px;*/
  margin: 20px auto;
  background: var(--bg-light);
  /*border: 1px solid #ddd;*/
  border-radius: 6px;
  padding: 4px 2px;
}
body.dark-mode .template-editor,
body.dark-mode .prefs-form {
  background: var(--bg-dark);
  border-color: #444;
}

.template-editor label,
.prefs-form .checkbox-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--text-light);
}
body.dark-mode .template-editor label,
body.dark-mode .prefs-form .checkbox-group label {
  color: var(--text-dark);
}

.template-editor input[type="text"],
.template-editor textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: var(--bg-light);
  color: var(--text-light);
  font-family: inherit;
}
body.dark-mode .template-editor input[type="text"],
body.dark-mode .template-editor textarea {
  background: #3a3a3a;
  border-color: #555;
  color: var(--text-dark);
}

.template-editor button,
.prefs-form button {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.template-editor button {
  background: #0275d8;
  color: #fff;
}
.template-editor button:hover {
  background: #025aa5;
}
.prefs-form button {
  background: #5cb85c;
  color: #fff;
}
.prefs-form button:hover {
  background: #449d44;
}

/* Preferences checkbox group */
.checkbox-group {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}
.checkbox-group input {
  width: 16px;
  height: 16px;
  margin-right: 8px;
}


/* Base button */
.btn {
  display: inline-block;
  font-family: inherit;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  border-radius: 4px;
  border: 1px solid transparent;
  padding: 0.5em 1em;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

/* Small size */
.btn-sm {
  font-size: 0.85em;
  padding: 0.25em 0.75em;
}

/* Outline primary variant */
.btn-outline-primary {
  background: transparent;
  color: var(--primary-light);
  border-color: var(--primary-light);
}
.btn-outline-primary:hover {
  background: var(--primary-light);
  color: #fff;
}

/* Dark mode adjustments */
body.dark-mode {
  --btn-outline-primary-color: var(--primary-dark);
}
body.dark-mode .btn-outline-primary {
  color: var(--primary-dark);
  border-color: var(--primary-dark);
}
body.dark-mode .btn-outline-primary:hover {
  background: var(--primary-dark);
  color: var(--text-dark);
}















/* Preferences Form */
.prefs-form {
  max-width: 600px;
  margin: 2rem auto;
  padding: 2rem;
  background: var(--card-bg-light);
  border-radius: 8px;
  box-shadow: var(--shadow-light);
}

body.dark-mode .prefs-form {
  background: var(--card-bg-dark);
  box-shadow: var(--shadow-dark);
}

.prefs-form h2 {
  margin-bottom: 1.5rem;
  color: var(--text-light);
  font-size: 1.75rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.switch-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: var(--text-light);
}

body.dark-mode .switch-label {
  color: var(--text-dark);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  border-radius: 26px;
  transition: 0.3s;
}

.toggle-switch .slider::before {
  position: absolute;
  content: "";
  height: 20px; width: 20px;
  left: 3px; bottom: 3px;
  background-color: #fff;
  border-radius: 50%;
  transition: 0.3s;
}

.toggle-switch input:checked + .slider {
  background-color: var(--primary-light);
}

.toggle-switch input:checked + .slider::before {
  transform: translateX(24px);
}

.helper-text {
  margin: 0.3rem 0 0;
  font-size: 0.875rem;
  color: #666;
}

body.dark-mode .helper-text {
  color: #aaa;
}

.form-actions {
  text-align: right;
}

.btn-save {
  padding: 0.6rem 1.2rem;
  background: var(--primary-light);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
}

.btn-save:hover {
  background: darken(var(--primary-light), 10%);
}

/* Responsive */
@media (max-width: 480px) {
  .prefs-form {
    padding: 1rem;
  }
  .toggle-switch {
    width: 40px; height: 20px;
  }
  .toggle-switch .slider::before {
    height: 16px; width: 16px; left: 2px; bottom: 2px;
  }
}



























/*
.layout {
    display: flex;
}*/

/* Sidebar */
.sidebar {
    width: 200px;
    min-height: 80vh;
    background-color: #f4f4f4;
    padding: 4px;
    transition: transform 0.3s ease-in-out;
    z-index: 1000;
    padding-right: 0;
}

.sidebar nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar nav ul li {
    margin-bottom: 5px;
}

.sidebar nav ul li a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #333;
    padding: 10px 15px;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
}

.sidebar nav ul li a:hover {
    background-color: #e0e0e0;
}

.sidebar nav ul li.active a {
    background-color: #fff;
    font-weight: bold;
    font-size: 0.90rem;
    color: #000;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

.sidebar nav ul li a i {
    color: #666;
    transition: color 0.3s;
}

.sidebar nav ul li.active a i {
    color: #000;
}

/* Toggle Button */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1100;
    font-size: 24px;
    cursor: pointer;
    background-color: white;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

/* Main content */
.main-content {
    flex-grow: 1;
    padding: 20px;
}

/* Responsive: Collapse sidebar on small screens */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        overflow: auto;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        padding:12% 2%;
    }

    .sidebar.collapsed {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: block;
    }

    .main-content {
        padding-left: 10px;
    }
}




/* Sidebar overlay (for mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 999;
    transition: opacity 0.3s ease;
}

/* Show overlay when sidebar is active */
.sidebar.collapsed ~ .sidebar-overlay {
    display: block;
}







/* ── Sidebar Group Titles ───────────────────────────────────────────────────── */
.sidebar-group-title {
    font-size: 0.70rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #555;
    padding: 4px;      /* space above & below title */
    margin-top: 6px;            /* separate groups vertically */
    pointer-events: none;        /* titles aren’t clickable */
}

/* ── Sidebar Separators ─────────────────────────────────────────────────────── */
.sidebar-separator {
    height: 1px;
    background-color: #ddd;
    margin: 2px 0;
}

/* Ensure separators don’t add extra bottom margin after collapse */
.sidebar.collapsed .sidebar-separator {
    margin: 2px 0;
}

















.content {
    flex: 1;
    padding: 20px;
}


/* Navigation */
.main-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.main-nav a,
.main-nav button {
    text-decoration: none;
    color: #333;
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
}

.main-nav a.logout {
    /*color: red;*/
    font-weight: bold;
}


/* Dark mode JS toggle script (to be added inline or separate file) */



/* Header */
/*header {
    background: #eee;
    padding: 10px;
    text-align: center;
    position: relative;
}*/

/*header .logout {
    position: absolute;
    top: 10px;
    right: 10px;
}
*/
/* Login Page */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

.login-form h2 {
    text-align: center;
}

.login-form .error {
    color: red;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }
}




/* Flash message styling */
/* Flash message container */
#flash-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    z-index: 1000;
}

/* Flash message styling */
.alert {
    position: relative;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 5px;
    font-size: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-left: 5px solid #155724;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 5px solid #721c24;
}

/* Close button */
.closebtn {
    position: absolute;
    top: 10px;
    right: 15px;
    color: inherit;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
}

/* Progress bar */
.progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background-color: rgba(0, 0, 0, 0.2);
    width: 100%;
    animation: progressBar 4s linear forwards;
}

/* Animation for progress bar */
@keyframes progressBar {
    from { width: 100%; }
    to { width: 0; }
}




.remove-btn {
    background-color: red;
    color: white;
    border: none;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    font-weight: bold;
    cursor: pointer;
    margin-right: 8px;
}
.task_row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}










/* ========== GENERAL DARK MODE ========== */
body.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
    margin: 0;
    padding: 0;
    width: 100%;

}

/* ========== HEADER DARK MODE ========== */
body.dark-mode .app-header {
    background-color: #1e1e1e;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Nav link styles */
body.dark-mode .nav-link {
    color: #e0e0e0;
}

body.dark-mode .nav-link:hover {
    color: #ffffff;
}



/* ========== FOOTER DARK MODE ========== */
body.dark-mode .app-footer {
    background-color: #1e1e1e;
    color: #ccc;
    width: 99%;
    box-shadow: 0 -2px 4px rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ========== CONTENT AREA ========== */
body.dark-mode main,
body.dark-mode .main-content {
    background-color: #181818;
    box-shadow: 0 2px 6px rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    padding: 20px;
    margin: 10px;
}








/* ========== DARK MODE FOR MAIN CONTENT ========== */
body.dark-mode .main-content {
    background-color: #2b2b2b; /* Dark gray background like ChatGPT */
    color: #e0e0e0;
}

/* Main content area for dark mode */
body.dark-mode {
    background-color: #2b2b2b; /* dark charcoal, similar to ChatGPT */
    color: #e0e0e0;            /* light gray text */
}

/* Optional: lighten card or content boxes */
body.dark-mode main,
body.dark-mode .main-content {
    background-color: #383838;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}


















/* ========== DARK MODE FOR SIDEBAR ========== */
body.dark-mode .sidebar {
    background-color: #1e1e1e;
/*    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.5);*/
}

/* Sidebar nav links in dark mode */
body.dark-mode .sidebar nav ul li a {
    color: #ccc;
    background-color: transparent;
}

body.dark-mode .sidebar nav ul li a:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

body.dark-mode .sidebar nav ul li.active a {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    box-shadow: 0 0 5px rgba(255,255,255,0.05);
}

body.dark-mode .sidebar nav ul li.active a i {
    color: #fff;
}

/* Adjust sidebar icon color on hover */
body.dark-mode .sidebar nav ul li a i {
    color: #aaa;
}

body.dark-mode .sidebar nav ul li a:hover i {
    color: #fff;
}





body.dark-mode header,
body.dark-mode footer {
    background-color: #1f1f1f;
    color: #ddd;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

body.dark-mode .app-header .main-nav a,
body.dark-mode .app-header button {
    color: #ccc;
}






body,
.app-header,
.sidebar,
.app-footer,
.nav-link,
.main-content {
    transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}










/*------------------------------------------
  GLOBAL TABLE STYLES FOR ERP PROJECT
-------------------------------------------*/

/* 1) Light-mode variables */
:root {
  --erp-bg-page:      #f8f9fa;
  --erp-bg-table:     #ffffff;
  --erp-border:       #e0e0e0;
  --erp-text:         #555555;
  --erp-hover-row:    #f5f5f5;
  --erp-hover-add:    #e9ecef;
  --erp-blue:         #007bff;
  --erp-warning:      #ff8c00;
}

/* 2) Dark-mode overrides */
body.dark-mode {
  --erp-bg-page:   #1e1e1e;
  --erp-bg-table:  #2b2b2b;
  --erp-border:    #444444;
  --erp-text:      #cccccc;
  --erp-hover-row: #3a3a3a;
  --erp-hover-add: #444444;
  --erp-blue:      #4ea8de;
  --erp-warning:   #ffa502;
}

/* 3) Base on <body> */
/*body {
  background-color: var(--erp-bg-page);
  color: var(--erp-text);
}*/




/* 4) All tables */
table {
  width: 100%;
  border-collapse: collapse;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  background-color: var(--erp-bg-table);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

body.dark-mode table th{
    background-color: inherit;
    text-decoration-style: bold;
}

/* 5) Cells & headers */
table th,
table td {
  padding: 6px 8px;
  border: 1px solid var(--erp-border);
  text-align: left;
}

/* 6) Header row */
table th {
  background-color: #f2f2f2;
  color: var(--erp-text);
  font-weight: bold;
}

/* 7) Hover row */
table tbody tr:hover {
  background-color: var(--erp-hover-row);
}

/* 8) “Add-row” variant */
table tr.add-row td {
  text-align: left;
  color: var(--erp-blue);
  cursor: pointer;
  font-size: 0.8em;
}
table tr.add-row:hover td {
  background-color: var(--erp-hover-add);
}

/* 9) Utility badges & icons */
.badge {
  display: inline-block;
  padding: 5px 8px;
  border-radius: 5px;
  font-size: 0.9em;
}
.badge--wide {
  padding-left: 10px;
  padding-right: 10px;
}
.owner-icon {
  width: 24px; height: 24px;
  border-radius: 50%;
  background-color: #ccc;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8em;
  font-weight: bold;
  margin-right: 5px;
}
.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  margin-left: 5px;
  color: #777;
}
.icon-btn svg {
  width: 16px; height: 16px;
  fill: currentColor;
}
.warning {
  color: var(--erp-warning);
  margin-left: 5px;
}

/*------------------------------------------
  RESPONSIVE FALLBACK
-------------------------------------------*/
@media (max-width: 600px) {
  /* allow horizontal scroll */
  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
  }

  /* tighter cells on mobile */
  table th,
  table td {
    padding: 8px 10px;
    font-size: 0.85em;
  }
}


/*------------------------------------------
 TABLE Sty
-------------------------------------------*/

/* Add-task row */
    .add-task {
        color: #4ea8de;
        cursor: pointer;
        font-size: 1em;
        text-align: left;
    }
    .add-task:hover {
        font-size: 1.1em;
        transition: 0.4s;
    }

    /* --- Start of new CSS for row colors --- */
    .task-row-overdue {
        background-color: #ffebee; /* Light red/pink for overdue */
        color: #c62828;            /* Darker red text for overdue */
    }
    .task-row-due-soon {
        background-color: #fffde7; /* Light yellow for due soon (e.g., within 1 days) */
        color: #fbc02d;            /* Darker yellow/orange text */
    }
    .task-row-done {
        background-color: #e8f5e9; /* Light green for done */
        color: #388e3c;            /* Darker green text */
    }
    .task-row-cancelled {
        background-color: #eceff1; /* Light grey for cancelled */
        color: #78909c;            /* Muted grey text */
        text-decoration: line-through; /* Optional: strikethrough for cancelled tasks */
    }
    .task-row-overdue:hover,
    .task-row-due-soon:hover,
    .task-row-done:hover,
    .task-row-cancelled:hover {
        opacity: 0.9;
        transition: opacity 0.2s ease-in-out;
    }























/* assets/css/style.css */

.autologout-modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
    justify-content: center; /* Center horizontally */
    align-items: center; /* Center vertically */
}

.autologout-modal-content {
    background-color: #fefefe;
    margin: auto; /* For older browsers, flex box handles centering */
    padding: 20px;
    border: 1px solid #888;
    width: 80%; /* Could be responsive */
    max-width: 500px; /* Max width for larger screens */
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
    text-align: center;
    border-radius: 8px;
    color: #333; /* Default text color */
}

/* Dark mode adjustments for the modal content */
body.dark-mode .autologout-modal-content {
    background-color: #333; /* Darker background */
    color: #eee; /* Lighter text */
    border-color: #555;
}

.autologout-modal-content h2 {
    color: #e74c3c; /* Alert color */
    margin-bottom: 15px;
}

body.dark-mode .autologout-modal-content h2 {
    color: #ff7f50; /* A warmer alert color for dark mode */
}


.autologout-modal-content p {
    margin-bottom: 10px;
    line-height: 1.5;
}

#autologout-countdown {
    font-size: 1.2em;
    font-weight: bold;
    color: #3498db; /* Highlight countdown */
}

body.dark-mode #autologout-countdown {
    color: #6daceb; /* A brighter blue for dark mode */
}

.autologout-modal-actions {
    margin-top: 20px;
}

.autologout-modal-actions button {
    background-color: #4CAF50; /* Green */
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.autologout-modal-actions button:hover {
    background-color: #45a049;
}

body.dark-mode .autologout-modal-actions button {
    background-color: #28a745; /* Darker green for dark mode */
}

body.dark-mode .autologout-modal-actions button:hover {
    background-color: #218838;
}


.top_controls {
  display: flex;
  justify-content: space-between;
  align-items: flex-start; /* keeps filter top-aligned with buttons */
  flex-wrap: wrap;         /* allow wrapping on smaller devices */
  gap: 1rem;               /* space between form and buttons when wrapped */
  margin-bottom: 1rem;
  align-items: center;
}

.filter_row { display:flex; gap:1rem; flex-wrap:wrap;}