.acrm-portal {
    max-width: 100%;
    margin: 0;
    padding: 24px 40px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1d2327;
    box-sizing: border-box;
}

.acrm-portal-header {
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e0e0e0;
}

.acrm-portal-header h2 {
    margin: 0 0 4px;
    font-size: 24px;
    font-weight: 600;
}

.acrm-portal-company {
    color: #666;
    font-size: 14px;
    margin: 0;
}

.acrm-portal-loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* Projects list */
/* Projects grid */
.acrm-portal-projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
}

.acrm-portal-project-card {
    display: flex;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.acrm-portal-project-card:hover {
    border-color: #2271b1;
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.10);
    transform: translateY(-1px);
}

.acrm-portal-project-band {
    width: 5px;
    flex-shrink: 0;
}

.acrm-portal-project-body {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    flex: 1;
    min-width: 0;
}

.acrm-portal-progress-ring {
    flex-shrink: 0;
}

.acrm-portal-project-card h4 {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
}

.acrm-portal-project-card .acrm-portal-project-info {
    flex: 1;
    min-width: 0;
}

.acrm-portal-project-dates {
    font-size: 12px;
    color: #888;
    margin-bottom: 2px;
}

.acrm-portal-project-stats {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.acrm-portal-status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}

.acrm-portal-progress {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
}

.acrm-portal-progress-bar {
    display: inline-block;
    width: 100px;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    vertical-align: middle;
    margin-right: 6px;
}

.acrm-portal-progress-fill {
    height: 100%;
    background: #2271b1;
    border-radius: 3px;
    transition: width 0.3s;
}

/* Detail view */
#acrm-portal-back {
    text-decoration: none;
    font-size: 14px;
    color: #2271b1;
}

#acrm-portal-back:hover {
    text-decoration: underline;
}

.acrm-portal-meta {
    font-size: 13px;
    color: #666;
    margin-bottom: 24px;
}

.acrm-portal-section {
    margin-bottom: 32px;
}

.acrm-portal-section h4 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

/* Milestone groups */
.acrm-portal-ms-group {
    margin-bottom: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.acrm-portal-ms-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    font-weight: 600;
}
.acrm-portal-ms-header.done {
    background: #f0f0f0;
    color: #999;
}
.acrm-portal-ms-header.done .acrm-portal-ms-label {
    text-decoration: line-through;
}
.acrm-portal-ms-header.overdue {
    background: #fef2f2;
    border-left: 3px solid #d63638;
}
.acrm-portal-ms-header.orphan {
    background: #f5f5f5;
    font-style: italic;
    color: #888;
}

.acrm-portal-ms-header input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.acrm-portal-ms-label {
    flex: 1;
    font-size: 14px;
}

.acrm-portal-ms-progress {
    font-size: 12px;
    font-weight: 500;
    color: #666;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.acrm-portal-milestone-date {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
}
.acrm-portal-milestone-date.overdue {
    color: #d63638;
    font-weight: 600;
}

.acrm-portal-ms-tasks {
    padding: 4px 0;
}

/* Tasks */
.acrm-portal-task {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    border-bottom: 1px solid #f0f0f0;
    gap: 10px;
}

.acrm-portal-task:last-child {
    border-bottom: none;
}

.acrm-portal-task input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.acrm-portal-task-text {
    flex: 1;
    font-size: 14px;
}

.acrm-portal-task-text.done {
    text-decoration: line-through;
    color: #999;
}

/* Assigned badge */
.acrm-portal-assigned {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    white-space: nowrap;
}
.acrm-portal-assigned-client {
    background: #e8f4fd;
    color: #2271b1;
}
.acrm-portal-assigned-provider {
    background: #f0e6f6;
    color: #7c3aed;
}
.acrm-portal-assigned-both {
    background: #fef3c7;
    color: #92400e;
}

/* Milestone description & period */
.acrm-portal-ms-description {
    font-size: 13px;
    color: #555;
    padding: 4px 16px 8px 42px;
    line-height: 1.5;
}
.acrm-portal-milestone-date {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
}

/* Drag handle */
.acrm-drag-handle {
    cursor: grab;
    color: #ccc;
    font-size: 14px;
    user-select: none;
    flex-shrink: 0;
    padding: 0 2px;
}
.acrm-drag-handle:hover {
    color: #888;
}
.acrm-draggable:active .acrm-drag-handle {
    cursor: grabbing;
}
.acrm-dragging {
    opacity: 0.4;
    background: #e8f4fd !important;
}
.acrm-drag-over {
    background: #f0f7ff !important;
    outline: 2px dashed #2271b1;
    outline-offset: -2px;
    min-height: 40px;
}

/* Drop placeholder */
.acrm-portal-drop-placeholder {
    padding: 12px 16px;
    text-align: center;
    color: #ccc;
    font-size: 13px;
    font-style: italic;
}

/* Add task card */
.acrm-portal-add-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}
.acrm-portal-add-card h4 {
    margin: 0 0 16px;
    border: none;
    padding: 0;
}

/* Small button variant */
.acrm-portal-btn-small {
    padding: 6px 12px;
    font-size: 13px;
}
.acrm-portal-btn-secondary {
    background: #f0f0f1;
    color: #1d2327;
}
.acrm-portal-btn-secondary:hover {
    background: #e0e0e0;
}

