:root {
    --primary: #2c7be5;
    --secondary: #17c671;
    --gray: #f7fafc;
    --dark: #23272b;
    --white: #fff;
    --border: #e3e6ec;
    --radius: 10px;
    --shadow: 0 2px 16px 0 #0002;
    --transition: 0.2s cubic-bezier(.4,0,.2,1);
}

[data-theme='dark'] {
    --primary: #4a90e2;
    --secondary: #50e3c2;
    --gray: #181c21;
    --dark: #f7fafc;
    --white: #23272b;
    --border: #333a42;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--gray);
    font-family: 'Segoe UI', system-ui, sans-serif;
    color: var(--dark);
    min-height: 100vh;
}
body { display: flex; flex-direction: column; min-height: 100vh; }

header {
    position: fixed;
    top: 0; left: 0; right: 0;
    background: var(--white);
    box-shadow: var(--shadow);
    z-index: 10;
    display: flex; align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    height: 60px;
    color: var(--dark);
    transition: background var(--transition), color var(--transition);
}

.logo {
    font-weight: bold;
    color: var(--primary);
    font-size: 1.3rem;
    letter-spacing: 1px;
}

nav {
    display: flex;
    gap: 1.5rem;
}

nav a {
    text-decoration: none;
    color: var(--dark);
    padding: 8px 0;
    position: relative;
    transition: color var(--transition);
    outline: none;
}
nav a.active, nav a:hover, nav a:focus {
    color: var(--primary);
}
nav a.active::after, nav a:hover::after, nav a:focus::after {
    content: "";
    display: block;
    margin: 0 auto;
    width: 60%;
    height: 2px;
    background: var(--primary);
    border-radius: 1px;
    transition: width var(--transition);
}

.auth-btns {
    display: flex; gap: 0.5rem;
}
.auth-btns a, .auth-btns form button {
    border: none;
    background: var(--primary);
    color: var(--white);
    padding: 0.4em 1em;
    border-radius: var(--radius);
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    text-decoration: none;
    box-shadow: 0 1px 4px #0001;
    outline: none;
}
.auth-btns a:hover, .auth-btns form button:hover,
.auth-btns a:focus, .auth-btns form button:focus {
    background: var(--secondary);
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 2px 8px #0003;
}

.theme-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    /* font-size: 1.4em; */
    margin-right: 1em;
    color: var(--primary);
    transition: color var(--transition), transform var(--transition);
    outline: none;
}
.theme-toggle-btn:hover, .theme-toggle-btn:focus {
    color: var(--secondary);
    transform: scale(1.18) rotate(-12deg);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 0.8em;
}

main {
    flex: 1 0 auto;
    /* max-width: 1100px; */
    margin-top: 80px;
    background: var(--white);
    color: var(--dark);
    padding: 2.5rem 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: background var(--transition), color var(--transition), box-shadow var(--transition);
    min-height: 60vh;
}
h1, h2, h3 {
    margin-top: 0;
    font-weight: 700;
}

