

#portal {
    font-size: 18px;
    display: none;
    transition: opacity 0.2s ease;
	width: 100vw;
    height: 100vh;
	flex-direction: column;
	position: relative
}

#portal.show {
    display: flex;
}

body {
    width: 100%;
    height: 100%;
    margin: 0;
	font-family: Arial, sans-seriff;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 10vh;
    border-bottom: 1px solid grey;
    padding: 0 20px;
    flex-shrink: 0;
}

.logo img {
    height: 50px;   
	width: auto;
    max-height: 100%;
}

.header-title {
	width: 30%;
	font-size: 1.5em;
	color: #888;
	text-align: center;
	margin-right: 10px;
}

.header-right {
    display: flex;
    align-items: center;
	flex-grow: 1;
	justify-content: flex-end;
}

.search-box {
    padding: 5px;
    margin-right: 20px;
	border-radius: 9px;
	border: 1px solid #ccc;
	height: 21px;
	flex-grow: 1;
}

.icons {
    display: flex;
	position: relative;
}

.icons img {
    height: 31px;
    margin-left: 25px;
}

.user-menu {
    position: absolute;
    top: 100%;       /* right below the icon */
    right: 0;        /* aligned to the right edge of icon */
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 5px;
    min-width: 150px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    z-index: 10;
	font-size: 14px;
}

.user-menu-item {
    display: block;           /* makes the whole line clickable */
    padding: 10px 15px;       /* internal spacing */
    text-decoration: none;    /* remove underline for links */
    color: #333;
    cursor: pointer;
}

.user-menu-item:hover {
    background-color: #f0f0f0;
}

.user-menu a.user-menu-item {
    margin: 0;                /* remove previous margins */
}



.menu-toggle {
    display: none;
    font-size: 24px;
    cursor: pointer;
}

.container {
    display: flex;
    height: 100vh;
}

.left-menu {
    width: 250px;
    height: 100%;   /* fill parent container height */
    border-right: 1px solid grey;
    background-color: #fbfbfb;
    color: #555;
    transition: width 0.3s;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* allow scrolling if menu is tall */
    position: relative; /* keep it in flow */
}

.dropdown {
    position: relative;
    padding: 10px;
    background-color: #fbfbfb;
}

.dropbtn {
    background-color: #fff;
    color: #555;
    padding: 10px;
    border: none;
    cursor: pointer;
    background-color: #fbfbfb;
    width: 100%;
    text-align: left;
    outline: none;
    border-bottom: 1px solid grey;
    display: flex;
    justify-content: space-between;
    align-items: center;
	font-size: 16px;
	font-weight: 700
}

.triangle {
    margin-left: auto;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #fff;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
	font-size: 16px;
	font-weight: 700
}

.dropdown:hover .dropdown-content {
    display: block;
}

.drop-item {
    display: flex;
    align-items: center;
    padding: 10px;
    cursor: pointer;
}

.drop-item img {
    width: 30px;
    height: 30px;
    margin-right: 10px;
}

.menu-item {
    padding: 10px 25px;
	margin: 2px;
	border-radius: 9px;
    cursor: pointer;
    color: #555;
	font-size: 16px;
}

.menu-item.active {
    background-color: #f0f0f0; /* Color gris fosc o el que prefereixis */
}

.menu-item:hover {
    background-color: #f0f0f0;
}

.drop-item:hover {
    background-color: #fbfbfb;
}

.hide-menu-button {
	position: absolute;
    bottom: 20px;
    left: 0px;
    background-color: #d0d0d0;
    padding: 5px;
    cursor: pointer;
    border-radius: 5px;
    color: white;
    font-size: 18px;
}
.show-menu-button {
    position: fixed;
    bottom: 20px;
    left: 0;
    background-color: #d0d0d0;
    padding: 5px;
    cursor: pointer;
    border-radius: 5px;
    color: white;
    font-size: 18px;
}

