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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 15px 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
}

.navbar-menu {
    display: flex;
    gap: 20px;
    align-items: center;
}

.navbar-menu a {
    text-decoration: none;
    color: #555;
    padding: 8px 16px;
    border-radius: 5px;
    transition: all 0.3s;
}

.navbar-menu a:hover,
.navbar-menu a.active {
    background: #667eea;
    color: #fff;
}

.btn-logout {
    background: #e74c3c !important;
    color: #fff !important;
}

/* Auth Container - Melhorada para Mobile */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 15px;
}

.auth-box {
    background: #fff;
    padding: 35px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 450px;
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-box h1 {
    text-align: center;
    color: #667eea;
    margin-bottom: 10px;
    font-size: clamp(22px, 5vw, 28px);
}

.auth-box h2 {
    text-align: center;
    color: #555;
    margin-bottom: 30px;
    font-size: clamp(18px, 4vw, 22px);
}

/* Sistema de Toast Elegante */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: #fff;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 420px;
    pointer-events: auto;
    animation: toastSlideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    overflow: hidden;
}

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

.toast.toast-hide {
    animation: toastSlideOut 0.3s ease-out forwards;
}

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

.toast-icon {
    font-size: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.toast-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toast-title {
    font-weight: 600;
    font-size: 15px;
    color: #1a1a1a;
}

.toast-message {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

.toast-close {
    background: transparent;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.toast-close:hover {
    background: rgba(0,0,0,0.05);
    color: #333;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    animation: toastProgress 5s linear forwards;
}

@keyframes toastProgress {
    to {
        width: 0;
    }
}

/* Tipos de Toast */
.toast-sucesso {
    border-left: 4px solid #10b981;
}

.toast-sucesso .toast-icon {
    background: #d1fae5;
    color: #10b981;
}

.toast-sucesso .toast-progress {
    color: #10b981;
}

.toast-erro {
    border-left: 4px solid #ef4444;
}

.toast-erro .toast-icon {
    background: #fee2e2;
    color: #ef4444;
}

.toast-erro .toast-progress {
    color: #ef4444;
}

.toast-info {
    border-left: 4px solid #3b82f6;
}

.toast-info .toast-icon {
    background: #dbeafe;
    color: #3b82f6;
}

.toast-info .toast-progress {
    color: #3b82f6;
}

.toast-aviso {
    border-left: 4px solid #f59e0b;
}

.toast-aviso .toast-icon {
    background: #fef3c7;
    color: #f59e0b;
}

.toast-aviso .toast-progress {
    color: #f59e0b;
}

/* Alertas Tradicionais (mantidos como fallback oculto) */
.alert {
    display: none;
}

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

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #888;
    font-size: 13px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Buttons */
.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    font-weight: 600;
}

.btn-primary {
    background: #667eea;
    color: #fff;
    width: 100%;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #95a5a6;
    color: #fff;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-lg {
    padding: 15px 35px;
    font-size: 18px;
}

.btn-edit {
    background: #3498db;
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

.btn-delete {
    background: #e74c3c;
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
}

/* Auth Link */
.auth-link {
    text-align: center;
    margin-top: 20px;
    color: #666;
    font-size: 14px;
}

.auth-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* Main Content */
.main-content {
    padding: 40px 20px;
}

.welcome-box {
    background: #fff;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.welcome-box h1 {
    color: #667eea;
    margin-bottom: 10px;
}

.welcome-box p {
    color: #666;
    font-size: 16px;
}

/* Dashboard Cards */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.card {
    background: #fff;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s;
}

.card:hover {
    transform: translateY(-5px);
}

.card-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.card h3 {
    color: #333;
    margin-bottom: 10px;
}

.card p {
    color: #666;
    margin-bottom: 20px;
}

/* Stats Box */
.stats-box {
    background: #fff;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.stats-box h2 {
    color: #667eea;
    margin-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.stat-number {
    font-size: 48px;
    font-weight: bold;
    color: #667eea;
}

.stat-label {
    color: #666;
    margin-top: 10px;
}

/* Config Box */
.config-box {
    background: #fff;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.image-preview {
    margin: 10px 0;
    text-align: center;
}

.image-preview img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.image-preview p {
    margin-top: 10px;
    color: #666;
    font-size: 14px;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.page-header h1 {
    color: #667eea;
}

/* Filter Box */
.filter-box {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.filter-form {
    display: flex;
    align-items: center;
    gap: 15px;
}

.filter-form label {
    font-weight: 600;
    color: #555;
}

.filter-form select {
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
}

/* Table */
.table-responsive {
    background: #fff;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    overflow-x: auto;
}

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

.table thead {
    background: #667eea;
    color: #fff;
}

.table th,
.table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

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

.table .actions {
    display: flex;
    gap: 10px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    background: #fff;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

/* Print Actions */
.print-actions {
    background: #fff;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    text-align: center;
    margin-bottom: 30px;
}

.print-actions h2 {
    color: #667eea;
    margin-bottom: 15px;
}

.print-actions p {
    color: #666;
    margin-bottom: 20px;
}

/* ============================================
   RESPONSIVIDADE AVANÇADA PARA MOBILE
   ============================================ */

/* Tablets e dispositivos médios */
@media (max-width: 992px) {
    .dashboard-cards {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

/* Tablets pequenos */
@media (max-width: 768px) {
    .navbar-menu {
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
    }
    
    .navbar-menu a {
        padding: 6px 12px;
        font-size: 14px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        gap: 15px;
        padding: 20px;
    }
    
    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
    
    .table th,
    .table td {
        padding: 10px 8px;
        font-size: 14px;
    }
    
    .modal-content {
        margin: 10% auto;
        padding: 20px;
    }
}

/* Smartphones */
@media (max-width: 576px) {
    body {
        font-size: 14px;
    }
    
    /* Auth Box Mobile */
    .auth-container {
        padding: 10px;
    }
    
    .auth-box {
        padding: 25px 20px;
        border-radius: 12px;
    }
    
    .auth-box h1 {
        font-size: 20px;
        margin-bottom: 8px;
    }
    
    .auth-box h2 {
        font-size: 18px;
        margin-bottom: 20px;
    }
    
    /* Form Groups Mobile */
    .form-group {
        margin-bottom: 16px;
    }
    
    .form-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .form-group small {
        font-size: 12px;
    }
    
    /* Buttons Mobile */
    .btn {
        padding: 11px 20px;
        font-size: 15px;
    }
    
    .btn-lg {
        padding: 13px 25px;
        font-size: 16px;
    }
    
    /* Toast Mobile */
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .toast {
        min-width: unset;
        width: 100%;
        max-width: 100%;
        padding: 14px 16px;
    }
    
    .toast-icon {
        font-size: 20px;
        width: 28px;
        height: 28px;
    }
    
    .toast-title {
        font-size: 14px;
    }
    
    .toast-message {
        font-size: 13px;
    }
    
    /* Main Content Mobile */
    .main-content {
        padding: 20px 10px;
    }
    
    .welcome-box,
    .stats-box,
    .config-box {
        padding: 20px;
        border-radius: 12px;
    }
    
    .card {
        padding: 20px;
    }
    
    .card-icon {
        font-size: 36px;
    }
    
    .stat-number {
        font-size: 36px;
    }
    
    /* Navbar Mobile */
    .navbar .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .navbar-brand {
        font-size: 20px;
    }
    
    .navbar-menu {
        width: 100%;
        justify-content: center;
    }
    
    /* Page Header Mobile */
    .page-header {
        padding: 15px;
    }
    
    .page-header h1 {
        font-size: 20px;
    }
    
    /* Table Mobile */
    .table-responsive {
        padding: 15px 10px;
    }
    
    .table {
        font-size: 13px;
    }
    
    .table th,
    .table td {
        padding: 8px 5px;
    }
    
    .table .actions {
        flex-direction: column;
        gap: 5px;
    }
    
    .btn-edit,
    .btn-delete {
        font-size: 13px;
        padding: 6px 10px;
        width: 100%;
    }
}

/* Smartphones pequenos */
@media (max-width: 380px) {
    .auth-box {
        padding: 20px 15px;
    }
    
    .auth-box h1 {
        font-size: 18px;
    }
    
    .auth-box h2 {
        font-size: 16px;
    }
    
    .toast {
        padding: 12px 14px;
    }
    
    .toast-title {
        font-size: 13px;
    }
    
    .toast-message {
        font-size: 12px;
    }
}

/* Landscape em dispositivos móveis */
@media (max-width: 768px) and (orientation: landscape) {
    .auth-container {
        padding: 10px;
    }
    
    .auth-box {
        max-width: 600px;
    }
}
