/* Operation, Bill, and Invoice Statuses */
.status--paid {
    background-color: var(--lime);
}

.status--new,
.status--applying,
.status--approved {
    background-color: var(--celestial);
}

.status--questions,
.status--draft,
.status--sent {
    background-color: var(--banana);
}

.status--cancelled,
.status--closed {
    background-color: var(--radish);
}

/* Horizontal Rules from operation.html */
.hr-gloomy {
    width: 100%;
    border: 1px solid var(--gloomy);
    margin: 1rem 0;
}

.hr-lead {
    width: 100%;
    border: 1px solid var(--lead);
    opacity: 0.5;
    margin: 1rem 0;
}

/* Styling for .bill-info inside .bill-card */
.bill-info {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr;
    gap: 1rem;
    align-items: stretch;
}

/* Complete style for bill-info-card, moved from base.css */
.bill-info-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 20px;
    font-weight: 600;
    background-color: var(--light);
    padding: 10px;
    border-radius: 10px;
    /* No fixed width, min-width, or max-height */
}

/* Responsive layout for .bill-info */
@media (max-width: 992px) {
    .bill-info {
        grid-template-columns: 1fr 1fr;
    }

    .bill-info .bill-info-card.big {
        grid-column: 1 / -1; /* Span full width */
    }
}

@media (max-width: 576px) {
    .bill-info {
        grid-template-columns: 1fr; /* Single column */
    }
}

/* Toggle Switch Checkbox */
.form-field .switch {
    flex-grow: 0; /* Prevent the switch from stretching */
}

.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
}

input:checked + .slider {
  background-color: var(--style);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--style);
}

input:checked + .slider:before {
  transform: translateX(26px);
}

.slider.round {
  width: 60px;
  border-radius: 40px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Operations Page */
.operation {
    width: calc(50% - 70px);
    height: 700px;
    padding: 30px;
    background-color: var(--shady);
    border-radius: 35px;
    font-size: 20px;
    font-weight: 600;
    position: relative;
}

.op-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.op-btns {
    display: flex;
    gap: 10px;
}

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

.op-line {
    display: flex;
    flex-direction: row;
    gap: 10px;
}

.op-line.space {
    justify-content: space-between;
}

.op-line.col {
    flex-direction: column;
    gap: 5px;
}

.comments {
    display: grid;
    position: relative;
    gap: 10px;
    overflow: overlay;
    height: 300px;
}

.comments::after {
    content: '';
    position: sticky;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 70px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--shady));
    pointer-events: none;
}

.comments::-webkit-scrollbar {
    width: 1px;
}

.comment {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.comment.reversed {
    flex-direction: row-reverse;
}

.comment-info {
    display: grid;
    background-color: var(--white);
    color: var(--dark);
    border-radius: 10px;
    padding: 6px 10px;
}

.comment-info.reversed {
    background-color: var(--celestial);
}

.comment-form {
    width: calc(100% - 60px);
    position: absolute;
    bottom: 30px;
}

form.comment .comment-input {
    width: calc(100% - 40px);
    border-radius: 100px;
    background-color: var(--gloomy);
    color: var(--white);
    border: none;
    resize: vertical;   
    font-family: var(--font-family-main);
    font-size: 16px;
}

.comment-input::placeholder {
    color: var(--lead);
}

.comm-img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

/* Bills & Invoices */
.invoices {
    width: 50%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.inv-head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.bill-card {
    display: flex;
    flex-direction: column;
    padding: 30px;
    background-color: var(--white);
    border-radius: 35px;
    gap: 20px;
    color: var(--dark);
}

.bill-head {
    display: flex;
    justify-content: space-between;
}

.bill-opt {
    display: flex;
    gap: 10px;
}

.bill-extra {
    display: flex;
    flex-direction: column;
}

span.status.status-new, span.status.status-applying { background-color: var(--celestial); }
span.status.status-paid { background-color: var(--lime); }
span.status.status-pending, span.status.status-question { background-color: var(--banana); }
span.status.status-declined, span.status.status-cancelled { background-color: var(--radish); }
span.status.outflow { background-color: var(--radish); opacity: 0.8; }
span.status.inflow { background-color: var(--lime); opacity: 0.8; }

@media (max-width: 792px) {
    .proj-nav {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 20px;
    }

    .nav-btns {
        flex-wrap: wrap;
    }

    .table-nav-main {
        flex-direction: column-reverse;
    }

    .search-box-new {
        width: auto !important;
    }
}

@media (max-width: 768px) {
    .table-content table, .table-content tbody {
        display: block;
        width: 100%;
    }

    .table-content thead {
        display: none;
    }

    .table-content tr {
        display: block;
        width: 100%;
        box-sizing: border-box;
        margin-bottom: 1rem;
        border: 1px solid var(--light);
        border-radius: 10px;
        padding: 1rem;
    }

    .table-content td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--light);
        text-align: right;
    }
    
    .table-content td:first-child {
        padding-left: 0;
    }
    
    .table-content td:last-child {
        border-bottom: none;
    }

    .table-content td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--dark);
        text-align: left;
    }

    .operation {
        height: auto;
    }

    .comments {
        height: 200px;
    }
}