.main-window {
    flex-grow: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.mobile-icons-menu {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #f0f0f0;
    padding: 10px;
    text-align: center;
}

.mobile-icons img {
    height: 31px;
    margin: 0 10px;
}

/* Media Queries for Mobile */
@media (max-width: 768px) {
    .header-right .icons {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

    .left-menu {
        width: 0;
        overflow: hidden;
        position: absolute;
        left: 0;
        top: 10vh;
        height: 90vh;
        z-index: 1;
        border-right: none;
    }

    .mobile-icons-menu {
        display: block;
    }
}


/* Main div */
.button-row {
    display: flex;
    justify-content: left; /* Center the buttons */
    gap: 10px; /* Space between buttons */
    margin-bottom: 5px; /* Space between button row and view areas */
}

.view-button {
    padding: 5px 15px;
    background-color: grey; /* Grey background */
    color: white;
    border: none;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.view-button:hover {
    background-color: darkgrey; /* Dark grey on hover */
}

.view-button.active {
    background-color: rgb(0,122,205); /* Active tab color */
}

.view-area {

	display: none; /* Totes les àrees de vista estan ocultes per defecte */
    padding: 20px;
    border-top: 1px solid rgb(223,223,223);
    flex-grow: 1; /* Permet que les àrees de vista creixin i ocupin l'espai disponible */
    overflow-y: auto; /* Afegeix una barra de desplaçament vertical si el contingut és massa gran */

}

.view-area.active {
    display: block; /* Only the active view area is shown */
}

.description {
	color: #666;
	margin-bottom: 15px;
	max-width: 800px;
}

#bulkMessage
{
	color: #666;
	margin-bottom: 15px;
	max-width: 800px;
	font-family: Arial
}

.bulk-form
{
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 50px;
    max-width: 720px;
}

.form-row
{
    display: flex;
    align-items: center;
    gap: 20px;
	width: 100%
}

.form-row label
{
    width: 100px;
    font-weight: 600;
}

.form-row input
{
    flex: 1;
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
}

.form-row textarea
{
    flex: 1;                 /* take remaining width like inputs */
    width: 100%;             /* ensure full width */
    padding: 10px 14px;      /* comfortable padding */
    font-size: 15px;
    font-family: inherit;
    border: 1px solid #ccc;  /* match input borders */
    border-radius: 4px;
    resize: vertical;        /* user can resize vertically only */
    min-height: 120px;       /* enough height for messages */
    box-sizing: border-box;
}

.bulk-form textarea,
.bulk-form select,
.bulk-form input {
	padding: 6px 8px;
	font-size: 14px;
	border-radius: 4px;
	border: 1px solid #ccc;
}

.bulk-form-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 15px;
}

.csv-preview-wrapper-scroll {
	max-height: 300px;
	overflow: auto;
	border: 1px solid #ddd;
}

.csv-preview-wrapper {
	margin-top: 10px;
	border: 1px solid #ddd;
}


#csvPreviewTable {
	border-collapse: separate;  /* allows spacing */
	border-spacing: 0 4px;      /* row separation */
	width: 100%;
	font-size: 14px;
}

#csvPreviewTable th, #csvPreviewTable td {
	text-align: left;
}


.csv-highlight {
	background-color: #e8f2ff;
	font-weight: bold;
	padding: 4px;
}

.bulk-confirm {
	margin-top: 15px;
	text-align: right;
}






.exec-table-header,
.exec-row {
	display: grid;
	grid-template-columns: 2fr 1fr 1fr 1fr 120px;
	align-items: center;
	gap: 10px;
	padding: 10px;
}

.exec-table-header {
	font-weight: bold;
	border-bottom: 2px solid #ddd;
	background: #fafafa;
}

.exec-row {
	border-bottom: 1px solid #eee;
	cursor: pointer;
	font-size: 16px;
}

.exec-row:hover {
	background: #f9f9f9;
}

/* Status badge */
.exec-status {
	padding: 4px 10px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: bold;
	text-align: center;
	color: #fff;
	width: fit-content;
	display: inline-block;
}

.exec-status.pending { background: orange; }
.exec-status.executed { background: #2ecc71; }
.exec-status.error { background: #e74c3c; }
.exec-status.deleted { background: #7f8c8d; }

.exec-status.not_contacted { background: orange; }
.exec-status.contact_requested { background: #2e71cc; }
.exec-status.contacted { background: #2e71cc; }
.exec-status.greeting_sent { background: #2e71cc; }
.exec-status.conversation { background: #2e71cc; }
.exec-status.appointment_set { background: #2ecc71; }
.exec-status.abandoned { background: #2e2e2e; }
.exec-status.not_found { background: #2e2e2e; }

/* Expanded prompt details */
.exec-details {
	grid-column: 1 / -1;
	background: #fff;
	color: #222;
	padding: 12px;
	border-top: 1px solid #eee;
	display: none;
}

.exec-row.open .exec-details {
	display: block;
}

.exec-details pre {
	background: #f4f4f4;
	padding: 10px;
	overflow-x: auto;
	font-size: 12px;
	color: #111;
	border-radius: 4px;
}

.exec-details-conversation  {
	background: #f4f4f4;
	padding: 10px;
	overflow-x: auto;
	font-size: 12px;
	color: #111;
	border-radius: 4px;
	text-align: left
}

/* Filters */
.execution-filters {
	display: flex;
	gap: 10px;
	margin-bottom: 15px;
	align-items: center;
}
.execution-filters select,
.execution-filters input {
	padding: 6px 8px;
	font-size: 14px;
	border-radius: 4px;
	border: 1px solid #ccc;
}

/* Paging */
.execution-paging {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 10px;
	margin-top: 15px;
}
.execution-paging button {
	padding: 6px 12px;
	border-radius: 4px;
	border: none;
	cursor: pointer;
	background-color: #ddd;
}
.execution-paging button:disabled {
	opacity: 0.5;
	cursor: default;
}


