/* ==========================
   🔁 1. RESET
   ========================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: var(--font-base);
  background-color: var(--color-bg);
  color: var(--color-text);
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
  border: none;
  outline: none;
  background: none;
}

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

ul,
ol {
  list-style: none;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

html:focus-within {
  scroll-behavior: smooth;
}


/* ==========================
   🎨 2. VARIABLES GLOBALES
   ========================== */

:root {
  /* COLORS */
  --color-bg: #ffffff;
  --color-bg-alt: #F2F2F2;
  --color-text: #1A1A1A;
  --color-link: #6B6B6B;
  --color-primary: #384D6C;
  --color-secondary: #CDE1FE;
  --color-accent: #10AF02;
  --color-wrong: #FF4242;
  --color-muted: #E5E5E5;
  --color-disabled: #8D8686;
  --color-border: #EDEDED;

  --color-brand-blue: #3b82f6;
  --color-brand-blue-soft: #eff6ff;
  --color-info-soft: #dbeafe;
  --color-info-strong: #1d4ed8;

  --color-success-highlight: #65e069;
  --color-success-strong: #15803d;
  --color-success-mid: #059669;
  --color-success-dark: #065f46;
  --color-success-alt: #047857;

  --color-warning-soft: #fef3c7;
  --color-warning-strong: #d97706;
  --color-warning-dark: #92400e;

  --color-error-soft: #fe9898;
  --color-error-strong: #d54e4e;
  --color-error-dark:  #de0c0c
  ;


  --color-border-strong: #BEBEBE;
  --color-brand-indigo: #667eea;
  --color-brand-purple: #764ba2;
  --color-slate-500: #64748b;

  --gradient-purple-start: #667eea;
  --gradient-purple-end: #764ba2;
  --gradient-green-start: #10b981;
  --gradient-green-end: #059669;
  --gradient-amber-start: #f59e0b;
  --gradient-amber-end: #d97706;
  --gradient-warning-start: #fbbf24;
  --gradient-warning-end: #f97316;


  /* FONTS */
  --font-base: 'Montserrat', sans-serif;
  --font-size-base: 16px;
  --font-size-sm: 14px;
  --font-size-lg: 18px;

  /* SPACING */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 32px;
  --spacing-xl: 64px;

  /* BORDER RADIUS */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 15px;

  /* SHADOWS */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);

  --container: 1875px;
}


/* ==========================
   ⚙️ 3. ESTILOS GENERALES
   ========================== */

a {
  color: var(--color-link);
  transition: all 0.2s;
}
a:hover, a:focus {
  color: var(--color-primary);
}

#page-content {
  position: relative;
}

.section {
  padding: var(--spacing-md) var(--spacing-lg);
}
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  position: revert;
}

.text-center {
  text-align: center;
}

.hidden {
  display: none !important;
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin-block: var(--spacing-md);
}

input:not([type="submit"]), textarea, select {
  font-family: var(--font-base);
  font-size: var(--font-size-base);
  font-weight: 400;
  border-radius: var(--radius-sm);
  background: var(--color-bg-alt);
  border-color: var(--color-primary);
  color: var(--color-primary);
  border-width: 1px;
  border-style: solid;
  width: 100%;
  transition: all 0.2s;
}

input[type="date"],
input[type="datetime-local"],
input[type="email"],
input[type="file"],
input[type="month"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="text"],
input[type="time"],
input[type="url"],
input[type="week"],
select {
  min-height: 54px;
  line-height: 54px;
  padding: 0 var(--spacing-md);
}

