/**
 * Infin Project Manager - Public Styles
 * Version: 1.1.0
 * Last Updated: 2026-01-23
 */

/* Dashboard Grid */
.ipm-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.ipm-project-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s;
}

.ipm-project-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.ipm-project-card h3 {
    margin: 0 0 10px 0;
    font-size: 1.3em;
    color: #333;
}

.ipm-project-card p {
    color: #666;
    margin: 10px 0;
    line-height: 1.5;
}

.ipm-meta {
    font-size: 0.9em;
    color: #888;
    margin: 10px 0;
}

.ipm-open {
    display: inline-block;
    padding: 8px 16px;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    margin-top: 10px;
    transition: background 0.2s;
}

.ipm-open:hover {
    background: #005177;
    color: #fff;
}

/* Project View */
.ipm-project {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
}

.ipm-project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ddd;
}

.ipm-project-header h2 {
    margin: 0;
    font-size: 2em;
    color: #333;
}

/* Timer Controls */
.ipm-timer-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ipm-timer-controls button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.ipm-start-project,
.ipm-start-task {
    background: #46b450;
    color: #fff;
}

.ipm-start-project:hover,
.ipm-start-task:hover {
    background: #3a9943;
}

.ipm-stop-project {
    background: #dc3232;
    color: #fff;
}

.ipm-stop-project:hover {
    background: #c12626;
}

.ipm-live-timer {
    font-size: 1.5em;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    color: #0073aa;
    padding: 8px 16px;
    background: #f0f0f0;
    border-radius: 4px;
    min-width: 100px;
    text-align: center;
}

/* To-do Lists */
.ipm-project h3 {
    margin: 30px 0 15px 0;
    font-size: 1.5em;
    color: #333;
}

/* Project Description - Plain text */
.ipm-project-description {
    margin-bottom: 20px;
    padding: 0;
    background: none;
    border: none;
}

.ipm-project-description p {
    margin: 0 0 10px 0;
    padding: 0;
    border: none;
    line-height: 1.6;
    color: #555;
}

.ipm-project-description p:last-child {
    margin-bottom: 0;
}

/* Todo list headings (h4) */
.ipm-project .ipm-tab-content h4,
.ipm-todo-list-container h4 {
    margin: 20px 0 10px 0;
    font-size: 1.2em;
    color: #555;
    padding-left: 10px;
    border-left: 3px solid #0073aa;
}

.ipm-project ul {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.ipm-project ul li {
    padding: 10px;
    margin: 5px 0;
    background: #f9f9f9;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s;
}

.ipm-project ul li:hover {
    background: #f0f0f0;
}

.ipm-project ul li .todo-title {
    flex: 1;
    margin: 0 10px;
}

/* Done todos - orange highlight */
.ipm-todo-item.todo-done {
    background: #ff9800 !important;
    color: #fff;
}

.ipm-todo-item.todo-done .todo-title {
    text-decoration: line-through;
    opacity: 0.9;
}

/* Carried forward (billed) todos - greyed out, read-only */
.ipm-todo-item.todo-carried-forward {
    background: #f5f5f5 !important;
    opacity: 0.65;
    border-left: 3px solid #9e9e9e;
}

.ipm-todo-item.todo-carried-forward .todo-title {
    color: #757575;
    font-style: italic;
}

.ipm-todo-item.todo-carried-forward:hover {
    opacity: 0.8;
}

/* Billed badge */
.ipm-carried-badge {
    font-size: 0.7em;
    background: #9e9e9e;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 8px;
    text-transform: uppercase;
    font-weight: 600;
}

/* Overdue todos - red highlight */
.ipm-todo-item.todo-overdue {
    background: #ffebee !important;
    border-left: 4px solid #dc3232;
}

.ipm-todo-item.todo-overdue:hover {
    background: #ffcdd2 !important;
}

/* Due date display */
.todo-due-date {
    font-size: 0.8em;
    color: #666;
    padding: 2px 8px;
    border-radius: 12px;
    background: #f0f0f0;
    margin: 0 6px;
    white-space: nowrap;
}

.todo-due-date.overdue {
    background: #dc3232;
    color: #fff;
    font-weight: bold;
    animation: pulse-overdue 2s infinite;
}

@keyframes pulse-overdue {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.85;
        transform: scale(1.02);
    }
}

