/* Import a clean professional font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

body {
  font-family: 'Inter', sans-serif;
  background-color: #f4f6f8;
  margin: 0;
  padding: 0;
  color: #2c3e50;
}

/* Main Layout */
.container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */


/* Match main content background */
.main-content {
  background-color: #ffffff;
}

/* Set body and container to white */
body, .container {
  font-family: 'Inter', sans-serif;
  background-color: #ffffff;
  margin: 0;
  padding: 0;
}
.sidebar {
  width: 60px;
  overflow: hidden;
  background-color: #ffffff !important;
  color: #000 !important;
  padding: 20px 10px;
  transition: width 0.3s ease;
  /* border-right: 1px solid #ddd; */ /* ← Remove or comment this */
  position: relative;
}

.sidebar-logo {
  text-align: center;
  margin-bottom: 20px;
}

.sidebar-logo img {
  max-width: 70px;
  height: auto;
  display: block;
  margin: 0 auto;
  transition: all 0.3s ease;
}

.sidebar:hover .sidebar-logo img {
  max-width: 150px;
}

.sidebar:hover {
  width: 220px;
}

.sidebar button {
  background-color: #333;
  color: white;
  border: none;
  padding: 10px 14px;
  margin: 8px 0;
  font-size: 15px;
  border-radius: 8px;
  width: 100%;
  text-align: center;
  transition: all 0.3s ease;
}

.sidebar button:hover {
  background-color: #555;
  transform: translateY(-1px);
}

.sidebar.collapsed .home-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 24px;
  width: 100%;
  height: 60px;
  padding: 0;
  margin: 0 auto;
  background-color: transparent;
  border: none;
  box-shadow: none;
}

.sidebar .home-btn {
  background-color: #333;
  color: white;
  border: none;
  padding: 10px;
  margin: 8px auto 20px auto;
  font-size: 14px;
  border-radius: 8px;
  width: 100%;
  max-width: 120px;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
}


.sidebar .menu-btn {
  height: 0;
  opacity: 0;
  visibility: hidden;
  padding: 0;
  margin: 0;
  border: none;
  transition: none;
}

.sidebar:hover .menu-btn {
  height: auto;
  opacity: 1;
  padding: 10px 14px;
  margin: 8px 0;
  visibility: visible;
}

.sidebar .label {
  display: none;
  }

.sidebar:hover .label {
  display: inline;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 40px;
  background-color: #ffffff;
}

h2, h3 {
  color: #2c3e50;
  margin-top: 0;
}

/* Forms & Inputs */
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 16px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 15px;
  box-sizing: border-box;
  transition: all 0.2s ease-in-out;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #007BFF;
  box-shadow: 0 0 0 2px rgba(0,123,255,0.2);
  background-color: #f0f8ff;
}

/* Global Buttons */
button {
  background: linear-gradient(to right, #007BFF, #0056b3);
  color: white;
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  margin-top: 10px;
  max-width: 240px;
  transition: all 0.25s ease;
}

button:hover {
  background: linear-gradient(to right, #0056b3, #003f7f);
  transform: scale(1.03);
}

button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

/* Small Icon Buttons */
button[title] {
  padding: 6px 10px;
  font-size: 13px;
  min-width: auto;
}

/* Card Boxes */
form, .main-content > div {
  background-color: #ffffff;
  padding: 30px;
  margin-top: 25px;
  border-radius: 14px;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.07);
}

/* Locations Grouping */
#locations {
  display: flex;
  flex-direction: column;
}

.location-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.location-row input {
  flex: 1;
  min-width: 0;
}

.location-row button {
  flex-shrink: 0;
  height: 40px;
  padding: 0 14px;
  background-color: #e74c3c;
  color: white;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1;
}

.location-row button:hover {
  background-color: #c0392b;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 25px;
  font-size: 14px;
}

th, td {
  padding: 10px 14px;
  border: 1px solid #ddd;
  text-align: left;
}

th {
  background-color: #f1f3f5;
  color: #2c3e50;
  font-weight: 600;
}

tr:nth-child(even) {
  background-color: #fafafa;
}

tr:hover {
  background-color: #eef6ff;
  transition: background 0.2s ease-in-out;
}

/* Practice Login Filter Grid */
#practiceLoginSearch {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 20px;
  margin-bottom: 25px;
}

#practiceLoginSearch input {
  padding: 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 25px;
  font-size: 14px;
  table-layout: fixed;   /* ✅ Ensure columns fit the container */
  word-wrap: break-word; /* ✅ Allow content to wrap */
}

td, th {
  word-break: break-word;
  white-space: normal;
}

