@import url('https://fonts.googleapis.com/css2?family=Exo:ital,wght@0,100..900;1,100..900&family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');

body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    font-family: "Exo", sans-serif;
    background-color: #f5f5f5;
}

/* Login Page */
.login-container {
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    width: 320px;
    background: white;
}
.input-group {
    position: relative;
    margin-bottom: 20px;
}
.input-group input {
    width: 100%;
    padding: 12px 36px 12px 12px;
    border: 1px solid #d3d3d3;
    border-radius: 6px;
    font-size: 14px;
    background: transparent;
    outline: none;
    box-sizing: border-box;
}
.input-group input:focus {
    border-color: #1761a0;
    background: #fff;
    outline: none;
}
.input-group label {
    position: absolute;
    top: 14px;
    left: 12px;
    font-size: 14px;
    color: #888;
    pointer-events: none;
    transition: 0.2s ease all;
    background: white;
    padding: 0 4px;
    border-radius: 2px;
}
.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label {
    top: -8px;
    left: 10px;
    font-size: 13px;
    color: #1761a0;
    font-weight: 600;
}

.show-password-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.9rem;
    color: #939393;
}
.show-password-btn.active {
    color: #1761a0;
}

button.btn-primary {
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    border: none;
    background-color: #1761a0;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    display: block;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    justify-content: center;
    align-items: center;
}
button.btn-primary:hover {
    background-color: #2c8c8a;
}

.message {
    color: #2c8c8a;
    text-align: center;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 20px;
}
/* Sort icons in header */
th {
  position: relative;
  cursor: pointer;
  user-select: none;
}

/* TOPBAR */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 40px;
    border-bottom: 2px solid #e0e0e0;
    background-color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 1000;
}
.topbar .logo {
    height: 50px;
    width: auto;
}
.icon-btn {
    background: none;
    border: none;
    color: #20c1f5;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 90px;
}
.icon-btn:hover {
    color: #2c8c8a;
}

body.dashboard-page {
    padding-top: 60px;
    display: block;
}

/* Dashboard Header */
.dashboard-header {
    text-align: center;
    margin: 20px 0 40px;
}
.dashboard-header h1 {
    font-size: 50px;
    font-weight: 800;
    text-transform: uppercase;
    background: -webkit-linear-gradient(180deg, #20c1f5, #2c8c8a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    margin-bottom: 10px;
}
.dashboard-header p {
    font-size: 18px;
    color: #222;
    font-weight: 400;
    margin: 0;
}

/* CSV Upload */
.csv-upload {
  /* margin-left: 10px; */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #2c8c8a;
  width: 34px;
  height: 34px;
  cursor: pointer;
}

.csv-upload i {
  font-size: 18px;
  color: #2c8c8a;
}

/* TABLE */
.table-container {
    margin: 20px;
    overflow-x: auto;
    border-radius: 12px;
}
table {
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    overflow: hidden;
}
thead {
    background: -webkit-linear-gradient(180deg, #20c1f5, #2c8c8a);
    color: #fff;
    font-weight: 600;
    font-size: 15px;
}
.sort-icons {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2px;
  width: 10px;
  height: 100%;
  margin-left: 6px;
  position: relative;
  top: -1px;
}
.sort-icons::before,
.sort-icons::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  opacity: 0.6;
  transition: all 0.2s ease;
}
.sort-icons::before {
  border-bottom: 4px solid rgba(255, 255, 255, 0.7);
}
.sort-icons::after {
  border-top: 4px solid rgba(255, 255, 255, 0.7);
}

th:hover .sort-icons::before,
th:hover .sort-icons::after {
  opacity: 0.9;
}

/* Active ascending */
th.sorted-asc .sort-icons::before {
  border-bottom-color: #ffffff;
  opacity: 1;
}
th.sorted-asc .sort-icons::after {
  opacity: 0.3;
}

/* Active descending */
th.sorted-desc .sort-icons::after {
  border-top-color: #ffffff;
  opacity: 1;
}
th.sorted-desc .sort-icons::before {
  opacity: 0.3;
}

th, td {
    padding: 14px 16px;
    text-align: left;
}
tbody tr {
    position: relative;
}
tbody tr::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, #20c1f5 0%, #1761a0 50%, #2c8c8a 100%);
}
td a {
    text-decoration: none;
    color: black;
}
td a:hover {
    color: #939393;
}
th, td {
    padding: 12px 16px;
    text-align: left;
    vertical-align: top;
    word-break: break-word;
}
/* --- Stable, perfectly aligned sort icons --- */
thead th {
  vertical-align: middle;
  white-space: nowrap;
  line-height: 1.2;
  text-align: left;
}

th {
  position: relative;
  padding: 12px 16px;
}

/* Align sort icons and dropdown arrows in one straight line */
th .sort-icons {
  color: #fff;
  position: relative;
  vertical-align: middle;
}

/* Branche dropdown alignment fix */
.category-checkbox-dropdown {
  display: inline-block;
  vertical-align: middle;
  margin-left: 4px;
}

.category-checkbox-dropdown i {
  font-size: 12px;
  position: relative;
  top: -1px;
}