.ipm-done-mark {
    font-size: 1.2em;
    margin-right: 8px;
}

/* Checkbox */
.ipm-todo-checkbox {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
}

/* Timer and time displays */
.todo-time {
    font-size: 0.85em;
    color: #666;
    margin: 0 8px;
    font-weight: bold;
}

.ipm-todo-timer {
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #0073aa;
    margin: 0 8px;
    min-width: 60px;
    display: inline-block;
}

.ipm-assign-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
    flex-wrap: wrap;
}

.ipm-assign-wrap select {
    padding: 4px 8px;
    font-size: 13px;
}

.ipm-assigned-to {
    font-size: 12px;
    color: #444;
    background: #eef5ff;
    padding: 2px 6px;
    border-radius: 4px;
}

.ipm-client-no-timer {
    display: inline-block;
    font-size: 12px;
    color: #8a6d3b;
    background: #fcf8e3;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid #f2e5b3;
    margin-left: 8px;
}

.ipm-project-stats {
    background: #f0f0f0;
    padding: 10px 20px;
    border-radius: 4px;
    margin: 10px 0;
}

.ipm-total-time {
    font-size: 1.2em;
    font-weight: bold;
    color: #0073aa;
}

.ipm-start-task, .ipm-clone-todo {
    padding: 5px 12px;
    font-size: 12px;
}

.ipm-clone-todo {
    background: #607d8b;
    color: #fff;
}

.ipm-clone-todo:hover {
    background: #455a64;
}

/* Responsive */
@media (max-width: 768px) {
    .ipm-dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .ipm-project-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .ipm-timer-controls {
        flex-wrap: wrap;
    }
}

/* ========================================
   TABS
   ======================================== */
.ipm-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 20px 0;
    border-bottom: 2px solid #ddd;
}

.ipm-tab {
    padding: 12px 20px;
    text-decoration: none;
    color: #555;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    transition: all 0.2s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.ipm-tab:hover {
    background: #e8e8e8;
    color: #333;
}

.ipm-tab-active {
    background: #fff;
    color: #0073aa;
    font-weight: bold;
    border-bottom: 2px solid #fff;
    margin-bottom: -2px;
}

.ipm-tab-content {
    background: #fff;
    padding: 20px;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
}

/* ========================================
   MESSAGES
   ======================================== */
.ipm-message-form {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 30px;
    border: 1px solid #ddd;
}

.ipm-message-form h4 {
    margin-top: 0;
    border-left: none;
    padding-left: 0;
}

.ipm-messages-list {
    margin-top: 20px;
}

.ipm-message {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.ipm-message h4 {
    margin: 0 0 10px 0;
    color: #0073aa;
    border-left: none;
    padding-left: 0;
}

.ipm-message-meta {
    display: flex;
    gap: 15px;
    font-size: 0.85em;
    color: #888;
    margin-bottom: 15px;
}

.ipm-message-content {
    line-height: 1.6;
    color: #333;
}

.ipm-message-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 10px 0;
}

.ipm-message-content a {
    color: #0073aa;
}

.ipm-editor-wrapper {
    margin: 10px 0;
}

.ipm-editor-wrapper .wp-editor-container {
    border: 1px solid #ddd;
    border-radius: 4px;
}

.ipm-editor-wrapper .mce-panel {
    border-color: #ddd !important;
}

