/* General styles */
.button {
        display: inline-block;
        padding: 10px 20px;
        font-size: 14px;
        text-align: center;
        color: #fff;
        background-color: #007bff;
        border: none;
        border-radius: 5px;
        text-decoration: none;
        cursor: pointer;
}

.button:hover {
        background-color: #0056b3;
}

.cancel-button {
        background-color: #dc3545;
}

.cancel-button:hover {
        background-color: #c82333;
}

.btn.danger { background: #dc2626; }
.btn.danger:hover { background: #b91c1c; }

/* Dashboard top bar (index.php) */
.topbar {
    background-color: #007bff;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
    position: sticky;
    top: 0;
    z-index: 999;
}

.topbar .title {
    font-size: 18px;
    font-weight: bold;
}

.topbar-spacer { flex: 1; }

.topbar-user {
    font-size: 13px;
    opacity: 0.95;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 45vw;
}

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

.menu-button {
    background-color: transparent;
    color: #ffffff;
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 15px;
    cursor: pointer;
}

.menu-button:focus {
    outline: 2px solid rgba(255,255,255,0.75);
    outline-offset: 2px;
}

.dropdown-content {
    display: none;
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    background-color: #ffffff;
    min-width: 240px;
    max-width: min(320px, calc(100vw - 24px));
    box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    border-radius: 12px;
    overflow: hidden;
}

.dropdown-content a {
    color: #111827;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 14px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.dropdown-content a:hover { background-color: #f1f1f1; }

.dropdown-header {
    background-color: #f8f9fa;
    padding: 10px 16px;
    font-size: 12px;
    color: #6c757d;
    border-bottom: 1px solid #e9ecef;
    text-transform: uppercase;
}

/* Menu behavior: open only on click (toggled via JS) */
.menu.open .dropdown-content {
    display: block;
}

/* Hover should only highlight the button (not open the menu) */
.menu-button:hover {
    background-color: rgba(255,255,255,0.14);
}

.content { padding: 16px; }

/* Reusable card container */
.card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

@media (max-width: 600px) {
    .dropdown-content {
        position: fixed;
        left: 12px;
        right: 12px;
        top: 56px;
        max-width: none;
    }
    .topbar-user { max-width: 40vw; }
}


#topright {
    position: absolute;
    right: 0;
    top: 0;
    display: block;
    /* height: 125px; */
    /* width: 125px; */
    /* background: url(TRbanner.gif) no-repeat; */
    /* text-indent: -999em; */
    text-decoration: none;
}

body {
	margin: 0;
	background: linear-gradient(45deg, #49a09d, #5f2c82);
	font-family: sans-serif;
	font-weight: 100;
}

.container {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
}

/* Table container for responsive design */
table {
    width: 100%; /* Make the table take full width */
    border-collapse: collapse; /* Merge table borders for a clean look */
    margin: 20px 0; /* Add some spacing above and below the table */
    font-size: 16px; /* Slightly larger font for readability */
    font-family: Arial, sans-serif; /* Consistent font style */
}

/* Table header styles */
table th {
    background-color: #007bff; /* Add a blue background */
    color: #ffffff; /* White text */
    text-align: left; /* Align text to the left */
    padding: 10px; /* Add padding inside header cells */
    border: 1px solid #dddddd; /* Light border for separation */
}

/* Table body styles */
table td {
    padding: 10px; /* Add padding inside body cells */
    border: 1px solid #dddddd; /* Light border for separation */
    text-align: left; /* Align text to the left */
}

/* Alternate row coloring */
table tbody tr:nth-child(odd) {
    background-color: #f9f9f9; /* Light gray background for odd rows */
}

table tbody tr:nth-child(even) {
    background-color: #ffffff; /* White background for even rows */
}

/* Row hover effect */
table tbody tr:hover {
    background-color: #f1f1f1; /* Slightly darker gray on hover */
    cursor: pointer; /* Change cursor to pointer */
}

/* Table footer styles (if any) */
table tfoot {
    background-color: #007bff; /* Match header color */
    color: #ffffff;
    font-weight: bold;
    text-align: center;
    padding: 10px;
}

/* Responsive behavior for smaller screens */
@media screen and (max-width: 600px) {
    table, table th, table td {
        display: block; /* Stack rows for mobile */
        width: 100%;
    }

    table th, table td {
        text-align: right; /* Align text on smaller screens */
        padding-left: 50%; /* Indent content for readability */
        position: relative;
    }

    table th::before, table td::before {
        content: attr(data-label); /* Use custom labels for stacked content */
        position: absolute;
        left: 0;
        width: 45%; /* Adjust label width */
        padding-left: 10px;
        font-weight: bold;
        text-align: left;
    }
}


/* Forms styles */
form {
    background: #ffffff;
    border: 1px solid #ccc;
    border-radius: 10px;
    padding: 10px; /* Enough space inside the form */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: left; /* Align content to the left */
    display: flex;
    flex-direction: column;
    width: auto; /* Automatically adjust to content width */
    height: auto; /* Automatically adjust to content height */
    max-width: 600px; /* Optional: Limit the width for readability */
    margin: 0; /* Remove centering */
}

form label {
    margin-bottom: 5px;
    font-size: 14px;
    color: #333;
}

form input,
form select,
form textarea {
    padding: 8px; /* Comfortable padding */
    margin-bottom: 5px; /* Space between fields */
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    width: 100%; /* Make inputs stretch to form width */
    box-sizing: border-box; /* Include padding and border in width */
}

form button {
    padding: 10px 20px; /* Larger buttons for easier interaction */
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px; /* Space above the button */
}

form button:hover {
    background-color: #0056b3;
}

/* Optional: Styling for error messages */
form .error {
    color: red;
    font-size: 12px;
    margin-bottom: 10px;
}

/* Optional: Placeholder text styling */
form input::placeholder,
form textarea::placeholder {
    font-style: italic;
    color: #999;
}



/* Login Page styles */
#LoginPage {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
}

.login-container {
    background: #ffffff;
    border: 1px solid #ccc;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 300px;
    text-align: center;
}
.login-container h1 {
    margin-bottom: 20px;
    font-size: 24px;
    color: #333;
}
.login-container form {
    display: flex;
    flex-direction: column;
}
.login-container label {
    margin-bottom: 5px;
    text-align: left;
    font-size: 14px;
}
.login-container input {
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
}
.login-container button {
    padding: 10px;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}
.login-container button:hover {
    background-color: #0056b3;
}
.error {
    color: red;
    margin-bottom: 10px;
}

/* Menu Page styles */
#MenuPage {
    display: flex;
    flex-direction: row; /* Ensures content flows side by side */
    font-family: Arial, sans-serif;
    margin: 0;
    min-height: 100vh; /* Make the layout span at least the full viewport height */
    background-color: #f7f7f7;}

nav {
    width: 250px;
    background-color: #2c3e50;
    color: white;
    padding: 20px;
    box-sizing: border-box;
    position: sticky; /* Keeps the menu visible during scrolling */
    top: 0; /* Stick to the top of the viewport */
    align-self: stretch; /* Stretch to match the height of the content */
    display: flex;
    flex-direction: column; /* Vertical stacking of menu items */
}

nav h2 {
    font-size: 22px;
    margin-bottom: 20px;
}

nav a {
    color: white;
    text-decoration: none;
    display: block;
    margin: 10px 0;
    padding: 10px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

nav a.active,
nav a:hover {
    background-color: #34495e;
}

.menu-category h3 {
    font-size: 18px;
    margin-top: 20px;
    margin-bottom: 10px;
}

main {
    flex-grow: 1; /* Take up the remaining horizontal space */
    padding: 20px;
    background-color: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

header {
    background-color: #2980b9;
    color: white;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

header h1 {
    margin: 0;
    font-size: 24px;
}

header p {
    margin: 5px 0 0;
    font-size: 16px;
}

footer {
    text-align: center;
    padding: 10px;
    background-color: #2c3e50;
    color: white;
    position: fixed;
    bottom: 0;
    width: 100%;
    border-radius: 5px;
}

/* Chip + Tooltip para CSS PIC */
.pic-chip{
  position:relative; display:inline-block;
  background:#fef3c7;           /* amarillo claro */
  color:#92400e;                 /* texto */
  border:1px solid #f59e0b;      /* borde ámbar */
  border-radius:9999px; padding:2px 8px;
  font-weight:700; font-size:14px; line-height:1.2;
}
.pic-chip .pic-tip{
  position:absolute; left:50%; bottom:calc(100% + 8px);
  transform:translateX(-50%); opacity:0; pointer-events:none;
  background:#fde68a;           /* burbuja amarilla */
  color:#7c2d12; border:1px solid #f59e0b;
  border-radius:10px; padding:8px 10px;
  font-size:14px; font-weight:700; white-space:nowrap;
  box-shadow:0 6px 20px rgba(0,0,0,.15); z-index:30;
  transition:opacity .15s ease, transform .15s ease;
  max-width:260px; overflow:hidden; text-overflow:ellipsis;
}
.pic-chip .pic-tip::after{
  content:''; position:absolute; top:100%; left:50%;
  transform:translateX(-50%);
  border:6px solid transparent; border-top-color:#f59e0b; /* flecha */
}
.pic-chip:hover .pic-tip,
.pic-chip:focus .pic-tip{
  opacity:1; transform:translateX(-50%) translateY(-2px);
}

/* Avisos genéricos */
.error, .flash {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  font-size: 14px;
}

/* Éxito / info */
.flash {
  background: #ecfdf5;        /* green-50 */
  border-color: #a7f3d0;      /* green-200 */
  color: #065f46;             /* green-900 */
}

/* Error */
.error {
  background: #fef2f2;        /* red-50 */
  border-color: #fecaca;      /* red-200 */
  color: #991b1b;             /* red-900 */
}

.banner-sticky {
  position: sticky;
  top: 0;
  z-index: 50;
}

/* Notifications (bell + dropdown + toast) */
.notif { position: relative; display: inline-flex; align-items: center; margin-right: 10px; }
.notif-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  color: #fff;
  cursor: pointer;
}
.notif-btn:hover { background: rgba(255,255,255,.14); }
.notif-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 12px;
  line-height: 18px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 6px 16px rgba(0,0,0,.25);
}

.notif-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 420px;
  max-width: calc(100vw - 26px);
  background: #fff;
  color: #111827;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 18px 60px rgba(0,0,0,.25);
  overflow: hidden;
  z-index: 200;
}
.notif-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 12px;
  background: #111827;
  color: #fff;
  font-weight: 700;
}
.notif-markall {
  background: rgba(255,255,255,.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,.18);
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
}
.notif-markall:hover { background: rgba(255,255,255,.18); }

.notif-list { max-height: 380px; overflow-y: auto; }
.notif-empty { padding: 14px; color: #6b7280; font-size: 13px; }
.notif-item {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 12px 12px;
  border-bottom: 1px solid #f3f4f6;
}
.notif-item:hover { background: #f9fafb; }
.ni-title { font-weight: 800; font-size: 13px; margin-bottom: 4px; }
.ni-subject { font-size: 13px; color: #111827; margin-bottom: 4px; }
.ni-meta { font-size: 12px; color: #6b7280; }
.notif-foot { padding: 10px 12px; background: #f9fafb; }
.notif-hint { font-size: 12px; color: #6b7280; }

/* Toast */
.notif-toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 360px;
  max-width: calc(100vw - 32px);
  background: #111827;
  color: #fff;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 20px 70px rgba(0,0,0,.35);
  z-index: 999;
}
.notif-toast.hide { opacity: 0; transform: translateY(10px); transition: opacity .25s ease, transform .25s ease; }
.nt-title { font-weight: 800; margin-bottom: 6px; }
.nt-subject { font-size: 13px; opacity: .95; margin-bottom: 4px; }
.nt-sender { font-size: 12px; opacity: .75; margin-bottom: 10px; }
.nt-actions { display: flex; gap: 10px; align-items: center; }
.nt-open {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 10px;
  background: #2563eb;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 12px;
}
.nt-dismiss {
  background: rgba(255,255,255,.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,.18);
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
}
.nt-dismiss:hover { background: rgba(255,255,255,.18); }