/* Table styling */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    margin-bottom: 1.5rem;
    color: var(--dark);
    transition: background var(--transition), color var(--transition);
}
th, td {
    padding: 0.8em 1em;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
th {
    background: var(--gray);
    font-weight: 600;
}
tr:hover, tr:focus-within {
    background: #eaf6fd;
    transition: background 0.2s;
}
[data-theme='dark'] tr:hover,
[data-theme='dark'] tr:focus-within {
    background: #22354a;
}

/* Form styling */
form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    /* margin-bottom: 1.5rem; */
    background: var(--gray);
    /* padding: 1.5rem; */
    border-radius: var(--radius);
    box-shadow: 0 1px 4px #0001;
    transition: background var(--transition);
}
label { font-weight: 500; }
input, select, textarea {
    padding: 0.6em 1em;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color var(--transition), background var(--transition), color var(--transition);
    background: var(--white);
    color: var(--dark);
    outline: none;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    background: #e7f1fa;
    color: var(--dark);
    box-shadow: 0 0 0 2px var(--primary, #2c7be5)33;
}
[data-theme='dark'] input:focus,
[data-theme='dark'] select:focus,
[data-theme='dark'] textarea:focus {
    background: #222c35;
    color: var(--dark);
}

button, input[type="submit"] {
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    padding: 0.6em 1.5em;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 500;
    box-shadow: 0 2px 4px #0002;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    outline: none;
}
button:hover, input[type="submit"]:hover,
button:focus, input[type="submit"]:focus {
    background: var(--secondary);
    transform: scale(1.04);
    box-shadow: 0 4px 12px #0003;
}

/* Modal */
.modal-backdrop {
    position: fixed; top:0; left:0; width:100vw; height:100vh;
    background: #0007; z-index:1000; display: flex; align-items: center; justify-content: center;
    animation: fadeIn .25s;
}
.modal-content {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-width: 300px; max-width: 90vw;
    animation: popIn .2s;
    color: var(--dark);
    transition: background var(--transition), color var(--transition);
}
[data-theme='dark'] .modal-content {
    background: #20262b;
    color: var(--dark);
}

@keyframes fadeIn { from {opacity:0} to {opacity:1} }
@keyframes popIn { from {transform: scale(.95); opacity:.6;} to {transform:scale(1); opacity:1;} }

/* Responsive */
@media (max-width: 700px) {
    header { flex-direction: column; height: auto; padding: 1rem; }
    main { margin: 90px 0.5rem 1rem; padding: 1rem 0.3rem; }
    .logo { font-size: 1.1rem; }
    nav { gap: 1rem; }
}

/* Dashboard-specific classes */
.primary { color: var(--primary); }
.dashboard-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
    width: 100%;
}
.subtitle {
    color: #666;
    font-size: 1.12em;
    max-width: 520px;
    text-align: center;
    margin-top: 0;
    margin-bottom: 0;
}
[data-theme='dark'] .subtitle {
    color: #c4cbe3;
}
.dashboard-info {
    margin-top: 2.5em;
    max-width: 750px;
    width: 100%;
}
.dashboard-info h3 {
    margin-bottom: 0.3em;
    font-size: 1.14em;
    font-weight: 600;
}
.dashboard-info ul {
    color: #888;
    list-style: square inside;
    padding-left: 0;
    margin: 0;
    line-height: 1.9;
}
[data-theme='dark'] .dashboard-info ul {
    color: #b1c4d6;
}

/* Profile Form Section */
.profile-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.profile-form {
    background: var(--gray);
    border-radius: var(--radius);
    box-shadow: 0 1px 4px #0001;
    padding: 2rem 2.5rem;
    max-width: 420px;
    width: 100%;
    transition: background var(--transition);
    margin-top: 2rem;
}
[data-theme='dark'] .profile-form {
    background: #23272b;
}

.profile-form p {
    display: flex;
    flex-direction: column;
    gap: 0.2em;
    margin-bottom: 1.2em;
}

.profile-form label {
    font-weight: 500;
    margin-bottom: 0.2em;
    color: var(--primary);
}

.profile-form .form-control {
    padding: 0.6em 1em;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    background: var(--white);
    color: var(--dark);
    transition: border-color var(--transition), background var(--transition), color var(--transition);
    outline: none;
}

[data-theme='dark'] .profile-form .form-control {
    background: #20262b;
    color: var(--dark);
}

.profile-form .form-control:focus {
    border-color: var(--primary);
    background: #e7f1fa;
    color: var(--dark);
    box-shadow: 0 0 0 2px var(--primary)33;
}

[data-theme='dark'] .profile-form .form-control:focus {
    background: #222c35;
    color: var(--dark);
}

.profile-form .helptext {
    color: #888;
    font-size: 0.97em;
    margin-bottom: 0.2em;
}
[data-theme='dark'] .profile-form .helptext {
    color: #b1c4d6;
}

.profile-form ul.errorlist {
    margin: 0 0 0.2em 0;
    padding: 0;
    color: #e94e77;
    font-size: 0.99em;
    list-style: disc inside;
}

.form-actions {
    display: flex;
    gap: 1em;
    align-items: center;
}
.button,
a.button,
.button.secondary {
    display: inline-block;
    background: var(--primary);
    color: var(--white);
    padding: 0.6em 1.5em;
    border-radius: var(--radius);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
}
.button.secondary,
a.button.secondary {
    background: var(--border);
    color: var(--dark);
}
.button:hover, a.button:hover,
.button:focus, a.button:focus {
    background: var(--secondary);
    color: var(--white);
    transform: scale(1.04);
}
.button.secondary:hover,
a.button.secondary:hover,
.button.secondary:focus,
a.button.secondary:focus {
    background: var(--primary);
    color: var(--white);
}

/* Category Form Section */

.category-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.category-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1em;
}

.category-list {
    width: 100%;
    padding: 0;
    margin: 0;
    list-style: none;
}

.category-list li {
    background: var(--gray);
    border-radius: var(--radius);
    margin-bottom: 0.7em;
    padding: 0.8em 1.2em;
    box-shadow: 0 1px 4px #0001;
    transition: background var(--transition);
}