.ipm-message-replies {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.ipm-reply {
    padding: 10px;
    background: #f5f5f5;
    border-radius: 4px;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.reply-date {
    font-size: 0.85em;
    color: #999;
}

.ipm-reply-form {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.ipm-reply-form input[type="text"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* ========================================
   FILES
   ======================================== */
.ipm-file-upload {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 30px;
    border: 1px solid #ddd;
    transition: all 0.3s;
}

.ipm-file-upload.drag-over {
    background: #e3f2fd;
    border-color: #0073aa;
    box-shadow: 0 0 10px rgba(0, 115, 170, 0.3);
}

.ipm-file-upload h4 {
    margin-top: 0;
    border-left: none;
    padding-left: 0;
}

.ipm-files-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    table-layout: auto;
}

.ipm-files-table th,
.ipm-files-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

/* Column sizing: let file column flex, keep meta columns compact */
.ipm-files-table th:nth-child(1),
.ipm-files-table td:nth-child(1) {
    width: 36%;
    white-space: normal;
}

.ipm-files-table th:nth-child(2),
.ipm-files-table td:nth-child(2),
.ipm-files-table th:nth-child(3),
.ipm-files-table td:nth-child(3),
.ipm-files-table th:nth-child(4),
.ipm-files-table td:nth-child(4) {
    width: 14%;
    white-space: nowrap;
}

.ipm-files-table th:nth-child(5),
.ipm-files-table td:nth-child(5) {
    width: 22%;
    white-space: nowrap;
}

.ipm-files-table td:nth-child(5) a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    margin-right: 6px;
    font-size: 16px;
}

.ipm-files-table td:nth-child(5) .button {
    font-size: 16px;
    line-height: 1.4;
    padding: 5px 12px;
}

.ipm-files-table th {
    background: #f5f5f5;
    font-weight: bold;
    color: #333;
}

.ipm-files-table tr:hover {
    background: #f9f9f9;
}

.ipm-note-preview {
    display: inline-block;
    background: #fff7b8;
    color: #444;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1.3;
}

/* ========================================
   SCHEDULE/EVENTS
   ======================================== */
.ipm-event-form {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 30px;
    border: 1px solid #ddd;
}

.ipm-event-form h4 {
    margin-top: 0;
    border-left: none;
    padding-left: 0;
}

.ipm-events-list h4 {
    color: #0073aa;
    border-left: 3px solid #0073aa;
    padding-left: 15px;
    margin: 25px 0 15px 0;
}

.ipm-schedule-list {
    list-style: none;
    padding: 0;
}

.ipm-event {
    background: #fff;
    border: 1px solid #ddd;
    border-left: 4px solid #4caf50;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 10px;
}

.event-time {
    display: inline-block;
    color: #666;
    font-size: 0.9em;
    margin: 5px 0;
}

.event-desc {
    margin: 10px 0 0 0;
    color: #555;
    font-size: 0.95em;
}

/* ========================================
   ACTIVITY FEED
   ======================================== */
.ipm-activity-feed {
    margin-top: 20px;
    max-width: 800px;
}

.ipm-activity-item {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    padding: 15px;
    background: #fff;
    border-left: 3px solid #0073aa;
    border-radius: 6px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.ipm-activity-item:hover {
    background: #f8f9fa;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transform: translateX(3px);
}

.activity-icon {
    font-size: 1.5em;
    width: 40px;
    height: 40px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 50%;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
    line-height: 1.6;
}

.activity-content strong {
    color: #333;
    font-weight: 600;
}

.activity-time {
    display: inline-block;
    margin-top: 5px;
    font-size: 0.85em;
    color: #999;
}

/* ========================================
   NOTIFICATIONS
   ======================================== */
.ipm-notif-badge {
    display: inline-block;
    padding: 4px 12px;
    background: #dc3232;
    color: #fff;
    border-radius: 12px;
    font-size: 0.85em;
    cursor: pointer;
    transition: background 0.2s;
}

.ipm-notif-badge:hover {
    background: #c12626;
}

/* Overdue Todos ALERT Badge */
.ipm-todo-overdue-alert {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: #fff !important;
    border-radius: 25px;
    font-size: 0.9em;
    font-weight: 600;
    text-decoration: none !important;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(244,67,54,0.4);
    animation: alert-pulse 1.5s ease-in-out infinite;
    position: relative;
}

.ipm-todo-overdue-alert:hover {
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
    color: #fff !important;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(244,67,54,0.5);
}

.ipm-todo-overdue-alert .overdue-icon {
    font-size: 1.2em;
}

.ipm-todo-overdue-alert .overdue-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    background: rgba(255,255,255,0.95);
    color: #d32f2f;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.85em;
}

.ipm-todo-overdue-alert .overdue-text {
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85em;
}

/* Follow-up ALERT Badge */
.ipm-followup-alert {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #dc3232 0%, #c12626 100%);
    color: #fff !important;
    border-radius: 25px;
    font-size: 0.9em;
    font-weight: 600;
    text-decoration: none !important;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(220,50,50,0.4);
    animation: alert-pulse 1.5s ease-in-out infinite;
    position: relative;
}

.ipm-followup-alert:hover {
    background: linear-gradient(135deg, #c12626 0%, #a01f1f 100%);
    color: #fff !important;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(220,50,50,0.5);
}

.ipm-followup-alert .followup-icon {
    font-size: 1.1em;
    animation: bell-ring 0.5s ease-in-out infinite;
}

.ipm-followup-alert .followup-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    background: #fff;
    color: #dc3232;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.85em;
}

.ipm-followup-alert .followup-text {
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.8em;
}

@keyframes alert-pulse {
    0%, 100% { 
        box-shadow: 0 3px 10px rgba(220,50,50,0.4);
    }
    50% { 
        box-shadow: 0 3px 20px rgba(220,50,50,0.7), 0 0 30px rgba(220,50,50,0.3);
    }
}

@keyframes bell-ring {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(10deg); }
    75% { transform: rotate(-10deg); }
}

/* Upcoming Follow-ups Badge (blue/calm) */
.ipm-followup-upcoming {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: #fff !important;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
    text-decoration: none !important;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(33,150,243,0.3);
}

.ipm-followup-upcoming:hover {
    background: linear-gradient(135deg, #1976D2 0%, #1565C0 100%);
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(33,150,243,0.4);
}

.ipm-followup-upcoming .upcoming-icon {
    font-size: 1em;
}

.ipm-followup-upcoming .upcoming-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    background: #fff;
    color: #1976D2;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.8em;
}

.ipm-followup-upcoming .upcoming-text {
    font-size: 0.85em;
}

.ipm-notifications-list {
    margin-top: 20px;
}

.ipm-notification {
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-left: 4px solid #ccc;
    border-radius: 4px;
    margin-bottom: 10px;
}

.ipm-notification.unread {
    background: #e3f2fd;
    border-left-color: #0073aa;
}

.ipm-notification p {
    margin: 0 0 5px 0;
}

.notif-time {
    font-size: 0.85em;
    color: #999;
}

/* ========================================
   TEAM DIRECTORY
   ======================================== */
.ipm-team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.ipm-team-member {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.ipm-team-member:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.member-avatar {
    margin-bottom: 15px;
}

.member-avatar img {
    border-radius: 50%;
    border: 3px solid #0073aa;
}

.member-info h4 {
    margin: 10px 0 5px 0;
    color: #333;
    border-left: none;
    padding-left: 0;
}

.member-role {
    color: #0073aa;
    font-weight: bold;
    font-size: 0.9em;
    margin: 5px 0;
}

.member-email {
    color: #666;
    font-size: 0.85em;
    margin: 5px 0;
}

/* ========================================
   FORMS
   ======================================== */
.ipm-form input[type="text"],
.ipm-form input[type="email"],
.ipm-form input[type="datetime-local"],
.ipm-form input[type="file"],
.ipm-form textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.ipm-form input[type="text"]:focus,
.ipm-form input[type="email"]:focus,
.ipm-form input[type="datetime-local"]:focus,
.ipm-form textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 5px rgba(0, 115, 170, 0.3);
}

.ipm-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.ipm-form p {
    margin: 0 0 15px 0;
}

/* ========================================
   PROJECT STATS
   ======================================== */
.ipm-project-stats {
    display: flex;
    align-items: center;
    gap: 20px;
}

.ipm-team-count {
    padding: 6px 12px;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 0.9em;
    color: #555;
}

/* Time Display - Period & Total */
.ipm-time-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid #a5d6a7;
}

