/* RESET */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* BODY */
body {
  font-family: "Inter", sans-serif;
  display: flex;
  background: #f1f5f9;
  color: #0f172a;
}

/* SIDEBAR */
.sidebar {
  width: 240px;
  background: #0f172a;
  color: white;
  height: 100vh;
  padding: 25px 20px;
}

.sidebar h2 {
  margin-bottom: 30px;
}

.sidebar a {
  display: block;
  padding: 12px;
  margin-bottom: 10px;
  border-radius: 8px;
  color: #cbd5e1;
  text-decoration: none;
  transition: 0.3s;
}

.sidebar a:hover {
  background: #1e293b;
  color: white;
}

/* MAIN */
.main {
  flex: 1;
  padding: 30px;
}

/* CARDS GRID */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* CARD STYLE */
.card {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.05);
  margin-bottom: 20px;
}

.card input,
.card select {
  margin-bottom: 10px;
}

.card-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
}

.transaction-top .card {
  display: block;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 25px rgba(0,0,0,0.08);
}

/* CARD COLORS */
.card.blue { background: linear-gradient(135deg, #3b82f6, #2563eb); color: white; }
.card.green { background: linear-gradient(135deg, #10b981, #059669); color: white; }
.card.orange { background: linear-gradient(135deg, #f59e0b, #d97706); color: white; }

/* CARD TEXT */
.card h3 {
  font-size: 14px;
  opacity: 0.9;
}

.card p {
  font-size: 26px;
  font-weight: bold;
  margin-top: 5px;
}

/* ICON */
.icon {
  font-size: 30px;
  opacity: 0.8;
}

/* BUTTONS */
button {
  padding: 7px 14px;
  font-size: 13px;
  border-radius: 6px;
  border: none;
  background: #2563eb;
  color: white;
  cursor: pointer;
  transition: 0.2s;
}

button:hover {
  background: #1d4ed8;
}

/* INPUTS */
input, select {
  width: auto;
  flex: 1;
  padding: 9px;
  margin: 8px 0;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}

/* TABLE */
table {
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse;
}

th {
  background: #e2e8f0;
  padding: 10px;
  text-align: left;
}

td {
  padding: 10px;
  border-top: 1px solid #e2e8f0;
}

/* MOBILE */
@media (max-width: 900px) {
  .cards {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .main {
    padding: 15px;
  }
}

.main {
  animation: fadeIn 0.4s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.dashboard-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.row input, .row select {
  flex: 1;
}

.transaction-top {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.export-row {
  display: flex;
  gap: 10px;
}

@media (max-width: 900px) {

  .dashboard-bottom,
  .transaction-top {
    grid-template-columns: 1fr;
  }

  .row {
    flex-direction: column;
  }

}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.table-actions {
  display: flex;
  gap: 8px;
}

/* Company selector and logout button */
.company-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.company-selector {
  display: flex;
  align-items: center;
  gap: 10px;
}

.company-selector label {
  font-weight: 500;
  color: #0f172a;
}

.company-selector select {
  width: auto;
  min-width: 200px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: white;
}

/* Login page adjustments */
.login-page .sidebar {
  display: none;
}

/* Settings page improvements */
#companyTable button, #userTable button {
  background: #ef4444;
  padding: 5px 10px;
  font-size: 12px;
}

#companyTable button:hover, #userTable button:hover {
  background: #dc2626;
}

select[multiple] {
  padding: 8px;
}

select[multiple] option {
  padding: 8px;
  border-bottom: 1px solid #e2e8f0;
}