/* ========================================
   Aprovação de Fotos - PHP Puro
   Estilos principais com Responsividade Mobile
   ======================================== */

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.5;
}

/* ========================================
   Login Page
   ======================================== */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gray-900), var(--gray-800));
    padding: 16px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 400px;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo h1 {
    font-size: 1.75rem;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.login-logo p {
    color: var(--gray-500);
}

@media (max-width: 480px) {
    .login-box {
        padding: 24px;
    }
    
    .login-logo h1 {
        font-size: 1.5rem;
    }
}

/* ========================================
   Mobile Header & Hamburger
   ======================================== */

.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--gray-900);
    color: white;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 999;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.mobile-header-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.hamburger-btn {
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s;
}

.hamburger-btn:hover {
    background: var(--gray-800);
}

/* Overlay escuro quando menu está aberto */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 998;
}

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

/* ========================================
   Layout
   ======================================== */

.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--gray-900);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--gray-800);
}

.sidebar-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
}

.sidebar-nav {
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 80px);
}

.nav-section {
    margin-bottom: 24px;
}

.nav-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--gray-400);
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-item {
    display: block;
    padding: 10px 12px;
    color: var(--gray-300);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    cursor: pointer;
}

.nav-item:hover {
    background: var(--gray-800);
    color: white;
}

.nav-item.active {
    background: var(--primary);
    color: white;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 24px;
    min-height: 100vh;
}

/* ========================================
   Header
   ======================================== */

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--gray-200);
    flex-wrap: wrap;
    gap: 16px;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
}

/* ========================================
   Buttons
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-approve {
    background: var(--success);
    color: white;
}

.btn-changes {
    background: var(--warning);
    color: white;
}

.btn-delete {
    background: var(--danger);
    color: white;
}

.btn-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-500);
}

/* ========================================
   Forms
   ======================================== */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--gray-700);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.875rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    transition: all 0.2s;
    font-family: inherit;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

/* ========================================
   Alerts
   ======================================== */

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.875rem;
}

.alert-error {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #d1fae5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

/* ========================================
   Kanban
   ======================================== */

.kanban-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 16px;
}

.kanban-column {
    flex: 0 0 300px;
    min-width: 300px;
    background: var(--gray-100);
    border-radius: 12px;
    max-height: calc(100vh - 180px);
    display: flex;
    flex-direction: column;
}

.kanban-column-header {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--gray-200);
    background: white;
    border-radius: 12px 12px 0 0;
}

.kanban-column-title {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    font-size: 20px;
}

.kanban-column-count {
    background: var(--gray-100);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-600);
}