.ipm-period-time {
    font-size: 1.1em;
    color: #2e7d32;
    white-space: nowrap;
}

.ipm-period-time strong {
    font-size: 1.4em;
    font-weight: 700;
}

.ipm-total-time-small {
    font-size: 0.75em;
    color: #666;
    margin-top: 2px;
    opacity: 0.8;
}

/* ========================================
   BILLING
   ======================================== */
.ipm-billing-container {
    display: grid;
    gap: 24px;
}

.ipm-billing-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.ipm-billing-card h3 {
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
    font-size: 1.2em;
    color: #333;
}

.ipm-billing-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.ipm-billing-stat {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 16px;
    text-align: center;
}

.ipm-stat-highlight {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
}

.ipm-stat-label {
    display: block;
    font-size: 0.85em;
    color: #666;
    margin-bottom: 6px;
    font-weight: 500;
}

.ipm-stat-value {
    display: block;
    font-size: 1.1em;
    color: #333;
    font-weight: 600;
}

.ipm-big-number {
    font-size: 1.8em !important;
    color: #0073aa !important;
}

.ipm-big-number.ipm-amount {
    color: #2e7d32 !important;
}

.ipm-stat-sublabel {
    display: block;
    font-size: 0.75em;
    color: #888;
    margin-top: 4px;
}