input[type="checkbox"], input[type="radio"] {
  -webkit-appearance: none;
  appearance: none;
  vertical-align: top;
  flex-shrink: 0;
  text-align: center;
  margin-right: .5em;
  letter-spacing: 0;
  text-transform: none;
  line-height: 16px;
  height: 16px;
  width: 16px;
  padding: 0;
  box-sizing: content-box;
  border-width: 2px;
  border-radius: 4px;
  background: #ffffff;
}
input[type="checkbox"]::before {
  visibility: hidden;
  content: '\f00c';
  font-family: "Font Awesome 6 Free";
  font-weight: 700;
  vertical-align: top;
}
input[type="radio"] {
  border-width: 1px !important;
  border-radius: 50% !important;
}
input[type="radio"]::before {
  visibility: hidden;
  content: '';
  display: block;
  height: 10px;
  width: 10px;
  margin: 3px;
  border-radius: inherit;
  background: currentColor;
}
input:checked::before {
  visibility: visible;
}

span.list-item {
  display: block;
  margin: 0;
  width: fit-content;
}
span.list-item > label {
  display: flex;
  align-items: center;
  padding: .2em 0;
  cursor: pointer;
}
span.list-item span.list-item-label {
  font-size: var(--font-size-sm);
}

.button {
  outline: none;
  padding: 0.9em;
  background: var(--color-primary);
  border-color: var(--color-primary);
  border-width: 1px;
  border-style: solid;
  color: #ffffff;
  font-size: var(--font-size-lg);
  border-radius: var(--radius-sm);
  line-height: 1.2;
  font-weight: 400;
  box-shadow: 0;
  transition-property: background,border,box-shadow,color,opacity,transform;
  transition-duration: 0.3s;
  text-align: center;
}
.button:hover, .button:focus {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
  box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);
}
.button.icon {
  width: 29px;
  height: 29px;
  line-height: 29px;
  padding: 0.15em;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  box-shadow: none !important;
}
.button.icon-right {
  display: inline-flex;
  justify-content: space-between;
  align-items: center;
}
.button.disabled {
  background: var(--color-muted);
  border-color: var(--color-disabled);
  color: var(--color-disabled);
  pointer-events: none;
}
button[type="submit"],
input[type="submit"] {
  font-weight: 400;
  height: 54px;
  font-size: large;
  outline: none;
  display: inline-block;
  vertical-align: top;
  text-align: center;
  position: relative;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
  overflow: visible;
  -webkit-appearance: button;
  appearance: button;
  cursor: pointer;
  width: 100%;
  box-shadow: none !important;
}

.hidden {
  display: none;
}

.tooltip {
  padding: 0.9em;
  background: var(--color-bg-alt);
  border-color: var(--color-bg-alt);
  border-width: 1px;
  border-style: solid;
  color: var(--color-primary);
  font-size: var(--font-size-sm);
  border-radius: var(--radius-sm);
  line-height: 1.2;
  font-weight: 400;
  box-shadow: 0;
  transition-property: background,border,box-shadow,color,opacity,transform;
  transition-duration: 0.3s;
  gap: 0.9em;
  display: inline-flex;
  align-items: center;
}

/* ==========================
   🧩 4. CUSTOM STYLES
   ========================== */

/* HEADER */
header.sticky {
  position: fixed;
  top: 0;
  left: 0;
  width: 100dvw;
  z-index: 9999;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
header.default .subheader {
  background: var(--color-bg);
  padding: var(--spacing-md) var(--spacing-lg);
  font-size: var(--font-size-sm);
}
header.w-header .subheader,
.cards-week .card-week .card-week-header {
  background: var(--color-bg-alt);
  padding-inline: var(--spacing-lg);
  height: 45px;
  color: var(--color-primary);
  font-weight: 500;
  font-size: var(--font-size-lg);
  text-align: center;
}
header .subheader .container {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}
header .subheader-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  width: 100%;
  gap: var(--spacing-md);
}
header.w-header .subheader .container {
  max-width: 350px;
}
header .subheader-cell {
  display: flex;
  align-items: center;
  flex-grow: 1;
}
header .subheader-cell a {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
}
header .subheader-cell.at_left,
header .subheader-cell.at_right {
  display: flex;
}
header .subheader-cell.at_left {
  justify-content: flex-start;
}
header .subheader-cell.at_right {
  justify-content: flex-end;
}
header .subheader-cell.at_center {
  justify-content: center;
}
header.w-header .subheader-cell.at_left,
header.w-header .subheader-cell.at_right {
  flex-basis: 50px;
}
header .subheader-cell.at_left > * {
  margin-right: 1.6em;
}
header .subheader-cell.at_right > * {
  margin-left: 1.6em;
}
header.w-header .subheader-cell.at_left > * {
  margin-right: 0.5em;
}
header.w-header .subheader-cell.at_right > * {
  margin-left: 0.5em;
}
header .button.icon-right {
  max-width: 170px;
}

