/**
 * DANKE BACKOFFICE 2.0 - GLOBAL STYLES
 * Cores: #f3b416 (Amarelo Dourado) + Preto
 */

:root {
    --primary-color: #f3b416;
    --primary-dark: #d49a0f;
    --primary-light: #ffc94d;
    --secondary-color: #000000;
    --secondary-light: #2c2c2c;
    --text-dark: #1a1a1a;
    --text-light: #666666;
    --background: #f5f5f5;
    --white: #ffffff;
    --success: #2ecc71;
    --danger: #e74c3c;
    --warning: #f39c12;
    --info: var(--primary-color);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    color: var(--text-dark);
    background: var(--background);
}

[ng-cloak] {
    display: none !important;
}

/* COMMON STYLES */
.page-container {
    /* background: white; */
    border-radius: 10px;
    padding: 0px;
    /* box-shadow: 0 2px 4px rgba(0,0,0,0.1); */
    margin-bottom: 20px;
}

.page-header {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ecf0f1;
}

.page-header h1 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 28px;
}

.page-header p {
    margin: 0;
    color: #7f8c8d;
}

.loading-container,
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
}

.loading-container i,
.empty-state i {
    display: block;
    margin-bottom: 15px;
}

/* BUTTONS */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    transition: all 0.3s;
    font-weight: 500;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--secondary-color);
    font-weight: 600;
}

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

.btn-success {
    background: #2ecc71;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #27ae60;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #c0392b;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover:not(:disabled) {
    background: #e67e22;
}

.btn-default {
    background: #ecf0f1;
    color: #2c3e50;
}

.btn-default:hover:not(:disabled) {
    background: #bdc3c7;
}

.btn-block {
    width: 100%;
    display: block;
}

/* TABLES */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    color: #2c3e50;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* Drag visual para tarefas */
.tarefa-dragging {
    background: #fff4d6 !important;
    border-color: #f3b416 !important;
    box-shadow: 0 2px 8px rgba(243, 180, 22, 0.35);
}

.tarefa-drag-over {
    outline: 2px dashed #f3b416;
    outline-offset: -2px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-control:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

/* CARDS */
.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.card-header {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #2c3e50;
}

.card-body {
    color: #7f8c8d;
}

/* BADGES */
.badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* ALERTS */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* UTILITIES */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.p-10 { padding: 10px; }
.p-20 { padding: 20px; }

.d-flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.gap-10 {
    gap: 10px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .backoffice-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .data-table {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px;
    }
}

/* MODAL */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.modal-dialog {
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-lg {
    width: 900px;
    max-width: 95vw;
}

.modal-header {
    background: var(--primary-color);
    color: var(--white);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 20px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(90vh - 150px);
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #ddd;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* FORM LAYOUT */
.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.modal-dialog .form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-group.col-12 { flex: 0 0 100%; }
.form-group.col-8 { flex: 0 0 calc(66.666% - 10px); }
.form-group.col-6 { flex: 0 0 calc(50% - 7.5px); }
.form-group.col-4 { flex: 0 0 calc(33.333% - 10px); }

.required {
    color: var(--danger);
}

.modal-dialog .form-group label {
    font-size: 13px;
    font-weight: 500;
    color: #666;
    margin-bottom: 5px;
}

.modal-dialog .form-control {
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

.modal-dialog .form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(243, 180, 22, 0.1);
}

.modal-dialog textarea.form-control {
    resize: vertical;
    font-family: inherit;
}

/* TABS DO MODAL */
.modal-tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    background: #f8f9fa;
    padding: 0 20px;
}

.modal-tabs .tab {
    padding: 15px 20px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    font-weight: 500;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-tabs .tab:hover {
    background: #fff;
    color: var(--primary-color);
}

.modal-tabs .tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: #fff;
}

.modal-tabs .tab i {
    font-size: 14px;
}

.modal-tabs .tab-badge {
    background: var(--primary-color);
    color: var(--white);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 5px;
}

/* TABELA DE ENCOMENDAS NO MODAL */
.encomendas-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.encomendas-table thead {
    background: #f8f9fa;
}

.encomendas-table thead th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #666;
    border-bottom: 2px solid #e0e0e0;
    font-size: 12px;
    text-transform: uppercase;
}

.encomendas-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s;
}

.encomendas-table tbody tr:hover {
    background: #f8f9fa;
}

.encomendas-table tbody td {
    padding: 10px 12px;
    color: #333;
    vertical-align: top;
}