.category-link {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
    font-size: 1.06em;
    transition: color var(--transition);
}
.category-link:hover,
.category-link:focus {
    color: var(--secondary);
    text-decoration: underline;
}

.empty {
    text-align: center;
    color: #888;
}

/* Reports Section */

.report-section {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.report-filter-form {
  margin-bottom: 2rem;
  width: 100%;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2em;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.2em;
}

.filter-label {
  font-weight: 500;
  color: var(--primary);
  margin-bottom: 0.1em;
}

.form-control {
  padding: 0.5em 1em;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  background: var(--white);
  color: var(--dark);
  transition: border-color var(--transition), background var(--transition), color var(--transition);
  outline: none;
}

[data-theme='dark'] .form-control {
  background: #20262b;
  color: var(--dark);
}

.form-control:focus {
  border-color: var(--primary);
  background: #e7f1fa;
  color: var(--dark);
  box-shadow: 0 0 0 2px var(--primary)33;
}

[data-theme='dark'] .form-control:focus {
  background: #222c35;
  color: var(--dark);
}

.report-summary-card {
  width: 100%;
  margin-top: 2rem;
}

.card-header {
  font-size: 1.14em;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 1em;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  color: var(--dark);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 0;
  box-shadow: 0 1px 4px #0001;
  transition: background var(--transition), color var(--transition);
}

.report-table th, .report-table td {
  padding: 0.8em 1em;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.report-table th {
  background: var(--gray);
  font-weight: 600;
}

.report-table tr:hover {
  background: #eaf6fd;
  transition: background 0.2s;
}

[data-theme='dark'] .report-table {
  background: #23272b;
  color: var(--dark);
}

[data-theme='dark'] .report-table th {
  background: #23272b;
}

[data-theme='dark'] .report-table tr:hover {
  background: #22354a;
}

.empty {
  text-align: center;
  color: #888;
}
[data-theme='dark'] .empty {
  color: #b1c4d6;
}

/* Animations */
@keyframes fadeInDown { from { opacity:0; transform:translateY(-24px);} to{ opacity:1; transform:none; } }
@keyframes popIn { from { opacity:.7; transform:scale(.97);} to { opacity:1; transform:none;} }
.fade-in-down { animation: fadeInDown 0.5s; }
.pop-in { animation: popIn 0.5s; }

/* Utility classes */
.hide { display: none !important; }
.show { display: block !important; }
.inline { display: inline !important; }

/* End of file */


.menu-toggle-checkbox { display: none; }
.menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  width: 36px;
  height: 36px;
  justify-content: center;
  align-items: center;
  z-index: 20;
  background: none;
  border: none;
}
.menu-toggle span {
  display: block;
  width: 26px;
  height: 3px;
  margin: 4px 0;
  background: var(--primary);
  border-radius: 2px;
  transition: 0.3s;
}
.menu-toggle-left { order: 0; }
.menu-toggle-right { order: 2; margin-left: auto; }

@media (max-width: 700px) {
  header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.7rem;
    height: 60px;
    position: fixed;
    width: 100vw;
    left: 0;
    top: 0;
    background: var(--white);
    z-index: 100;
  }
  .logo {
    flex: 1 1 auto;
    text-align: center;
    order: 2;
    margin: 0;
  }
  .menu-toggle.menu-toggle-left {
    order: 1;
    margin-right: 0.5rem;
  }
  .menu-toggle.menu-toggle-right {
    order: 3;
    margin-left: 0.5rem;
  }
  .menu-toggle { display: flex; }
  
  nav,
  .header-controls {
    display: none;
    position: absolute;
    left: 0;
    width: 100vw;
    background: var(--white);
    box-shadow: var(--shadow);
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 1rem 0.5rem 0.8rem 0.5rem;
    z-index: 15;
    animation: fadeInDown 0.3s;
    flex-direction: column;
    gap: 1.2rem;
  }
  /* Left menu: controls under header */
  .menu-toggle-checkbox#controls-toggle:checked ~ .header-controls {
    display: flex !important;
    top: 60px;
  }
  /* Right menu: nav under header */
  .menu-toggle-checkbox#nav-toggle:checked ~ nav {
    display: flex !important;
    top: 60px;
  }
}

@media (min-width: 701px) {
  .menu-toggle { display: none !important; }
  .header-controls,
  nav {
    display: flex !important;
    position: static !important;
    background: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    gap: 1.5rem;
  }
}

/* Hamburger animation to X */
.menu-toggle-checkbox:checked + .menu-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.menu-toggle-checkbox:checked + .menu-toggle span:nth-child(2) {
  opacity: 0;
}
.menu-toggle-checkbox:checked + .menu-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}