:root {
  /* New Palette */
  --c-orange-red: #eb704d;
  --c-orange-yellow: #f7ba7b;
  --c-yellow: #fff16a;
  --c-yellow-green: #e1e58b;
  --c-green: #91c36e;
  --c-cyan: #95d1d1;
  --c-light-blue: #80cbee;
  --c-blue: #77abd9;
  --c-purple: #8672ad;
  --c-light-purple: #b992bd;
  --c-pink-red: #d06a92;
  --c-pink: #f191b7;
  --c-gold: #ffd500;

  --primary-color: var(--c-blue); /* #77abd9 */
  --secondary-color: var(--c-cyan); /* #95d1d1 */
  --bg-color: #f4f7f6;
  --card-bg: #ffffff;
  --text-color: #333333;
  --border-radius: 12px;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  --font-family: "Heebo", sans-serif;

  /* Table specific colors */
  --period-prev-bg: #eaf2f8;
  --period-curr-bg: #e8f8f5;
  --left-player-bg: #ffebee;
  --less-player-bg: #ffffff;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

body.has-sidebar {
  padding-right: 0; /* Remove padding, use margin on main-content instead */
}

.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  height: 100vh;
  background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.08);
  overflow-y: auto;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  padding: 20px 0 0;
}

.sidebar-header {
  padding: 0 20px 20px;
  border-bottom: 2px solid #e0e0e0;
  margin-bottom: 15px;
}

.sidebar-header h2 {
  margin: 0;
  font-size: 1.4rem;
  color: var(--primary-color);
  text-align: center;
}

.main-content {
  margin-right: 280px;
  padding: 20px;
  min-height: 100vh;
  box-sizing: border-box;
}

.container {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 30px;
  width: 100%;
  box-sizing: border-box;
}

h1,
h2,
h3 {
  text-align: center;
  color: var(--primary-color);
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.page-header-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.page-header h1 {
  margin: 0;
  text-align: right;
}

a {
  text-decoration: none;
  color: inherit;
}

.top-nav {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px;
}

.back-btn {
  display: inline-block;
  background-color: var(--c-light-purple); /* #b992bd */
  color: white;
  padding: 8px 15px;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: background-color 0.2s;
  text-decoration: none;
}

.back-btn:hover {
  background-color: var(--c-purple); /* #b992bd */
}

/* Standard Button Styles */
.btn {
  display: inline-block;
  padding: 12px 24px;
  font-size: 1.1rem;
  font-family: inherit;
  line-height: normal;
  text-align: center;
  text-decoration: none;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s;
  color: white;
  background-color: var(--c-light-purple); /* Default secondary */
}

.btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--c-blue); /* #77abd9 */
}

.btn-danger {
  background-color: var(--c-orange-red); /* #eb704d */
}

.btn-secondary {
  background-color: var(--c-light-blue); /* #80cbee */
}

.btn-green {
    background-color: var(--c-green); /* #91c36e */
}

.btn-orange {
    background-color: var(--c-orange-yellow); /* #f7ba7b */
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.8rem;
}

/* Form Styles */
form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.vertical-form {
  display: grid;
  grid-template-columns: 1fr;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.form-group {
  display: flex;
  flex-direction: column;
}

label {
  font-weight: 500;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

input[type="text"],
input[type="email"],
input[type="date"],
input[type="datetime-local"],
input[type="number"],
select,
textarea {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-family: var(--font-family);
  font-size: 1rem;
  transition: border-color 0.3s;
  background-color: #fff;
  width: 100%;
  box-sizing: border-box;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  border-color: var(--primary-color);
  outline: none;
}

.radio-group {
  grid-column: 1 / -1;
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: center;
  margin-top: 10px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: normal;
}

h3,
hr {
  grid-column: 1 / -1;
  width: 100%;
}

/* Table Styles */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  border-radius: var(--border-radius);
  overflow: hidden;
}

th,
td {
  padding: 10px 15px;
  text-align: center;
}

thead tr:first-child th {
  background-color: var(--c-purple); /* #8672ad */
  color: white;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
}

thead tr:nth-child(2) th {
  background-color: #ecf0f1;
  color: #7f8c8d;
  font-weight: 600;
  font-size: 0.85rem;
  border-bottom: 2px solid #bdc3c7;
}

.ltr {
  direction: ltr;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.error-box {
  background-color: #fdecea;
  border: 1px solid var(--c-pink-red); /* #d06a92 */
  color: var(--c-pink-red);
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.success-box {
     background-color: var(--c-green);
     color: white;
     padding: 15px;
     border-radius: 8px;
     margin-bottom: 20px;
     opacity: 0.8;
}

.table-link {
  display: block;
  color: inherit;
  text-decoration: none;
  width: 100%;
  height: 100%;
}