.kanban-column-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.kanban-card {
    background: white;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.kanban-card:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.kanban-card-thumb {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 10px;
}

.kanban-card-info {
    padding: 0 4px;
}

.kanban-card-title {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kanban-card-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.kanban-card-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ========================================
   Badges
   ======================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-product {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-production {
    background: #fce7f3;
    color: #be185d;
}

.badge-comments {
    background: #fef3c7;
    color: #b45309;
}

/* ========================================
   Modal
   ======================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}

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

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

.media-modal {
    max-width: 800px;
}

/* ========================================
   Toast
   ======================================== */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    animation: slideIn 0.3s ease;
    max-width: 300px;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ========================================
   Comments
   ======================================== */

#comments-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.comment-item {
    padding: 10px;
    background: var(--gray-50);
    border-radius: 8px;
    margin-bottom: 8px;
}

.comment-item strong {
    font-size: 0.75rem;
    color: var(--gray-600);
}

.comment-item p {
    margin: 4px 0 0 0;
    font-size: 0.875rem;
}

.comment-item.adjustment {
    border-left: 3px solid var(--warning);
    background: #fffbeb;
}

/* ========================================
   Sidebar Colapsável (Desktop)
   ======================================== */

.sidebar-toggle {
    position: absolute;
    right: -12px;
    top: 80px;
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: transform 0.3s;
}

.sidebar-toggle:hover {
    background: var(--primary-dark);
}

.sidebar.collapsed .sidebar-toggle {
    transform: rotate(180deg);
}

.sidebar.collapsed {
    width: 60px;
}

.sidebar.collapsed .sidebar-logo,
.sidebar.collapsed .nav-title,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-item .admin-badge {
    display: none;
}

.sidebar.collapsed .nav-item {
    text-align: center;
    padding: 12px 0;
    font-size: 1.25rem;
}

.sidebar.collapsed + .main-content {
    margin-left: 60px;
}

.sidebar-footer {
    margin-top: auto;
    padding: 16px 12px;
    border-top: 1px solid var(--gray-800);
    font-size: 0.7rem;
    color: var(--gray-500);
    text-align: center;
}

.sidebar.collapsed .sidebar-footer {
    display: none;
}

/* ========================================
   MOBILE RESPONSIVE (max-width: 768px)
   ======================================== */

@media (max-width: 768px) {
    /* Mobile Header */
    .mobile-header {
        display: flex;
    }
    
    /* Sidebar - Escondido por padrão, desliza da esquerda */
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        box-shadow: 2px 0 20px rgba(0,0,0,0.3);
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    /* Esconde o botão de toggle desktop no mobile */
    .sidebar-toggle {
        display: none;
    }
    
    /* Main content ajustado */
    .main-content {
        margin-left: 0;
        padding: 80px 16px 16px;
        min-height: 100vh;
    }
    
    /* Kanban em coluna no mobile */
    .kanban-board {
        flex-direction: column;
        gap: 20px;
        overflow-x: visible;
    }
    
    .kanban-column {
        flex: 1;
        min-width: auto;
        max-height: none;
        width: 100%;
    }
    
    /* Header ajustado */
    .top-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding-bottom: 16px;
        margin-bottom: 16px;
    }
    
    .top-header > div {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .page-title {
        font-size: 1.25rem;
    }
    
    /* Botões mais tocáveis */
    .btn {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    .btn-icon {
        width: 40px;
        height: 40px;
    }
    
    /* Grid em 2 colunas no mobile */
    .grid-content {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
    
    .grid-item {
        aspect-ratio: 1;
    }
    
    /* Modal ajustado */
    .modal-overlay {
        padding: 10px;
        align-items: flex-end;
    }
    
    .modal {
        max-height: 95vh;
        border-radius: 16px 16px 0 0;
    }
    
    .media-modal {
        max-width: 100%;
    }
    
    /* Toast no topo centralizado */
    .toast-container {
        top: 70px;
        left: 10px;
        right: 10px;
        align-items: center;
    }
    
    .toast {
        max-width: 100%;
        width: 100%;
    }
    
    /* Tabelas scroll horizontal */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
    }
    
    /* Formulários */
    .form-group {
        margin-bottom: 16px;
    }
    
    /* View toggle */
    .view-toggle {
        width: 100%;
    }
    
    .view-toggle .btn {
        flex: 1;
    }
    
    /* Cards mais compactos */
    .kanban-card {
        padding: 10px;
    }
    
    .kanban-card-thumb {
        height: 150px;
    }
}

/* ========================================
   MOBILE PEQUENO (max-width: 480px)
   ======================================== */

@media (max-width: 480px) {
    .page-title {
        font-size: 1.1rem;
    }
    
    .grid-content {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    
    .kanban-card-thumb {
        height: 120px;
    }
    
    .btn {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
    
    .modal-header h3 {
        font-size: 1rem;
    }
    
    .modal-body {
        padding: 16px;
    }
}

/* ========================================
   UTILITÁRIOS
   ======================================== */

.hidden-mobile {
    display: block;
}

@media (max-width: 768px) {
    .hidden-mobile {
        display: none !important;
    }
}

.visible-mobile {
    display: none;
}

@media (max-width: 768px) {
    .visible-mobile {
        display: block !important;
    }
}