header div.title-header {
  font-weight: 700;
  color: var(--color-primary);
  display: flex;
  flex-direction: column;
  gap: 0.25em;
}
header div.title-header h1 {
  font-size: var(--font-size-sm);
  color: rgba(0, 0, 0, 0.4);
  font-weight: 400;
  white-space: nowrap;
}
header .week-range-wrapper {
  display: flex;
  justify-content: center;
}
header .week-range-buttons {
  display: flex;
  gap: 0.4em;
  justify-content: center;
}
header .week-range-button {
  border: 1px solid var(--color-border);
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
header .week-range-button:hover:not(:disabled) {
  background: var(--color-primary);
  color: #fff;
}
header .week-range-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

header .nav-mobile {
  display: none;
}

header .tooltips .wrapper-tooltips {
  display: flex;
  gap: 1.4em;
}
header .tooltip.total {
  font-weight: 700;
  background: var(--color-secondary);
  border-color: var(--color-secondary);
}
header .tooltip > span {
  font-weight: 700;
}

header div.account {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  overflow: visible;
  position: relative;
}
header div.account img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  border-radius: var(--radius-sm);
}
header div.account .account-trigger {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

/* Dropdown del menú de usuario */
header div.account .account-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  min-width: 220px;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
}
header div.account:hover .account-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

header div.account .account-dropdown-header {
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--color-border);
}
header div.account .account-dropdown-header .user-name {
  font-weight: 600;
  color: var(--color-primary);
  font-size: var(--font-size-base);
  display: block;
}

header div.account .account-dropdown-menu {
  list-style: none;
  margin: 0;
  padding: var(--spacing-sm) 0;
}
header div.account .account-dropdown-menu li {
  margin: 0;
}
header div.account .account-dropdown-menu li.dropdown-divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--spacing-sm) 0;
}
header div.account .account-dropdown-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  transition: background 0.2s;
  cursor: pointer;
  width: 100%;
  text-align: left;
}
header div.account .account-dropdown-menu .dropdown-item:hover {
  background: var(--color-bg-alt);
  color: var(--color-primary);
}
header div.account .account-dropdown-menu .dropdown-item i {
  width: 16px;
  text-align: center;
  color: var(--color-link);
}
header div.account .account-dropdown-menu .dropdown-item:hover i {
  color: var(--color-primary);
}

/* LOGIN Y FICHAR */
#login {
  padding-top: 45px;
  padding-bottom: 45px;
}
#login .container,
#sign-on .container {
  max-width: 350px;
  margin-top: 128px;
}
/**/

form div.form-block {
  display: inline-block;
  width: 100%;
  margin-bottom: 20px;
}
form div.form-submit {
  padding: 15px 0;
}
form div.form-forgot {
  text-align: center;
  padding-top: 15;
  line-height: 1.6;
  font-size: var(--font-size-sm);
}

span.label {
  display: none !important;
}

div.wrapper-buttons {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: var(--spacing-md);
}
div.wrapper-buttons a {
  width: 100%;
  height: 45px;
  max-width: 50%;
}

