/* front/css/style.css */
/* Design System Premium - Portal SAC Ritmi Confecções */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #1e293b;
    --primary-accent: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-accent: #0ea5e9;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-primary: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* Header & Topbar */
.navbar-custom {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-bottom: 2px solid var(--secondary-accent);
    padding: 0.75rem 1.5rem;
    box-shadow: var(--shadow-md);
}

.navbar-brand img {
    height: 38px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.brand-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
    margin-left: 0.75rem;
}

.user-badge {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #f8fafc;
    padding: 0.4rem 1rem;
    border-radius: 50rem;
    font-size: 0.875rem;
    font-weight: 500;
}

/* KPI Cards */
.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.kpi-icon.primary { background: #dbeafe; color: #2563eb; }
.kpi-icon.warning { background: #fef3c7; color: #d97706; }
.kpi-icon.info { background: #e0f2fe; color: #0284c7; }
.kpi-icon.success { background: #dcfce7; color: #16a34a; }
.kpi-icon.danger { background: #fee2e2; color: #dc2626; }

.kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-top: 0.5rem;
}

.kpi-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Filter Section */
.filter-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.filter-card .form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}

/* DataTables Styling */
.card-table {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.table-custom {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0;
}

.table-custom th {
    background: #f1f5f9;
    color: #334155;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.table-custom td {
    padding: 0.85rem 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.table-custom tr:hover td {
    background-color: #f8fafc;
}

/* Modals & Lightbox */
.modal-content-custom {
    border: none;
    border-radius: 1.25rem;
    box-shadow: var(--shadow-lg);
}

.modal-header-custom {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #ffffff;
    border-top-left-radius: 1.25rem;
    border-top-right-radius: 1.25rem;
    padding: 1.25rem 1.5rem;
}

.modal-header-custom .btn-close {
    filter: invert(1);
}

/* Timeline / Chat of Responses */
.chat-timeline {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 380px;
    overflow-y: auto;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
}

.chat-bubble {
    max-width: 80%;
    padding: 0.85rem 1.15rem;
    border-radius: 1rem;
    font-size: 0.9rem;
    line-height: 1.45;
}

.chat-bubble.cliente {
    align-self: flex-start;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #1e293b;
    border-bottom-left-radius: 0.2rem;
}

.chat-bubble.admin {
    align-self: flex-end;
    background: #2563eb;
    color: #ffffff;
    border-bottom-right-radius: 0.2rem;
}

.chat-bubble.setor-interno {
    align-self: flex-end;
    background: #fff8e1;
    color: #78350f;
    border: 1.5px solid #f59e0b;
    border-bottom-right-radius: 0.2rem;
    box-shadow: var(--shadow-sm);
}

.chat-bubble.setor-interno .chat-meta {
    color: #92400e;
}

.chat-meta {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 0.35rem;
    display: block;
}

/* Image Upload Preview Box */
.photo-upload-box {
    border: 2px dashed #cbd5e1;
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.photo-upload-box:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.photo-preview-img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

/* Lightbox Modal & Gallery Thumbnails */
#modalLightbox {
    z-index: 1070 !important;
}

.lightbox-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(30, 41, 59, 0.85);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.lightbox-nav-btn:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
    transform: translateY(-50%) scale(1.1);
}

.lightbox-nav-prev { left: 1rem; }
.lightbox-nav-next { right: 1rem; }

.photo-thumb-box {
    position: relative;
    width: 75px;
    height: 75px;
    border-radius: 0.5rem;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid #e2e8f0;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.photo-thumb-box:hover {
    transform: scale(1.06);
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.photo-thumb-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-thumb-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    color: #ffffff;
    font-size: 1.1rem;
}

.photo-thumb-box:hover .photo-thumb-overlay {
    opacity: 1;
}