/* Add forms */
.acrm-portal-add-form {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    align-items: center;
}

.acrm-portal-input {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.acrm-portal-input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.acrm-portal-input-date {
    width: 150px;
}

.acrm-portal-btn {
    padding: 8px 16px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}

.acrm-portal-btn:hover {
    background: #135e96;
}

.acrm-portal-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.acrm-portal-empty {
    color: #999;
    font-size: 14px;
    padding: 12px 0;
}

/* Portal tabs */
.acrm-portal-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 24px;
}
.acrm-portal-tab {
    padding: 10px 24px;
    background: none;
    border: none;
    font-size: 15px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s;
}
.acrm-portal-tab:hover { color: #1d2327; }
.acrm-portal-tab.active {
    color: #2271b1;
    border-bottom-color: #2271b1;
    font-weight: 600;
}

/* Ticket messages */
.acrm-portal-ticket-msg {
    padding: 12px 16px;
    margin-bottom: 8px;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 3px solid #e0e0e0;
}
.acrm-portal-ticket-msg.is-admin {
    background: #eef5fb;
    border-left-color: #2271b1;
}
.acrm-portal-ticket-msg-header {
    font-size: 12px;
    color: #888;
    margin-bottom: 6px;
}
.acrm-portal-ticket-msg-body {
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Logout link */
.acrm-portal-logout {
    font-size: 13px;
    color: #888;
    text-decoration: none;
}
.acrm-portal-logout:hover {
    color: #d63638;
}

/* Preview bar */
.acrm-portal-preview-bar {
    background: #fcf0f1;
    border: 1px solid #d63638;
    border-radius: 6px;
    padding: 10px 16px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #50575e;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.acrm-portal-preview-bar a {
    color: #2271b1;
    text-decoration: none;
    font-weight: 500;
}

/* =========================================================================
   LOGIN FORM
   ========================================================================= */

.acrm-login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.acrm-login-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    padding: 40px 32px;
}

.acrm-login-logo {
    text-align: center;
    margin-bottom: 32px;
}
.acrm-login-logo h1 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    color: #1d2327;
}
.acrm-login-logo img {
    max-height: 48px;
    width: auto;
}

.acrm-login-field {
    margin-bottom: 16px;
}
.acrm-login-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #50575e;
    margin-bottom: 6px;
}
.acrm-login-field input {
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.15s;
}
.acrm-login-field input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.15);
}

.acrm-login-btn {
    display: block;
    width: 100%;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}
.acrm-login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.acrm-login-btn-primary {
    background: #2271b1;
    color: #fff;
}
.acrm-login-btn-primary:hover {
    background: #135e96;
}

.acrm-login-btn-secondary {
    background: #f0f0f1;
    color: #1d2327;
    margin-top: 0;
}
.acrm-login-btn-secondary:hover {
    background: #e0e0e0;
}

.acrm-login-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: #999;
    font-size: 12px;
}
.acrm-login-divider::before,
.acrm-login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}
.acrm-login-divider span {
    padding: 0 12px;
}

.acrm-login-links {
    text-align: center;
    margin-top: 16px;
}
.acrm-login-links a {
    color: #2271b1;
    font-size: 13px;
    text-decoration: none;
}
.acrm-login-links a:hover {
    text-decoration: underline;
}

/* Login messages */
.acrm-login-msg-error {
    background: #fcf0f1;
    border-left: 4px solid #d63638;
    padding: 10px 14px;
    margin-bottom: 16px;
    border-radius: 4px;
    font-size: 13px;
    color: #50575e;
}
.acrm-login-msg-success {
    background: #edf7ed;
    border-left: 4px solid #00a32a;
    padding: 10px 14px;
    margin-bottom: 16px;
    border-radius: 4px;
    font-size: 13px;
    color: #50575e;
}

/* Force full-width on theme containers */
.page-template-default .entry-content,
.page-template-default .post-content,
.page-template-default article .entry-content,
.wp-site-blocks > .entry-content,
.wp-block-post-content {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
.page-template-default .site-content .content-area,
.page-template-default .site-main {
    max-width: 100% !important;
    width: 100% !important;
}

/* Responsive */
@media (max-width: 600px) {
    .acrm-portal {
        padding: 12px 16px;
    }

    .acrm-portal-projects-grid {
        grid-template-columns: 1fr;
    }

    .acrm-portal-add-form {
        flex-direction: column;
    }

    .acrm-portal-input {
        width: 100%;
    }
}

/* ===== Documents (portail client) ===== */
.acrm-portal-file-list {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.acrm-portal-file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px 12px;
    background: #f6f7f8;
    border-radius: 6px;
}
.acrm-portal-file-item a {
    font-weight: 600;
    word-break: break-word;
}
.acrm-portal-file-size {
    color: #6b7280;
    font-size: 12px;
}
.acrm-portal-tag {
    font-size: 11px;
    background: #e8f0fe;
    color: #1a56b0;
    border-radius: 999px;
    padding: 2px 8px;
}
.acrm-portal-file-del {
    margin-left: auto;
    background: none;
    border: none;
    color: #c0392b;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}
.acrm-portal-file-del:hover { color: #e74c3c; }
