* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #FFF8DC 0%, #FFFAF0 100%);
    min-height: 100vh;
}

/* ========== LOGIN ========== */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    color: #228B22;
    margin-bottom: 10px;
    text-align: center;
}

.login-box .subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 0.9em;
}

/* ========== FORMULÁRIOS ========== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #F5DEB3;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #228B22;
    box-shadow: 0 0 0 3px rgba(34, 139, 34, 0.1);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* ========== BOTÕES ========== */
.btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #228B22 0%, #32CD32 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 139, 34, 0.4);
}

.btn-green {
    background: linear-gradient(135deg, #228B22 0%, #32CD32 100%);
}

.btn-green:hover {
    box-shadow: 0 6px 20px rgba(34, 139, 34, 0.4);
}

.btn-orange {
    background: linear-gradient(135deg, #FF8C00 0%, #FFA500 100%);
}

.btn-orange:hover {
    box-shadow: 0 6px 20px rgba(255, 140, 0, 0.4);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9em;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-edit {
    background: #FF8C00;
    color: white;
}

.btn-delete {
    background: #FF6347;
    color: white;
}

.btn-pdf {
    background: linear-gradient(135deg, #FF8C00 0%, #FF6347 100%);
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1em;
    box-shadow: 0 4px 12px rgba(255, 140, 0, 0.3);
    transition: all 0.3s;
}

.btn-pdf:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 140, 0, 0.4);
}

.logout-btn {
    background: #FF6347;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: #228B22;
    text-decoration: none;
}

/* ========== CONTAINER PRINCIPAL ========== */
.main-container {
    display: none;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ========== HEADER ========== */
.header {
    background: linear-gradient(135deg, #228B22 0%, #32CD32 100%);
    color: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    margin-bottom: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.8em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.2em;
    opacity: 0.95;
}

/* Header alternativo para admin/user */
.header.admin-header {
    background: white;
    color: #228B22;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
}

.header.admin-header h1 {
    text-shadow: none;
    font-size: 1.8em;
}

.user-info {
    display: flex;
    gap: 20px;
    align-items: center;
}

/* ========== DASHBOARD ========== */
.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-box, .stat-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
    border-left: 5px solid #228B22;
    overflow: hidden;
}

.stat-box h3, .stat-card h3 {
    font-size: 3em;
    margin-bottom: 10px;
    color: #228B22;
    
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.2;
    padding: 0 5px;
}

.stat-box p, .stat-card p {
    font-size: 1.1em;
    color: #666;
}

.stat-card h3.long-value {
    font-size: 2em; /* Reduz fonte para valores longos */
}
/* ========== CARDS ========== */
.card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.card h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.4em;
    border-bottom: 3px solid #228B22;
    padding-bottom: 10px;
}

/* ========== TABS ========== */
.tabs, .tabs-admin {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab, .tab-admin {
    flex: 1;
    padding: 15px;
    background: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.tab.active, .tab-admin.active {
    background: linear-gradient(135deg, #228B22 0%, #32CD32 100%);
    color: white;
}

.tab-content {
    display: none;
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.tab-content.active {
    display: block;
}

/* ========== LISTAS ========== */
.list-item {
    background: #FFFAF0;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
    border: 2px solid #F5DEB3;
}

.list-item:hover {
    border-color: #228B22;
    transform: translateX(5px);
}

.list-info {
    flex: 1;
}

.list-info strong {
    display: block;
    color: #228B22;
    margin-bottom: 5px;
    font-size: 1.1em;
}

.list-info small {
    color: #666;
}

.list-actions {
    display: flex;
    gap: 10px;
}

/* ========== ITEMS GRID ========== */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.item-card {
    background: #FFFAF0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s;
    border: 2px solid #F5DEB3;
}

.item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    border-color: #228B22;
}

.item-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
}

.item-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #F5DEB3 0%, #FAEBD7 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    margin-bottom: 15px;
}

.item-card h3 {
    color: #228B22;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.item-detail {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #F5DEB3;
    font-size: 0.9em;
}

.item-detail:last-child {
    border-bottom: none;
}

.item-detail strong {
    color: #333;
}

.item-detail span {
    color: #666;
}

.item-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* ========== BADGES ========== */
.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.badge.novo { background: #90EE90; color: #006400; }
.badge.bom { background: #87CEEB; color: #00008B; }
.badge.danificado { background: #FFD700; color: #8B4513; }
.badge.inutilizavel { background: #FFA07A; color: #8B0000; }

.category-badge {
    background: linear-gradient(135deg, #FF8C00 0%, #FF6347 100%);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 10px;
}

.tipo-badge {
    background: #228B22;
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85em;
}

/* ========== ALERTAS ========== */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background: #90EE90;
    color: #006400;
    border: 1px solid #32CD32;
}

.alert-error {
    background: #FFA07A;
    color: #8B0000;
    border: 1px solid #FF6347;
}

/* ========== MODAL ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 3px solid #228B22;
    padding-bottom: 10px;
}

.modal-header h3 {
    color: #228B22;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #999;
}

/* ========== CATEGORIAS ========== */
.category-item {
    background: #FFFAF0;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 2px solid #F5DEB3;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.category-name {
    font-weight: 600;
    color: #228B22;
    font-size: 1.1em;
}

.tipos-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

/* ========== FAMÍLIA SECTION ========== */
.family-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.family-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 3px solid #228B22;
    margin-bottom: 25px;
}

.family-info h2 {
    color: #228B22;
    font-size: 1.8em;
    margin-bottom: 8px;
}

.family-info p {
    color: #666;
    font-size: 0.95em;
}

/* ========== FILTROS ========== */
.filters {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.filters-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 15px;
}

/* ========== UPLOAD DE FOTO ========== */
.photo-upload {
    border: 2px dashed #F5DEB3;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 20px;
}

.photo-upload:hover {
    border-color: #228B22;
    background: #FFFAF0;
}

.photo-preview {
    max-width: 200px;
    max-height: 200px;
    margin: 10px auto;
    border-radius: 8px;
}

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state svg {
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
    opacity: 0.3;
}

/* ========== LOGIN LINK ========== */
.login-link {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #228B22 0%, #32CD32 100%);
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(34, 139, 34, 0.4);
    transition: all 0.3s;
    font-weight: 600;
    z-index: 100;
}

.login-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 139, 34, 0.5);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .dashboard, .stats-container {
        grid-template-columns: 1fr;
    }

    .list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .list-actions {
        width: 100%;
    }

    .btn-small {
        flex: 1;
    }

    .tabs, .tabs-admin {
        flex-direction: column;
    }

    .form-row, .filters-grid {
        grid-template-columns: 1fr;
    }

    .items-grid {
        grid-template-columns: 1fr;
    }

    .family-header {
        flex-direction: column;
        gap: 15px;
    }

    .header h1 {
        font-size: 2em;
    }
}