:root {
  /* Light Theme Variables */
  --bg-color: #fff;
  --text-color: #333;
  --accent-color: #ff6900;
  --box-bg: #fff;
  --box-border: #eee;
  --hover-bg: #f9f9f9;
  --status-green: #2ecc71;
  --status-orange: #ff6900;
  --status-red: #dc3545;
  --header-bg: #ff6900;
  --header-text-color: #fff;
  --switch-bg: #ddd;
  --switch-handle-bg: #fff;
  --btn-hover-bg: #e05f00;
}
body.dark-theme {
  /* Dark Theme Overrides */
  --bg-color: #1a1a1a;
  --text-color: #fff;
  --box-bg: #2a2a2a;
  --box-border: #444;
  --hover-bg: #333;
  --header-bg: #111;
  --header-text-color: #ff6900;
  --switch-bg: #444;
  --switch-handle-bg: #ff6900;
  --btn-hover-bg: #c23f00;
}
/* Global Reset & Font */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Cairo', sans-serif;
}
body {
  background: var(--bg-color);
  color: var(--text-color);
  transition: background 0.3s ease, color 0.3s ease;
}
.mr-1{
  margin-right: 1em;
}
.custom-radio [type="radio"] {
  visibility: hidden; /* hide default radio button */
/* you may need to adjust margin here, too */
}
.custom-radio [type="radio"]::before { /* create pseudoelement */
  border: 2px solid  var(--accent-color); /* thickness, style, color */
  height: .9em; /* height adjusts with font */
  width: .9em; /* width adjusts with font */
  border-radius: 50%; /* make it round */
  display: block; /* or flex or inline-block */
  content: " "; /* won't display without this */
  cursor: pointer; /* appears clickable to mouse users */
  visibility: visible; /* reverse the 'hidden' above */
}
.pagination-wrapper{
    display: flex;justify-content: center;margin-top: 20px;
}
/* Light/Dark theme pagination styles */
.pagination-wrapper .pagination {
    background-color: var(--box-bg);
    border-radius: 5px;
    padding: 8px;
}

.pagination-wrapper .page-item .page-link {
    color: var(--text-color);
    background-color: var(--box-bg);
    border: 1px solid var(--box-border);
    margin: 0 2px;
    transition: background-color 0.3s;
}

.pagination-wrapper .page-item.active .page-link {
    background-color: #ff6900;
    border-color: #ff6900;
    color: #fff;
}

.pagination-wrapper .page-item .page-link:hover {
    background-color: var(--hover-bg);
    color: var(--text-color);
    border-color: var(--box-border);
}
.custom-radio [type="radio"]:checked::before { /* selected */
 background: radial-gradient( var(--accent-color) 36%, transparent 38%);
}
.radio-list-right{
  padding: 1em 0em;
}

.check-list-right input[type=checkbox], .radio-list-right input[type=radio], .check-list-left input[type=checkbox], .radio-list-left input[type=radio] {
  opacity: 0;
  float: left;
  width: 1px;
  margin: 0;
}
.check-list-right input[type=checkbox] + label, .radio-list-right input[type=radio] + label, .check-list-left input[type=checkbox] + label, .radio-list-left input[type=radio] + label {
  position: relative;
  margin: 0;
  display: block;
  width: 100%;
  padding: 10px;
  /* color: #fff; */
  background: var(--bg-color);
  border: 1px solid #eee;
  border-radius: 6px;
}
.check-list-right input[type=checkbox] + label:before, .radio-list-right input[type=radio] + label:before, .check-list-left input[type=checkbox] + label:before, .radio-list-left input[type=radio] + label:before {
  content: "";
  position: absolute;
  top: 50%;
  background: #ddd;
  border: 1px solid #aaa;
}
.check-list-right input[type=checkbox]:checked + label, .radio-list-right input[type=radio]:checked + label, .check-list-left input[type=checkbox]:checked + label, .radio-list-left input[type=radio]:checked + label {
  color: var(--accent-color);
}
.check-list-right input[type=checkbox]:checked + label:before, .radio-list-right input[type=radio]:checked + label:before, .check-list-left input[type=checkbox]:checked + label:before, .radio-list-left input[type=radio]:checked + label:before {
  background: var(--accent-color);
  border-color: var(--accent-color);
}
.check-list-right input[type=checkbox]:disabled + label, .radio-list-right input[type=radio]:disabled + label, .check-list-left input[type=checkbox]:disabled + label, .radio-list-left input[type=radio]:disabled + label {
  color: #ccc;
}
.check-list-right input[type=checkbox]:disabled + label:before, .radio-list-right input[type=radio]:disabled + label:before, .check-list-left input[type=checkbox]:disabled + label:before, .radio-list-left input[type=radio]:disabled + label:before {
  background: rgba(204, 204, 204, 0.5);
  border: 2px dotted #ccc;
}
.check-list-right input[type=checkbox]:focus + label, .radio-list-right input[type=radio]:focus + label, .check-list-left input[type=checkbox]:focus + label, .radio-list-left input[type=radio]:focus + label {
  box-shadow: inset 0 0 3px #eee;
}


