:root {
  --bg-primary: #f5f7fa;
  --bg-card: #ffffff;
  --text-primary: #333333;
  --text-secondary: #7f8c8d;
  --border: #ddd;
  --header-bg: #2c3e50;
  --btn-primary: #3498db;
  --btn-hover: #2980b9;
  --btn-danger: #e74c3c;
  --btn-success: #2ecc71;
  --role-owner: #e11463;
  --role-dev: #3addf3;
  --role-admin: #1830e5;
  --role-staff: #e5e318;
}

.dark-mode {
  --bg-primary: #1a1a1a;
  --bg-card: #2d2d2d;
  --text-primary: #f0f0f0;
  --text-secondary: #bbbbbb;
  --border: #444;
  --header-bg: #1c2833;
  --btn-primary: #2980b9;
  --btn-hover: #3498db;
  --btn-danger: #c0392b;
  --btn-success: #27ae60;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: 0;
  transition: background 0.3s, color 0.3s;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

header {
  background: var(--header-bg);
  color: white;
  padding: 15px 20px;
  position: relative;
  border-radius: 8px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  font-size: 1.5rem;
}

.logout-menu {
  position: relative;
  display: inline-block;
}

.logout-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 4px;
}

.logout-popup {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  z-index: 100;
  width: 160px;
  overflow: hidden;
}

.logout-popup a {
  display: block;
  padding: 10px 15px;
  color: var(--text-primary);
  text-decoration: none;
  transition: background 0.2s;
}

.logout-popup a:hover {
  background: #eee;
}

.dark-mode .logout-popup a:hover {
  background: #444;
}

.theme-toggle {
  background: none;
  border: 1px solid white;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-weight: bold;
  margin-right: 10px;
}

.banner {
  background: #e3f2fd;
  padding: 12px;
  text-align: center;
  border-radius: 6px;
  margin-bottom: 20px;
  font-weight: bold;
  color: #0d47a1;
}

.dark-mode .banner {
  background: #1e3a5f;
  color: #bbdefb;
}

.form-group {
  margin: 15px 0;
}

label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

input,
select,
button,
.theme-toggle {
  width: 100%;
  padding: 10px;
  margin: 5px 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-card);
  color: var(--text-primary);
}

button,
.theme-toggle {
  background: var(--btn-primary);
  color: white;
  cursor: pointer;
  font-weight: bold;
  border: none;
}

button:hover {
  background: var(--btn-hover);
}

.btn-danger {
  background: var(--btn-danger);
}

.btn-danger:hover {
  background: #c0392b;
}

.btn-success {
  background: var(--btn-success);
}

.btn-success:hover {
  background: #27ae60;
}

.hidden {
  display: none;
}

.role-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.85em;
  color: white;
  margin-left: 8px;
}

.owner {
  background: var(--role-owner);
}

.developer {
  background: var(--role-dev);
}

.admin {
  background: var(--role-admin);
}

.staff {
  background: var(--role-staff);
}

.income-table-wrapper {
  overflow-x: auto;
  background: var(--bg-card);
  border-radius: 8px;
  padding: 15px;
  margin: 20px 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

th {
  background: var(--header-bg);
  color: white;
  position: sticky;
  top: 0;
}

.log-item {
  background: var(--bg-card);
  padding: 10px;
  margin: 10px 0;
  border-left: 4px solid var(--btn-primary);
  border-radius: 4px;
}

.more-menu {
  position: relative;
  display: inline-block;
}

.more-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.more-popup {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  z-index: 100;
  width: 140px;
  overflow: hidden;
}

.more-popup button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
}

.more-popup button:hover {
  background: #eee;
}

.dark-mode .more-popup button:hover {
  background: #444;
}

.unauthorized {
  text-align: center;
  padding: 40px 20px;
}

.unauthorized img {
  max-width: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

footer {
  text-align: center;
  margin-top: 40px;
  padding: 15px;
  font-size: 0.9em;
  border-top: 1px solid var(--border);
}

#copyright-1 {
  color: #000000;
  margin: 0 0 8px 0;
}

#copyright-2 {
  color: #0d47a1;
  margin: 0;
}

.dark-mode #copyright-1 {
  color: #ffffff;
}

.dark-mode #copyright-2 {
  color: #1fe6f3;
}

.income-table-wrapper a {
  color: #2980b9;
  text-decoration: underline;
  cursor: pointer;
}

.dark-mode .income-table-wrapper a {
  color: #3498db;
}