div#total-hours {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5em 0.9em;
  font-size: var(--font-size-lg);
  background: var(--color-secondary);
  color: var(--color-primary);
  font-weight: 700;
  border-radius: var(--radius-sm);
  margin-bottom: var(--spacing-md);
}
div.resume {
  margin-bottom: var(--spacing-lg);
}
div.resume div.entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--font-size-sm);
  color: var(--color-primary);
  margin-bottom: var(--spacing-xs);
  font-weight: 500;
  position: relative;
  gap: 0.5em;
}
div.resume div.entry .title-label,
div.resume div.entry .hours {
  white-space: nowrap;
}
div.resume div.entry .separator {
  flex-grow: 1;
  height: 1px;
  margin-bottom: 5px;
  background-color: #BEBEBE;
  align-self: flex-end;
}
div.resume div.entry:last-child {
  margin-bottom: 0;
}
.hours.extra {
  color: var(--color-accent);
}
.hours.left {
  color: var(--color-wrong);
}

.block-duration {
  white-space: nowrap;
}

div.time-summary {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}
div.time-summary div.time-block {
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-md);
  padding: var(--spacing-md) 0;
  overflow: hidden;
}
div.time-summary div.time-block div.time-block-header {
  padding-inline: 0.9em;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--font-size-lg);
  color: var(--color-primary);
  font-weight: 700;
  gap: 0.5em;
}
div.time-summary div.time-block div.time-block-body div.time-block-resume {
  padding-top: var(--spacing-md);  
  margin-top: var(--spacing-md);
  border-top: 1px solid var(--color-border);
}

div.time-block-resume > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-inline: 0.9em;
  font-weight: 500;
  font-size: var(--font-size-sm);
  color: var(--color-primary);
  margin-bottom: var(--spacing-sm);
  gap: 0.9em;
}
div.time-block-resume > div:last-child {
  margin-bottom: 0;
}
div.time-block-resume div.time-block-resume-header {
  font-weight: 600;
}

div.time-entry div.wrapper-inputs {
  display: flex;
  align-items: center;
  gap: 0.3em;
}
div.time-entry span {
  font-size: 16px;

}
div.time-entry div.wrapper-inputs input {
  width: 100%;
  text-align: center;
  font-size: 16px;
  background: var(--color-bg);
  color: var(--color-primary);
  border-color: #BEBEBE;
  font-weight: 500;
  min-height: 46px;
  line-height: 16px;
  padding-inline: 8px;
  
}
div.time-entry div.wrapper-inputs input:disabled {
  color: #BEBEBE;
  cursor: not-allowed;
}

.time-input-actions {
  display: flex;
  gap: 8px;
}

.btn-time-action {
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  color: #fff;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn-time-accept {
  background-color: #384D6C;
}

.btn-time-cancel {
  background-color: #8B1C2C;
}

div.time-block-work {
  background: var(--color-bg-alt);
}
div.time-summary div.time-block div.time-block-body div.time-block-resume {
  border-top: 1px solid #C5C5C5;
}
div.time-block-work div.time-block-body div.time-block-resume div.time-block-resume-header {
  display: none;
}

.modal-popup {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.modal-popup .modal-content {
  padding: var(--spacing-xl) var(--spacing-lg);
}
.modal-popup .container > a.close {
  position: absolute;
  top: -50px;
  right: 0;
  font-size: 24px;
  color: var(--color-primary);
}
.modal-popup.default {
  top: 45px;
  background: rgba(255,255,255,0.95);
  height: calc(100% + 45px);
}
.modal-popup.default .container {
  position: relative;
  max-width: 350px;
}

.modal-popup .modal-message {
  font-size: var(--font-size-sm);
  color: var(--color-primary);
}
.modal-popup .modal-message strong {
  font-weight: 600;
}
.modal-popup .modal-message .box-icon {
  display: flex;
  gap: 0.9em;
  margin-bottom: var(--spacing-lg);
}
.modal-popup .modal-message .box-icon i {
  font-size: 28px;
  color: var(--color-wrong);
}
.modal-popup .modal-message form {
  margin-bottom: var(--spacing-lg);
}
.modal-popup .modal-message form,
.modal-popup .modal-message form span.list-item span.list-item-label {  
  font-size: var(--font-size-lg);
}
.modal-popup .modal-message form small {
  color: var(--color-link);
}

.modal-popup .button {
  font-size: var(--font-size-sm);
  font-weight: 500;
  box-shadow: none !important;
}

/* SEMANAL */
#week {
  background: #C5C5C5;
  padding: 0;
  /* margin-top: 128px; */
}
#week .container {
  max-width: calc(var(--container) + var(--spacing-md));
  margin-top: 128px;
}

