/* ============================================
   K V REDDY & CO. — PORTAL & OFFICE STYLES
   Extends main styles.css for portal modules
   ============================================ */

/* === PORTAL LAYOUT === */
.portal-body {
    background: #f0f2f5;
    min-height: 100vh;
}

.portal-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

/* === DASHBOARD GRID === */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.dash-card {
    background: white;
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(10,36,99,0.06);
    border: 1px solid rgba(0,0,0,0.05);
    transition: all 0.2s;
}

.dash-card:hover {
    box-shadow: 0 4px 16px rgba(10,36,99,0.1);
    transform: translateY(-2px);
}

.dash-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.dash-card-header h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.dash-card-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.dash-card-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary-navy);
    font-family: var(--font-display);
    line-height: 1;
    margin-bottom: 4px;
}

.dash-card-change {
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.dash-card-change.positive { color: #10b981; }
.dash-card-change.negative { color: #ef4444; }

/* === CONTENT PANELS === */
.panel {
    background: white;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(10,36,99,0.06);
    border: 1px solid rgba(0,0,0,0.05);
    overflow: hidden;
}

.panel-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h3 {
    font-size: 1.1rem;
    margin: 0;
    color: var(--primary-navy);
}

.panel-body {
    padding: 24px;
}

.panel-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-light);
}

/* === STATUS BADGES === */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-pending { background: #fef3c7; color: #92400e; }
.badge-progress { background: #dbeafe; color: #1e40af; }
.badge-review { background: #e0e7ff; color: #3730a3; }
.badge-completed { background: #d1fae5; color: #065f46; }
.badge-backlog { background: #f3f4f6; color: #4b5563; }
.badge-high { background: #fee2e2; color: #991b1b; }
.badge-medium { background: #fef3c7; color: #92400e; }
.badge-low { background: #dbeafe; color: #1e40af; }
.badge-open { background: #dbeafe; color: #1e40af; }
.badge-answered { background: #d1fae5; color: #065f46; }
.badge-closed { background: #f3f4f6; color: #4b5563; }

/* === FILE UPLOAD ZONE === */
.upload-zone {
    border: 2px dashed var(--border-light);
    border-radius: 14px;
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-light);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary-blue);
    background: rgba(30,91,168,0.04);
}

.upload-zone i {
    font-size: 3rem;
    color: var(--primary-blue);
    opacity: 0.5;
    margin-bottom: 16px;
}

.upload-zone h4 {
    margin: 0 0 8px;
    color: var(--text-dark);
}

.upload-zone p {
    margin: 0;
    font-size: 0.85rem;
}

.file-list {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    margin-bottom: 8px;
    background: white;
}

.file-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.file-item-icon.pdf { background: #fee2e2; color: #dc2626; }
.file-item-icon.excel { background: #d1fae5; color: #059669; }
.file-item-icon.image { background: #dbeafe; color: #2563eb; }
.file-item-icon.doc { background: #dbeafe; color: #1e40af; }
.file-item-icon.other { background: #f3f4f6; color: #4b5563; }

.file-item-info { flex: 1; }
.file-item-info h5 { margin: 0; font-size: 0.9rem; color: var(--text-dark); }
.file-item-info span { font-size: 0.8rem; color: var(--text-light); }

/* === STATUS TIMELINE === */
.timeline {
    position: relative;
    padding-left: 32px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-light);
}

.timeline-item {
    position: relative;
    padding-bottom: 24px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
    position: absolute;
    left: -26px;
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--border-light);
    border: 3px solid white;
    box-shadow: 0 0 0 2px var(--border-light);
}

.timeline-dot.active {
    background: var(--primary-blue);
    box-shadow: 0 0 0 2px var(--primary-blue);
}

.timeline-dot.completed {
    background: #10b981;
    box-shadow: 0 0 0 2px #10b981;
}

.timeline-content h5 { margin: 0 0 4px; font-size: 0.9rem; }
.timeline-content p { margin: 0; font-size: 0.8rem; color: var(--text-light); }
.timeline-content .time { font-size: 0.75rem; color: var(--text-light); margin-top: 4px; }

/* === KANBAN BOARD === */
.kanban-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 16px;
    min-height: 500px;
}

.kanban-column {
    flex: 0 0 300px;
    background: var(--bg-light);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
}

.kanban-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-light);
}

.kanban-column-header h4 {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kanban-count {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-light);
}

.kanban-cards {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 100px;
}

.kanban-card {
    background: white;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    cursor: grab;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.kanban-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.kanban-card.priority-high { border-left-color: #ef4444; }
.kanban-card.priority-medium { border-left-color: #f59e0b; }
.kanban-card.priority-low { border-left-color: #3b82f6; }

.kanban-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.kanban-card h5 {
    margin: 0 0 6px;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.kanban-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 0.75rem;
    color: var(--text-light);
}

.kanban-card-client {
    font-size: 0.8rem;
    color: var(--primary-blue);
    font-weight: 600;
}

/* === DATA TABLE === */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 14px 16px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    background: var(--bg-light);
    border-bottom: 2px solid var(--border-light);
}

.data-table td {
    padding: 14px 16px;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-dark);
}

.data-table tr:hover td {
    background: rgba(30,91,168,0.02);
}

/* === FORUM STYLES === */
.ticket-card {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.ticket-card:hover {
    border-color: var(--primary-blue);
    box-shadow: 0 2px 8px rgba(30,91,168,0.08);
}

.ticket-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.ticket-card h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--primary-navy);
}

.ticket-card p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ticket-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
    font-size: 0.8rem;
    color: var(--text-light);
}

.reply-bubble {
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 12px;
    max-width: 80%;
}

.reply-bubble.client {
    background: #eff6ff;
    border: 1px solid #dbeafe;
    margin-right: auto;
}

.reply-bubble.staff {
    background: #f0fdf4;
    border: 1px solid #dcfce7;
    margin-left: auto;
}

.reply-bubble .reply-author {
    font-weight: 700;
    font-size: 0.8rem;
    margin-bottom: 4px;
}

.reply-bubble .reply-text {
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

.reply-bubble .reply-time {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 6px;
}

/* === CALENDAR / DEADLINES === */
.deadline-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.15s;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
}

.deadline-item:hover { background: var(--bg-light); }

.deadline-date {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 700;
    word-break: break-word;
    overflow: hidden;
}

.deadline-date .day { font-size: 1.3rem; line-height: 1; }
.deadline-date .month { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px; }

.deadline-date.urgent { background: #fee2e2; color: #991b1b; }
.deadline-date.warning { background: #fef3c7; color: #92400e; }
.deadline-date.normal { background: #dbeafe; color: #1e40af; }
.deadline-date.done { background: #d1fae5; color: #065f46; }

.deadline-info {
    flex: 1;
    min-width: 0;            /* allow shrinking */
    word-break: break-word;  /* wrap long words */
}
.deadline-info h5 { margin: 0 0 4px; font-size: 0.9rem; }
.deadline-info p { margin: 0; font-size: 0.8rem; color: var(--text-light); }

/* === QUICK ACTIONS === */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 24px 16px;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: var(--text-dark);
}

.quick-action-btn:hover {
    border-color: var(--primary-blue);
    box-shadow: 0 4px 12px rgba(30,91,168,0.1);
    transform: translateY(-2px);
}

.quick-action-btn i {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.quick-action-btn span {
    font-weight: 600;
    font-size: 0.85rem;
}

/* === MODAL === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    transform: scale(0.9);
    transition: transform 0.2s;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 { margin: 0; }

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-light);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--text-light);
    transition: all 0.15s;
}

.modal-close:hover {
    background: #fee2e2;
    color: #dc2626;
}

.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* === SEARCH BAR === */
.search-bar {
    position: relative;
    margin-bottom: 20px;
}

.search-bar input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 2px solid var(--border-light);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: var(--font-body);
    transition: all 0.2s;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px rgba(30,91,168,0.1);
}

.search-bar i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

/* === EMPTY STATES === */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-light);
}

.empty-state i {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: 16px;
}

.empty-state h4 {
    color: var(--text-dark);
    margin-bottom: 8px;
}

/* === TABLE RESPONSIVE WRAPPER === */
.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    background: white;
}

.table-responsive .data-table {
    margin-bottom: 0;
    min-width: 650px;
}

/* === TWO COLUMN LAYOUT === */
.dashboard-two-column {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.dashboard-two-column > div {
    min-width: 0;
}

/* === RESPONSIVE UTILITY GRIDS === */
.responsive-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.responsive-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.responsive-grid-2-1 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}
.responsive-grid-1-2 {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 24px;
}
.responsive-settings-grid {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 24px;
}

/* === RESPONSIVE PORTAL STYLES === */
@media (max-width: 768px) {
    .portal-container { padding: 16px 12px; }
    .layout-grid { grid-template-columns: 1fr; }
    .layout-grid > div { min-width: 0; }

    .responsive-grid-2,
    .responsive-grid-3,
    .responsive-grid-2-1,
    .responsive-grid-1-2,
    .responsive-settings-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    #reply-form {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    #reply-form > div {
        width: 100% !important;
    }
    
    /* Master-Detail Collapsible Workspace flow for Mobile */
    .layout-grid:not(.client-selected) #manager-workspace {
        display: none !important;
    }
    .layout-grid.client-selected > div:first-child {
        display: none !important;
    }
    .layout-grid.client-selected #manager-workspace {
        display: block !important;
        opacity: 1 !important;
    }
    
    .mobile-back-btn {
        display: inline-flex !important;
        align-items: center;
        gap: 6px;
        background: var(--bg-light);
        color: var(--primary-navy);
        border: 1px solid var(--border-light);
        padding: 6px 12px;
        border-radius: 8px;
        font-size: 0.85rem;
        font-weight: 600;
        cursor: pointer;
        margin-right: 12px;
        transition: var(--transition-fast);
    }
    .mobile-back-btn:hover {
        background: var(--border-light);
    }

    /* Inbox items responsive stacking */
    .inbox-item {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 16px !important;
        padding: 16px !important;
    }
    .inbox-icon {
        align-self: flex-start;
    }
    .inbox-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 4px;
        padding-top: 12px;
        border-top: 1px solid var(--border-light);
    }
    .inbox-actions button {
        flex: 1;
        justify-content: center;
        min-width: 120px;
    }
    
    /* Kanban Board Mobile adjustments */
    .kanban-board { 
        flex-direction: row;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 12px;
        padding-bottom: 16px;
        height: auto !important; 
        min-height: auto; 
    }
    .kanban-column { 
        flex: 0 0 82vw;
        scroll-snap-align: start;
    }
    
    .dashboard-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .dashboard-two-column { grid-template-columns: minmax(0, 1fr); }
    .quick-actions { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .reply-bubble { max-width: 95%; }
    .data-table { font-size: 0.85rem; }
    .data-table th, .data-table td { padding: 10px 10px; }

    /* Panel adjustments */
    .panel-body { padding: 16px; }
    .panel-header { padding: 14px 16px; flex-wrap: wrap; gap: 10px; }
    .panel-header h3 { font-size: 1rem; }
    .panel-footer { padding: 12px 16px; }

    /* Modals — centered sheet */
    .modal {
        width: 96%;
        max-height: 90vh;
        border-radius: 16px;
    }
    .modal-body { padding: 16px; }
    .modal-header { padding: 16px; }
    .modal-footer { 
        padding: 12px 16px; 
        flex-direction: column;
    }
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }

    /* Form inputs - touch friendly */
    .login-input, input[type="text"], input[type="email"], 
    input[type="password"], input[type="number"], input[type="tel"],
    input[type="date"], select, textarea {
        min-height: 48px;
        font-size: 16px !important; /* Prevent iOS zoom */
        padding: 12px 14px !important;
        border-radius: 10px !important;
    }
    select { padding-right: 32px !important; }

    /* Upload zone mobile */
    .upload-zone { padding: 28px 16px; }
    .upload-zone i { font-size: 2.2rem; }

    /* Ticket cards */
    .ticket-card { padding: 14px; }
    .ticket-card-header { flex-direction: column; gap: 8px; align-items: flex-start; }

    /* Deadline items */
    .deadline-item { gap: 12px; padding: 12px; }
    .deadline-date { width: 48px; height: 48px; }

    /* Dashboard card value sizing */
    .dash-card-value { font-size: 1.8rem; }
    .dash-card { padding: 16px; }

    /* Quick action buttons */
    .quick-action-btn { padding: 16px 12px; }
    .quick-action-btn i { width: 40px; height: 40px; font-size: 1.1rem; }

    /* Page title + actions header row */
    .page-header-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }
    .page-header-row .btn-group,
    .page-header-row > button,
    .page-header-row > a {
        width: 100%;
    }

    /* Filter/search bars on mobile */
    .filter-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }
    .filter-bar select,
    .filter-bar input {
        width: 100% !important;
    }

    /* Timeline */
    .timeline { padding-left: 24px; }
    .timeline-dot { left: -18px; }
}

/* Default non-mobile back button behavior */
.mobile-back-btn {
    display: none;
}

/* === SMALL MOBILE (<576px) === */
@media (max-width: 576px) {
    .portal-container { padding: 12px 10px; }
    .dashboard-grid { grid-template-columns: 1fr; gap: 10px; }
    .quick-actions { grid-template-columns: repeat(2, 1fr); }

    /* Modal — bottom sheet on small phones */
    .modal-overlay {
        align-items: flex-end;
    }
    .modal {
        width: 100%;
        max-height: 95vh;
        border-radius: 20px 20px 0 0;
        margin: 0;
    }

    /* File items on mobile */
    .file-item { padding: 10px 12px; gap: 10px; }
    .file-item-info h5 {
        font-size: 0.82rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 180px;
    }
    .file-item-icon { width: 34px; height: 34px; font-size: 0.95rem; }

    /* Table-to-card transformation on xs screens
       Add class="no-card-transform" to keep it scrollable instead */
    .table-responsive:not(.no-card-transform) table,
    .table-responsive:not(.no-card-transform) thead,
    .table-responsive:not(.no-card-transform) tbody,
    .table-responsive:not(.no-card-transform) th,
    .table-responsive:not(.no-card-transform) td,
    .table-responsive:not(.no-card-transform) tr { display: block; }

    .table-responsive:not(.no-card-transform) thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    .table-responsive:not(.no-card-transform) tr {
        border: 1px solid var(--border-light);
        border-radius: 10px;
        margin-bottom: 10px;
        padding: 4px 0;
        background: white;
        box-shadow: 0 1px 4px rgba(0,0,0,0.04);
        overflow: visible;
    }
    .table-responsive:not(.no-card-transform) td {
        border: none;
        border-bottom: 1px solid #f1f5f9;
        position: relative;
        padding: 10px 12px 10px 44%;
        text-align: right;
        font-size: 0.85rem;
        min-height: 38px;
    }
    .table-responsive:not(.no-card-transform) td:last-child { border-bottom: none; }
    .table-responsive:not(.no-card-transform) td:before {
        position: absolute;
        top: 50%;
        left: 12px;
        transform: translateY(-50%);
        width: 40%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: 600;
        font-size: 0.75rem;
        color: var(--text-light);
        text-transform: uppercase;
        letter-spacing: 0.3px;
        content: attr(data-label);
        text-align: left;
    }

    /* Kanban columns wider on xs */
    .kanban-column { flex: 0 0 88vw; }

    /* Reply bubbles */
    .reply-bubble { max-width: 100%; font-size: 0.88rem; padding: 12px; }

    /* Buttons */
    .btn { padding: 11px 18px; font-size: 0.88rem; }

    /* Form group spacing */
    .form-group { margin-bottom: 14px !important; }
    .form-group label { font-size: 0.82rem; margin-bottom: 5px; }

    /* Hide less important columns */
    .hide-xs { display: none !important; }
}

/* === FORM QUALITY IMPROVEMENTS (All Sizes) === */
.form-group {
    margin-bottom: 18px;
}
.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.84rem;
    color: var(--text-dark);
    margin-bottom: 6px;
    letter-spacing: 0.2px;
}
.form-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-navy);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 20px;
    margin-top: 8px;
}

/* Input focus ring improvement */
.login-input:focus,
input.login-input:focus, select.login-input:focus, textarea.login-input:focus {
    outline: none;
    border-color: var(--primary-blue) !important;
    box-shadow: 0 0 0 3px rgba(30, 91, 168, 0.12) !important;
}

/* Textarea */
textarea.login-input {
    resize: vertical;
    min-height: 90px;
    line-height: 1.6;
}

/* Select arrow */
select.login-input {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px !important;
    cursor: pointer;
}

/* === HELPER UTILITIES === */
.page-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

/* Secondary Button Overrides for Portal Views (ensure high contrast on light backgrounds) */
.portal-body .btn-secondary,
.office-body .btn-secondary,
.admin-body .btn-secondary {
    background: #f8fafc !important;
    color: var(--text-dark, #0f172a) !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
}

.portal-body .btn-secondary:hover,
.office-body .btn-secondary:hover,
.admin-body .btn-secondary:hover {
    background: #f1f5f9 !important;
    color: var(--primary-blue, #1e5ba8) !important;
    border-color: var(--primary-blue, #1e5ba8) !important;
}