th:nth-child(1), td:nth-child(1) { width: 60px; }
th:nth-child(2), td:nth-child(2) { width: 150px; }
th:nth-child(3), td:nth-child(3) { width: 140px; }
th:nth-child(4), td:nth-child(4) { width: 190px; }
th:nth-child(5), td:nth-child(5) { width: 130px; }
th:nth-child(6), td:nth-child(6) { width: 70px; }
th:nth-child(7), td:nth-child(7) { width: 100px; }
th:nth-child(8), td:nth-child(8) { width: 150px; }
th:nth-child(9), td:nth-child(9) { width: 140px; }
th:nth-child(10), td:nth-child(10) { width: 180px; }
th:nth-child(11), td:nth-child(11) { width: 500px; }
th:nth-child(12), td:nth-child(12) { width: 220px; }
th:nth-child(13), td:nth-child(13) { width: 20px; }

/* Category Dropdown Styling */
.category-checkbox-dropdown {
    position: relative;
    display: inline-block;
    margin-left: 8px;
}
.dropdown-btn {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 12px;
    color: white;
}
.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 250px;
    border: 1px solid #ccc;
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
    padding: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    border-radius: 6px;
}
.category-checkbox-dropdown.show .dropdown-content {
    display: block;
}
.dropdown-content label {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
    color: #333;
    text-transform: uppercase;
}
.dropdown-content input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
    accent-color: #2c8c8a;
}
.dropdown-content input[type="checkbox"]:hover {
    accent-color: #2c8c8a;
}

/* Download */
.download {
    text-decoration: none;
    color: #fff;
}
.download:hover {
    color: #2c8c8a;
}
.download i {
    font-size: 18px;
}

/* See more Section */
.see-more-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}
.see-more-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.see-more-btn {
  background: none;
  border: none;
  cursor: pointer;
  margin-left: 8px;
  font-size: 16px;
  color: #20c1f5;
}
.see-more-btn:hover {
  color: #2c8c8a;
}

/* PAGINATION CONTROLS */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 32px;
    margin: 20px 40px 40px;
    background: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
}
.data-range {
    font-size: 15px;
    color: #666;
    min-width: 160px;
    text-align: left;
}

/* ITEMS PER PAGE */
.items-per-page-container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    background: none;
    box-shadow: none;
    padding: 0;
}
.items-per-page-container input {
    width: 48px;
    padding: 6px 10px;
    outline: none;
    border: 1px solid #d3d3d3;
    border-radius: 6px;
    font-size: 15px;
    margin: 0 4px;
    background: #fafbfc;
    transition: border 0.2s;
}
.items-per-page-container input:focus {
    color: #1761a0;
}
.items-per-page-container button {
    padding: 6px 12px;
    border-radius: 8px;
    border: none;
    background: #f5f5f5;
    color: #1761a0;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, color 0.3s;
    margin-left: 2px;
}
.items-per-page-container button:hover {
    background: #1761a0;
    color: #fff;
}

/* PAGINATION */
#pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    background: none;
    box-shadow: none;
    padding: 0;
}
.pagination-btn {
    padding: 6px 10px;
    border-radius: 6px;
    color: #1761a0;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    margin: 0 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pagination-btn.disabled {
    color: #bbb;
    pointer-events: none;
}
.pagination-page-input {
    width: 40px;
    padding: 4px 6px;
    border: 1px solid #d3d3d3;
    border-radius: 6px;
    font-size: 15px;
    margin: 0 4px;
    text-align: center;
}
.pagination-of {
    font-size: 15px;
    color: #666;
    margin: 0 4px;
}

/* Modern purple scrollbar for all scrollable elements */
.table-container::-webkit-scrollbar,
.dropdown-content::-webkit-scrollbar {
    width: 8px;
    height: 8px;
    border-radius: 8px;
}

/* Scroll */
.table-container::-webkit-scrollbar-track,
.dropdown-content::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 8px;
}
.table-container::-webkit-scrollbar-thumb,
.dropdown-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #1761a0, #2c8c8a);
    border-radius: 8px;
}
.table-container::-webkit-scrollbar-thumb:hover,
.dropdown-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #a04ee1, #2c8c8a);
}
.table-container,
.dropdown-content {
    scrollbar-width: thin;
    scrollbar-color: #1761a0 #f0f0f0;
}

/* RESPONSIVE DESIGN */

/* Media query: Tablet / Mobile */
@media (max-width: 900px) {
    .dashboard-header h1 {
        font-size: 32px;
    }
    .upload-section, .table-container {
        margin: 0 10px;
    }
    .table-container { 
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; 
    }
    table {
        min-width: 700px;
        width: max-content;
    }
}

/* Mobile (smaller screens) */
@media (max-width: 600px) {
    .dashboard-header h1 {
        font-size: 22px;
    }
    .dashboard-header p {
        font-size: 14px;
    }
    .upload-section, .table-container {
        margin: 0 2vw;
    }
    table {
        min-width: 600px;
    }
    .pagination-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin: 20px 10px 40px;
    }
    .items-per-page-container,
    .data-range,
    #pagination {
        justify-content: center;
        text-align: center;
        width: 100%;
    }
    .items-per-page-container {
        flex-wrap: wrap;
        gap: 6px;
    }
    #pagination {
        flex-wrap: wrap;
        gap: 4px;
    }
    .pagination-btn {
        font-size: 16px;
        padding: 6px 8px;
    }
    .pagination-page-input {
        width: 36px;
        padding: 4px;
    }
    .data-range {
        min-width: auto;
    }
}