:root {
    --orange: #f37000;
    --orange-dark: #d95f00;
    --bg: #f4f6f9;
    --white: #ffffff;
    --text: #222;
    --muted: #777;
    --border: #e5e7eb;
    --green: #28a745;
    --red: #dc3545;
    --yellow: #ffc107;
    --gray: #9ca3af;
    --shadow: 0 12px 35px rgba(0,0,0,0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    color: var(--orange);
    text-decoration: none;
}

button,
.btn {
    background: var(--orange);
    color: #fff;
    border: 1px solid #464745;
    border-radius: 2px;
    padding: 11px 18px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
}

button:hover,
.btn:hover {
    background: var(--orange-dark);
}

.card {
    background: var(--white);
    border-radius: 4px;
    box-shadow: var(--shadow);
    padding: 28px;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--orange);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.table th {
    text-align: left;
    background: #f3f3f3;
    padding: 14px;
    font-size: 14px;
}

.table td {
    padding: 14px;
    border-bottom: 1px solid var(--border);
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 30px;
    border-radius: 4px;
    color: #fff;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 0.3px;
}

.badge.ex { background: #2F80ED; } /* Export - Albastru */
.badge.ca { background: #E88CA0; } /* Calitate - Roz */
.badge.te { background: #F29900; } /* Tehnic - Portocaliu */
.badge.pr { background: #6C43D9; } /* Productie - Mov */
.badge.pl { background: #9CA3AF; } /* Planificare - Gri */
.badge.fn { background: #7A552A; } /* Final - Maro */

.status-green { color: var(--green); font-weight: 700; }
.status-red { color: var(--red); font-weight: 700; }
.status-yellow { color: var(--yellow); font-weight: 700; }
.status-gray { color: var(--gray); font-weight: 700; }

.page {
    padding: 30px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.page-subtitle {
    color: var(--muted);
    margin-bottom: 24px;
}

/* =========================================
   PROJECT.PHP
========================================= */
.project-page {
    flex: 1;
    padding: 30px;
}

.project-top {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.project-title {
    margin: 0 0 6px 0;
    font-size: 28px;
    font-weight: 800;
    color: #111827;
}

.activity-link {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    color: #6b7280;
    font-size: 14px;
    text-decoration: none;
}

.activity-link:hover {
    color: #111827;
    text-decoration: underline;
}

.project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.meta-pill {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    color: #374151;
    border-radius: 1px;
    padding: 6px 11px;
    font-size: 13px;
}

.notice-success {
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.notice-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.active-print-card {
    text-align: center;
    padding: 26px;
    margin-bottom: 22px;
}

.print-icon {
    width: 75px;
    height: 75px;
    border-radius: 2px;
    background: #f9fafb;
    border: 2px dashed #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    margin: 0 auto 12px auto;
}

.print-name {
    font-size: 18px;
    font-weight: 800;
    color: #111827;
    margin-bottom: 4px;
}

.print-version {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 15px;
}

.print-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-secondary {
    background: #f3f4f6;
    color: #111827;
    border: 1px solid #b1b1b1;
}

.project-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(420px, 1.2fr) minmax(280px, 0.9fr);
    gap: 22px;
    align-items: start;
}

.project-layout-three {
    grid-template-columns: minmax(280px, 30%) minmax(420px, 40%) minmax(280px, 30%);
}

.project-column {
    display: flex;
    flex-direction: column;
    gap: 22px;
    min-width: 0;
}

.trace-card,
.workflow-card,
.comments-card {
    width: 100%;
}

.workflow-title {
    text-align: center;
}

.section-title {
    margin: 0 0 14px 0;
    font-size: 18px;
    font-weight: 800;
    color: #111827;
}

/* Print upload / drag & drop */
.print-upload-form {
    margin-top: 22px;
}

.upload-dropzone {
    width: 560px;
    max-width: 100%;
    min-height: 190px;
    margin: 0 auto;
    border: 2px dashed #cbd5e1;
    border-radius: 4px;
    padding: 34px 22px;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-dropzone:hover,
.upload-dropzone.is-dragover,
.upload-dropzone.dragover {
    border-color: var(--orange);
    background: #fff7ed;
}

.upload-dropzone input[type="file"] {
    display: none;
}

.upload-icon {
    font-size: 48px;
    line-height: 1;
}

.upload-title {
    font-size: 18px;
    font-weight: 800;
    color: #111827;
}

.upload-hint,
.upload-formats {
    color: var(--muted);
    font-size: 13px;
}

.upload-select-btn {
    margin-top: 6px;
    display: inline-flex;
}

.upload-submit-wrap {
    text-align: center;
    margin-top: 14px;
}

.workflow {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.workflow-step {
    position: relative;
    border: 1px solid #e5e7eb;
    border-left: 9px solid var(--step-color);
    border-radius: 2px;
    padding: 15px 16px;
    background: #ffffff;
    text-align: left;
}

.workflow-step.active {
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
    border-top-color: var(--step-color);
    border-right-color: var(--step-color);
    border-bottom-color: var(--step-color);
}

.workflow-step.active::after {
    content: "ACȚIUNE NECESARĂ";
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 10px;
    font-weight: 800;
    color: #111827;
    background: #ffff00;
    border: 1px solid #eab308;
    border-radius: 1px;
    padding: 5px 8px;
}

.workflow-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding-right: 0;
}

.workflow-badge {
    width: 46px;
    height: 38px;
    border-radius: 1px;
    background: var(--step-color);
    color: white;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.workflow-name {
    font-weight: 800;
    color: #111827;
}

.workflow-description {
    color: #6b7280;
    font-size: 13px;
    margin-top: 2px;
}

.workflow-arrow {
    text-align: center;
    color: #9ca3af;
    font-size: 24px;
    line-height: 10px;
}

.workflow-actions {
    margin-top: 14px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-ok {
    background: #16a34a;
}

.btn-nok {
    background: #dc2626;
}

.waiting-box {
    margin-top: 12px;
    font-size: 13px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px;
    color: #6b7280;
}

.comment-form textarea {
    width: 100%;
    min-height: 95px;
    resize: vertical;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-family: inherit;
    box-sizing: border-box;
}

.comment-item,
.history-item,
.file-item {
    border-bottom: 1px solid #e5e7eb;
    padding: 12px 0;
}

.comment-item:last-child,
.history-item:last-child,
.file-item:last-child {
    border-bottom: none;
}

.item-author {
    font-weight: 800;
    color: #111827;
    font-size: 14px;
}

.item-date {
    color: #6b7280;
    font-size: 12px;
    margin-top: 2px;
}

.comment-text,
.history-text {
    color: #374151;
    font-size: 14px;
    margin-top: 8px;
    white-space: pre-wrap;
}

.files-list {
    margin-top: 0;
}

.file-name a {
    font-weight: 700;
    color: #111827;
    text-decoration: none;
}

.file-name a:hover {
    text-decoration: underline;
}

.file-meta {
    color: #6b7280;
    font-size: 12px;
    margin-top: 4px;
}

@media (max-width: 1250px) {
    .project-layout,
    .project-layout-three {
        grid-template-columns: 1fr;
    }

    .project-top {
        flex-direction: column;
    }
}


/* 3 coloane project.php */
.workflow-copy {
    min-width: 0;
}

.project-workflow-column .workflow-step {
    max-width: 100%;
}

.project-workflow-column .waiting-box {
    text-align: center;
}

/* =========================================
   PROJECT.PHP - 3 COLUMNS FIXED LAYOUT
   Stanga: Trasabilitate | Centru: Flux | Dreapta: Comentarii
========================================= */
.project-layout.project-layout-three {
    display: grid !important;
    grid-template-columns: minmax(300px, 30%) minmax(460px, 40%) minmax(300px, 30%) !important;
    gap: 22px !important;
    align-items: start !important;
    width: 100% !important;
}

.project-layout-three .project-traceability {
    grid-column: 1 !important;
    grid-row: 1 !important;
}

.project-layout-three .project-workflow-column {
    grid-column: 2 !important;
    grid-row: 1 !important;
}

.project-layout-three .project-comments-column {
    grid-column: 3 !important;
    grid-row: 1 !important;
}

.project-layout-three .project-column {
    min-width: 0 !important;
    width: 100% !important;
}

.project-layout-three .workflow-card,
.project-layout-three .trace-card,
.project-layout-three .comments-card {
    width: 100% !important;
}

.workflow-centered {
    align-items: center;
}

.workflow-centered .workflow-step {
    width: 100%;
}

.workflow-centered .workflow-head {
    justify-content: flex-start;
}



/* Trasabilitate - tipuri workflow */
.history-type-ok {
    color: #16a34a;
}

.history-type-nok {
    color: #dc2626;
}

/* PROJECTS.PHP - PROGRESS BAR */
.progress-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 105px;
}

.progress-bar {
    width: 70px;
    height: 8px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    border: 1px solid #d1d5db;
}

.progress-fill {
    height: 100%;
    background: var(--orange);
    border-radius: 1px;
}

.progress-cell span {
    font-size: 13px;
    font-weight: 700;
    color: #374151;
    min-width: 34px;
}


/* =========================================
   RESPONSIVE OPTIMIZATION - LAPTOPS / SMALL SCREENS
   Pastreaza designul actual, dar reduce overflow-ul orizontal.
========================================= */

html,
body {
    max-width: 100%;
}

body {
    overflow-x: hidden;
}

img,
video,
iframe {
    max-width: 100%;
}

/* Cardurile care contin tabele primesc scroll intern, nu scroll pe toata pagina */
.card:has(.table) {
    overflow-x: auto;
}

/* Linkurile/titlurile lungi se rup corect pe laptopuri */
.table td,
.table th,
.project-title,
.print-name,
.file-name,
.comment-text,
.history-text {
    overflow-wrap: anywhere;
    word-break: normal;
}

/* Laptopuri 1366px / 1440px */
@media (max-width: 1500px) {

    .page,
    .project-page {
        padding: 22px;
    }

    .card {
        padding: 22px;
    }

    .page-title {
        font-size: 26px;
    }

    .project-title {
        font-size: 24px;
        line-height: 1.25;
    }

    .table th,
    .table td {
        padding: 10px 9px;
        font-size: 13px;
        vertical-align: middle;
    }

    .progress-cell {
        min-width: 82px;
        gap: 6px;
    }

    .progress-bar {
        width: 55px;
    }

    .progress-cell span {
        font-size: 12px;
        min-width: 28px;
    }

    .badge {
        min-width: 38px;
        height: 28px;
        font-size: 12px;
    }

    .meta-pill {
        font-size: 12px;
        padding: 5px 8px;
    }

    /*
       Project.php ramane pe 3 coloane si pe laptopuri normale.
       Am redus minimele ca sa nu sara prematur una sub alta.
    */
    .project-layout.project-layout-three {
        grid-template-columns:
            minmax(220px, 28%)
            minmax(360px, 44%)
            minmax(220px, 28%) !important;
        gap: 14px !important;
    }

    .workflow-step {
        padding: 13px 12px;
    }

    .workflow-badge {
        width: 40px;
        height: 34px;
        font-size: 12px;
    }

    .workflow-name {
        font-size: 14px;
    }

    .workflow-description {
        font-size: 12px;
    }

    .workflow-step.active::after {
        top: 8px;
        right: 8px;
        font-size: 9px;
        padding: 4px 6px;
    }

    .workflow-actions {
        gap: 8px;
    }

    .workflow-actions button,
    .workflow-actions .btn {
        padding: 9px 12px;
        font-size: 12px;
    }

    .comment-form textarea {
        min-height: 82px;
    }

    .upload-dropzone {
        min-height: 165px;
        padding: 26px 18px;
    }
}

/* Laptopuri mici / zoom mare: pastram 2 coloane, comentariile coboara jos */
@media (max-width: 1250px) {

    .project-layout.project-layout-three {
        grid-template-columns: minmax(230px, 34%) minmax(420px, 66%) !important;
        gap: 16px !important;
    }

    .project-layout-three .project-traceability {
        grid-column: 1 !important;
        grid-row: 1 !important;
    }

    .project-layout-three .project-workflow-column {
        grid-column: 2 !important;
        grid-row: 1 !important;
    }

    .project-layout-three .project-comments-column {
        grid-column: 1 / -1 !important;
        grid-row: 2 !important;
    }

    .project-top {
        flex-direction: column;
    }

    .print-actions {
        gap: 8px;
    }
}

/* Ecrane foarte mici: totul pe o coloana */
@media (max-width: 980px) {

    .project-layout.project-layout-three,
    .project-layout,
    .project-layout-three {
        grid-template-columns: 1fr !important;
    }

    .project-layout-three .project-traceability,
    .project-layout-three .project-workflow-column,
    .project-layout-three .project-comments-column {
        grid-column: 1 !important;
        grid-row: auto !important;
    }

    .page,
    .project-page {
        padding: 16px;
    }

    .card {
        padding: 18px;
    }
}

/* Dashboard responsive */
@media (max-width: 1500px) {
    .dashboard-stats {
        grid-template-columns: repeat(5, minmax(130px, 1fr)) !important;
        gap: 12px !important;
    }

    .dashboard-stat-card {
        padding: 16px !important;
    }

    .dashboard-stat-value {
        font-size: 28px !important;
    }

    .dashboard-grid-main {
        grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr) !important;
        gap: 16px !important;
    }

    .dashboard-grid-secondary {
        grid-template-columns: minmax(360px, 1fr) minmax(260px, 0.75fr) minmax(260px, 0.75fr) !important;
        gap: 16px !important;
    }

    .department-users-grid {
        grid-template-columns: repeat(2, minmax(180px, 1fr)) !important;
    }
}

@media (max-width: 1250px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, minmax(160px, 1fr)) !important;
    }

    .dashboard-grid-main,
    .dashboard-grid-secondary,
    .dashboard-history-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Projects.php: tabel mai compact pe laptop */
@media (max-width: 1500px) {
    .table {
        font-size: 13px;
    }

    .table a {
        line-height: 1.25;
    }
}


/* =========================================
   USERS.PHP - CLEAN LAYOUT
   Pune acest bloc la final in assets/css/style.css
========================================= */

.app-layout {
    display: flex;
    width: 100%;
    max-width: 100vw;
}

.app-content {
    flex: 1 1 auto;
    min-width: 0;
    padding: 30px;
}

.users-page {
    width: 100%;
}

.users-card {
    width: 100%;
    max-width: 100%;
}

.users-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}

.users-search-wrap {
    margin-bottom: 20px;
}

.users-search-input {
    width: 460px;
    max-width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.users-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: visible;
}

#usersTable,
#usersTable.users-compact-table {
    width: 100%;
    table-layout: auto;
}

#usersTable th,
#usersTable td {
    vertical-align: middle;
    white-space: nowrap;
}

#usersTable th:nth-child(3),
#usersTable td:nth-child(3) {
    white-space: normal;
    word-break: break-all;
    width: 99%;
}

#usersTable th:nth-child(1),
#usersTable td:nth-child(1) {
    width: 55px;
    white-space: nowrap;
    text-align: center;
}

#usersTable th:nth-child(2),
#usersTable td:nth-child(2) {
    width: 150px;
}

#usersTable th:nth-child(3),
#usersTable td:nth-child(3) {
    min-width: 190px;
}

#usersTable th:nth-child(4),
#usersTable td:nth-child(4) {
    width: 140px;
}

#usersTable th:nth-child(5),
#usersTable td:nth-child(5),
#usersTable th:nth-child(6),
#usersTable td:nth-child(6) {
    width: 90px;
    text-align: center;
    white-space: nowrap;
}