/* Billing Actions */
.ipm-billing-actions {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.ipm-form-group {
    margin-bottom: 16px;
}

.ipm-form-group label {
    display: inline-block;
    min-width: 120px;
    font-weight: 500;
    color: #555;
}

.ipm-form-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.ipm-form-row label {
    min-width: 100px;
    font-weight: 500;
    color: #555;
}

.ipm-input, .ipm-input-small {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.ipm-input:focus, .ipm-input-small:focus {
    outline: none;
    border-color: #0073aa;
}

.ipm-input-small {
    width: 100px;
}

.ipm-help-text {
    font-size: 0.85em;
    color: #666;
    margin: 8px 0 0;
    font-style: italic;
}

/* Buttons */
.ipm-btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    margin-right: 8px;
}

.ipm-btn-primary {
    background: #0073aa;
    color: #fff;
}

.ipm-btn-primary:hover {
    background: #005177;
}

.ipm-btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
}

.ipm-btn-secondary:hover {
    background: #e0e0e0;
}

.ipm-btn-danger {
    background: #dc3545;
    color: #fff;
}

.ipm-btn-danger:hover {
    background: #c82333;
}

.ipm-btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.ipm-btn-large {
    padding: 14px 28px;
    font-size: 16px;
}

.ipm-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.ipm-btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* End Project */
.ipm-end-project {
    border-left: 4px solid #dc3545;
}

.ipm-end-project-list {
    list-style: none;
    padding: 0;
    margin: 16px 0;
}

.ipm-end-project-list li {
    padding: 8px 0 8px 24px;
    position: relative;
    color: #555;
}

.ipm-end-project-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #888;
}

/* Create Period Form */
.ipm-create-period-form {
    max-width: 400px;
    margin-top: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 6px;
}

.ipm-create-period-form h4 {
    margin: 0 0 16px 0;
    color: #333;
}

/* Billing Table */
.ipm-billing-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.ipm-billing-table th,
.ipm-billing-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.ipm-billing-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    font-size: 0.9em;
}

.ipm-billing-table tr:hover {
    background: #fafafa;
}

/* Modal */
.ipm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.ipm-modal-content {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.ipm-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    line-height: 1;
}

.ipm-modal-close:hover {
    color: #333;
}

.ipm-empty-state {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .ipm-tabs {
        flex-wrap: wrap;
    }
    
    .ipm-tab {
        flex: 1 1 auto;
        text-align: center;
        font-size: 0.9em;
        padding: 10px 8px;
        justify-content: center;
    }
    
    .ipm-team-grid {
        grid-template-columns: 1fr;
    }
    
    .ipm-project-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .ipm-reply-form {
        flex-direction: column;
    }
    
    .ipm-reply-form input[type="text"] {
        width: 100%;
    }
    
    /* Billing Responsive */
    .ipm-billing-summary {
        grid-template-columns: 1fr 1fr;
    }
    
    .ipm-form-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .ipm-form-row label {
        margin-bottom: 6px;
    }
    
    .ipm-billing-table {
        font-size: 0.9em;
    }
    
    .ipm-billing-table th,
    .ipm-billing-table td {
        padding: 8px;
    }
}

/* ===============================
   Todo Lists & Permissions UI
   =============================== */

.ipm-todo-list-container {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
}

.ipm-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.ipm-list-header h4 {
    margin: 0;
    color: #333;
    border-left: none;
    padding-left: 0;
}

.ipm-list-header h4 small {
    font-weight: normal;
    font-size: 0.8em;
}

.ipm-add-list-form {
    margin-bottom: 20px;
}