.radio-list-right input[type=radio] + label {
  padding-right: 50px;
}
.radio-list-right input[type=radio] + label:before {
  height: 20px;
  width: 20px;
  margin-top: -11px;
  right: 10px;
  border-radius: 100%;
}
.text-cap{
  text-transform: capitalize;
}

/* Fixed Top Bar */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--header-bg);
  color: var(--header-text-color);
  padding: 10px 20px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
  z-index: 1000;
}
.top-bar-left,
.top-bar-center,
.top-bar-right {
  display: flex;
  align-items: center;
}
.top-bar-left {
  gap: 20px;
}
.top-bar-center {
  flex-grow: 1;
  justify-content: center;
}
.top-bar-right {
  gap: 20px;
}
/* App Name with Light Static Glow */
.app-name {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--accent-color);
  text-shadow: 0 0 5px var(--accent-color), 0 0 10px var(--accent-color);
}
/* Theme Switch */
.theme-switch {
  display: flex;
  align-items: center;
  cursor: pointer;
}
.theme-switch label {
  margin-right: 8px;
  font-weight: 600;
  font-size: 0.9rem;
}
.theme-switch input[type="checkbox"] {
  width: 40px;
  height: 20px;
  appearance: none;
  background: var(--switch-bg);
  border-radius: 20px;
  position: relative;
  outline: none;
  cursor: pointer;
  transition: background 0.3s ease;
}
.theme-switch input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: var(--switch-handle-bg);
  border-radius: 50%;
  transition: transform 0.3s ease;
}
.theme-switch input[type="checkbox"]:checked::before {
  transform: translateX(20px);
}
/* Top Bar Logo */
.top-bar-logo img {
  height: 60px;
  object-fit: contain;
}
/* Buttons in Top Bar */
.top-bar-button {
  text-decoration: none;
  background: #fff;
  color: var(--accent-color);
  border: none;
  border-radius: 5px;
  padding: 6px 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.3s ease, color 0.3s ease;
}
.top-bar-button:hover {
  background: #f2f2f2;
}
/* Container */
.container {
  margin-top: 100px;
  margin-bottom: 100px;
  max-width:100%;  
}
/* .container {
  width: auto;
  margin: 100px 20px 20px;
} */
/* Sections */
.section {
  display: none;
}
.section.active {
  display: block;
}
/* Add Case Form */
.add-case-form {
  background: var(--box-bg);
  border: 1px solid var(--box-border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 30px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.add-case-form:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.add-case-form h2 {
  margin-bottom: 15px;
  color: var(--accent-color);
  font-size: 1.2rem;
}
.form-row {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 15px;
}
.form-row label {
  width: 130px;
  font-weight: 600;
  margin-right: 10px;
}
.form-row input,
.form-row textarea,
.form-row select
{
  flex: 1;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  transition: border 0.3s ease;
  background: transparent;
  color: inherit;
}
.form-row input:focus,
.form-row textarea:focus {
  border-color: var(--accent-color);
  outline: none;
}
.add-case-form button {
  background: var(--accent-color);
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 10px 20px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s ease;
}
.add-case-form button:hover {
  background: var(--btn-hover-bg);
}
/* Case List */
.case-list {
  background: var(--box-bg);
  border: 1px solid var(--box-border);
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.08);
  margin-bottom: 30px;
  /* Removed overflow to allow table to expand */
}
.case-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--hover-bg);
  border-bottom: 1px solid var(--box-border);
  padding: 15px 20px;
}
.case-list-header h2 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--accent-color);
  font-weight: 600;
}
.case-list-header div {
  font-size: 0.95rem;
  color: var(--text-color);
}
.case-list-table {
  width: 100%;
  border-collapse: collapse;
}
.case-list-table thead {
  background: var(--hover-bg);
}
.case-list-table th,
.case-list-table td {
  text-align: left;
  padding: 12px 15px;
  border-bottom: 1px solid var(--box-border);
}
.case-list-table tbody tr:hover {
  background: var(--hover-bg);
}
/* Status Indicator */
.status-indicator {
  font-weight: 600;
  color: #fff;
  padding: 5px 8px;
  border-radius: 5px;
  display: inline-block;
}
.status-green { background: var(--status-green); }
.status-orange { background: var(--status-orange); }
.status-red { background: var(--status-red); }
/* Action Buttons */
.btn {
  padding: 7px 12px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.85rem;
  margin-right: 5px;
  transition: background 0.3s ease;
  position: relative;
}
.btn-view {
  background: var(--accent-color);
  color: #fff;
}
.btn-view:hover {
  background: var(--btn-hover-bg);
}
.btn-edit {
  background: #007bff;
  color: #fff;
}
.btn-edit:hover {
  background: #0056b3;
}
/* "Updates" Popup */
.view-btn-container {
  position: relative;
  display: inline-block;
}
.updates-popup {
  position: absolute;
  top: 110%;
  left: 0;
  background: var(--box-bg);
  border: 1px solid var(--box-border);
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  width: 250px;
  padding: 10px;
  z-index: 9999;
  visibility: hidden;
  opacity: 0;
  transform: translateY(10px);
  transition: visibility 0.3s, opacity 0.3s, transform 0.3s;
}
.updates-popup.show {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}
.updates-popup h4 {
  margin-bottom: 8px;
  color: var(--accent-color);
  font-size: 0.95rem;
  position: relative;
  padding-right: 20px;
}
.updates-popup p {
  font-size: 0.85rem;
  border-bottom: 1px dashed #ccc;
  padding-bottom: 5px;
  margin-bottom: 5px;
  color: var(--text-color);
}
.popup-close-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  background: transparent;
  border: none;
  font-size: 1rem;
  color: var(--accent-color);
  cursor: pointer;
}
/* EDIT MODAL */
.modal-overlay {
  position: fixed;
  top: 0; 
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}
.modal-overlay.show {
  display: flex;
}
.edit-modal {
  background: var(--box-bg);
  border: 1px solid var(--box-border);
  border-radius: 8px;
  width: 600px;
  max-width: 90%;
  padding: 20px;
  position: relative;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  transform: translateY(20px);
  opacity: 0;
  animation: fadeInUp 0.4s forwards;
}
@keyframes fadeInUp {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
.edit-modal h2 {
  margin-bottom: 20px;
  color: var(--accent-color);
}
.close-edit-modal {
  position: absolute;
  top: 15px;
  right: 15px;
  background: #ccc;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  transition: background 0.3s ease;
}
.close-edit-modal:hover {
  background: #bbb;
}
.edit-form-row {
  display: flex;
  margin-bottom: 15px;
  align-items: center;
}
.edit-form-row label {
  width: 130px;
  font-weight: 600;
  margin-right: 10px;
}
.edit-form-row input,
.edit-form-row textarea {
  flex: 1;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  background: transparent;
  color: inherit;
  transition: border 0.3s ease;
}
.edit-form-row input:focus,
.edit-form-row textarea:focus {
  border-color: var(--accent-color);
  outline: none;
}
.save-changes-btn,
.cancel-changes-btn {
  background: var(--accent-color);
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 10px 20px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s ease;
  margin-top: 10px;
  margin-right: 10px;
}
.save-changes-btn:hover,
.cancel-changes-btn:hover {
  background: var(--btn-hover-bg);
}
/* Checkbox to close case in edit modal */
.edit-close-checkbox {
  margin-top: 15px;
  display: flex;
  align-items: center;
}
.edit-close-checkbox input[type="checkbox"] {
  margin-right: 8px;
  cursor: pointer;
}
/* Edit Modal - Updates Section */
.edit-updates-section {
  margin-top: 20px;
  border-top: 1px solid var(--box-border);
  padding-top: 15px;
}
.edit-updates-section h3 {
  margin-bottom: 10px;
  color: var(--accent-color);
  font-size: 1rem;
}
.edit-updates-list {
  max-height: 150px;
  overflow-y: auto;
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 10px;
  background: var(--hover-bg);
  margin-bottom: 10px;
}
.edit-updates-list p {
  font-size: 0.85rem;
  border-bottom: 1px dashed #ccc;
  padding-bottom: 5px;
  margin-bottom: 5px;
}
.add-update-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}
.add-update-row input {
  flex: 1;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  background: transparent;
  color: inherit;
  transition: border 0.3s ease;
}
.add-update-row input:focus {
  border-color: var(--accent-color);
  outline: none;
}
.add-update-btn {
  background: var(--accent-color);
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 10px 15px;
  cursor: pointer;
  transition: background 0.3s ease;
}
.add-update-btn:hover {
  background: var(--btn-hover-bg);
}
.btn-primary{
  background-color: #ff6900;
}
.btn-primary:hover {
  color: #fff;
  background-color: #f06402;
  border-color: #ff6900;
}
/* Search Container Styles */
.search-container {
  position: fixed;
  top: 70px;
  right: 520px;
  background: var(--box-bg);
  border: 1px solid var(--box-border);
  padding: 10px;
  border-radius: 5px;
  z-index: 1001;
}
.search-container input {
  padding: 5px;
  border: 1px solid var(--box-border);
  border-radius: 3px;
  width: 200px;
}
.search-container button {
  margin-left: 5px;
  background: var(--accent-color);
  color: #fff;
  border: none;
  border-radius: 3px;
  padding: 5px 10px;
  cursor: pointer;
}
.search-results {
  margin-top: 10px;
  max-height: 150px;
  overflow-y: auto;
}
.search-result-item {
  padding: 5px;
  border-bottom: 1px solid var(--box-border);
  cursor: pointer;
}
.search-result-item:hover {
  background: var(--hover-bg);
}
 /* ===== BUTTONS ===== */
 .btn.viewBtn , .addBtn , .submitBtn , .closeBtn{background:#444;border:1px solid #666;color:#fff;padding:5px 10px;border-radius:4px;cursor:pointer;font-size:13px;font-weight:600;transition:background .15s}
 .btn.viewBtn:hover, .addBtn:hover , .submitBtn:hover, .closeBtn:hover {background:#555;color:#fff;}
 .btn.closeQuick{background:#dc3545;border-color:#aa1f2f;color: #fff;}
 .btn.closeQuick:hover{background:#b72834}
/* ===== UPDATES PANEL ===== */
.panelRow{display:none}
.updates-panel{/*background:#222;border:1px solid #444;*/border-radius:6px;padding:12px;animation:slideDown .25s ease-out}
.btnCloseTextArea{
  padding: 6px;
  border: 1px solid #555;
  border-radius: 4px;
  /*background: #333;
  color: #fff; */
}
.dark-theme .btnCloseTextArea:focus {
  background-color: #333;
  color: #fff; /* optional: to make text visible on black background */
}

@keyframes slideDown{from{opacity:.2;max-height:0}to{opacity:1;max-height:800px}}
.updates-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px}
.updates-list{margin-left:20px;list-style:square}
.updates-list li{margin:4px 0;font-size:14px}
.addRow{display:none;margin-top:6px;gap:6px}
.addRow input{flex:1;padding:6px;/*border:1px solid #555;*/border-radius:4px;/*background:#333;color:#fff*/}
.add_radio label:nth-child(2),
.add_radio label:nth-child(3) {
  width: 90px;
}
.add_radio label:nth-child(4) {
  width: 98px;
}
/* Responsive adjustments */
@media (max-width: 600px) {
  .top-bar {
    flex-direction: column;
  }
  .top-bar-left, .top-bar-center, .top-bar-right {
    width: 100%;
    text-align: center;
    margin: 5px 0;
  }
  .container {
    margin-top: 120px;
    margin-left: 10px;
    margin-right: 10px;
  }
  .case-list-table th,
  .case-list-table td {
    padding: 8px 10px;
  }
  .app-name {
    font-size: 1.6rem;
  }
}