.cards-wee2-scroll {
  overflow-x: auto;
  overflow-y: auto;
  padding-inline: var(--spacing-md);
  -webkit-overflow-scrolling: touch;
  max-height: calc(100dvh - 95px);
}
.cards-week {
  padding: var(--spacing-md);
  display: flex;
  gap: 15px;
  min-width: max-content;
}

.cards-week .card-week {
  flex: 0 1 calc(100% / 7);
  background: var(--color-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  min-width: 225px;
}
.cards-week .card-week .card-week-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--font-size-base);
  padding-inline: var(--spacing-md);
  white-space: nowrap;
}
.cards-week .card-week .card-week-header a:hover{
transform: scale(1.1);
transition: all 0.2s ease;
filter: drop-shadow(3px 3px 2px #6B6B6B);
}
.cards-week .card-week .card-week-body {
  padding: var(--spacing-md);
}

.cards-week div.time-entry div.wrapper-inputs input {
  max-width: 67px;
}
.cards-week div.time-summary div.time-block div.time-block-header {
  font-size: var(--font-size-sm);
  line-height: 1.2;
}
.cards-week div.time-summary div.time-block-work div.time-block-header {
  font-size: var(--font-size-lg);
}

@media only screen and (max-width: 1160px) {

  header.sticky {
    border-bottom: 2px solid #EFECE8;
  }

  header .subheader-cell.at_left > * {
    margin-right: 0.9em;
  }
  header .subheader-cell.at_right > * {
    margin-left: 0.9em;
  }

  header.default .subheader {
    padding-inline: var(--spacing-md);
  }
  .cards-week-scroll {
    padding-inline: 0;
  }

  header div.title-header {
    margin-right: 0 !important;
  }

  header .nav-mobile {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: calc(100% - 15px);
    left: 50%;
    transform: translateX(-50%) rotate(0deg);
    width: 35px;
    height: 35px;
    border-radius: 35px;
    background: #EFECE8;
    cursor: pointer;
    color: var(--color-primary);
    transition: .3s;
    z-index: 9;
  }
  header .tooltips.open .nav-mobile {
    transform: translateX(-50%) rotate(180deg);
  }
  header .tooltips .wrapper-tooltips {
    display: none;
    opacity: 0;
    transition: .3s;
  }
  header .tooltips.open .wrapper-tooltips {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    position: absolute;
    background: #fff;
    top: calc(100% + 2px);
    left: 0;
    width: 100%;
    padding: var(--spacing-md);
    opacity: 1;
  }
  header .button.icon-right {
    min-width: 120px;
    padding: 0.65em 0.9em;
    flex-grow: 0;
  }

  .tooltip {
    justify-content: space-between;
    flex: 1 1 100px;
  }

}

@media only screen and (max-width: 490px) {

  .cards-week-scroll {
    max-height: none;
    overflow-x: hidden;
  }
  .cards-week {
    flex-direction: column;
    min-width: 100%;
  }
  /*.cards-week:after {
    display: none;
  }*/
  .cards-week .card-week {
    flex: 0 0 auto !important;
    width: 100%;
    min-width: auto;
  }

}

/* User role styles */
.user-role {
  font-size: 0.8em;
  color: #666;
  font-weight: normal;
  display: block;
  margin-top: 2px;
}