.ipm-add-list-inputs {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.ipm-add-todo-form {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 12px;
    margin: 10px 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.ipm-add-todo-form input[type="text"] {
    flex: 1;
    min-width: 200px;
}

.ipm-add-todo-form input[type="date"] {
    width: auto;
}

.ipm-todo-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ipm-todo-item {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 8px;
    transition: background 0.2s;
}

.ipm-todo-item:hover {
    background: #f0f7ff;
}

.ipm-todo-item .todo-title {
    flex: 1;
    font-weight: 500;
}

.ipm-delete-todo {
    padding: 4px 8px !important;
    font-size: 12px !important;
    background: transparent !important;
    border: 1px solid #ddd !important;
}

.ipm-delete-todo:hover {
    background: #fee !important;
    border-color: #b32d2e !important;
}

.ipm-assigned-to-readonly {
    font-size: 12px;
    color: #666;
    background: #f0f0f0;
    padding: 4px 8px;
    border-radius: 4px;
}

.ipm-show-add-todo,
.ipm-show-add-list {
    font-size: 13px;
}

/* ========================================
   CONTACT RECORDS (CRM)
   ======================================== */
.ipm-contact-form-wrapper {
    transition: all 0.3s ease;
}

.ipm-contact-form-wrapper:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.ipm-contact-form label {
    display: block;
    margin-bottom: 4px;
    color: #333;
}

.ipm-contact-form input,
.ipm-contact-form select,
.ipm-contact-form textarea {
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ipm-contact-form input:focus,
.ipm-contact-form select:focus,
.ipm-contact-form textarea:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0,115,170,0.1);
    outline: none;
}

.ipm-contacts-list {
    margin-top: 20px;
}

.ipm-contact-card {
    transition: all 0.3s ease;
}

.ipm-contact-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.ipm-contact-filters a {
    transition: all 0.2s ease;
}

.ipm-contact-filters a:hover {
    background: #f0f0f0;
    border-color: #999;
}

.ipm-delete-contact {
    transition: all 0.2s ease;
}

.ipm-delete-contact:hover {
    background: #fee !important;
    border-color: #dc3232 !important;
}

.ipm-contact-admin {
    transition: all 0.3s ease;
}

.ipm-contact-admin:hover {
    box-shadow: 0 2px 8px rgba(255,193,7,0.2);
}

/* Contact status badges */
.contact-status-completed { background: #d4edda; color: #155724; }
.contact-status-no_answer { background: #f8d7da; color: #721c24; }
.contact-status-voicemail { background: #fff3cd; color: #856404; }
.contact-status-callback { background: #d1ecf1; color: #0c5460; }
.contact-status-rescheduled { background: #e2e3e5; color: #383d41; }
.contact-status-cancelled { background: #f5c6cb; color: #721c24; }

/* Contact type badges */
.contact-type-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    background: #e7f3ff;
    color: #0066cc;
}

/* ========================================
   TODO DETAIL VIEW
   ======================================== */
.ipm-todo-detail {
    max-width: 900px;
}

.ipm-todo-detail-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.ipm-todo-detail-header h3 {
    margin: 0 0 10px 0;
    font-size: 1.6em;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.ipm-status-badge {
    font-size: 0.6em;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: normal;
}

.ipm-status-badge.done {
    background: #d4edda;
    color: #155724;
}

.ipm-status-badge.open {
    background: #fff3cd;
    color: #856404;
}

.ipm-todo-meta {
    display: flex;
    gap: 20px;
    color: #666;
    font-size: 0.95em;
    flex-wrap: wrap;
}

.ipm-todo-description-section,
.ipm-todo-comments-section {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 25px;
}

.ipm-todo-description-section h4,
.ipm-todo-comments-section h4 {
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    color: #333;
}

.ipm-todo-description-content {
    line-height: 1.7;
}

.ipm-todo-description-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 10px 0;
}

.ipm-todo-comments-list {
    margin-bottom: 25px;
}

.ipm-todo-comment {
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 12px;
}

.ipm-comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.ipm-comment-header strong {
    color: #333;
}

.ipm-comment-date {
    font-size: 0.85em;
    color: #888;
}

.ipm-comment-content {
    line-height: 1.6;
    color: #444;
}

.ipm-comment-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 10px 0;
}

.ipm-add-comment-form {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Clickable todo title */
a.todo-title {
    color: #333;
    text-decoration: none;
    flex: 1;
}

a.todo-title:hover {
    color: #0073aa;
    text-decoration: underline;
}
