/* Define custom properties */

:root {

  --bg: #f7f7f8; /* Background color */

  --fg: #111; /* Foreground/text color */

  --primary: #0aa; /* Link and button color */

  --primary-hover: #088; /* Darker shade for hover */

  --accent: #3498db; /* Button background */

  --accent-hover: #2980b9; /* Button hover */

  --error: #f8d7da; /* Error background */

  --error-text: #721c24; /* Error text */

  --border: #ddd; /* Border color */

  --card-bg: #fff; /* Card background */

  --header-bg: #2c3e50; /* Header background */

  --footer-bg: #f8f9fa; /* Footer background */

}


/* Reset and base styles */

* {

  box-sizing: border-box;

  margin: 0;

  padding: 0;

}


body {

  font-family: system-ui, Segoe UI, Roboto, Arial, sans-serif;

  background: var(--bg);

  color: var(--fg);

  line-height: 1.6;

}


/* Layout */

.wrap {

  max-width: 860px;

  margin: 0 auto;

  padding: 24px;

}


/* Headings */

h1 {

  margin: 0 0 12px;

  font-size: 2rem;

}


h2 {

  margin: 0 0 16px;

  font-size: 1.5rem;

}


/* Links */

a {

  color: var(--primary);

  text-decoration: none;

  transition: color 0.2s;

}


a:hover {

  color: var(--primary-hover);

}


/* Header */

.hdr {

  background: var(--header-bg);

  color: #fff;

  padding: 16px 0;

}


.hdr .wrap {

  display: flex;

  justify-content: space-between;

  align-items: center;

}


.brand img.logo {

  height: 40px;

  max-width: 100%;

  object-fit: contain;

  vertical-align: middle;

}


.nav {

  display: flex;

  gap: 16px;

}


.nav a {

  color: #fff;

  padding: 8px 12px;

  border-radius: 4px;

  transition: background 0.2s;

}


.nav a:hover,

.nav a[aria-current="page"] {

  background: rgba(255, 255, 255, 0.1);

}


/* Main content */

main {

  min-height: calc(100vh - 200px); /* Ensure main takes available space */

  padding: 24px 0;

}


/* Footer */

.footer {

  background: var(--footer-bg);

  padding: 16px 0;

  text-align: center;

  font-size: 0.9rem;

}


/* Form styles (for login.html) */

.card {

  background: var(--card-bg);

  border: 1px solid var(--border);

  padding: 24px;

  border-radius: 8px;

  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);

  max-width: 420px;

  margin: 0 auto;

}


.form-group {

  margin-bottom: 16px;

}


.form-group label {

  display: block;

  font-weight: bold;

  margin-bottom: 8px;

}


.form-group input {

  width: 100%;

  padding: 8px;

  border: 1px solid var(--border);

  border-radius: 4px;

  font-size: 1rem;

}


.form-group input:focus {

  outline: none;

  border-color: var(--primary);

  box-shadow: 0 0 0 2px rgba(0, 170, 170, 0.2);

}


.password-wrapper {

  position: relative;

}


.toggle-password {

  position: absolute;

  right: 10px;

  top: 50%;

  transform: translateY(-50%);

  background: none;

  border: none;

  cursor: pointer;

  font-size: 1rem;

}


.forgot-password {

  font-size: 0.9rem;

  display: block;

  margin-top: 8px;

}


.alert {

  padding: 12px;

  margin-bottom: 16px;

  border-radius: 4px;

}


.alert-error {

  background: var(--error);

  color: var(--error-text);

  border: 1px solid var(--error-text);

}


/* Button styles */

.btn {

  background: var(--accent);

  color: #fff;

  padding: 10px 16px;

  border: none;

  border-radius: 4px;

  cursor: pointer;

  font-size: 1rem;

  text-align: center;

  display: inline-block;

  transition: background 0.2s;

}


.btn:hover {

  background: var(--accent-hover);

}


/* Table styles (for tabla.html) */

.table {

  width: 100%;

  border-collapse: collapse;

  margin-top: 16px;

}


.row {

  display: flex;

  border-bottom: 1px solid var(--border);

}


.cell {

  flex: 1;

  padding: 12px;

  border-right: 1px solid var(--border);

}


.cell:last-child {

  border-right: none;

}


.row.header {

  background: var(--footer-bg);

  font-weight: bold;

}


#q {

  width: 100%;

  max-width: 360px;

  padding: 8px;

  border: 1px solid var(--border);

  border-radius: 4px;

  font-size: 1rem;

}


#q:focus {

  outline: none;

  border-color: var(--primary);

  box-shadow: 0 0 0 2px rgba(0, 170, 170, 0.2);

}


/* Grid for panel (panel.html) */

.grid {

  display: grid;

  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));

  gap: 16px;

  margin-top: 16px;

}


/* Responsive design */

@media (max-width: 768px) {

  .hdr .wrap {

    flex-direction: column;

    align-items: flex-start;

  }


  .nav {

    margin-top: 16px;

    flex-wrap: wrap;

  }


  .nav a {

    margin: 4px 8px 4px 0;

  }


  .wrap {

    padding: 16px;

  }


  .grid {

    grid-template-columns: 1fr;

  }

}


@media (max-width: 480px) {

  h1 {

    font-size: 1.5rem;

  }


  h2 {

    font-size: 1.25rem;

  }


  .btn {

    width: 100%;

    text-align: center;

  }

}


/* Accessibility enhancements */

:focus {

  outline: 2px solid var(--primary);

  outline-offset: 2px;

}


[role="alert"] {

  font-weight: bold;

}