#usersTable th:nth-child(7),
#usersTable td:nth-child(7) {
    width: 150px;
    text-align: center;
    white-space: nowrap;
}

.small-muted {
    font-size: 12px;
    color: #6b7280;
    margin-top: 3px;
}

.user-manage-panel {
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 14px;
}

.user-info-box {
    font-size: 13px;
    color: #374151;
    margin-bottom: 14px;
}

.user-info-box div {
    margin-top: 4px;
}

.user-edit-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.user-edit-grid label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
}

.user-form-action {
    align-self: end;
}

.user-actions-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.user-password-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.user-password-form input {
    max-width: 260px;
}

.app-footer-local {
    width: 100%;
    text-align: center;
    margin-top: 28px;
    padding: 16px 0;
    color: #6b7280;
    font-size: 13px;
}

@media (max-width: 1500px) {
    .app-content {
        padding: 22px;
    }

    #usersTable th,
    #usersTable td {
        padding: 10px 8px;
        font-size: 13px;
    }

    #usersTable th:nth-child(2),
    #usersTable td:nth-child(2) {
        width: 135px;
    }

    #usersTable th:nth-child(3),
    #usersTable td:nth-child(3) {
        min-width: 170px;
    }

    #usersTable th:nth-child(4),
    #usersTable td:nth-child(4) {
        width: 120px;
    }

    #usersTable th:nth-child(7),
    #usersTable td:nth-child(7) {
        width: 135px;
    }

    .user-edit-grid {
        grid-template-columns: repeat(2, minmax(150px, 1fr));
    }
}

