/* =========================
   Global layout
   ========================= */

body {
    background: darkgreen;
    font-family: 'Courier New', monospace;
    margin: 0;
    padding: 0;
}

/* =========================
   Top section
   ========================= */

.upperBox {
    background-color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.upperLeftBox h1 {
    margin: 0;
}

.upperRightBox {
    text-align: right;
}

.upperRightBox h2,
.upperRightBox h3 {
    margin: 0;
}

/* =========================
   Main layout
   ========================= */

.content {
    display: flex;
    align-items: flex-start;
    gap: 30px;
    padding: 20px;
}

.leftBox {
    width: 350px;
    margin-top: 20px;
}

.rightBox {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 40px;
}

/* =========================
   Navigation
   ========================= */

nav {
    flex-direction: column;
}

.mngtList {
    font-size: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: white;
    padding: 6px;
    border-radius: 8px;
    margin: 20px;
    height: 50px;
    text-decoration: none;
    color: black;
}

.mngtList:hover {
    background-color: #f2f2f2;
}

.mngtList i {
    color: black;
}

/* =========================
   User filter (search bar)
   ========================= */

.userFilterWrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 25px;
}

.userFilterBox {
    background: white;
    padding: 14px 18px;
    border-radius: 12px;

    display: flex;
    gap: 12px;
    align-items: center;

    width: 100%;
    max-width: 1100px;  
}

.userFilterBox input,
.userFilterBox select {
    padding: 10px 12px;
    font-size: 14px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.userFilterBox input {
    flex: 1;
}

.userFilterBox select {
    width: 180px;
}

.userFilterBox .btn {
    margin-top: 0;
    white-space: nowrap;
}



/* =========================
   User cards
   ========================= */

.userCard {
    background: white;
    border-radius: 12px;
    padding: 18px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

.userLeft {
    display: flex;
    align-items: center;
    gap: 18px;
}

.userAvatar {
    font-size: 40px;
    color: #333;
}

.userInfo {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.userInfo strong {
    font-size: 18px;
}

.userInfo p {
    color: #555;
    font-size: 14px;
    margin: 2px;
}

.userRole {
    font-size: 14px;
    font-weight: bold;
    color: #333;
}

.userCard i {
    color: black;
}


/* =========================
   User actions
   ========================= */

.userActions {
    margin-top: 4px;
    display: flex;
    gap: 12px;
}

.userActions a {
    padding: 8px 18px;
    border-radius: 6px;
    font-weight: bold;
    text-decoration: none;
    color: white;
    font-size: 14px;
}

.btnUpdate {
    background-color: green;
}

.btnDelete {
    background-color: red;
}

/* =========================
   Pagination
   ========================= */

.pagination {
    display: flex;
    gap: 6px;
    margin: 20px 0;
    justify-content: center;
}

.pageBtn {
    padding: 6px 12px;
    border: 1px solid #ccc;
    text-decoration: none;
    color: black;
    border-radius: 4px;
    background: white;
}

.pageBtn:hover {
    background: green;
    color: white;
}

.pageBtn.active {
    background: black;
    color: white;
    border-color: #333;
}

/* =========================
   Create user form
   ========================= */

.formLargeBox {
    background-color: white;
    padding: 20px 30px;
    min-height: 900px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 0px;
    flex: 1;
    border-radius: 6px;
    font-size: 20px;
}

.addUserForm {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.addUserForm h1 {
    margin-bottom: 20px;
}

.formRow {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.formRow input,
.formRow select {
    padding: 10px 12px;
    font-size: 15px;
    border-radius: 4px;
    border: 1px solid #ccc;
    max-width: 500px;
}

.formRow input:focus,
.formRow select:focus,
.formRow input:hover,
.formRow select:hover {
    outline: none;
    border-color: green;
}

/* =========================
   Buttons
   ========================= */

.btn {
    background-color: white;
    border-color: black;
    padding: 6px 14px;
    margin-top: 20px;
    width: fit-content;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    color: black;
}

.btn:hover {
    color: white;
    background: green;
}

/* =========================
   Mobile (iPhone)
   ========================= */

@media (max-width: 768px) {

    /* Layout: en kolumn */
    .content {
        flex-direction: column;
        padding: 10px;
    }

    .leftBox {
        width: 100%;
        margin-top: 0;
    }

    .rightBox {
        width: 100%;
        margin-top: 20px;
    }

    /* Navigation */
    .mngtList {
        font-size: 20px;
        margin: 10px 0;
        height: auto;
        padding: 10px;
    }

    /* User cards */
    .userCard {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .userLeft {
        width: 100%;
    }

    .userInfo {
        width: 100%;
    }

    .userActions {
        margin-top: 6px;
    }

    /* Role: flytta ner på mobilen */
    .userRole {
        align-self: flex-start;
        font-size: 13px;
        opacity: 0.8;
    }

    /* Pagination */
    .pagination {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    /* Search bar på mobil */
    .userFilterBox {
        display: flex;
        flex-direction: column;
        gap: 10px;

        padding: 12px;
        width: 100%;
        box-sizing: border-box;
    }

    .userFilterBox input[type="text"],
    .userFilterBox select,
    .userFilterBox button {
        width: 100%;
        font-size: 16px;
        padding: 12px;
    }

    .userFilterBox button {
        cursor: pointer;
    }
}

/* =========================
   	 Analytics (dashboard)
   ========================= */

.dashboardCard {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.dashboardCard h3 {
    margin-bottom: 16px;
    color: #0b5f2a;
    border-bottom: 2px solid #e5e5e5;
    padding-bottom: 8px;
}

.dashboardCard table {
    border-collapse: separate;
    border-spacing: 0;
}

.dashboardCard table th,
.dashboardCard table td {
    padding: 14px 18px;
    border-right: 1px solid #ddd;
}

.dashboardCard table th:last-child,
.dashboardCard table td:last-child {
    border-right: none;
}

.chart-card {
    min-height: 350px;
}

.chart-container {
    position: relative;
    height: 280px;
    width: 100%;
}

#visitChart {
    background-color: #f9f9f9;
    border-radius: 12px;
    padding: 12px;
}

.chartWrapper {
    position: relative;
    width: 100%;
    height: 300px;
    margin-bottom: 30px;
}

#incidentChart {
    width: 100% !important;
    height: 100% !important;
	margin-bottom: 30px;
}

/* =========================
   	 Create Incident Form
   ========================= */
   
#description {
	width: 50vw;		/* viewport width (1vw = 1% of the browsers width)*/
	min-width: 300px;
	
	height: 20vh;		/* viewport height (1vh = 1% of the browsers height) */
	min-height: 120px;
	
	resize: none;
}

#comment {
	width: 50vw;
	min-width: 300px;
	
	height: 10vh;
	min-height: 120px;
	
	resize: none;
}