body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #e9c7bf;
  display: flex;
  max-width: 100vw;
  box-sizing: border-box;
  padding: 0;
  overflow-x: hidden !important;
  font-size: 15px;
  height: 100vh;
}
html {
  overflow-x: hidden !important;
  max-width: 100vw !important;
  font-size: 15px;
  height: 100vh;
}
.sidebar {
  width: 220px;
  background: #8c241c; /* dark brown */
  color: #fff;
  height: 100vh;
  min-height: 100vh;
  max-height: 100vh;
  position: sticky;
  top: 0;
  left: 0;
  align-self: flex-start;
  z-index: 1000;
  padding: 24px 0 0 0;
  box-shadow: 2px 0 12px #e45424;
  display: none; /* Hidden by default - only shown after authentication */
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
}
.sidebar.sidebar-collapsed {
  transform: translateX(-100%);
}
.sidebar-toggle-btn {
  display: none !important; /* Hidden by default - only shown after authentication */
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 1100;
  background: #8c241c;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 2em;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px #e45424;
  /* Fix: prevent stretching */
  padding: 0;
  min-width: 0;
  min-height: 0;
  max-width: 44px;
  max-height: 44px;
  line-height: 44px;
  text-align: center;
}
.sidebar h2 {
  text-align: center;
  margin-bottom: 24px;
  font-weight: bold;
  letter-spacing: 1px;
  color: #232946;
  background: #fff;
  border-radius: 8px;
  padding: 8px 0;
  width: 80%;
}
.sidebar-logo {
  display: block;
  margin: 0 auto 18px auto;
  max-width: 120px;
  max-height: 60px;
  background: #fff;
  border-radius: 8px;
  padding: 8px;
}
.sidebar nav ul {
  list-style: none;
  padding: 0;
  width: 100%;
}
.sidebar nav ul li {
  margin: 0;
}
.sidebar nav ul li button {
  width: 100%;
  background: none;
  border: none;
  color: #fff;
  padding: 14px 24px;
  text-align: left;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  border-radius: 0 20px 20px 0;
}
.sidebar nav ul li button:hover,
.sidebar nav ul li button.active {
  background: #8c241c; /* match sidebar, no color change */
  color: #fff;
  box-shadow: 0 2px 12px #e45424;
}
.sidebar-status {
  margin: 24px 0 0 0;
  text-align: center;
  font-size: 0.95em;
  color: #232946;
  background: #ee9f64;
  border-radius: 8px;
  padding: 6px 0;
  width: 80%;
}
.main-content {
  flex: 1;
  padding: 24px 24px;
  min-height: 100vh;
  background: #f8f9fa;
  overflow-y: auto;
  font-size: 0.98em;
  height: 100vh;
}
.widget-row {
  display: flex;
  gap: 24px;
  margin-bottom: 32px;
}
.widget {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px #b47572;
  padding: 24px 32px;
  flex: 1;
  text-align: center;
  cursor: pointer;
  transition: box-shadow 0.2s, background 0.2s;
  border: 2px solid #eb7b24;
}
.widget:hover,
.widget:focus {
  box-shadow: 0 4px 18px #e45424;
  background: #fff; /* keep background white on hover */
}
.widget-title {
  font-size: 1em;
  color: #eb7b24;
  margin-bottom: 8px;
  font-weight: bold;
}
.widget-count {
  font-size: 1em;
  color: #232946;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 18px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  font-size: 1em;
  overflow-x: auto;
  display: block;
  table-layout: auto;
}
.data-table th, .data-table td {
  border: 1px solid #e9c7bf;
  padding: 10px 8px;
  text-align: left;
  font-size: 0.97em;
  vertical-align: middle;
  line-height: 1.5;
  background: none;
  min-height: 48px;
  height: 48px;
  box-sizing: border-box;
}
.data-table th {
  background: #eb7b24;
  color: #fff;
  font-weight: bold;
  font-size: 1.05em;
  letter-spacing: 0.04em;
}
.data-table tr:nth-child(even) {
  background: #f8f9fa;
}
.data-table tr {
  transition: background 0.15s;
}
.data-table tr:hover {
  background: #f3e7e6;
}
form, .data-table, .modal, .card, .section {
  width: 100%;
  box-sizing: border-box;
}
button, input, select, textarea {
  font-size: 1em;
  max-width: 100%;
  box-sizing: border-box;
}
#quotation-modal, .modal {
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  padding: 0;
  margin: 0;
}
#app {
  display: flex;
  flex-direction: row;
  width: 100vw;
  min-height: 100vh;
  height: 100vh;
  box-sizing: border-box;
}
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    min-height: 100vh;
    max-height: 100vh;
    width: 220px;
    transform: translateX(0);
    box-shadow: 2px 0 12px #e45424;
  }
  .sidebar.sidebar-collapsed {
    transform: translateX(-100%);
  }
  .sidebar-toggle-btn {
    display: flex;
  }
  .main-content {
    padding: 18px 4px !important;
    margin-left: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
  body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }
  .widget-row {
    flex-direction: column;
    gap: 16px;
  }
  .widget {
    min-width: 0 !important;
    width: 100% !important;
    box-sizing: border-box;
    padding: 18px 8px;
  }
  .data-table {
    display: table;
    width: 100%;
    min-width: 600px;
    max-width: none;
    overflow-x: auto;
    box-sizing: border-box;
    border-radius: 8px;
    margin: 0 0 18px 0;
    font-size: 0.98em;
    table-layout: auto;
  }
  .data-table thead {
    display: table-header-group;
  }
  .data-table tr {
    display: table-row;
    background: #fff;
    border-radius: 0;
    box-shadow: none;
    border: none;
    padding: 0;
  }
  .data-table td, .data-table th {
    display: table-cell;
    width: auto;
    min-width: 80px;
    max-width: 220px;
    word-break: break-word;
    font-size: 0.98em;
    padding: 8px 4px;
    border: 1px solid #e9c7bf;
    box-sizing: border-box;
    text-align: left;
  }
  .data-table td:before {
    display: none !important;
  }
  /* Enable horizontal scroll if needed */
  .data-table-wrapper {
    width: 100vw;
    overflow-x: auto;
  }
}
@media (max-width: 600px) {
  body, .container, main {
    padding: 0 4px;
  }
  h1, h2, h3 {
    font-size: 1.2em;
    margin: 10px 0 8px 0;
  }
  .data-table th, .data-table td {
    padding: 6px 4px;
    font-size: 0.98em;
  }
  .data-table {
    font-size: 0.98em;
  }
  .data-table thead {
    display: none;
  }
  .data-table tr {
    display: block;
    margin-bottom: 10px;
    border-bottom: 2px solid #eee;
    background: #fff;
  }
  .data-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: none;
    border-bottom: 1px solid #f3e7e6;
    padding: 8px 4px;
    font-size: 1em;
  }
  .data-table td:before {
    content: attr(data-label);
    font-weight: bold;
    color: #8c241c;
    margin-right: 8px;
    min-width: 90px;
    display: inline-block;
  }
  .data-table button, .data-table a {
    font-size: 1.2em;
    padding: 4px 8px;
  }
  form {
    flex-direction: column !important;
    gap: 8px !important;
    align-items: stretch !important;
  }
  form > div, .form-group {
    width: 100% !important;
    min-width: 0 !important;
  }
  input, select, textarea, button {
    width: 100% !important;
    min-width: 0 !important;
    margin-bottom: 8px;
  }
  #quotation-modal > div, .modal > div {
    max-width: 98vw !important;
    padding: 10px !important;
  }
}

/* Utility: Hide data-label on desktop */
@media (min-width: 901px) {
  .data-table td:before {
    display: none;
  }
  .data-table {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    display: table;
    table-layout: auto;
  }
  .data-table th, .data-table td {
    min-width: 80px;
    max-width: none;
    word-break: break-word;
    padding: 10px 14px;
    font-size: 1em;
  }
  .main-content {
    width: 100%;
    max-width: 100vw;
    margin: 0;
    padding: 32px 40px;
    box-sizing: border-box;
  }
}

/* Utility: Hide data-label on all screens now (since we want real tables) */
.data-table td:before {
  display: none !important;
}

h1, h2, h3, h4, h5, h6 {
  font-size: 1.1em;
  margin: 10px 0 8px 0;
}

.finance-form-input, .finance-form-select, .finance-form-btn {
  font-size: 0.97em;
}