@media (max-width: 1050px) {
    .users-table-wrap {
        overflow-x: auto;
    }

    #usersTable,
    #usersTable.users-compact-table {
        min-width: 780px;
    }

    .user-edit-grid {
        grid-template-columns: 1fr;
    }
}

/* Footer heartbeat */
@keyframes heartbeat {
    0%   { transform: scale(1); }
    14%  { transform: scale(1.3); }
    28%  { transform: scale(1); }
    42%  { transform: scale(1.3); }
    70%  { transform: scale(1); }
}

.footer-heart {
    display: inline-block;
    animation: heartbeat 1.5s ease-in-out infinite;
    transform-origin: center;
}

/* =========================================
   RESPONSIVE MOBIL - max 768px
   ========================================= */

/* Hamburger buton */
.hamburger-btn {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1100;
    background: var(--orange);
    color: #fff;
    border: none;
    border-radius: 6px;
    width: 44px;
    height: 44px;
    font-size: 22px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.sidebar-close-btn {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 20px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px 8px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 999;
}

.sidebar-overlay.sidebar-overlay-visible {
    display: block;
}

@media (max-width: 768px) {

    /* --- Hamburger si sidebar --- */
    .hamburger-btn {
        display: flex;
    }

    .sidebar-close-btn {
        display: block;
    }

    #mainSidebar {
        position: fixed !important;
        top: 0 !important;
        left: -280px !important;
        height: 100vh !important;
        min-height: 100vh !important;
        z-index: 1000 !important;
        overflow-y: auto !important;
        transition: left 0.28s ease !important;
        width: 260px !important;
    }

    #mainSidebar.sidebar-open {
        left: 0 !important;
    }

    /* --- Layout principal --- */
    .project-page,
    .app-content,
    .page,
    .main-content-area {
        padding: 16px !important;
        padding-top: 64px !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    /* Div-ul flex principal din fiecare pagina */
    body > div[style*="display:flex"],
    div[style*="display:flex"] {
        flex-direction: row;
    }

    .card {
        padding: 16px;
    }

    /* --- Tabele cu scroll orizontal --- */
    .table-scroll-wrap,
    div[style*="overflow-x:auto"],
    div[style*="overflow-x: auto"] {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        min-width: 600px;
    }

    /* --- projects.php --- */
    .projects-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* --- Dashboard --- */
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .dashboard-stat-card {
        padding: 14px !important;
    }

    .dashboard-stat-value {
        font-size: 26px !important;
    }

    .dashboard-grid-main,
    .dashboard-grid-secondary,
    .dashboard-history-grid {
        grid-template-columns: 1fr !important;
    }

    .department-users-grid {
        grid-template-columns: 1fr !important;
    }

    /* --- project.php --- */
    .project-layout.project-layout-three,
    .project-layout,
    .project-layout-three {
        grid-template-columns: 1fr !important;
    }

    .project-layout-three .project-traceability,
    .project-layout-three .project-workflow-column,
    .project-layout-three .project-comments-column {
        grid-column: 1 !important;
        grid-row: auto !important;
    }

    .project-top {
        flex-direction: column !important;
    }

    .project-title {
        font-size: 20px !important;
    }

    .page-title {
        font-size: 22px !important;
        padding-top: 10px;
    }

    .project-meta {
        gap: 6px;
    }

    .meta-pill {
        font-size: 11px;
        padding: 4px 7px;
    }

    .active-print-card {
        padding: 16px;
    }

    .upload-dropzone {
        width: 100% !important;
        min-height: 140px !important;
        padding: 20px 14px !important;
    }

    .workflow-actions {
        flex-direction: column;
        gap: 8px;
    }

    .workflow-actions button,
    .workflow-actions .btn {
        width: 100%;
    }

    .print-actions {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .print-actions .btn {
        width: 100%;
        max-width: 280px;
    }

    /* --- Butoane generale --- */
    .btn {
        padding: 10px 14px;
        font-size: 14px;
    }

    /* --- Notificari --- */
    .notice-success,
    .notice-error {
        font-size: 13px;
        padding: 10px 12px;
    }

    /* --- Sectiunea proiecte cu termen depasit din dashboard --- */
    .dashboard-grid-main > div {
        overflow-x: auto;
    }
}

/* Telefoane foarte mici */
@media (max-width: 420px) {
    .dashboard-stats {
        grid-template-columns: 1fr 1fr !important;
    }

    .project-title {
        font-size: 17px !important;
    }

    .card {
        padding: 12px;
    }

    .workflow-step {
        padding: 12px 10px;
    }
}