/* Responsive */
@media (max-width: 1024px) {
  .chart-container-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 768px) {
  .sidebar:hover {
    width: 200px;
  }

  .sidebar button {
    font-size: 14px;
    padding: 8px 12px;
  }

  
  .report-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
}

/* Chart Popup */
#chartPopup canvas {
  width: 100% !important;
  height: auto !important;
  max-width: 800px;
}

.login-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #f7f9fb;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  overflow: hidden;
}

.login-card {
  background-color: #ffffff;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  text-align: center;
  max-width: 400px;
  width: 90%;
}

.login-logo {
  width: 200px;
  margin-bottom: 10px;
}

.login-subtext {
  color: #6c757d;
  margin-bottom: 25px;
}

.login-input {
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 16px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 15px;
}

.login-button {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  font-weight: 600;
  background: linear-gradient(to right, #007BFF, #0056b3);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.login-button:hover {
  background: linear-gradient(to right, #0056b3, #004080);
}

.login-link {
  display: inline-block;
  margin-top: 15px;
  font-size: 14px;
  color: #007BFF;
  text-decoration: none;
}

.login-link:hover {
  text-decoration: underline;
}

.login-error {
  color: red;
  margin-bottom: 10px;
  font-size: 14px;
}

/* Mobile Sidebar open toggle */
.sidebar.open-mobile {
  width: 220px !important;
}

.sidebar.open-mobile .menu-btn {
  height: auto;
  opacity: 1;
  padding: 10px 14px;
  margin: 8px 0;
  visibility: visible;
}

.sidebar.open-mobile .label {
  display: inline;
}

@media (max-width: 600px) {
  .container {
    flex-direction: row; /* ⬅️ Keep sidebar on left, content on right */
  }

  .sidebar {
    width: 220px !important;
    position: relative;
    height: auto;
    overflow: visible;
  }

  .main-content {
    padding: 20px;
    flex: 1;
    overflow-x: auto;
  }

  #mobileMenuToggle {
    display: none !important;
  }
}

@media (max-width: 600px) {
  .sidebar {
    width: 220px !important;
    position: relative;
    height: auto;
    overflow: visible;
  }

  .sidebar:hover {
    width: 220px !important;
  }

  .sidebar .menu-btn,
  .sidebar .label {
    display: inline !important;
    opacity: 1 !important;
    height: auto !important;
    padding: 10px 14px;
    margin: 8px 0;
    visibility: visible !important;
  }

  .sidebar.collapsed {
    width: 220px !important;
  }

  #mobileMenuToggle {
    display: none !important;
  }

  .main-content {
    padding-left: 220px;
  }
}

/* ==== FINAL MOBILE FIXES (FOR iOS + Android) ==== */
@media only screen and (max-width: 480px) {
  body, html {
    overflow-x: hidden;
  }

  .main-content {
    padding: 15px !important;
  }

  .container {
    flex-direction: column;
  }

  .sidebar {
    width: 100% !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0 !important;
    background-color: #ffffff;
  }

  .sidebar button,
  .sidebar .home-btn {
    width: 90% !important;
    max-width: 240px;
    min-width: 240px;
    font-size: 14px;
    padding: 12px 16px;
    margin: 6px 0;
    text-align: center;
    display: block;
  }

  .login-card {
    padding: 20px;
  }

  .login-logo {
    width: 150px;
  }

  input, select, textarea {
    font-size: 14px;
    padding: 10px;
  }

  button {
    font-size: 14px;
    padding: 10px 12px;
  }

  table {
    font-size: 13px;
    overflow-x: auto;
    display: block;
    white-space: nowrap;
  }

  #content h2,
  #content h3 {
    font-size: 18px;
  }

  .location-row {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .location-row input,
  .location-row button {
    width: 100%;
    margin: 5px 0;
  }
}

/* Remove unintentional space above and below buttons */
#saveButton,
#cancelButton,
button[onclick="renderContractPreview()"] {
  margin-top: 0;
}

.edit-client-section {
  background-color: #ffffff;
  padding: 30px;
  border-radius: 14px;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.07);
  margin-top: 30px;
}
.contract-log-entry {
  margin: 8px 0;
  background: #f8f8f8;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #ddd;
}
.contract-log-entry select, .contract-log-entry button {
  margin-left: 10px;
}

#insuranceNameDropdown {
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

.container {
  display: flex;
  min-height: 100vh;
  overflow-x: hidden; /* Prevent sideways overflow */
}

.main-content {
  flex: 1;
  padding: 40px;
  background-color: #ffffff;
  max-width: 1500px;   /* ✅ Prevents overflow */
  margin-left: auto;   /* ✅ Centers the content */
  margin-right: auto;
  overflow-x: auto;    /* ✅ Scrolls internally if content exceeds width */
}


