:root {
    --SideBarButton: 60px;
    --SideBarHoverColor: #34495e;
    --SideBarTextColor: #ffffff;
    --MainColor: #2C67A7;
}

/* ===============================
   GLOBAL NORMALISATION
   =============================== */

*, *::before, *::after {
    box-sizing: border-box;
}

/* ===============================
   TABLE SCROLLING
   =============================== */

.table-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    max-height: 900px;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 2rem;
}

.responsive-table {
    border-collapse: collapse;
    width: max-content;
    min-width: 100%;
    table-layout: auto;
}

.responsive-table th,
.responsive-table td {
    white-space: nowrap;
    padding: 8px 12px;
    text-align: left;
    border: 1px solid #ddd;
    background: #fff;
}

.responsive-table th {
    position: sticky;
    top: 0;
    background-color: #f9f9f9;
    z-index: 10;
}

/* ===============================
   FORM CONTROLS (CRITICAL)
   =============================== */

input[type="text"],
input[type="password"],
input[type="date"],
select,
textarea {
    padding: 10px;
    margin: 8px 0;
    font-size: 16px; /* Prevent Android zoom */
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
	text-align: center;
}

/* Buttons */
input[type="submit"],
button {
    background: none;
    border: none;
}

input[type="submit"]:hover,
button:hover {
    opacity: 0.9;
}

.form-button {
    width: 100%;
    max-width: 400px;
    padding: 14px;
    font-size: 16px;
    background-color: var(--MainColor);
    color: #fff;
    margin: 8px 0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* ===============================
   FORMS IN TABLES (ABSENSES)
   =============================== */

.form-table {
    width: 100%;
    max-width: 900px; /* desktop */
    margin: auto;
}

@media (max-width: 1024px) {
    .form-table {
        max-width: 100%;
    }
}

.form-control,
input,
select,
textarea {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
}

.form-table td:first-child {
    min-width: 160px;
    white-space: nowrap;
}

.form-table td:last-child {
    width: 100%;
}

/* ===============================
   FOOTER
   =============================== */

.footer {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    text-align: center;
    background-color: #f2f2f2;
}

/* ===============================
   LOGIN
   =============================== */

.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

#login {
    width: 100%;
    max-width: 800px;
    padding: 20px;
    box-shadow: 0 0 18px #ccc;
    border-radius: 10px;
    background-color: #f2f2f2;
}

/* ===============================
   LOGO / CENTERING
   =============================== */

.center {
    display: block;
    margin-left: auto;
    margin-right: auto;
    width: 70%;
    height: auto;
    text-align: center;
}

.text-center {
    text-align: center;
}

/* ===============================
   TIMER
   =============================== */

.timer {
    position: absolute;
    top: 1%;
    right: 1%;
    font-size: 24px;
}

/* ===============================
   SIDEBAR
   =============================== */

.sidenav {
    height: 100%;
    width: 250px;
    position: fixed;
    z-index: 1;
    top: 0;
    left: 0;
    background-color: var(--MainColor);
    overflow-x: hidden;
    transition: 1s;
    padding-top: 20px;
}

.sidenav.collapsed {
    width: var(--SideBarButton);
}

.sidenav .toggle-btn {
    position: fixed;
    top: 15px;
    left: 250px;
    background-color: var(--MainColor);
    color: white;
    padding: 10px 15px;
    font-size: 20px;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.2);
    transition: left 1s ease;
    z-index: 1100;
}

.sidenav.collapsed .toggle-btn {
    left: var(--SideBarButton);
}

.sidenav img {
    display: block;
    margin: 0 auto 10px auto;
    width: 80%;
    transition: 1s;
}

.sidenav .user-info {
  color: var(--SideBarTextColor);
  text-align: center;
  margin-bottom: 20px;
  font-size: 18px;
}

.sidenav.collapsed img {
    width: 30px;
}

.sidenav a {
    padding: 12px 16px;
    text-decoration: none;
    font-size: 16px;
    color: var(--SideBarTextColor);
    display: block;
    transition: font-size 1s ease, opacity 1s ease;
}

.sidenav a:hover {
    background-color: var(--SideBarHoverColor);
}

/* COLLAPSED SIDEBAR BEHAVIOUR */
.sidenav.collapsed a {
    text-align: center;
    padding: 12px 0;
}

.sidenav.collapsed a span {
    display: none; /* HIDE TEXT */
}

.sidenav.collapsed a i {
    font-size: 20px;
    margin: 0;
}

.sidenav.collapsed .user-info {
    display: none;
}

.sidenav.collapsed img {
    width: 40px;
    margin: 10px auto;
}

/* ===============================
   MAIN CONTENT
   =============================== */

.main {
    margin-left: 250px;
    max-width: calc(100% - 250px);
    font-size: 20px;
    padding: 0 10px;
    transition: margin-left 1s ease, max-width 1s ease;
}

.sidenav.collapsed ~ .main {
    margin-left: 60px;
    max-width: calc(100% - 60px);
}

/* ===============================
   STATUS DOTS
   =============================== */

.status-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    cursor: pointer;
    border: 1px solid rgba(0,0,0,0.25);
    box-shadow: 0 0 0 2px rgba(0,0,0,1);
}

.status-dot[data-value="1"] {
    background-color: #2ecc71;
}

.status-dot[data-value="0"] {
    background-color: #e74c3c;
}

/* ===============================
   CALENDAR
   =============================== */

.calendar {
    width: 100%;
    border-collapse: collapse;
}

.calendar th,
.calendar td {
    border: 1px solid #ddd;
    padding: 5px;
}

.calendar td {
    height: 100px;
    vertical-align: top;
}

.calendar .date {
    font-size: 18px;
    font-weight: bold;
}

.calendar .events {
    margin-top: 10px;
    max-height: 60px;
    overflow-y: auto;
}

.calendar .holidays { background-color: #ffcccc; }
.calendar .sickness { background-color: #ccffcc; }
.calendar .unpaid { background-color: #ccccff; }
.calendar .maternity { background-color: #ffccff; }
.calendar .paternity { background-color: #ffffcc; }

.more-link {
    color: #0000ff;
    text-decoration: underline;
    cursor: pointer;
}

.color-box {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border-radius: 4px;
}

.color-key {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}


/* Bootstrap override (Android fix) */
input[type="date"],
input[type="text"],
select,
textarea {
    width: 100% !important;
    max-width: 100% !important;
}