/* Stiluri specifice modulelor Feroviar (pontaj, dispoziții, mesaje). Baza (variabile, butoane, carduri,
   tabele) rămâne în app.css, preluat din OptimalProd. */

[hidden] {
    display: none !important;
}

/* === Sub-navigație (file în interiorul unui modul) === */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.tabs a {
    padding: 8px 14px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.tabs a:hover {
    color: var(--text-primary);
}

.tabs a.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* === Bară de filtre === */
.filter-bar {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-bar .form-group {
    margin: 0;
    min-width: 150px;
}

.filter-bar .grow {
    flex: 1;
    min-width: 220px;
}

.counter {
    display: inline-block;
    min-width: 24px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
}

.counter.accent {
    background: var(--accent);
    color: #fff;
}

.btn-success {
    background: var(--green);
    color: #fff;
}

.btn-success:hover {
    filter: brightness(0.93);
}

.btn-whatsapp {
    background: #25d366;
    color: #fff;
}

.btn-whatsapp:hover {
    background: #1eb957;
}

.btn[disabled],
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.muted {
    color: var(--text-muted);
}

.hint {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 8px 24px;
}

.info-grid dt {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.info-grid dd {
    margin: 0 0 6px;
    font-weight: 500;
}

/* === Dispoziții === */
tr.invalidata td {
    background: rgba(226, 68, 92, 0.12);
    color: #a10000;
}

tr.invalidata td a {
    color: #a10000;
}

td.clip {
    max-width: 240px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

tr.clickable {
    cursor: pointer;
}

.grid-actiuni {
    min-width: 1750px;
}

.grid-actiuni th,
.grid-actiuni td {
    padding: 6px 4px;
}

.grid-actiuni .form-control {
    padding: 6px 8px;
    font-size: 0.8rem;
}

/* === Import pontaj: foaia de prezență === */
.pontaj-grid {
    overflow: auto;
    max-height: 72vh;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
}

.pontaj-grid table {
    font-size: 11px;
    white-space: nowrap;
    border-collapse: separate;
    border-spacing: 0;
}

.pontaj-grid th,
.pontaj-grid td {
    padding: 3px 5px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.pontaj-grid th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--bg-input);
    vertical-align: bottom;
    text-transform: none;
    letter-spacing: 0;
}

.pontaj-grid th.rotit > div {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    line-height: 1;
    margin: 0 auto;
}

.pontaj-grid td.zi {
    text-align: center;
    min-width: 28px;
}

.pontaj-grid td.cod {
    background: rgba(253, 171, 61, 0.22);
    font-weight: 700;
}

.pontaj-grid td.numar {
    text-align: right;
}

.pontaj-grid td.nume {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--bg-card);
    font-weight: 600;
}

.pontaj-grid tr.potrivit td {
    background: rgba(0, 200, 117, 0.10);
}

.pontaj-grid tr.potrivit td.nume {
    background: #e5f9f1;
}

.pontaj-grid tr.potrivit td.cod {
    background: rgba(253, 171, 61, 0.22);
}

/* === Mesaje (conversații SMS / WhatsApp) === */
.chat-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 16px;
    align-items: start;
}

@media (max-width: 900px) {
    .chat-layout {
        grid-template-columns: 1fr;
    }
}

.chat-list {
    padding: 0;
    max-height: 72vh;
    overflow-y: auto;
}

.chat-list a {
    display: block;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--text-primary);
}

.chat-list a:hover,
.chat-list a.active {
    background: var(--bg-input);
}

.chat-list .rand1 {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-weight: 600;
    font-size: 0.875rem;
}

.chat-list .rand2 {
    color: var(--text-muted);
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-fir {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 56vh;
    overflow-y: auto;
    padding: 4px 4px 12px;
}

.bula {
    max-width: 72%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.875rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.bula.primit {
    align-self: flex-start;
    background: var(--bg-input);
}

.bula.trimis {
    align-self: flex-end;
    background: rgba(97, 97, 224, 0.12);
}

.bula.trimis.whatsapp {
    background: rgba(37, 211, 102, 0.16);
}

.bula.esuat {
    border: 1px solid var(--red);
}

.bula .meta {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.7rem;
}

.canal-tag {
    display: inline-block;
    padding: 0 6px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 600;
    background: var(--bg-input);
    color: var(--text-secondary);
}

.canal-tag.whatsapp {
    background: rgba(37, 211, 102, 0.2);
    color: #128c4a;
}
