/* Reset and Box Sizing */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Layout Containers */
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #f8f9fa;
  color: #232323;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
  padding: 24px 0;
}

/* Add scrollable viewport for trade-table */
.trade-table-viewport {
  margin: 0;
  overflow-x: auto;
  background: transparent;
  /* Add padding/border if desired for clarity */
}

/* On small screens reduce the margin */
@media (max-width: 900px) {
  .trade-table-viewport {
    margin: 0 8px;
  }
}

/* Main */
main {
  margin-top: 32px;
  margin-bottom: 32px;
}

form#trade-form {
  margin: 0 32px;
}

.trade-table {
  min-width: 1200px;
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  background: #fff;
  box-shadow: 0px 2px 9px rgba(44,69,92,0.08);
  border-radius: 10px;
  overflow: hidden;
}

.trade-table thead {
  background: #295;
  color: #fff;
  background: #336495;
}

.trade-table th,
.trade-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid #eaedf1;
  font-size: 0.7rem;
}

.trade-table td[class="asset"] {
  text-wrap-mode: nowrap;
}

.trade-table td[class="currency"] {
  text-wrap-mode: nowrap;
  text-align: right;
}

.trade-table tbody tr:last-child td {
  border-bottom: none;
}

.trade-table th {
  font-weight: 600;
  white-space: nowrap;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="time"],
select {
  width: 100%;
  padding: 6px 7px;
  border: 1px solid #cdd9ed;
  border-radius: 5px;
  background: #f4f6fc;
  font-size: 0.7rem;
  transition: border-color 0.2s;
}

input:focus,
select:focus {
  border-color: #336495;
  outline: none;
  background: #fff;
}

input[type="file"] {
  width: 100%;
  padding: 2px 0;
  background: none;
  border: none;
  font-size: 0.7rem;
}

button[class="action"] {
  padding: 5px 5px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  min-width: 25px;
  min-height: 25px;
  max-width: 25px;
  max-height: 25px;
}

button[class="action"]:hover,
button[class="action"]:focus {
  background: #183154;
}

button[type="submit"] {
  display: inline-block;
  background: #336495;
  color: #fff;
  font-weight: 600;
  border: none;
  border-radius: 5px;
  padding: 11px 22px;
  cursor: pointer;
  font-size: 1rem;
  margin-top: 10px;
  box-shadow: 0 2px 6px rgba(30,50,90,0.07);
  transition: background 0.15s;
}

button[type="submit"]:hover,
button[type="submit"]:focus {
  background: #183154;
}

/* Footer */
footer {
  width: 100%;
  background: #f4f6fc;
  color: #444;
  padding: 12px 0 22px 0;
  font-size: 0.7rem;
  border-top: 1px solid #d7e0ef;
  position: relative;
}

.footer-date {
  text-align: right;
  font-style: italic;
  color: #758099;
}

@media (max-width: 900px) {
  .container {
    width: 99%;
    padding: 10px 0;
  }

  .trade-table-viewport {
    margin: 0 4px;
  }

  .trade-table, .trade-table th, .trade-table td {
    font-size: 0.7rem;
  }
}

@media (max-width: 720px) {
  .trade-table-viewport {
    margin: 0 1px;
  }
  .trade-table thead {
    display: none;
  }
  .trade-table, .trade-table tbody, .trade-table tr, .trade-table td {
    display: block;
    width: 100%;
  }
  .trade-table tr {
    margin-bottom: 12px;
    background: #fff;
    border-radius: 7px;
    box-shadow: 0 1px 6px rgba(44,69,92,0.08);
    padding: 9px 0;
  }
  .trade-table td {
    padding: 10px 16px;
    text-align: left;
    border-bottom: none;
    position: relative;
  }
  .trade-table td::before {
    content: attr(data-label);
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
    color: #336495;
  }
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-thumb {
  background: #d2d6e5;
  border-radius: 5px;
}