/* =========================================
   1. GLOBAL & TYPOGRAPHY
   ========================================= */
:root {
    --primary-color: #0d6efd;
    --primary-hover: #0b5ed7;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #212529;
    --border-color: #e9ecef;
    --shadow-sm: 0 .125rem .25rem rgba(0, 0, 0, .075);
    --shadow-md: 0 .5rem 1rem rgba(0, 0, 0, .15);
    --radius-md: 12px;
    --radius-lg: 16px;
}

body {
    font-family: 'Inter', sans-serif;
    /* Modern Google Font */
    background-color: var(--bg-color);
    color: var(--text-color);
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* =========================================
   2. COMPONENTS (CARDS & BUTTONS)
   ========================================= */
.card {
    border: none;
    border-radius: var(--radius-md);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    /* Ensures headers align with radius */
}

.card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    /* Slight lift on hover */
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
}

.card-header h2 {
    font-size: 1.1rem;
    color: #495057;
    font-weight: 700;
}

.card-body {
    padding: 1.5rem;
}

.form-control,
.form-select {
    border-radius: 8px;
    padding: 0.6rem 1rem;
    border: 1px solid #ced4da;
    box-shadow: none;
    transition: all 0.2s;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.15);
}

.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1.2rem;
    transition: all 0.2s;
}

.btn-lg {
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
}

/* =========================================
   3. HERO SECTION (HEADER)
   ========================================= */
.header-hero {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 3rem 1rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    text-align: center;
}

.header-hero h1 {
    font-weight: 800;
    color: #343a40;
}

.logo {
    max-height: 80px;
    margin-bottom: 1rem;
}

/* =========================================
   4. PRODUCT TABLE
   ========================================= */
#tabela-produtos-container {
    max-height: 500px;
    overflow-y: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background-color: #343a40;
    color: #fff;
    border: none;
    padding: 1rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table tbody td {
    vertical-align: middle;
    padding: 0.75rem 1rem;
    border-color: var(--border-color);
}

.table-striped>tbody>tr:nth-of-type(odd)>* {
    background-color: rgba(0, 0, 0, 0.015);
}

.table-hover>tbody>tr:hover>* {
    background-color: rgba(0, 0, 0, 0.03);
}

#tabela-produtos thead th[data-sort-by] {
    cursor: pointer;
}

.sort-indicator {
    display: inline-block;
    width: 1.5em;
    text-align: center;
    font-size: 0.8em;
    opacity: 0.7;
}

/* =========================================
   5. UTILITIES
   ========================================= */
.hidden {
    display: none !important;
}

/* =========================================
   6. TOAST NOTIFICATIONS
   ========================================= */
.toast-custom {
    min-width: 300px;
    margin-bottom: 1rem;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.toast-custom.hide {
    animation: slideOut 0.3s ease-in forwards;
}

.toast-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background-clip: padding-box;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.toast-header strong {
    font-size: 0.95rem;
}

.toast-body {
    padding: 1rem;
    font-size: 0.95rem;
    color: #495057;
}

/* Toast Variants */
.toast-success .toast-header {
    background-color: #d1e7dd;
    color: #0f5132;
}

.toast-error .toast-header {
    background-color: #f8d7da;
    color: #842029;
}

.toast-warning .toast-header {
    background-color: #fff3cd;
    color: #664d03;
}

/* Animations */
@keyframes slideIn {
    from {
        transform: translateX(120%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(120%);
        opacity: 0;
    }
}