﻿*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ensure common form controls are covered */
input,
textarea,
select,
button {
  box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
}

a {
    text-decoration: none;
    color: black;
}



.PageWrapper600 {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 600px;
    width: 100%;
}

.PageWrapper900 {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 900px;
    width: 100%;
}

.RightAlign {
    display:flex;
    justify-content: flex-end;
    gap:10px;
}

.Truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.Number {
    display: flex;
    justify-content: flex-end;
    white-space: nowrap;
}

.Button {
    display: inline-block;
    font-weight: 400;
    line-height: 1.5;
    border-color: #198754;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    border: 1px solid gray;
    padding: .375rem .75rem;
    font-size: 1rem;
    border-radius: .25rem;
    transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
    -webkit-appearance: button;
}

.ButtonOk {
    color: #fff;
    background-color: #198754;
}

.ButtonLemon {
    background-color: lemonchiffon;
}

.Button:disabled {
    color: gray !important;
    background-color: #DDDDDD !important;
}

.Button:not(:disabled):hover {
    color: #fff;
    background-color: #5a95f5 !important;
}


.Num {
    display: flex;
    justify-content: flex-end;
    white-space: nowrap;
}

.dropdown-container {
    position: relative;
}

    .dropdown {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 1.8em;
        border-bottom-left-radius: 5px;
        border-bottom-right-radius: 5px;
        border-left: 1px solid #DDDDDD;
        border-right: 1px solid #DDDDDD;
        border-bottom: 1px solid #DDDDDD;
        background-color: white;
        min-width: 100px;
        width: min-content;
        padding: 0 10px;
        box-shadow: 0 2.8px 2.2px rgba(0, 0, 0, 0.034), 0 6.7px 5.3px rgba(0, 0, 0, 0.048), 0 12.5px 10px rgba(0, 0, 0, 0.06), 0 22.3px 17.9px rgba(0, 0, 0, 0.072), 0 41.8px 33.4px rgba(0, 0, 0, 0.086), 0 100px 80px rgba(0, 0, 0, 0.12);
        z-index: 2;
        padding-top: 5px;
    }

.dropdown > * {
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

    .dropdown > * :hover {
        background-color: #E0E0E0;
    }

.dropdown-item {
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

    .dropdown-item:hover {
        background-color: #E0E0E0;
    }

/* new context menu */

/* ACTIONS (Outlook style) */ 

.cm-actions {
    display: flex;
    flex-direction: row;
    height: 100%;
    flex-shrink: 0;
}
    /* Each action block */

    .cm-actions > * {
        width: 80px; /* Outlook uses fixed-width blocks */
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-weight: 600;
        user-select: none;
        background: #0275d8; /* blue, default */
    }
    /* Example Outlook-like colors */

    .cm-actions > .delete {
        background: #d9534f; /* red */
    }

    .cm-actions > .archive {
        background: #0275d8; /* blue */
    }

    .cm-actions > .flag {
        background: #f0ad4e; /* orange */
    }
/* old context menu */

.ContextMenuContainer {
    position: relative;
}

.ContextMenu {
    display: none;
}

    .ContextMenu.Active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 1.8em;
        border-bottom-left-radius: 5px;
        border-bottom-right-radius: 5px;
        border-left: 1px solid #DDDDDD;
        border-right: 1px solid #DDDDDD;
        border-bottom: 1px solid #DDDDDD;
        background-color: white;
        min-width: 100px;
        width: min-content;
        padding: 0 10px;
        box-shadow: 0 2.8px 2.2px rgba(0, 0, 0, 0.034), 0 6.7px 5.3px rgba(0, 0, 0, 0.048), 0 12.5px 10px rgba(0, 0, 0, 0.06), 0 22.3px 17.9px rgba(0, 0, 0, 0.072), 0 41.8px 33.4px rgba(0, 0, 0, 0.086), 0 100px 80px rgba(0, 0, 0, 0.12);
        z-index: 2;
        padding-top: 5px;
    }

    .ContextMenu a {
        display: block;
        padding: 5px 7px 5px 10px;
    }
        .ContextMenu a:hover {
            background-color: #E0E0E0;
        }



@media(max-width:599px) {
    .HideOnMobile {
        display: none;
    }

    .Grid {
        display: flex;
        flex-direction: column;
    }

    .Item {
        padding: 10px 0;
    }

        .Item:not(:last-child) {
            border-bottom: 1px solid gray;
        }
}

@media(min-width:600px) {
    .HideOnDesktop {
        display: none;
    }

    .Grid {
        display: grid;
        grid-row-gap: 5px;
    }

    .Item {
        display:contents;
    }
}


/* ============================================================
   PROPERTY GRID
   ============================================================ */


/* Contenidor principal */
.mat-propertygrid-container {
    --mat-propertygrid-label-width: 160px;
    color: #333;
    border: 1px solid #DDDDDD;
}

/* Fila del grid */
.mat-propertygrid-row {
    display: flex;
    align-items: center;
    min-height: 28px;
    padding: 2px 0;
    border-bottom: 1px solid #eee;
    transition: background 0.15s ease;
}

    .mat-propertygrid-row:hover {
        background: #f7f7f7;
    }

/* Columna esquerra (labels) */
.mat-propertygrid-label {
    width: var(--mat-propertygrid-label-width);
    padding: 4px 6px;
    font-weight: 500;
    color: #444;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Splitter discret i elegant */
.mat-propertygrid-splitter {
    width: 6px;
    cursor: col-resize;
    background: transparent;
    transition: background 0.15s ease;
    align-self: stretch;
}

    .mat-propertygrid-splitter:hover {
        background: #d0d0d0;
    }

/* Columna dreta (editors) */
.mat-propertygrid-editor {
    flex: 1;
    padding: 2px 0;
}

    .mat-propertygrid-editor input[type=text] {
        width: 100%;
        border: none;
        outline: none;
        background: transparent;
        padding: 0;
        margin: 0;
        /* Match label appearance */
        font-size: inherit;
        font-family: inherit;
        line-height: inherit;
        color: inherit;
    }

        .mat-propertygrid-editor input[type=text]:focus {
            outline: none;
            box-shadow: none;
        }


.buttons-bar {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 15px;
}

/* Base button style */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 1rem;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    color: white !important;
    transition: background-color 0.15s ease, opacity 0.15s ease;
}

    .btn ::deep * {
        color: white;
    }

/* Accept / Confirm / Save */
.btn-accept {
    background-color: #28A745;
}

    .btn-accept:hover {
        background-color: #218838;
    }

    .btn-accept:active {
        background-color: #1e7e34;
    }

/* Cancel / Neutral */
.btn-cancel {
    background-color: #6C757D;
}

    .btn-cancel:hover {
        background-color: #5a6268;
    }

    .btn-cancel:active {
        background-color: #545b62;
    }

/* Delete / Destructive */
.btn-delete {
    background-color: #DC3545;
}

    .btn-delete:hover {
        background-color: #c82333;
    }

    .btn-delete:active {
        background-color: #bd2130;
    }

/* Optional: disabled state */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}


/* ============================
   RESPONSIVE MODE
   ============================ */
@media (max-width: 600px) {
    /* Fila vertical */
    .mat-propertygrid-row {
        flex-direction: column;
        align-items: stretch;
        padding: 6px 0;
    }
    /* Label a dalt */
    .mat-propertygrid-label {
        width: 100% !important;
        padding: 4px 2px;
        font-weight: 600;
        border: none;
        background: transparent;
    }
    /* Splitter desapareix */
    .mat-propertygrid-splitter {
        display: none;
    }
    /* Editor ocupa tot l’ample */
    .mat-propertygrid-editor {
        width: 100%;
        padding-top: 2px;
    }
}